source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
controller.py | # Electron Cash - lightweight Bitcoin client
# Copyright (C) 2019, 2020 Axel Gembe <derago@gmail.com>
#
# 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 withou... |
session_hooks.py | import contextlib
import glob
import logging
import math
import multiprocessing as mp
import queue
import re
import signal
import threading
import time
import numpy as np
import tensorflow as tf
import eta
import init
import tfasync
import tfu
import util
mp_spawn = mp.get_context('spawn')
@tfasync.coroutine_hook
... |
camera.py | import traitlets
from traitlets.config.configurable import SingletonConfigurable
import atexit
import cv2
import threading
import numpy as np
import pdb
import time
class Camera(SingletonConfigurable):
value = traitlets.Any()
# config
width = traitlets.Integer(default_value=720).tag(config=True)... |
wrappers.py | # Copyright 2019 The Dreamer 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 applicabl... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrumsys.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrumsys.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrumsys import ... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum - Lightweight Radiocoin Client
# Copyright (C) 2015 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 witho... |
packetSender.py | from packet import Packet
from packetConstructor import PacketConstructor
import threading
import time
class PacketSender:
"""
Packet represents a simulated UDP packet.
"""
# The next seq num for sent packets
seq_num = 0
# The next seq num for acks that we're waiting for
next_seq_num = 0
... |
lord.py | import server
import threading
import time
import socket
import json
import voice_commands
class WIFIReceiver:
def __init__(self):
self.UDP_IP = ""
self.UDP_port = 5005
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_RE... |
test_utils_test.py | import asyncio
import pathlib
import socket
import threading
from contextlib import contextmanager
from time import sleep
import pytest
from tornado import gen
from distributed import Client, Nanny, Scheduler, Worker, config, default_client
from distributed.core import Server, rpc
from distributed.metrics import time... |
installwizard.py |
from functools import partial
import threading
import os
from typing import TYPE_CHECKING
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Butto... |
stratum-ss-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 ... |
test_fake_server.py | #!/usr/bin/env python
# This code is based on https://medium.com/@hmajid2301/pytest-with-background-thread-fixtures-f0dc34ee3c46
"""Tests for `broadworks_ocip` package."""
import threading
import pytest # noqa: F401
from broadworks_ocip import BroadworksAPI
from broadworks_ocip import OCIErrorResponse
from tests.fak... |
InstallTranslator.py | from threading import Thread
from src.services.parent.SlackInstallationService import SlackInstallationService
from src.translators.Translator import Translator
class InstallTranslator(Translator):
def __init__(self, code, slack_client_wrapper, strand_api_client_wrapper):
super().__init__(slack_client_wr... |
motors.py | from .devices import Device
from .exc import DeviceInvalid, DirectionInvalid, MotorException
from threading import Condition
from collections import deque
from enum import Enum
import threading
import statistics
import time
class PassiveMotor(Device):
"""Passive Motor device
:param port: Port of device
:r... |
wex.py | from befh.restful_api_socket import RESTfulApiSocket
from befh.exchanges.gateway import ExchangeGateway
from befh.market_data import L2Depth, Trade
from befh.util import Logger
from befh.instrument import Instrument
from befh.clients.sql_template import SqlClientTemplate
from functools import partial
from datetime impo... |
ipc_teleop.py | import time
from threading import Thread
import posix_ipc
import json
class Teleoperator:
def __init__(self):
self.status = False
self.shutdown = False
def start_process(self):
self.process = Thread(target=self.start_server)
self.process.daemon = True
self.process.sta... |
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... |
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... |
alarm_server.py | import logging
import random
import threading
import time
from typing import List, Iterator
from .alarm import Alarm
from .server import Server, get_zone_state_event_type
from .zone import Zone
from ...event import SystemStatusEvent, ArmingUpdate, ZoneUpdate, StatusUpdate
_LOGGER = logging.getLogger(__name__)
class... |
train_ac_f18_plasma.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn
Modifed for CS294-112 Fall2018 by Matthew Witman to implement solutions
and add a... |
test_tracking.py | # -*- coding: utf-8 -*-
# flake8: disable E501
'''
Tests for contrib/tracking...
Compatibility Tests Table
============= ==================================== ======================================== ========================================
client/server native v2 ... |
tunnel.py | """Basic ssh tunnel utilities, and convenience functions for tunneling
zeromq connections.
"""
# Copyright (C) 2010-2011 IPython Development Team
# Copyright (C) 2011- PyZMQ Developers
#
# Redistributed from IPython under the terms of the BSD License.
import atexit
import os
import re
import signal
import socket
imp... |
epname.py | import sys
import pathlib
import os
import re
import threading
"""Regex for season names"""
SEASON_NAME = "s(e(ason)?)?( )*([0-9])*[0-9]( )?"
"""Regex for episode names"""
EPISODE_NAME = "e(pisode|p(i)?)?( )*([0-9])*[0-9]"
def fatal(msg: str):
"""Fatal error message"""
print(f"Error: {msg}!")
sys.exit(... |
constant.py | # Copyright 2014: Mirantis 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 b... |
__init__.py | import builtins
import contextlib
import errno
import glob
import importlib.util
from importlib._bootstrap_external import _get_sourcefile
import marshal
import os
import py_compile
import random
import shutil
import stat
import subprocess
import sys
import textwrap
import threading
import time
import unittest
from uni... |
recipe-302746.py | import threading,Queue,time,sys,traceback
#Globals (start with a captial letter)
Qin = Queue.Queue()
Qout = Queue.Queue()
Qerr = Queue.Queue()
Pool = []
def err_msg():
trace= sys.exc_info()[2]
try:
exc_value=str(sys.exc_value)
except:
exc_value=''
return str(traceback.format_tb(tr... |
test_sys.py | import unittest, test.support
import sys, io, os
import struct
import subprocess
import textwrap
import warnings
import operator
import codecs
# count the number of test runs, used to create unique
# strings to intern in test_intern()
numruns = 0
try:
import threading
except ImportError:
threading = None
cla... |
sublist3r.py | #!/usr/bin/env python
# coding: utf-8
# Sublist3r v1.0
# By Ahmed Aboul-Ela - twitter.com/aboul3la
import argparse
import hashlib
import json
import multiprocessing
import os
import random
# modules in standard library
import re
import socket
import sys
import threading
import time
from collections import Counter
im... |
mdns_example_test.py | import re
import os
import socket
import time
import struct
import dpkt
import dpkt.dns
from threading import Thread
from tiny_test_fw import DUT
import ttfw_idf
g_run_server = True
g_done = False
def mdns_server(esp_host):
global g_done
UDP_IP = "0.0.0.0"
UDP_PORT = 5353
MCAST_GRP = '224.0.0.251'
... |
acceptor.py | # -*- coding: utf-8 -*-
"""
proxy.py
~~~~~~~~
⚡⚡⚡ Fast, Lightweight, Pluggable, TLS interception capable proxy server focused on
Network monitoring, controls & Application development, testing, debugging.
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE... |
TaskManager.py | """
Python thread pool, see
http://code.activestate.com/recipes/577187-python-thread-pool/
Author: Valentin Kuznetsov <vkuznet [AT] gmail [DOT] com>
"""
# futures
from __future__ import division
from builtins import range, object
from future import standard_library
standard_library.install_aliases()
# system modules... |
cognifly_remote.py | from copy import deepcopy
from threading import Lock, Thread
import socket
import pickle as pkl
import logging
import time
import numpy as np
from cognifly.utils.udp_interface import UDPInterface
from cognifly.utils.tcp_video_interface import TCPVideoInterface
from cognifly.utils.ip_tools import extract_ip, get_free_p... |
main.py | from flask import Flask, jsonify, request, send_from_directory
import requests
from threading import Thread
import os
import shutil
app = Flask(__name__)
app.config['UPLOAD_FOLDER']='usersContent'
def verifyJson(dadosNext):
tempHTML = ''
if (len(list(dadosNext)) > 0):
for dado in dadosNext:
... |
test_cli.py | import json
import os
import re
import signal
import threading
from time import sleep
from psutil import Process
from .conftest import TPath
def test_help(run):
p = run('--help')
assert p.returncode == 0
assert 'USAGE:' in p.stdout
assert p.stderr == ''
def test_list_view(run, test_path: TPath):
... |
__main__.py | """fdtool.__main__: executed when fdtool directory is called as script."""
import multiprocessing, time, sys
from fdtool import main
from config import MAX_TIME
# Start main as a process
p = multiprocessing.Process(target=main, name="Main")
p.start()
# Wait for main
p.join(MAX_TIME)
# If thread is active
if p.is_ali... |
student.py | """Student implementations for PyBryt"""
__all__ = ["StudentImplementation", "check", "generate_student_impls"]
import os
import dill
import base64
import nbformat
import inspect
import hashlib
import warnings
from contextlib import contextmanager
from glob import glob
from multiprocessing import Process, Queue
from... |
communication_main.py | #!/usr/bin/python3
#coding:utf-8
import serial
import RPi.GPIO
import time
import threading
import rospy
from std_msg.msg import String
class Com:
def __init__(self):
rospy.init_node('communication_node', anonymous = True)
self.pkg_path = rospy.get_param("/pkg_path/communication")
self.seria... |
art-bot.py | #!/usr/bin/python3
import click
import os
import os.path
from slack_sdk.rtm.v2 import RTMClient
import pprint
import re
import logging
import yaml
from multiprocessing.pool import ThreadPool
import traceback
import threading
import random
import umb
from artbotlib.buildinfo import buildinfo_for_release
from artbotlib... |
UdpIO.py | import logging
from socket import AF_INET, SOCK_DGRAM, socket
from threading import Thread
from rx.subject import Subject
from rx.scheduler import EventLoopScheduler
from sharktopoda_client.Log import get_logger
from sharktopoda_client.model.GenericCommand import GenericCommand
from sharktopoda_client.model.GenericRe... |
test_browser.py | # coding=utf-8
# Copyright 2013 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.
from __future__ import print_function
import argparse
... |
joinable_queue.py | from lithops.multiprocessing import Process, JoinableQueue
def worker(q):
working = True
while working:
x = q.get()
# Do work that may fail
assert x < 10
# Confirm task
q.task_done()
if x == -1:
working = False
if __name__ == '__main__':
q =... |
prueba_thread.py | import logging
import threading
import time
def thread_function(name):
while True:
logging.info("Thread %s: starting", name)
time.sleep(2)
logging.info("Thread %s: finishing", name)
if __name__ == "__main__":
format = "%(asctime)s: %(message)s"
logging.basicConfig(format=f... |
bgperf.py | #!/usr/bin/env python3
#
# Copyright (C) 2015, 2016 Nippon Telegraph and Telephone 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... |
chartlib.py | # -*- coding: utf-8 -*-
'''
Created on 04.05.2016
@author: rdebeerst
'''
from __future__ import absolute_import
import os #for os.path, listdir and makedirs
import time
import logging
from threading import Thread #used for non-blocking gallery thumbnails refresh
from contextlib import contextmanager #used for open... |
fake_access_point.py | from scapy.all import *
from threading import Thread
from faker import Faker
def send_beacon(ssid, mac, infinite=True):
dot11 = Dot11(type=0, subtype=8, addr1="ff:ff:ff:ff:ff:ff", addr2=mac, addr3=mac)
# type=0: management frame
# subtype=8: beacon frame
# addr1: MAC address of the rec... |
mpi_submit.py | #!/usr/bin/python
import sys, os, subprocess, shutil, time, xmlrpclib
from callback_serv import CallbackServ
from template_file import TemplateFile
from condor_mpi_util import *
from optparse import OptionParser
from threading import Thread
DEBUG = 1
PORT = 32603 # server listening ... |
webdriver.py | # coding=utf-8
# @license
# Copyright 2020 Google 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 ... |
infeed_test.py | # Copyright 2019 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, ... |
server.py | """
Created on Jul 24, 2018
@author: ionut
"""
import logging
import socket
import threading
import time
class IMUServer:
"""
IMU TCP server implementation to stream IMU data from Reach
"""
def __init__(self, host, port):
self.host = host
self.port = port
# self.rtimu = Dumm... |
wifi_scanner.py | from scapy.all import *
from threading import Thread
import pandas
import time
import os
# initialize the networks dataframe that will contain all access points nearby
networks = pandas.DataFrame(columns=["BSSID", "SSID", "dBm_Signal", "Channel", "Crypto"])
# set the index BSSID (MAC address of the AP)
networks.set_in... |
main.py | # Copyright 2017 Mycroft AI 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 agreed to in writin... |
main.py |
from time import sleep
from threading import Thread
import random
import Configuration
from Connection import Connection
class stress:
connections = []
count = 0
conf = Configuration.config()
def __init__(self,conf):
self.conf = conf
self.engine()
def listen(self,conn):
... |
demo_python.py | # coding=utf-8
"""
Python 操作 OSS Demo
此版本的Python SDK适用于Python 2.7
1.通过pip安装, pip install boto3
2.通过源码安装。
git clone https://github.com/boto/boto3.git && cd boto3 && sudo python setup.py install
备注说明:
对象存储的存储空间(Bucket)本身是扁平结构的,并没有文件夹或目录的概念。用户可以通过在文件名里加入”/“来模拟文件夹。
"""
from boto3.session import Sessi... |
server.py | #!/usr/bin/env python3
# This is a simple CoAP server using Aiocoap. More details and examples
# can be found at Aiocoap Github Repo <https://github.com/chrysn/aiocoap>
#
# Copyright (c) 2021 Chris Dinh <https://aniotodyssey.com/>
#
# This file is published under the MIT license
import aiocoap.resource as r... |
Hiwin_socket_ros_20190521130159.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import Hiwin_socke... |
vnoanda.py | # encoding: utf-8
import json
import requests
from queue import Queue, Empty
from threading import Thread
API_SETTING = {}
API_SETTING['practice'] = {'rest': 'https://api-fxpractice.oanda.com',
'stream': 'https://stream-fxpractice.oanda.com'}
API_SETTING['trade'] = {'rest': 'htt... |
concurrency.py | from threading import RLock, Thread
from typing import Any, Callable, TypeVar
from typing_extensions import ParamSpec
from reactivex.typing import StartableTarget
_T = TypeVar("_T")
_P = ParamSpec("_P")
def default_thread_factory(target: StartableTarget) -> Thread:
return Thread(target=target, daemon=True)
d... |
thread_shared_vector.py | '''
multi-threading (python3 version)
https://docs.python.org/3/library/threading.html
'''
from time import clock
import threading
THREADS=2
Checked = []
Primes = []
def is_prime(n):
hits = 0
for x in range(2, n):
for y in range(2, n):
if x*y == n:
hits += 1
if hits > 1:
return False
return True... |
widget.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py
----------------------------------
"""
import datetime
import sys
i... |
ros_adapter.py | #!/usr/bin/python
#
# Copyright 2019 The Cloud Robotics Authors
#
# 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 appl... |
sloth.py | from subprocess import Popen, PIPE, TimeoutExpired
from threading import Thread
from collections import deque
from importlib import import_module
from cherrypy import HTTPError
import logging
class Sloth:
"""Base Sloth class.
Each instance represents a separate Sloth app,
with its own config, log, acti... |
server.py | """Basic http server for tests to simulate PyPI or custom indexes
"""
import time
import threading
from setuptools.extern.six.moves import BaseHTTPServer, SimpleHTTPServer
class IndexServer(BaseHTTPServer.HTTPServer):
"""Basic single-threaded http server simulating a package index
You can use this server i... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import base64
from electroncash.bitcoin import aes_decrypt_with_iv, aes_encrypt_with_iv
from electroncash.plugins import BasePlugin, hook
from electroncash.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, par... |
wechat.py | #coding=utf-8
import requests
import ssl
import re
import os
import threading
import time
import xml.dom.minidom
def responseState(func, BaseResponse):
ErrMsg = BaseResponse['ErrMsg']
Ret = BaseResponse['Ret']
if DEBUG or Ret != 0:
print('func: %s, Ret: %d, ErrMsg: %s' % (func, Ret, ErrMsg))
if... |
chatClient.py | import socket
import sys
import threading
import json
from datetime import datetime
from myUtil import RKChatHelpers, PORT
def send_message(sock, message):
data = { "timestamp": datetime.now().strftime("%H:%M") }
if ">>>" in msg_send:
data["message"] = msg_send[msg_send.index(">>>") + 3:].strip()
... |
ssh_cpython_backend.py | """Intermediate process for communicating with the remote Python via SSH"""
import os.path
import sys
import threading
from threading import Thread
import thonny
from thonny.backend import (
SshMixin,
BaseBackend,
interrupt_local_process,
RemoteProcess,
ensure_posix_directory,
)
from thonny.common ... |
async_.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import threading
__all__ = ['await_callback']
class ThreadExceptHookHandler(object):
"""Workaround to deal with a bug in the Python interpreter (!).
Report: http://bugs.python.org/issue1... |
DeviceManager.py | import schedule
import time
import log
import MQTT
import threading
def exec_threaded(f):
threading.Thread(target=f).start()
class DeviceManager(object):
def __init__(self, client : MQTT.Client):
self.logger = log.get_logger("DEVMGR")
self.client = client
def add(self, device : object, i... |
patient.py | import socket
import threading
import pyaudio
import numpy as np
import sys
####### Import custum_filter function from preprocess.py for data processing
from preprocess import custum_filter
### Define class which would stream the data
class Client:
def __init__(self):
self.s = socket.socket(socket.AF_IN... |
WrappedGraphsWindowCross.py | import pickle
import threading
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtWidgets import (
QWidget, QToolTip, QPushButton, QApplication, QMessageBox)
from .GraphsWindowCross import GraphsWindowCross
from ..WaitingSpinnerWidget import QtWaitingSpinner
from PyQt5.QtCore import QTimer, QEventLoop
from .... |
tester.py | #!/usr/bin/python
#
# tester.py
#
# This source file is part of the FoundationDB open source project
#
# Copyright 2013-2018 Apple Inc. and the FoundationDB project authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... |
two_models_inference.py | # Lint as: python3
# Copyright 2019 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 agr... |
cache_test.py | #!/usr/bin/env python
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import random
import threading
from absl.testing import absltest
import mock
from grr_response_core.lib import rdfvalue
from grr_response_core.lib.util import cache
from grr_response_c... |
__init__.py | """
Base classes for job runner plugins.
"""
import os
import time
import string
import logging
import datetime
import threading
import subprocess
from Queue import Queue, Empty
import galaxy.jobs
from galaxy.jobs.command_factory import build_command
from galaxy import model
from galaxy.util import DATABASE_MAX_STRI... |
simple_program_gevent.py | from gevent import monkey
monkey.patch_all()
import threading
from ddtrace.profiling import bootstrap
# do not use pyddprofile; the monkey-patching would be done too late
import ddtrace.profiling.auto
from ddtrace.profiling.collector import stack
def fibonacci(n):
if n == 0:
return 0
elif n == 1:
... |
debugpin.py | #!/usr/bin/env python
import threading, subprocess, sys, os, tempfile
def execute_gdb(cmd, env, pin_home, arch, quiet = False, wait = False, quit = False):
if wait and quit:
raise ValueError('Cannot call execute_gdb() with both wait and false == True')
if not quiet:
print 'Running', cmd
sys.stdout.fl... |
controller.py | #from gunconf import mouses
from threading import *
import time
from .drivers.mouse import AbsMouseManager
from .drivers.aimtrak import Aimtrak
import pyudev
from collections import defaultdict
from logging import *
import gunconf
from gunconf.util.statemachine import StateMachine
gStateTrans = {'scanning' : {'... |
aws_integration.py | from __future__ import annotations
import asyncio
import base64
import dataclasses
import datetime
import json
import threading
import traceback
from types import TracebackType
from typing import (
Any,
Dict,
Generator,
Iterable,
Optional,
Sequence,
Tuple,
Type,
TypeVar,
)
import a... |
PiCaApp.py | from Camera import Camera
from flask import Flask
import atexit
import logging
from gui.Window import Window
from State import State
import threading
logging.basicConfig(filename='app.log', filemode='w', format='%(asctime)s - %(message)s', datefmt='%d-%b-%y %H:%M:%S')
logging.warning('App started')
app = Flask(__name... |
utils.py | """Utilities"""
from contextlib import contextmanager
from multiprocessing import Process, active_children
from time import sleep, time
from typing import Any, Callable, Union
from strand.taskrunning.base import Taskrunner
from strand.taskrunning.coroutine import CoroutineTaskrunner
from strand.taskrunning.multiproces... |
rersconnectorv3.py | from suls.sul import SUL
from subprocess import check_output, Popen, STDOUT, PIPE
from queue import Queue, Empty
from threading import Thread
import re
import pygtrie
import hashlib
from pathlib import Path
import pickle
import os
import sys
class RERSConnectorV3(SUL):
def __init__(self, path_to_binary, path_to_ca... |
backup_gui.py | import os
import datetime as dt
from time import sleep
import multiprocessing
import threading
import wx
from wx.lib.newevent import NewEvent
import wx.adv
from backup_data import BackupJob, QueueToBackup
# TO DO:
# - Raise all errors to messageboxes
# - Make decorator for any button that populates the job to ge... |
data_generator.py | __author__ = "Gopi Raghavan"
__copyright__ = "Copyright (C) 2015 Gopi Raghavan"
__license__ = "GPL"
__version__ = "1.0"
from timeit import default_timer as timer
import json
import random
import decimal
import string
import datetime
from datetime import date
import multiprocessing as mp
# Define an output queue
outpu... |
server_test.py | #!usr/bin/python3
# -*- coding: utf-8 -*-
# @Time : 2021/5/21 15:54
# @Author : Fandes
import json
import socket
import sys
import threading
import time
import math
class ControlServer:
def __init__(self, host="", port=8787):
self.host = host
self.port = port
self.serve... |
handle.py | import sys
import threading
from abc import ABCMeta, abstractmethod
from collections import namedtuple
import six
from dagster import check
from dagster.api.get_server_id import sync_get_server_id
from dagster.api.list_repositories import sync_list_repositories_grpc
from dagster.core.definitions.reconstructable import... |
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 ... |
test_intercept_proxy.py | """
test_intercept_proxy.py
Copyright 2012 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in the ... |
CreateProteinAlignmentFromSNPSeek.py | from Bio import SeqIO
from SNPSeek.Get_variety_snps_from_csv import *
from HelperRoutines.CreateTranscriptOrProteinFromGff import *
from Bio.SeqRecord import SeqRecord
from Bio.Seq import Seq
from SNPSeek.RetrieveJsonForLocus import retrieve_json
from SNPSeek.ConvertOneJsonToCsv import convert_json_text
import os
from... |
input_server.py | # first to start the nameserver start: python -m Pyro4.naming
import time
from threading import Thread
import numpy as np
import Pyro4
from rlkit.launchers import conf as config
Pyro4.config.SERIALIZERS_ACCEPTED = set(["pickle", "json", "marshal", "serpent"])
Pyro4.config.SERIALIZER = "pickle"
device_state = None
... |
proc_indicators.py | #sub processes to collect seo indicators and to classify the documents
#include libs
import sys
sys.path.insert(0, '..')
from include import *
def indicators():
call(["python3", "job_indicators.py"])
def classifier():
call(["python3", "job_classifier.py"])
process1 = threading.Thread(target=indicators)
pro... |
history_tracer.py | #@+leo-ver=5-thin
#@+node:vitalije.20190928154420.1: * @file ../plugins/history_tracer.py
#@+<< docstring >>
#@+node:vitalije.20190928154420.2: ** << docstring >>
"""This plugin cooperates with leo-ver-serv utilty.
To install leo-ver-serv visit https://crates.io/crates/leo-ver-serv
In idle time, whenever use... |
generator.py | import ctypes, os, threading, strgen, base64
tokenid = "INSERT TOKEN ID"
class Discord:
def __init__(self):
self.regularExpression = ".([a-zA-Z0-9]{6})\.([a-zA-Z0-9]{27})" # This is the regular expression for discord.
self.generated = 0
def generate(self):
discordToken = str... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import collections
import httplib
import json
import logging
import os
import random
import shutil
import socket
import sys
import tempfile
import threading
import time
import nose.config
import nose.core
import nose.loader
import nose.plugins.manager
import reque... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2021 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 ... |
servo.py | #!/usr/bin/python2
import threading
import sys
import logging
from pca9685 import PCA9685
from datetime import datetime
from time import sleep
class Servo:
def __init__(self, config, lsm):
self.pwm = PCA9685(0x40)
self.pwm.set_pwm_freq(60)
self.lsm = lsm
self.high_accuracy = Fa... |
__init__.py | '''
Set up the Salt integration test suite
'''
# Import Python libs
import optparse
import multiprocessing
import os
import sys
import shutil
import pprint
import tempfile
import logging
import time
import signal
import subprocess
from hashlib import md5
from subprocess import PIPE, Popen
from datetime import datetime... |
command_line.py | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import sys
import gettext
import multiprocessing
import time
import datetime
from ikabot.config import *
from ikabot.web.session import *
from ikabot.helpers.gui import *
from ikabot.function.donate import donate
from ikabot.function.update import update
from i... |
localstore.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for johnny-cache. Much of johnny cache is designed to cache things
forever, and because it aims to keep coherency despite that it's important
that it be tested thoroughly to make sure no changes introduce the possibility
of stale data in the cache."""
from djang... |
Extrac_Video_Palette_Main.py | #!/usr/bin/env python
# coding: utf-8
from skvideo.io import FFmpegReader
import PIL.Image as Image
import time
import scipy
import json
import Additive_mixing_layers_extraction
from scipy.spatial import ConvexHull, Delaunay
import scipy.sparse
import PIL.Image as Image
import RGBXY_method
import numpy as np
from nump... |
gunicorn_worker.py | import logging.config
import threading
from multiprocessing import Process
from util.log import logfile_path
class GunicornWorker:
"""
GunicornWorker allows a quay worker to run as a Gunicorn worker.
The Quay worker is launched as a sub-process and this class serves as a delegate
for the wsgi app.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.