source
stringlengths
3
86
python
stringlengths
75
1.04M
acquiareDmaSamples.py
# Copyright (c) 2020, embedINN # 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 conditions and the foll...
assistant.py
import time, os import numpy as np import scipy.signal as sg from PyQt5.QtCore import * import deepspeech as ds import pvporcupine import struct import pyaudio from hue_helper import HueHelper from led_helper import LedHelper from cal_helper import CalHelper from joplin_helper import JoplinHelper from thermometer i...
node_t5_ur5_1.py
#! /usr/bin/env python """ This script controls the UR5 near the shelf for placing boxes on the conveyor. It borrows methods from :mod:`lib_task5` for execution, and uses multithreading to operate :meth:`controller <UR5One.controller>` and the order pipeline simultaneously. """ import os import json import datetime imp...
upload_api-v2_human.py
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, json, time, sys, thread import argparse import unicodedata import shutil import subprocess import threading # import dlib import math import time import os.path import Queue from threa...
chatup.py
#!/usr/bin/env python2.7 import tkinter as Tkinter #Tkinter GUI module from tkinter import ttk #themed tkinter module import socket #Socket module import select #Efficient I/O import threading #Concurrency import plat...
adb_enhanced.py
#!/usr/bin/env python3 import re import signal import subprocess import sys import tempfile import threading import time import os import random from functools import wraps, partial from urllib.parse import urlparse from enum import Enum import psutil # asyncio was introduced in version 3.5 if sys.version_info >= (3,...
tcp3server.py
import socket import threading import CompressAndDecompress from CompressAndDecompress import Compressed from ToSendFromServer import ToFindData from EncyrptAndDecrypt import Encrypt class TCPserver(): def __init__(self): self.server_ip = 'localhost' self.server_port = 9999 def m...
utils.py
from __future__ import (unicode_literals, print_function, absolute_import, division) import logging # Py2-3 compatibility try: import queue except ImportError: import Queue as queue import os import random import string import subprocess import sys import threading from time import slee...
qfluidsynth.py
#!/usr/bin/env python3 import sys import time import socket import threading import subprocess import jack import mido from mido import MidiFile import fluidsynth def demo01(): cli = jack.Client('xxx') s1 = '../../soundfont/sf2/ChateauGrand-Plus-Instruments-bs16i-v1.4.sf2' s2 = "/usr/share/sounds/sf2/Flui...
fake_sensor.py
#!/usr/bin/env python from PySide.QtGui import QApplication, QVBoxLayout, \ QDial, QPushButton, QGroupBox import sys import threading sensor = None class ActualFakeSensor(object): def __init__(self, callback=None): self.callback = callback self.app = QApplication(sys.a...
scraper.py
# update: 01/27/2021 # Author: Borneo Cyber # Description: Proxy scraper from time import sleep from requests import get from .proxy import Proxy from random import randint from .display import Display from .proxy_list import ProxyList from bs4 import BeautifulSoup as bs from threading import Thread, RLock ...
show_weights.py
#!/usr/bin/env python # -------------------------------------------------------- # Quantize Fast R-CNN based Network # Written by Chia-Chi Tsai # -------------------------------------------------------- """Quantize a Fast R-CNN network on an image database.""" import os os.environ['GLOG_minloglevel'] = '2' import _...
sniffer.py
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # 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 # ...
TempServer.py
#!/usr/bin/python # small web server that polls 18B20's that it finds # and makes them available as a json response # see TempNames.py for sensor id to name mapping # from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer from w1thermsensor import W1ThermSensor import json, time import socket import sys ...
common.py
"""Test the helper method for writing tests.""" import asyncio import collections from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta import functools as ft from io import StringIO import json import logging import os import pathlib import threading import time from ...
upload.py
#!/usr/bin/env python3 # coding=utf-8 ''' #------------------------------------------------------------------------------- Project : Instagram Bot Module : bot Purpose : Follow users, like posts, upload photo, unfollow Version : 0.1.2 beta Status : Development Modified : 2020 Jun 28 Created : 2019 Nov 03 #-...
server.py
from envgen import EnvironmentGenerator from flask import Flask, request from flask_restful import Resource, Api, reqparse, fields, marshal from json import dumps import os import shutil import threading import argparse app = Flask(__name__) api = Api(app) e = EnvironmentGenerator() project_dir = '' hos...
quote.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = '' __author__ = 'HaiFeng' __mtime__ = '2016/9/23' """ import threading import platform import os from .structs import InfoField, Tick from .ctp_quote import Quote from .ctp_struct import CThostFtdcRspUserLoginField, CThostFtdcRspInfoField, CThostFtdcDepthM...
__init__.py
""" objectstore package, abstraction for storing blobs of data for use in Galaxy. all providers ensure that data can be accessed on the filesystem for running tools """ import logging import os import random import shutil import threading from xml.etree import ElementTree try: from sqlalchemy.orm import object_...
alice.py
__author__ = "mashed-potatoes" from threading import Thread from os import _exit from modules.config import * from modules.hamming import * from modules.sender import RemoteHost from modules.iohelper import update_file from modules.http_server import NetIO from modules.logger import Logger from pymitter import EventEm...
GUIDieHard4.py
# GUIDieHard4.py from tkinter import * import threading import pygame import time pygame.mixer.init() def play(): # playsound('sound1.mp3') pygame.mixer.music.load("search.mp3") pygame.mixer.music.play(loops=0) def playThread(): task = threading.Thread(target=play) task.start() GUI = Tk() ...
argthread.py
import threading def mythread(arg): print("Finished simple thread!!\n",arg) t = threading.Thread(target=mythread,args=(2,)) t.start() t.join()
gameHome.py
# coding=utf-8 import pygame as pg from pygame.locals import * from constantes_PunchinBall import * from constantesDataStream import * import sys from subprocess import Popen, PIPE from threading import Thread # from Queue import Queue, Empty # from subprocess import call # import binascii # import time # import sign...
multistart.py
import multiprocessing import numpy as np import scipy.optimize as opt from functools import partial from parallel import BetterPool from scipy.linalg import LinAlgError def minimize_success(res): # Condition to check if opt.minimize result is successful if res.success: return res.fun, res return ...
youtubeDownloder.py
import requests from urllib.parse import unquote import time import itertools from threading import Thread import uuid query=input(' Enter your URL ') timer=time.time() res = requests.get(query,headers={"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/...
controller.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- # OpneWinchPy : a library for controlling the Raspberry Pi's Winch # Copyright (c) 2020 Mickael Gaillard <mick.gaillard@gmail.com> from openwinch.config import config from openwinch.constantes import (SPEED_INIT, SPEED_MAX, SPEED_MIN) from openwinch.display import Gui f...
uart.py
import posix_ipc as ipc import threading import serial import time direction_q = ipc.MessageQueue('/directionQueue', ipc.O_CREAT) hit_q = ipc.MessageQueue('/hitQueue', ipc.O_CREAT) wq = ipc.MessageQueue('/serialWriteQueue', ipc.O_CREAT) ser = serial.Serial('/dev/ttyTHS1', 115200, timeout=0) def uart_recv(): whil...
historian.py
""" Holds the worker which trains the chess model using self play data. """ import glob import os from collections import deque from concurrent.futures import ProcessPoolExecutor from datetime import datetime from logging import getLogger from multiprocessing import Manager from threading import Thread from time import...
launcher.py
from hops import util from hops import hdfs as hopshdfs import pydoop.hdfs as hdfs from hops import tensorboard from hops import devices import pydoop.hdfs import threading import six import datetime import os run_id = 0 def launch(sc, map_fun, args_dict=None, local_logdir=False): global run_id app_id = s...
mailcatcher.py
# std lib import json from threading import Thread from typing import List, Optional # community lib import requests from websocket import create_connection from rx.subjects import Subject from rx.concurrency import ThreadPoolScheduler class Message: def __init__(self, message_id: str, recipients: List[str], sen...
hello_world__with_daemon.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import threading import time def run(): print(threading.current_thread()) for i in 'Hello World!': print(i) time.sleep(0.2) if __name__ == '__main__': thread = threading.Thread(target=run, daemon=True) thread.s...
test_basic.py
from RLTest import Env from sqlalchemy import create_engine from sqlalchemy.sql import text import time import subprocess import signal from threading import Thread MYSQL_DB = 1 ORACLESQL_DB = 2 class Background(object): """ A context manager that fires a TimeExpired exception if it does not return within...
via_app_data.py
"""Bootstrap""" from __future__ import absolute_import, unicode_literals import logging from contextlib import contextmanager from functools import partial from threading import Lock, Thread from virtualenv.info import fs_supports_symlink from virtualenv.seed.embed.base_embed import BaseEmbed from virtualenv.seed.emb...
Script.py
import logging import multiprocessing as mp import os.path as op import signal from util import FileNotFoundError import Tests class ScriptError(Exception): pass class Script(object): def __init__(self, path, timeout=0, logcat_regex=None): self.logger = logging.getLogger(self.__class__.__name__) ...
evaluator.py
from threading import Thread from deepdab import * def evaluate(policy, board_size, num_trials, opponents): final_results = {} for opponent_policy in opponents: results = {'won': 0, 'lost': 0, 'tied': 0} for trial in range(num_trials): players = ['policy', 'opponent'] ...
concurrent.py
# Copyright 2016 Google Inc. 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 law or a...
command.py
# This file is part of the uPiot project, https://github.com/gepd/upiot/ # # MIT License # # Copyright (c) 2017 GEPD # # 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, inc...
upload_api-v2.py
# coding=utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import os, json, time, sys, thread, base64 import argparse import unicodedata import shutil import subprocess import threading # import dlib import math import time import os.path import Queue fr...
main.py
# coding: utf-8 __author__ = 'Catarina Silva' __version__ = '0.3' __email__ = 'c.alexandracorreia@ua.pt' __status__ = 'Development' import os import sys import socket import logging import argparse import datetime import threading import configparser from check_https_utils import PostgreSQL, send_msg, recv_msg fro...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return "Your bot is alive!" def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): server = Thread(target=run) server.start()
USB_bak.py
import os import time import psutil from threading import Thread import pandas as pd logRoot = "..\\Log" logName = "Log_"+ time.strftime("%Y%m%d",time.localtime(time.time())) targetRoot = 'D:\CopyFileRoot' # 目标目录 oldDiskName = [] # 旧的磁盘列表 number = 0 # 磁盘数,判断是否为第一次运行 bakpath = "" # u盘验证文件路径 usbData = "" ''' ...
server__main__.py
import os.path import traceback import sys __file__ = os.path.abspath(__file__) if __file__.endswith((".pyc", ".pyo")): __file__ = __file__[:-1] _critical_error_log_file = os.path.join( os.path.expanduser("~"), "robotframework_server_api_critical.log" ) def _stderr_reader(stream): from robocode_ls_core....
_server.py
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test litecoinzd shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_frame...
irc_client.py
import socket from threading import Thread, Lock from typing import Callable, List, Any import certifi import ssl class IrcClient(): """ Class for connecting to Twitch's IRC chat server. Uses socket with SSL functionality """ _instance: Any = None def __new__(self): if self._instance == N...
object_storage_bulk_rename.py
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
wallet.py
import copy, hashlib, json, logging, os import time from hwilib.descriptor import AddChecksum from .device import Device from .key import Key from .util.merkleblock import is_valid_merkle_proof from .helpers import der_to_bytes, sort_descriptor, fslock, parse_utxo from .util.base58 import decode_base58 from .util.xpub ...
test_capture.py
from __future__ import absolute_import, division, print_function # note: py.io capture tests where copied from # pylib 1.4.20.dev2 (rev 13d9af95547e) from __future__ import with_statement import pickle import os import sys from io import UnsupportedOperation import _pytest._code import py import pytest import context...
fetchirisdmc.xpy
import os import sys, traceback import time from time import localtime, strftime # This is needed for running multiple threads as the name implies import threading # required for antelope sys.path.append(os.environ['ANTELOPE'] + "/data/python") import copy import antelope.datascope as datascope import antelope.stock a...
task.py
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
utils.py
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # Copyright (c) 2013, Battelle Memorial Institute # 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. Redis...
server.py
import socket from threading import Thread from game import Game if __name__ == "__main__": clients = [] game = Game() new_game = [False, False] def recv(clientsocket, player): while True: # wait for message from any of the clients. msg = clientsoc...
NanoCam.py
# Import the needed libraries import time from threading import Thread import cv2 # (MZ) added functions: HW sensor definition, crop (on full size image), and rescale to desired resolution class Camera: def __init__(self, camera_type=0, device_id=0, source="localhost:8080", flip=0, width=640, height=480, fps=30,...
utils.py
#---------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. #---------------------------------------------------------------...
process_replay.py
#!/usr/bin/env python3 import capnp import os import sys import threading import importlib if "CI" in os.environ: def tqdm(x): return x else: from tqdm import tqdm # type: ignore from cereal import car, log from selfdrive.car.car_helpers import get_car import selfdrive.manager as manager import cereal.messa...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
__init__.py
# We import importlib *ASAP* in order to test #15386 import importlib import importlib.util from importlib._bootstrap_external import _get_sourcefile import builtins import marshal import os import platform import py_compile import random import stat import sys import threading import time import unittest import unitte...
fastlogging.py
# -*- coding: utf-8 -*- # Copyright 2019 Martin Bammer. All Rights Reserved. # Licensed under MIT license. #cython: language_level=3, boundscheck=False """Implements lightweight and fast logging.""" import os import sys import atexit import time import traceback from collections import deque from threadi...
mt5_gateway.py
import threading from datetime import datetime from typing import Callable, Dict, Set, List from dataclasses import dataclass import zmq import zmq.auth from zmq.backend.cython.constants import NOBLOCK from tzlocal import get_localzone import pytz from vnpy.trader.constant import ( Direction, Exchange, Or...
safe_bank_fine_grained.py
import datetime import random import time from threading import Thread, RLock from typing import List class Account: def __init__(self, balance=0): self.balance = balance self.lock = RLock() def main(): accounts = create_accounts() total = sum(a.balance for a in accounts) validate_b...
xla_client_test.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...
base_test.py
"""TESTS - UTILS - BASE TEST Base test to be inherited by all tests of the project """ # # Native # # import contextlib from uuid import uuid4 from threading import Thread from typing import List, Tuple # # Project # # from mqtt2etcd.connectors import ETCDClient from mqtt2etcd.connectors import MQTTClient as MQTT2ETC...
nanny.py
from __future__ import annotations import asyncio import errno import logging import os import shutil import threading import uuid import warnings import weakref from contextlib import suppress from inspect import isawaitable from queue import Empty from time import sleep as sync_sleep from typing import TYPE_CHECKING...
test_wsgi.py
import threading from wsgiref.simple_server import make_server, WSGIServer import requests from autocert.wsgi import hello_world_app, redirect_app from autocert.wsgi import reconstruct_https_url class BackgroundWSGIServer(WSGIServer): def __init__(self, *args, **kwargs): super().__init__(*args, **kwarg...
pilogger.py
import socket import time import traceback import errno from message_socket.message_socket import MessageSocket, MessageType, PiLogMsg class PiLogger(): def __init__(self, host, port): """ """ try: sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect((host,...
test_spark.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import os from urlparse import urlparse, parse_qsl from urllib import unquote_plus from urlparse import urljoin import json import BaseHTTPServer import threading import ssl import time import requests i...
test_message.py
import pytest import time from threading import Thread from assemblyline.common.importing import load_module_by_path from assemblyline.odm.messages.alert import AlertMessage from assemblyline.odm.messages.dispatcher_heartbeat import DispatcherMessage from assemblyline.odm.messages.ingest_heartbeat import IngestMessag...
oldtest.py
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import unittest import threading import tornado_requests import os import json import base64 import configparser import common import crypto import tempfile import signal import subprocess import queue import uuid im...
renderer.py
""" Renders the command line on the console. (Redraws parts of the input line that were changed.) """ from __future__ import unicode_literals from prompt_toolkit.eventloop import Future, From, ensure_future, get_event_loop from prompt_toolkit.filters import to_filter from prompt_toolkit.formatted_text import to_format...
mail.py
import smtplib import os,sys import time,random import threading import argparse H = '\033[95m' B = '\033[94m' G = '\033[92m' W = '\033[93m' F = '\033[91m' E = '\033[0m' U = '\033[4m' O = '\033[33m' serv = None port = 587 os.chdir('modules/') parser = argparse.ArgumentParser(description="Framework Hunner") parser.ad...
test_loopingcall.py
# Copyright 2012 Red Hat, Inc. # # 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...
ev3.py
from PIL import Image, ImageFont import dbus # only for waitForConnection() bluetooth import glob # only for stopAllMotors() import logging import math import os import threading # only for ledOn() animations import time # ignore failure to make this testable outside of the target platform try: # this has ...
main.py
""" main.py Main.py é responsável por iniciar o processo o programa completamente, através de duas threads, uma para manter o servidor de aplicação via flask para poder receber requisições e comunicar com o cliente, seus processos estão detalhados em server.py e outra thread para manter o fluxo da aplicação, baseado n...
klee_conc_explorer.py
import ConfigParser from ConfigParser import NoOptionError import multiprocessing import subprocess import os import sys import utils import signal from utils import bcolors def se_info(s): print bcolors.HEADER+"[KleeConc-Info]"+bcolors.ENDC," {0}".format(s) class ConcExplorer: def __init__(self, config, tar...
sense-hat-visualizer.py
import time import threading import random from collections import deque from sense_hat import SenseHat, ACTION_PRESSED, ACTION_HELD, ACTION_RELEASED # Color config BACKGROUND_COLOR = (0, 0, 0) RAINBOW_COLOR = deque([ (143, 0, 255), (75, 0, 130), (0, 0, 255), (0, 255, 0), (255, 255, 0), (255, 127, 0), ...
session.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- import logging import uuid import six from collections import deque from threading import Event from threading import RLock from threading import Thread from time import sleep from time import time from sanji.message import Message _logger = logging.getLogger("sanji.s...
test_launcher.py
#!/usr/bin/env python3 # -*- coding: UTF-8 -*- """ Copyright 2017-2019 Baidu Inc. 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...
main.py
import web from web import form import socket import RPi.GPIO as GPIO import time from threading import Thread from threading import Lock localhost = "http://" + socket.gethostbyname(socket.gethostname()) + ":8080" print(localhost) global infrared, ultrasonic, servomotor, motor_L1, motor_L2, motor_R1, motor_R2...
test_worker.py
import unittest import time import multiprocessing import logging from .. import worker class EventsTestWorker( worker.Worker, ): name = 'events_test_worker' config = worker.Worker.config.copy() config.update( { 'timeouts': { 'soft_timeout': 2.0, '...
sshthread.py
# -*- coding:utf-8 -*- import paramiko import threading import time def ssh_multi(ip,port,username,passwd,cmd): """ 1.利用多线程,同时发出登录请求,同时去连接电脑,速度很快. 因为有一些命令执行时间会长一些. 2. 循环时循环所有ip. 3. 远程执行命令有交互,用stdin.write('Y')来完成交互. 4. 把需要执行的命令存放到一个列表. 5. exec_command为单个会话,执行完成后会回到登录时的默认目录. """ try: ...
lionel_bot.py
# importing the requests library import requests import json import socket, string import time import re import threading import chat_plays_go as cpg import queue import time CHANNEL = "t4rquin" USERNAME = # Your bots nick OAUTH = # OAuth class Chatbot: def __init__(self): # Some basic variables used to c...
binaries.py
# Lint-as: python3 """Utilities for locating and invoking compiler tool binaries.""" # Copyright 2020 The IREE Authors # # Licensed under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import importlib...
migrate.py
# # Migrate the current beacon to a different process # import os import json import base64 import argparse import threading from lib import buildtools __description__ = "Migrate the beacon to a different process" __author__ = "@_batsec_" # identify the task as shellcode execute DLLINJECT_EXEC_ID = 0x5000 # did th...
__init__.py
import os import py import sys import time import math import pytest import _pytest import platform import threading import multiprocessing from tblib import pickling_support from multiprocessing import Manager, Process # In Python 3.8 and later, the default on macOS is spawn. # We force forking behavior at the expens...
queue_service.py
""" Import fix - check README for documentation """ import os,sys,inspect __currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))) sys.path.insert(0, __currentdir[0:__currentdir.find("/CREPE")+len("/CREPE")]) """ End import fix """ from multiprocessing import Process, Queue, Array as ...
camera.py
from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=0, name="WebcamVideoStream"): # initialize the video camera stream and read the first frame # from the stream self.stream = cv2.VideoCapture(src) #self.stream.set(cv2.CAP_PROP_FRAME_WIDTH...
jobStoreTest.py
# Copyright (C) 2015-2016 Regents of the University of California # # 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 app...
test_zeromq.py
# -*- coding: utf-8 -*- ''' :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import time import threading import multiprocessing import ctypes from concurrent.futures.thread import ThreadPoolExecutor # ...
test_html.py
from functools import partial from importlib import reload from io import BytesIO, StringIO import os from pathlib import Path import re import threading from urllib.error import URLError import numpy as np import pytest from pandas.compat import is_platform_windows from pandas.errors import ParserError import pandas...
Main.py
# Module Imports - System from threading import Thread import pprint import datetime import time import json import subprocess import os # Module Imports - pip install * import pyautogui import requests import schedule # Function -> getTimeTable def getTimeTable(sessionID): GYOC = {"ASP.NET_SessionId": sessionID} ...
core.py
import os import time import numpy as np import torch from torch import nn, optim from multiprocessing import Process, Queue # import torch.multiprocessing as mp import warnings warnings.filterwarnings("ignore") import sys sys.path.append("..") from util import util,transformer,dataloader,statistics,plot from . impor...
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
test_client.py
import pytest import time import sys import logging import threading import ray.util.client.server.server as ray_client_server from ray.util.client.common import ClientObjectRef from ray.util.client.ray_client_helpers import ray_start_client_server @pytest.mark.skipif(sys.platform == "win32", reason="Failing on Wind...
worker.py
""" :mod:`worker` ============= Responsible for executing jobs on the worker. """ import asyncio import logging import os import signal import sys import time from datetime import datetime from functools import partial from importlib import import_module, reload from multiprocessing import Process from signal import S...
threadpool.py
# Testoob, Python Testing Out Of (The) Box # Copyright (C) 2006 The Testoob Team # # 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 ...
gamePunchinBallbackup.py
import pygame as pg from pygame.locals import * from constantesDataStream import * import sys from subprocess import Popen, PIPE from threading import Thread from Queue import Queue, Empty from subprocess import call import binascii import time import signal import numpy as np import pandas as pd import scipy as sp im...
boilerplate1.py
import cv2 import numpy as np import threading import time from PIL import Image from skimage.restoration import estimate_sigma import os import multiprocessing def est_noise(image): return estimate_sigma(image, average_sigmas=True, multichannel=True) def median(): img = cv2.imread('Sample_BinaryImage_2.pn...
ballisticacore_server.py
#!/usr/bin/env python3.8 # Released under the MIT License. See LICENSE for details. # """BallisticaCore server manager.""" from __future__ import annotations import json import os import signal import subprocess import sys import time from pathlib import Path from threading import Lock, Thread, current_thread from typ...
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
app.py
import os import praw import json import datetime import atexit from apscheduler.schedulers.background import BackgroundScheduler from argparse import ArgumentParser from kafka import KafkaProducer from kafka.errors import NoBrokersAvailable from multiprocessing import Process from time import sleep KAFKA_IP = os.get...