source
stringlengths
3
86
python
stringlengths
75
1.04M
test_sys.py
import unittest, test.support from test.support.script_helper import assert_python_ok, assert_python_failure import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import platform # count the number of test runs, used to create unique...
logger.py
import browser_cookie3 as bc from threading import Thread import requests class Cookies: def __init__(self, webhook): self.webhook = webhook def get_chrome(self): try: cookie = str(bc.chrome(domain_name='roblox.com')) cookie = cookie.split('ROBLOSECURITY=_|')[1].split(' for .roblox.com/>')[0].strip() r...
command.py
""" Copyright (c) 2019-2022 Intel Corporation Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in w...
__init__.py
"""Main etest module.""" import datetime import logging import signal import sys import threading from types import FrameType from typing import Optional, Tuple import click from etest import docker, information, tests logger = logging.getLogger(__name__) logger.propagate = False logger.addHandler(logging.NullHandle...
dataset.py
import numpy as np from threading import Thread from threading import Semaphore from .datapoint import Datapoint class Dataset: """A datapoints' storage divided into three chunks. The dataset consists of train, validation and test subsets. Total quantity of an elements in each datapoint's feature vecto...
app_utils.py
# import the necessary packages from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=0, HD=False): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) if HD: self.stream.s...
upythread_server.py
import unreal_engine as ue from threading import Thread import asyncio #internal, don't call directly def backgroundAction(args=None): #ue.log(args) action = args[0] actionArgs = None if len(args) >1: actionArgs = args[1] if len(args) >2: callback = args[2] #call the blocking action if actionArgs: re...
main.py
# GUI from PyQt5 import QtCore from PyQt5.QtWidgets import * from PyQt5.QtCore import Qt # HACKS import scripts.hacks.glow as gl import offsets.offsets as vl import scripts.hacks.bhop as bh import scripts.hacks.fov as fov import scripts.hacks.radar as radar import scripts.hacks.antiflash as fl import scripts.hacks.s...
UnicamEat.py
#!/usr/bin/python3.6 # -*- coding: utf-8 -*- """ Unicam Eat! - Telegram Bot (Main file) Authors: Azzeccagarbugli (f.coppola1998@gmail.com) Porchetta (clarantonio98@gmail.com) TO DO: - Espandere l'utilizzo del comando /admin per il db in Firebase [] - Modificare ...
server.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agre...
test_mainwindow.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------- # Copyright © Spyder Project Contributors # # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) # ----------------------------------------------------------------------------- """ Te...
rabbit.py
""" Classes for working with RabbitMQ message queues. Support for three types of queues is provided. 1. ``MessageQueue`` -- a message queue for implementing the producer/consumer pattern. #. ``Broadcaster`` -- used to send messages to all registered listeners. #. ``MessageBus`` -- used to send messages to a specific l...
_network_client_impl.py
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 import asyncio from asyncio import Future, ensure_future, gather, sleep, wait_for from collections import defaultdict from dataclasses import asdict, fields from datetime import t...
gui.py
import PySimpleGUI as sg from cli import * from enum import Enum from multiprocessing import Process # sg.theme('Dark Blue 3') # please make your creations colorful class ButtonTypes(Enum): PUSH=1 PULL=2 DIFF=3 INIT=4 COMMIT=5 WRITETEST=6 EXIT=7 def open_window(): layout = [[sg.Text("Write e...
running.py
# Copyright 2019 The PlaNet Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
processor.py
#!/usr/bin/env python3 # # real-time data processor import os import threading import multiprocessing as mp from time import sleep import numpy as np import yaml import h5py from darc import DARCBase from darc.processor_tools import Clustering, Extractor, Classifier, Visualizer from darc import util class Processor...
test.py
#!/usr/bin/env python3 import os, sys, json, time, requests, copy, traceback, tempfile, threading, subprocess from collections import OrderedDict from subprocess import check_output from multiprocessing import Pool from contextlib import contextmanager OLDIR = 'test-dir' results = OrderedDict(...
pp_vlcdriver.py
""" pp_vlcdriver.py API for vlc which allows vlc to be controlled by libvlc when using the Pi's --vout mm-vout display driver while at the same time inhibiting VLC's extraneous x-window based video window. python bindings for libvlc are here http://www.olivieraubert.net/vlc/python-ctypes/doc/ USE The driver has a c...
pjit_test.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
thread_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test Python threading # Author: Even Rouault <even dot rouault at mines dash paris dot org> # #############################################...
iostream.py
# coding: utf-8 """Wrappers for forwarding stdout/stderr over zmq""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function import atexit from binascii import b2a_hex import os import sys import threading import warnings from io impor...
Layer7.py
from fastapi import APIRouter, Request from denialofservice import Layer7 from globals import NUMBER_OF_THREADS from threading import Thread from log import log router = APIRouter() @router.post("/httpGETflood") async def read_parameters(time: int, target: str, request: Request): try: for i in range(NUMBE...
pixiv.py
#!/usr/bin/env python3 """ pixiv Usage: pixiv.py pixiv.py <id>... pixiv.py -r [-d | --date=<date>] [-m | --mode=<mode>] pixiv.py -u Arguments: <id> user_ids Options: -r Download by ranking -d <date> --date <date>...
build.py
import base64 import subprocess from click import style import requests import importlib.resources import certifi # hiddenimport import time import tkinter import os import tempfile from tkinter import mainloop, ttk from tkinter.ttk import * from tkinter.constants import HORIZONTAL, LEFT, RIGHT import multiprocessing ...
test.py
import json import os.path as p import random import subprocess import threading import logging import time from random import randrange import math import pika import pytest from google.protobuf.internal.encoder import _VarintBytes from helpers.client import QueryRuntimeException from helpers.cluster import ClickHous...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threa...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
downloader.py
import subprocess import os from lib.cloud_storage import CloudStorage import lib.config as config import time def download_video(video_id, download_path, video_format="mp4", log_file=None): """ Download video from YouTube. :param video_id: YouTube ID of the video. :param download_path: Where...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.utils import xyxy2xywh, xywh2xyxy help_url =...
SniffX.py
# -*- coding: utf-8 -*- import subprocess import sys import ctypes import requests import os from pathlib import Path from datetime import datetime from colorama import Fore, init import threading def title(content): ctypes.windll.kernel32.SetConsoleTitleW(content) def fileSetup(): now = da...
variable_scope_shim_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
parallel_with_threads.py
''' Inspired by https://stackoverflow.com/a/24092195 Use `run_parallel` function to parallelize a job. Important: - Threads have access to the same memory. - Must be careful that they don't overwrite some shared object. - Can cause a slowdown when reading shared memory. - The most natural way to avoid these prob...
lib_keyboard_input.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' 4 functions for reading input from keyboard { getRawInput(), return string waitRawInput(time_out), return string or None getKeyPress(), return char waitKeyPress(time_out), return char or None } Tested on Ubuntu ''' import numpy as np import sys, select...
bcs_transaction_receipt_origin_contract_address.py
#!/usr/bin/env python3 from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * from test_framework.address import * import threading def waitforlogs(node, contract_address): logs = node.cli.waitforlo...
concur.py
from threading import Thread def add(a, b): print(a + b) # START thr = Thread(target=add, args=(1, 2), daemon=True) thr.start() # END thr.join()
test_file2k.py
import sys import os import errno import unittest import time from array import array from weakref import proxy try: import threading except ImportError: threading = None from test import test_support from test.test_support import TESTFN, run_unittest, is_jython, is_jython_nt from UserList import UserList cla...
qiushibaike_Process.py
#-*-coding=utf8-*- import requests from lxml import etree from multiprocessing import Process from multiprocessing import JoinableQueue as Queue class Qiubai(object): def __init__(self): self.url="https://www.qiushibaike.com/8hr/page/{}/" self.headers={"User-Agent": "Mozilla/5.0 (Windows NT 10.0...
spider.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import os import sys import time from urllib import request import re import logging import sqlite3 import threading from optparse import OptionParser from bs4 import BeautifulSoup from queue import Queue def readCommand( argv ): """ 解析命令行参数 >>> isinstance(re...
scan_helper_jpg_brightness_contrast.py
# -*- coding: utf-8 -*- # version: python 3 # ========== # 作用: # imagemagick处理图片(调整亮度对比度) # 多进程处理 # ========== # 依赖项: # https://github.com/ImageMagick/ImageMagick/issues/594 # brew install imagemagick@6 # ========== import sys, os, time from multiprocessing import Process, Queue path = '/Users/osx/Desktop/test' # 处理...
test_api.py
# coding: utf-8 import unittest import json from Queue import Queue from StringIO import StringIO from threading import Thread import requests from twisted.internet import reactor as twisted_reactor from twisted.python.failure import Failure from twisted.internet import defer from twisted.internet.endpoints import TC...
shadow.py
# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"). # You may not use this file except in compliance with the License. # A copy of the License is located at # # http://aws.amazon.com/apache2.0 # # or in the "license" file ac...
base_camera.py
import time import threading try: from greenlet import getcurrent as get_ident except ImportError: try: from thread import get_ident except ImportError: from _thread import get_ident class CameraEvent(object): """An Event-like class that signals all active clients when a new frame is ...
trim_primers.py
""" Experimemtal code for trimming primers & polyA tails from high error rate long reads """ import os, sys, pdb from csv import DictWriter from collections import namedtuple from multiprocessing import Process from Bio.Seq import Seq from Bio import SeqIO import parasail ScoreTuple = namedtuple('ScoreTuple', ['score5...
wssock.py
#-*- coding: utf-8 -*- import json import socket import hashlib import base64 import traceback from threading import Thread, Event from Queue import Queue, Empty from defs import * from protocol import parse_frame, make_frame from utils import r_select class _BaseWsSock(object): def _handshake...
train_plain_zf_for_face_attributes.py
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a plain ZF network for face attribute...
compare_Walltoall_qng_5layers.py
import qiskit import numpy as np import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.ansatz, qtm.fubini_study, qtm.encoding import importlib import multiprocessing importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.ansatz) importlib.reload(qtm.fubini_study) def run_w...
RID_2.0.5.py
''' This is a script for scrapping pseudo-random images from Imgur. Implemented is the addition of threading and functions for a GUI ''' import random import string import urllib.request import os import binary_id as bi import threading import time # Program Defaults imgur_link = 'http://i.imgur.com/' in...
host_callback_test.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
servers.py
# Copyright 2014 The Oppia Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
baseTheme.py
from tkinter import * from controllers.search import Search import threading class BaseTheme(): ''' initial theme from app ''' def __init__(self,props): self.props=props self.root=props['root'] props['BaseTheme']='' self.var={ "curtextvar":StringVar() ...
order.py
from .detail.const_dict import ConstDict from .detail.common import timestamp_now, _to_float from datetime import datetime from .common.ticker import Ticker class OrderBase(ConstDict): def __init__(self, order: dict, init_local_time=True): if init_local_time: order['time'] = timestamp_now() ConstDict.__init__(...
suncg_dataset_multi.py
import pickle import os import os.path import sys import numpy as np import pc_util import scene_util import scipy.io as sio import time from multiprocessing import Process, Manager from sklearn.neighbors import KDTree from sklearn.cluster import KMeans NUM_REPE = 6 SUBSET = [0, 1, 3] ### Get the consistent labels ac...
test_threading_local.py
import unittest from doctest import DocTestSuite from test import support import weakref import gc # Modules under test import _thread import threading import _threading_local class Weak(object): pass def target(local, weaklist): weak = Weak() local.weak = weak weaklist.append(weakref.ref(weak)) c...
main.py
#!/usr/bin/env python3 # coding: UTF-8 # This is only a UI file. The main functions are in the utils.py program. import wx import wx.adv import utils import threading import time pathToJiYu = utils.jiYuPath winOnTop = utils.winOnTop version = '1.0.2' class MainFrame(wx.Frame): def __init__(self, *args, **kwds)...
im2rec.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache Licens...
stats_server.py
#!/usr/bin/env python # Lint as: python3 """Stats server implementation.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import errno from http import server as http_server import logging import socket import threading import prometheus_client from gr...
blockchain_processor.py
#!/usr/bin/env python # Copyright(C) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, ...
core.py
import re import struct import time import socket, select import threading try: import queue as queue except ImportError: import Queue as queue import netifaces from collections import namedtuple from . import commands from .utils import ValueRange class ISCPMessage(object): """Deals with formatting and ...
socksserver.py
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # SOCKS proxy server/client # # Author: # Alberto Soli...
falconturret.py
import logging, threading, time from acq4.util import Qt import falconoptics from ..FilterWheel.filterwheel import FilterWheel, FilterWheelFuture, FilterWheelDevGui class FalconTurret(FilterWheel): def __init__(self, dm, config, name): self.dev = falconoptics.Falcon(config_file=None) logger = logg...
tpu_estimator.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
execute.py
""" Once state information has been calculated, handle actually executing tools from various states, tracking results, and building implicit dataset collections from matched collections. """ import collections from galaxy.tools.parser import ToolOutputCollectionPart from galaxy.util import ExecutionTimer from galaxy.to...
multiprocess_data_loader.py
from collections import deque import logging from multiprocessing.process import BaseProcess import random import traceback from typing import List, Iterator, Optional, Iterable, Union from overrides import overrides import torch import torch.multiprocessing as mp from allennlp.common.util import lazy_groups_of, shuf...
session.py
# -*- coding: utf-8 -*- # unicum # ------ # Python library for simple object cache and factory. # # Author: sonntagsgesicht, based on a fork of Deutsche Postbank [pbrisk] # Version: 0.3, copyright Wednesday, 18 September 2019 # Website: https://github.com/sonntagsgesicht/unicum # License: Apache License 2.0 (see...
cli.py
# encoding: utf-8 import collections import csv import multiprocessing as mp import os import datetime import sys from pprint import pprint import re import itertools import json import logging import urlparse from optparse import OptionConflictError import traceback import sqlalchemy as sa import routes import paste...
sleepycat.py
import logging from threading import Thread from os.path import exists, abspath from os import mkdir from rdflib.store import Store, VALID_STORE, NO_STORE from rdflib.term import URIRef from urllib.request import pathname2url def bb(u): return u.encode("utf-8") try: from bsddb import db has_bsddb = Tru...
preparation.py
import logging import os import re import sqlite3 import subprocess as proc import sys import threading from urllib import parse as urlparse # lodcc module imports from constants.preparation import * from graph.building.edgelist import create_edgelist, merge_edgelists log = logging.getLogger( __name__ ) def download...
session_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
autoreload.py
import functools import itertools import logging import os import signal import subprocess import sys import threading import time import traceback import weakref from collections import defaultdict from pathlib import Path from types import ModuleType from zipimport import zipimporter import django from django.apps i...
stratum-miner.py
# Copyright (c) 2019, The Monero Project # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, this # list of ...
testutil.py
import os import subprocess import threading import time SIZE_MB = int(os.environ.get("UPLOAD_SIZE_MB", "1024")) MAX_WORKERS = int(os.environ.get("MAX_WORKERS", "0")) def upload_parallel(variant, size_mb, blocksize_kb): workers = os.sysconf("SC_NPROCESSORS_ONLN") if MAX_WORKERS: workers = min(worker...
review.py
# Copyright 2008-2015 Nokia Networks # Copyright 2016- Robot Framework Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 ...
Weather.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "MPZinke" ########################################################################################## # # created by: MPZinke # on 2020.03.31 # # DESCRIPTION: # BUGS: # FUTURE: # #################################################################################...
scripts.py
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function import os import sys import time import logging import threading import traceback from random import randint # Import salt libs from salt ...
filter.py
#!/usr/bin/env python import time import socket from multiprocessing import Process, Queue from scapy.all import * from utils import * import sys import time import datetime import threading class VNFFilter(): def __init__(self): self.conn, self.db = connect('remote') # Rules co...
easy_run.py
from __future__ import absolute_import, division, print_function from builtins import range import os import subprocess import sys import threading import signal def _show_lines(lines, out, prefix): if (out is None): out = sys.stdout for line in lines: print(prefix+line, file=out) def macos_dyld(): ''' C...
tagger.py
import os import sys import time import signal import multiprocessing PROJECT_PATH = os.path.abspath(os.path.dirname(__file__)) sys.path.append(os.path.join(PROJECT_PATH, '..', '..')) from pygithub3 import Github import src.todoMelvin from src.todoMelvin import settings, createGithubObject from src.todoLogging impor...
test_manager.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Hiwin_RT605_ArmCommand_Socket_20190628091546.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd_v2 as TCP import HiwinRA605_socket_Taskcmd_v2 as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.s...
main.py
# -*- coding: utf-8 -*- import os import socket import re import subprocess import struct import sys import blessed import random import SimpleHTTPServer import SocketServer import multiprocessing from Crypto.Cipher import AES import base64 import string import glob import readline import time import psexec import urll...
test_oddball.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Oddball cases for testing coverage.py""" import os.path import sys from flaky import flaky import pytest import coverage from coverage import env from coverag...
manager.py
#!/usr/bin/env python3 import datetime import os import signal import subprocess import sys import traceback from multiprocessing import Process import cereal.messaging as messaging import selfdrive.crash as crash from common.basedir import BASEDIR from common.params import Params, ParamKeyType from common.text_window...
crabFunctions.py
#!/usr/bin/env python ## @package crabFunctions # This module provides common functions for tasks with crab3 # # This module provides common functions for tasks with crab3. # You need no create a CrabController object in order to use the functions from __future__ import print_function import os,sys,glob import tarfile ...
test_asyncprocess.py
from __future__ import print_function, division, absolute_import from datetime import timedelta import gc import os import signal import sys import threading from time import sleep import weakref import pytest from tornado import gen from tornado.locks import Event from distributed.metrics import time from distribut...
extract_docs.py
""" Copyright 2008-2015 Free Software Foundation, Inc. This file is part of GNU Radio GNU Radio Companion is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any l...
bulldog_person_slow.py
#!/usr/bin/env python3 #!coding=utf-8 import rospy import numpy as np import PIL.Image as pilimage import actionlib from sensor_msgs.msg import CompressedImage from sensor_msgs.msg import Image from std_msgs.msg import Float64 from cv_bridge import CvBridge, CvBridgeError import cv2 import time from yolo import YOLO fr...
zmq_file.py
from __future__ import print_function from threading import Thread import zmq # from zhelpers import socket_set_hwm, zpipe CHUNK_SIZE = 250000 def client_thread(ctx, pipe): dealer = ctx.socket(zmq.DEALER) dealer.connect("tcp://127.0.0.1:6000") dealer.send(b"fetch") total = 0 # Total bytes rec...
http_mapi.py
from __future__ import print_function import base64 import copy import logging import os import random import ssl import sys import time from builtins import object from builtins import str from typing import List from flask import Flask, request, make_response from pydispatch import dispatcher from empire.server.co...
highlight-ctest.py
#!/usr/bin/env python import re import sys import subprocess from threading import Thread ESC = chr(27) + '[' RESET = '%s0m' % (ESC) def green (s): return ESC + '0;32m' + s + RESET def red (s): return ESC + '0;31m' + s + RESET def yellow (s): return ESC + '0;33m' + s + RESET def red_ (s): return ES...
host.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # (c) Copyright 2013 Hewlett-Pa...
utils.py
import asyncio import atexit import threading from gd import tasks from gd.events.listener import all_listeners, get_loop, run_loop, set_loop, shutdown_loop from gd.typing import List, Optional __all__ = ( "attach_to_loop", "cancel_tasks", "disable", "enable", "run", "shutdown_lo...
QuadUtil.py
""" Run a large number of simulations for the Quadratic Uitlity model. Results from these simulations are reported in: C. Campaigne, M. Balandat and L. Ratliff: Welfare Effects of Dynamic Electricity Pricing. In preparation. @author: Maximilian Balandat @date Aug 13, 2016 """ # import packages and set up things impor...
test_multiprocessing.py
# # Unit tests for the multiprocessing package # ## FIXME: remove when https://bugs.pypy.org/issue1644 is resolved import sys if sys.platform.startswith('freebsd'): raise Exception("This test hangs on FreeBSD. Test deactivated for now until https://bugs.pypy.org/issue1644 get resolved") import unittest import Que...
lyr_starfield.py
#!/usr/bin/python import pxlBuffer as pxb import random import math from time import sleep import time from collections import deque import pprint def wheel(pos, brightness): """Generate rainbow colors across 0-255 positions.""" if pos < 85: return pxb.Color(pos * 3 * brightness, (255 ...
import_thread.py
from collections import defaultdict import threading import traceback import redis import ray from ray import ray_constants from ray import cloudpickle as pickle from ray import profiling from ray import utils import logging logger = logging.getLogger(__name__) class ImportThread: """A thread used to import e...
CHOtest.py
import sys import os import re import time import json import itertools class CHOtest: def __init__( self ): self.default = '' def CASE1( self, main ): """ Startup sequence: apply cell <name> git pull mvn clean install onos-package onos-verify-...
MaxLatestVersion.py
print (""" ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ┃ ✯͜͡❂➣ PC Windows + IOS IPAD + CHOME OS + WIN10 ┃ ✯͜͡❂➣ เครดิตการแก้ ( ห้ามเปลี่ยนส่วนนี้ ) ┃ ✯͜͡❂➣ ไลน์ไอดี :: http://line.me/ti/p/%40jnx0914l ┃ ✯͜͡❂➣ ลิขสิทธิ์ :: http://github.com/teambotmax ┃ ✯͜͡❂➣ ประเทศ :: ไทย ( Thailand ) ┃ ✯͜͡❂➣ ผู้สร้าง :: แม็กซ์ บินแหลก ( T...
test_bitcoind_mock.py
import re import requests from threading import Thread from riemann import tx from test.unit.conftest import bitcoin_cli import bitcoind_mock.conf as conf from bitcoind_mock import transaction, utils from bitcoind_mock.bitcoind import BitcoindMock, set_event from bitcoind_mock.auth_proxy import JSONRPCException MIX...
deepcompare.py
#!/usr/bin/python3 # # Compare two databases to ensure data integrity # Copyright 2018 PatientsLikeMe Inc. # logan.brown@patientslikeme.com # Imports import psycopg2 import configparser import sqlite3 import os import signal import sys from dbworker import dbWorker from multiprocessing import Process, Manager, Value f...
pattern_executor.py
# =============================================================================== # Copyright 2012 Jake Ross # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licens...