source
stringlengths
3
86
python
stringlengths
75
1.04M
Thread.py
import time from threading import Thread def sleeper(i): print "thread %d sleeps for 5 seconds" % i time.sleep(5) print "thread %d woke up" % i for i in range(10): t = Thread(target=sleeper, args=(i,)) t.start()
test_wallet.py
import rsa from tcoin_base.wallet import Wallet import time import threading import sys IP = "127.0.0.1" PORT = int(input('Port: ')) # w = input('wallet: ') # w = Wallet.load_wallet_pem(node_addr=(IP, PORT), file_path='./' + w) # w = Wallet(node_addr=(IP, PORT)) w = Wallet.optioned_create_wallet((IP, PORT)) # w2 = Wal...
flow_runner.py
import os import signal import threading from time import sleep as time_sleep from typing import Any, Callable, Dict, Iterable, Optional, Iterator from contextlib import contextmanager import pendulum import prefect from prefect.client import Client from prefect.core import Flow, Task from prefect.engine.cloud import...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
politics_economics_process.py
import multiprocessing import signal import os import time import random # an event that uses signals to communicate to parent process class ExternalEvent: def __init__(self, name, probability, lifespan, sig, handler): self.name = name # event name self.probability = probabilit...
test_ssl.py
# -*- coding: utf-8 -*- # Test the support for SSL and sockets import sys import unittest from test import test_support as support from test.script_helper import assert_python_ok import asyncore import socket import select import time import datetime import gc import os import errno import pprint import tempfile impor...
ipsec_perf_tool.py
#!/usr/bin/env python3 """ ********************************************************************** Copyright(c) 2021, Intel Corporation All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redis...
curses_ui_test.py
# Copyright 2016 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...
mongodb_04.py
import time from pymongo import MongoClient from datetime import datetime from threading import Thread, Lock start = datetime.now() client = MongoClient("mongodb://username:password@127.0.0.1") database = client['database_name'] collection = database['collection_name'] threads_count = 0 lock = Lock() package = [] d...
test_driver_remote_connection_threaded.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...
detect_drowsiness_im.py
from scipy.spatial import distance as dist #from imutils.video import VideoStream from imutils.video import WebcamVideoStream from imutils import face_utils from threading import Thread import numpy as np import playsound import argparse import imutils import time import dlib import cv2 from socket import...
test_common.py
from __future__ import absolute_import, unicode_literals import pytest import socket from amqp import RecoverableConnectionError from case import ContextMock, Mock, patch from kombu import common from kombu.common import ( Broadcast, maybe_declare, send_reply, collect_replies, declaration_cached, ignore_...
mavtest.py
import rospy import glob import json import math import os import px4tools import sys from mavros import mavlink from mavros_msgs.msg import Mavlink, Waypoint, WaypointReached, GlobalPositionTarget, State from mavros_msgs.srv import CommandBool, SetMode, CommandTOL, WaypointPush, WaypointClear from sensor_msgs.msg impo...
main.py
#!/usr/bin/env python # flake8: noqa: E402 import argparse import grp import logging import os import pwd import signal import sys import time from pathlib import Path from typing import Tuple, Optional import daemon import psutil from daemon.daemon import change_process_owner from pid import PidFile, PidFileError lo...
gsi_index_partitioning.py
import copy import json import threading import time from .base_gsi import BaseSecondaryIndexingTests from membase.api.rest_client import RestConnection, RestHelper import random from lib import testconstants from lib.Cb_constants.CBServer import CbServer from lib.couchbase_helper.tuq_generators import TuqGenerators f...
word2vec.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...
generators.py
import json from PIL import Image from io import BytesIO import selenium.webdriver from shobdokutir.optical.image_utils import trim_image from shobdokutir.web.servers import run_parrot_server from multiprocessing import Process from subprocess import check_output class OpticalTextBuilder: """ Definition: Opti...
multithread.py
from threading import Thread import time COUNT = 5000000 def countdown(n): while n>0: n -= 1 t1 = Thread(target=countdown, args=(COUNT//4,)) t2 = Thread(target=countdown, args=(COUNT//4,)) t3 = Thread(target=countdown, args=(COUNT//4,)) t4 = Thread(target=countdown, args=(COUNT//4,)) start = time.time() ...
__main__.py
# Copyright Jamie Allsop 2019-2019 # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import sys import threading import platform import subprocess import re import os import six from cuppa.utili...
pool.py
from ximea import xiapi from imutils.video import FPS import imutils import cv2 import numpy as np import time import multiprocessing from multiprocessing import Pool, Queue RESIZE = 500 def worker(input_q, output_q): fps = FPS().start() while True: fps.update() frame = input_q....
client.py
from runtime.manager import RuntimeManager from config.GantryConfig import Configuration from config.object import ConfigParseException from gantryd.componentwatcher import ComponentWatcher from gantryd.machinestate import MachineState from gantryd.componentstate import ComponentState, STOPPED_STATUS, KILLED_STATUS fr...
coach.py
# Copyright (c) 2017 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 i...
explorer.py
# -*- coding: utf-8 -*- from .lib.goto import with_goto __action_menu_style = '[COLOR white][B]%s[/B][/COLOR]' def __get_season_title(core, season, year, episodes): season_template = core.kodi.get_setting('general.season_title_template') if season_template == '1': return 'Season %s (%s)' % (season, y...
__init__.py
#!/usr/bin/python import threading import serial import time import os if os.name == "posix": import fcntl class DMX_Serial: def __init__(self, port="/dev/ttyUSB0"): if isinstance(port, str): self.ser = serial.Serial(port) else: self.ser = port self.ser.baudrate...
utils.py
import wave import sys import struct import time import subprocess import threading import traceback import shlex import os import string import random import datetime as dt import numpy as np import scipy as sp import scipy.special from contextlib import closing from argparse import ArgumentParser from pyoperant impor...
test_connection.py
from __future__ import absolute_import, division, print_function __metaclass__ = type import gc import os from signal import SIGHUP import threading import time import signal from amqpy.login import login_response_plain import pytest from .. import Channel, NotFound, FrameError, spec, Connection from ..proto import ...
tcpserver.py
#!/usr/bin/env python3 import errno import os import signal import socket import struct import sys import threading import time from optparse import OptionParser from fprime.constants import DATA_ENCODING try: import socketserver except ImportError: import SocketServer as socketserver __version__ = 0.1 __d...
database_heartbeat.py
import datetime import threading from galaxy.model import WorkerProcess from galaxy.model.orm.now import now class DatabaseHeartbeat(object): def __init__(self, application_stack, heartbeat_interval=60): self.application_stack = application_stack self.heartbeat_interval = heartbeat_interval ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
ssh.py
from __future__ import absolute_import from __future__ import division import inspect import logging import os import re import shutil import six import string import sys import tarfile import tempfile import threading import time import types from pwnlib import term from pwnlib.context import context from pwnlib.log...
system_info.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ .. module:: system_info :platform: Unix :synopsis: the top-level submodule of T_System's remote_ui that contains the functions for moving of t_system's arm. .. moduleauthor:: Cem Baybars GÜÇLÜ <cem.baybars@gmail.com> """ import multiprocessing from t_system.foun...
launcher.py
# # CV is a framework for continuous verification. # # Copyright (c) 2018-2019 ISP RAS (http://www.ispras.ru) # Ivannikov Institute for System Programming of the Russian Academy of Sciences # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lice...
miner.py
# Time running import time # Long string import hashlib as hasher # Data import json # Get, post, ... import requests # base 64 import base64 # Web framework from flask import Flask # Http request from flask import request # Running and | from multiprocessing import Process, Pipe # Crypto algorithm # ecd sa import ec...
_testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import os from shutil import rmtree import string import tempfile from typing import Any, Callable, List, Optional, Type, Union, cast import warnings import zipfile imp...
monitor.py
#!/usr/bin/env python #-*- coding: utf-8 -*- import numpy as np import Queue import threading import time import datetime from serial import Serial debug=False ## Serial port simulation ## from Rat import Rat ## Define some Serial read functions queue = Queue.Queue(0) def get_all_queue_result(queue): result_...
default.py
# Copyright 2018 Microsoft 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...
reservation.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """This module contains client/server methods to manage node reservations during TFCluster startup.""" from __future__ import absolute_import from __future__ import division from _...
server.py
#!/usr/bin/env python # Author: # Muhammad Shahbaz (muhammad.shahbaz@gatech.edu) from multiprocessing import Queue from multiprocessing.connection import Listener from threading import Thread ''' bgp server ''' class server(object): def __init__(self, logger): self.logger = logger self.listene...
server.py
import socket from threading import Thread from time import sleep server=socket.socket() server.bind((socket.gethostbyname(socket.gethostname()),120)) print(f"your ip is: {socket.gethostbyname(socket.gethostname())}") clients={ "cls":[], "closed":[] } l=True def brodcast(msg): print("brodcasting") p...
credentials.py
# Copyright (c) 2012-2013 Mitch Garnaat http://garnaat.org/ # Copyright 2012-2014 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...
3.process_cpu.py
''' 说明: 多进程运行时,同一个子进程可能会在多个cpu上运行 注: 本文件代码只能在linux环境下运行 max_workers: 同一时刻,有多少线程在cpu上执行. 如果max_workers=4,cpu核数为16,只能说同一时刻最多只会4个线程在cpu上执行,实际上16个cpu可能都会工作,详细请看:https://www.cnblogs.com/edisonchou/p/5020681.html cpu_num: 返回此进程当前正在运行的 CPU的编号[编号从0开始]。这个方法只能在linux上使用,如何在windows上部署linux环境 ''' from multiprocessing import...
job.py
# Copyright (c) 2019 PaddlePaddle 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 app...
ops_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...
Udp.py
import socket import threading from PyQt5.QtCore import pyqtSignal from Network import StopThreading def get_host_ip() -> str: """获取本机IP地址""" try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) s.connect(('8.8.8.8', 80)) ip = s.getsockname()[0] finally: s.close() ...
bmv2stf.py
#!/usr/bin/env python3 # Copyright 2013-present Barefoot Networks, 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 b...
tests.py
from __future__ import unicode_literals import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDBFeature, skipUnlessDBFea...
colorScenarios.py
# -*- coding: utf-8 -*- """ colorScenarios.py Author: SMFSW Copyright (c) 2016-2021 SMFSW Desc: color scenario & fader classes """ import os import sys import csv import threading from collections import OrderedDict from copy import deepcopy from colorConv import RGBtoHSV, HSVtoRGB, RGBtoXYZ, XYZtoRGB, XYZtoYxy, Yx...
game.py
import re import os import subprocess import threading import signal import random import psutil import numpy as np from gym import logger class GameRegion: """A rectangle. Represents the game region. """ def __init__(self, x: int = 0, y: int = 0, width: int = None, height: int = None): """C...
run.py
import threading from datamodel import Bundle from signalserver import SignalingServer from voiceserver import VoiceServer if __name__ == "__main__": ADDR = "0.0.0.0" PORT = 9001 print("RicoChat loading server") bundle = Bundle() def thread_tcp(): _port = PORT + 1 print("RicoCh...
kill_restart.py
import sys import queue import struct import threading import importlib import torch.multiprocessing as mp from util.utils import TcpServer, TcpAgent, timestamp def func_get_request(qout): # Listen connections server = TcpServer('localhost', 12345) while True: # Get connection ...
fixity.py
#!/usr/bin/python3.5 import re import os import sys import json import timeit import hashlib import datetime import requests import subprocess from io import BytesIO from shutil import copyfile from threading import Thread from time import gmtime, strftime from warcio.warcwriter import WARCWriter from warcio.archiveit...
logsclient.py
"""This file implements a threaded stream controller to return logs back from the ray clientserver. """ import sys import logging import queue import threading import time import grpc from typing import TYPE_CHECKING import ray.core.generated.ray_client_pb2 as ray_client_pb2 import ray.core.generated.ray_client_pb2_g...
tools.py
# Lint-as: python3 """Utilities for locating and invoking compiler tools.""" # 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/licen...
serial_test.py
# # DAPLink Interface Firmware # Copyright (c) 2009-2016, ARM Limited, All Rights Reserved # SPDX-License-Identifier: Apache-2.0 # # 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...
nrf802154_sniffer.py
#!/usr/bin/env python # Copyright (c) 2019, Nordic Semiconductor ASA # 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, ...
online.py
''' Online link spider test ''' from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import next import unittest from unittest import TestCase import time import datetime import sys from os import path sys.path.append(path.dirname(path.dirname(path....
main.py
import addict import os import schedule from mesoshttp.client import MesosClient from multiprocessing import Process, Queue from multiprocessing.queues import Empty, Full from scheduler import config, espa, logger, task, util log = logger.get_logger() def get_products_to_process(cfg, espa, work_list): max_schedu...
web_server.py
#!/usr/bin/python3 # file: multiprocess_web_server.py # Created by Guang at 19-7-19 # description: # *-* coding:utf8 *-* import multiprocessing import socket import re import time from frame import frame_app class WSGIServer(object): def __init__(self, ip, port): # 1.创建套接字 self.listen_server = ...
drs.py
#!/usr/bin/python # -*- coding: utf-8 -*- from __future__ import division, print_function import sys import signal import zmq import conf import logging import atexit import random import json from time import sleep from math import sqrt from colorsys import rgb_to_hsv from urllib import urlencode from urllib2 import...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
utils.py
# From http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/ import cv2 import datetime from threading import Thread class FPS: def __init__(self): # store the start time, end time, and total number of frames # that were examined between the start and end intervals...
horizont.py
import logging import numpy as np import matplotlib #matplotlib.use('Agg') import matplotlib.pyplot as plt import time import threading class Hud: # ============================================ def __init__(self): self.state = [1000,1000,1000,1000,0.0,0.0,0.0] plt.ion() self.fig, sel...
coordinates_for_DrugBank.py
from openforcefield.utils import utils from openeye import oechem from openeye import oeomega import multiprocessing def genConfs(c_mol, ofsff, ofsTri, index): # set omega settings omega = oeomega.OEOmega() omega.SetMaxConfs(1) omega.SetIncludeInput(False) omega.SetEnergyWindow(15.0) strict_st...
regrtest.py
#! /usr/bin/env python """ Usage: python -m test.regrtest [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] If no arguments or options are provided, finds all files matching the pattern "test_*" in the Lib/test subdirectory and runs them in alphabeti...
master.py
""" This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. """ import collections import copy import ctypes import functools import logging import multiprocessing import os import re import signal import stat import s...
infer.py
# Copyright (c) 2021 PaddlePaddle 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 appli...
time_elapsed.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'time_elapsed2.ui' # # Created by: PyQt5 UI code generator 5.12.1 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets, Qt # from Frame_recording import Screen from threading import Thread impor...
test_server.py
import os from http import HTTPStatus from multiprocessing.managers import DictProxy from pathlib import Path from unittest.mock import Mock, ANY import requests import time import uuid import urllib.parse from typing import List, Text, Type, Generator, NoReturn, Dict, Optional from contextlib import ExitStack from ...
automating_by_check_box_csv.py
""" 'Automated AC' CSV Test Program v2.5, Copyright 2017 Sam Suri CSV Test program retrieves live data but does not update ANYTHING in VAN. It shows the user what would happen via use of a CSV file. Program should be run prior to running full program. """ import hmac, hashlib, time, json, requests, copy impor...
test_slow_retrieval_attack.py
""" <Program Name> test_slow_retrieval_attack.py <Author> Konstantin Andrianov <Started> March 13, 2012 <Copyright> See LICENSE for licensing information. <Purpose> Simulate slow retrieval attack. A simple client update vs. client update implementing TUF. During the slow retrieval attack, attacker i...
controls.py
#!/usr/bin/env python3 import threading import subprocess import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') gi.require_version('GtkLayerShell', '0.1') from gi.repository import Gtk, Gdk, GLib, GdkPixbuf, GtkLayerShell from nwg_panel.tools import check_key, get_brightness, set_brightness, g...
bot_atcoder.py
import os import os.path as pth import re import time from threading import Thread import pyperclip as clip from selenium.webdriver.common.keys import Keys from bot_cp import * class bot_atcoder(bot_cp): def prept(self, prob_code: str, autoload=False): prob_code = prob_code.lower() driver = get_...
utils.py
#! coding:utf-8 # compatible for win32 / python 2 & 3 from __future__ import division, print_function import argparse import hashlib import importlib import json import os import pickle import re import shlex import signal import sys import time import timeit from base64 import b64decode, b64encode from codecs import ...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JSO...
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import threading try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K from .. import optimizers from .. imp...
server.py
import sys import time import socket import struct import signal import threading from queue import Queue from config import Config THREADS = 2 TASKS = [1, 2] queue = Queue() COMMANDS = { "help": ["Shows this help"], "ls clients": ["Lists connected clients"], "connect": ["Selects a client by its index. T...
client_sim.py
import requests import cv2 import os import time import base64 import json from threading import Thread # '127.0.0.1' #'172.20.16.10' # '137.110.115.9' # '34.68.142.133' # '34.94.7.7' # 'https://gazelearning-apis.wl.r.appspot.com' host = '34.69.132.236' PORT = 8000 N_SERVER = 1 TOTAL = 400 img_folder = 'data_temp/...
dropbox.py
#!/usr/bin/env python3 # # Copyright (c) Dropbox, Inc. # # dropbox # Dropbox frontend script # This file is part of nautilus-dropbox 2020.03.04. # # nautilus-dropbox 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 Foundat...
download_cazy_sequence.py
import requests import re from datetime import datetime from threading import Thread import queue, sys import argparse from lxml import etree import os in_queue = queue.Queue() records_per_page = 1000 prefix = "http://www.cazy.org/" fivefamilies = {"GH": "Glycoside-Hydrolases.html", "GT": "GlycosylTransferases.htm...
stream_capture.py
# ######################################################################## # # An example script for capturing stream and processing it with opencv # ########################################################################## import cv2 import msvcrt as m import numpy as np from time import sleep from threading impo...
vpp_papi.py
#!/usr/bin/env python # # Copyright (c) 2016 Cisco and/or its affiliates. # 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...
tests.py
import json import os import sys import threading import time import unittest if sys.version_info >= (3, 3): import unittest.mock as mock else: import mock from yeelight import Bulb from yeelight import enums from yeelight import Flow from yeelight import flows from yeelight import TemperatureTransition from ...
exposition.py
from __future__ import unicode_literals import base64 from contextlib import closing import os import socket import sys import threading from wsgiref.simple_server import make_server, WSGIRequestHandler from .openmetrics import exposition as openmetrics from .registry import REGISTRY from .utils import floatToGoStrin...
vnoanda.py
# encoding: utf-8 import logging # from vtFunction import AppLoger # apploger = AppLoger() # apploger.set_log_level(logging.INFO) # # apiLog = apploger.get_logger() import json import requests from Queue import Queue, Empty from threading import Thread API_SETTING = {} API_SETTING['practice'] = {'rest': 'https://ap...
keyboard.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.input import InputType import threading import click class Keyboard(object): __winch = None __lcd = None __co...
rtsp_webserver.py
""" # TODO: Load ML model with redis and keep it for sometime. 1- detector/yolov3/detector.py |=> yolov3 weightfile -> redis cache 2- deepsort/deep/feature_extractor |=> model_path -> redis cache 3- Use tmpfs (Insert RAM as a virtual disk and store model state): https://pypi.org/project/memory-tempfile/ "...
app.py
import time import datetime import sqlite3 from multiprocessing import Process import numpy as np from bokeh.embed import server_document from bokeh.server.server import Server from bokeh.themes import Theme import bokeh.io import bokeh.models import bokeh.plotting import bokeh.layouts import bokeh.driving import boa...
app.py
# -*- coding utf-8 -*- from threading import Thread from dctcs.user.user import User from dctcs.db.models import db_handler from dctcs.constdef.const import DEFAULT_TMP from dctcs.schedule.scheduler import Scheduler from flask import Flask, request, jsonify from flask_cors import CORS app = Flask(__name__) CORS(app)...
fcfs_refinement.py
import os import sys import time import psutil import startinpy import numpy as np from multiprocessing import cpu_count, Process, Lock, Queue, current_process from scipy.spatial import KDTree COARSE_THRESHOLD = 2 FINE_THRESHOLD = 0.2 class MemoryUsage: def __init__(self, process_name, timestamp, memory_usage...
RoleManager.py
#!/usr/bin/env python import rospy import socket import threading import roslaunch import roslib import select import time from std_msgs.msg import String class RoleManager: PORT = 65535 RECEIVE_SOCKET_TIMEOUT = 3 CONNECTION_ATTEMPT_TIMEOUT = 5 def __init__(self): """ The rosparam ...
graphql.py
import re import sys import traceback from threading import Thread import sublime import sublime_plugin from ..core import RequestCommandMixin from ..core.parsers import parse_requests from ..core.responses import prepare_request from ..deps import requests from ..deps.graphql.lexer import GraphQLLexer from ..deps.gr...
JumpscriptFactory.py
from JumpScale import j import time import imp import linecache import inspect import JumpScale.baselib.redis import multiprocessing import tarfile import StringIO import collections import os import base64 import traceback import signal import sys class Jumpscript(object): def __init__(self, ddict=None, path=None...
draft.py
''' Program name: ChatRoom/client.py GUI Client: a GUI client that can communicate with the server. a client can send text messages to all parties in the chat room, as well as receive notifications when other clients connect or disconnect. Clients do not communicate directly with ...
manage.py
#!/usr/bin/env python import os import sys import time import datetime as dt import requests import threading from source.util import unpack_url_tar from Vizard.settings import TOOL_PATH, CONF_JMETER, CONF_GATLING def keep_alive(): while True: if 8 < dt.datetime.utcnow().hour < 22: print('Se...
cico_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...
helper_funcs.py
import contextlib import io import threading from typing import Any, Callable, Iterable, Union def null_fn() -> None: return None def check_null_fn(fn: Union[Callable[[], None], None]) -> Callable[[], None]: if fn is None: return null_fn return fn def check_iterable(s: Union[str, Iterable[str]]...
_exposition.py
# Copyright 2015-2019 Prometheus Python Client Developers # Copyright 2019 Matrix.org Foundation C.I.C. # # 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/...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development 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 required by ...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import _ from electrum.transaction im...
ib_api.py
""" Module to facilitate trading through Interactive Brokers's API see: https://interactivebrokers.github.io/tws-api/index.html Brent Maranzano Dec. 14, 2018 Classes IBClient (EClient): Creates a socket to TWS or IBGateway, and handles sending commands to IB through the socket. IBWrapper (EWrapper): H...