source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
worker.py | from google.cloud import firestore
from google.cloud import storage
import json
import os
from queue import Queue, Empty
import requests
from threading import Thread
import time
import subprocess
try:
config = json.load(open('../config.json'))
except:
config = json.load(open('config.json'))
try:
redis_co... |
core.py | # -*- coding: utf-8 -*-
import logging
import time
from requests.exceptions import ConnectionError
from threading import Thread
import pymongo
import requests
import json
import sys
import socketIO_client
from . import masks
from . import customized_methods
from six import iteritems
from six import string_types as... |
core.py | import copy
import json
import threading
import time
import traceback
from random import randint
from threading import Lock
import requests
import rlp
from ethereum import transactions
from web3 import Web3
RequestTimeout_seconds = 6
LengthOfDataProperty = 64
LengthOfPrivateKey = 64
LengthOfPublicAddress_Including0x =... |
models.py | from flask_sqlalchemy import SQLAlchemy
from threading import Thread
import subprocess
import shlex
import sys
import io
import json
from encoder import JsonEncodedDict
from pathlib import Path
from datetime import datetime
db = SQLAlchemy()
class Devices(db.Model):
__tablename__ = 'devices'
public_ip = db.C... |
HTTPControl.py | import logging
import mimetypes
import os
import pathlib
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn
from datetime import datetime, timedelta
import jinja2
import json
import re
import threading
import time
import urllib.parse
import uuid
import math
from ww import... |
test_utils_zmq_sockets.py | import traceback
import zmq
import time
import threading
import logging
from timeit import default_timer as timer
import numpy as np
from zmq import ContextTerminated, ZMQError
from zmq.utils.monitor import recv_monitor_message
from automon.common_node import State
logging = logging.getLogger('automon')
# Use ZMQ Clie... |
tests.py | from collections import namedtuple
from threading import Thread
from unittest import TestCase
from postgres import (
AlreadyRegistered, NotAModel, NotRegistered, NoSuchType, NoTypeSpecified,
Postgres,
)
from postgres.cache import Cache
from postgres.cursors import (
BadBackAs, TooFew, TooMany,
Row, Sim... |
__init__.py | # Create your views here.
import feedparser
import nltk
from nltk.tag import StanfordPOSTagger
from nltk import word_tokenize
import os
import csv
import threading, time
from geograpy.extraction import Extractor
import firebase_admin
from firebase_admin import credentials, firestore
cred = credentials.Certificate(".... |
plugin.py | import base64
import re
import threading
from binascii import hexlify, unhexlify
from functools import partial
from electrum.bitcoin import (bc_address_to_hash_160, xpub_from_pubkey,
public_key_to_p2pkh, EncodeBase58Check,
TYPE_ADDRESS, TYPE_SCRIPT,
... |
BrainDQNOneFlow.py | import numpy as np
import os
import random
from collections import deque
import oneflow as flow
import oneflow.typing as tp
from threading import Thread, Lock
import threading
# Hyper Parameters:
FRAME_PER_ACTION = 1
GAMMA = 0.99 # decay rate of past observations
OBSERVE = 100. # timesteps to observe before training
... |
util.py | import ctypes
import os
import platform
import shutil
import sys
from colorama import Back, Fore, Style
if sys.version_info[0] < 3 or sys.version_info[1] <= 5:
raise RuntimeError(
"\nPlease restart with Python 3.6+\n" + "Current Python version:",
sys.version_info)
ti_core = None
def in_docker()... |
CompanyOutlookBackup.py | # from/import for portability
from psutil import process_iter
from shutil import copyfile
from os import path, makedirs, system, remove
from socket import *
from glob import glob
from pathlib import Path
from multiprocessing import Process
from datetime import datetime,date
from time import sleep
from contextlib impo... |
as_metadata_manager.py | # 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 writing, software
# d... |
utils.py | import asyncio
import functools
import html
import importlib
import inspect
import json
import logging
import multiprocessing
import os
import pkgutil
import re
import shutil
import socket
import sys
import tempfile
import threading
import warnings
import weakref
import xml.etree.ElementTree
from asyncio import Timeout... |
main.py | #!/usr/bin/env python
'''
Copyright 2016-2017 Benjamin Elder (BenTheElder) 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
Unles... |
trainer.py | # Lint as: python2, python3
# Copyright 2018 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
#
... |
server.py | import argparse
import sched
import xmlrpc.client
from hashlib import sha256
from random import randrange
from socketserver import ThreadingMixIn
from threading import Thread
from time import time, sleep
from xmlrpc.server import SimpleXMLRPCRequestHandler
from xmlrpc.server import SimpleXMLRPCServer
class RequestHan... |
main.py | import sys
import glob
import serial
from pymouse import PyMouse
from pykeyboard import PyKeyboard
import pymouse
import pykeyboard
import PySimpleGUI as sg
from configobj import ConfigObj
import configobj
import multiprocessing
from multiprocessing import Process, Value, Array
from queue import Queue
import queue
... |
doprints.py | from twitchio.ext import commands
import asyncio
import csv
import tempfile
import os
import sys
import subprocess
from obswebsocket import obsws, requests, events
import zipfile
from pathlib import Path
import threading
import signal
import time
import my_settings
global plz_stop
plz_stop = False
printing = "Loa... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
network_monitor.py | # Copyright (C) 2016 Li Cheng at Beijing University of Posts
# and Telecommunications. www.muzixing.com
# Copyright (C) 2016 Huang MaChi at Chongqing University
# of Posts and Telecommunications, China.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compl... |
imagetools.py | # -*- coding=UTF-8 -*-
# pyright: strict
"""tools for image processing. """
import hashlib
import threading
from pathlib import Path
from typing import Any, Callable, Dict, Literal, Optional, Text, Tuple, Union
import cast_unknown as cast
import cv2
import cv2.img_hash
import numpy as np
from PIL.Image import BICUBI... |
server.py | import atexit
import http.client
import json
import re
import socket
import threading
import urllib.parse
from weakref import WeakValueDictionary
from .download_lt import download_lt
from .language_tag import LanguageTag
from .match import Match
from .utils import *
DEBUG_MODE = False
# Keep track of running server ... |
heapme.py | """
Heap Made Easy - Heap Analysis and Collaboration Tool
https://heapme.f2tc.com/
HeapME is a tool that helps simplify heap analysis and collaboration through an intuitive web interface.
Features:
- GEF patches to allow scripts to register functions to malloc, calloc, realloc and free events.
- An HTTP Log Server w... |
__init__.py | import threading
class AutonomousMode(object):
"""
Class for executing an autonomous mode. Usually done by executing macros.
"""
thread = None
running = False
def __init__(self):
self.running_macros = set()
def run_autonomous(self):
"""
Runs exec_autonomous in a... |
raidpir_client.py | #!/usr/bin/env python3
"""
<Author>
Daniel Demmler
(inspired from upPIR by Justin Cappos)
(inspired from a previous version by Geremy Condra)
<Date>
January 2019
<Description>
Client code for retrieving RAID-PIR files. This program uses a manifest
to communicate with a vendor and retrieve a list of mirrors. T... |
role_maker.py | # Copyright (c) 2020 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... |
network.py | # -*- coding: utf-8 -*-
# Copyright 2020 Kevin Schlosser
import socket
import threading
from . import rs485
class Network(object):
def __init__(self, ip, port):
self.ip = ip
self.port = port
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((ip,... |
pyDMON.py | """
Copyright 2015, Institute e-Austria, Timisoara, Romania
http://www.ieat.ro/
Developers:
* Gabriel Iuhasz, iuhasz.gabriel@info.uvt.ro
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:
ht... |
main.py | import threading
from .threads import threader
from .server.server import start_server
threader.monkey_patch_threads()
t = threading.Thread(name="PoolHub Server", target=start_server, daemon=True)
t.start()
|
gnpamp.py | #!/usr/bin/env python
# Copyright (C) 2012 Victor Semionov
# 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
# l... |
__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 shutil
import subprocess
import stat
import sys
import threading
import ti... |
MetagenomeUtilsServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
steadystate.py | """
Compute the steady-state delays of a serverless edge computing system
"""
__author__ = "Claudio Cicconetti"
__version__ = "0.1.0"
__license__ = "MIT"
import numpy as np
from itertools import product
import scipy.sparse as sp
from scipy.linalg import norm
import threading
import time
class DegenerateException(Ex... |
ray.py | #! /usr/bin/env python
# coding=utf-8
# Copyright (c) 2019 Uber Technologies, 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
#
# Unles... |
main.py | try:
from os.path import abspath, dirname
import json
import time
import threading
import multiprocessing
import sys
from pushover import init, Client
import platform
except:
print("Please type this: pip3 install python-pushover, colorama")
sys.exit()
#My modules
from activity i... |
__init__.py | import os
import sys
import subprocess
import threading
import time
import wx
import wx.aui
from wx import FileConfig
import pcbnew
from .dialog import Dialog
def check_for_bom_button():
# From Miles McCoo's blog
# https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/
def... |
test_explicit_comms.py | import multiprocessing as mp
import pytest
from distributed import Client
from distributed.deploy.local import LocalCluster
from dask_cuda.explicit_comms import CommsContext, dataframe_merge
import pandas as pd
import dask.dataframe as dd
import numpy as np
import pytest
import cudf
import cupy
mp = mp.get_context(... |
server.py | import jwt
import getpass
import os
import time
import shutil
from pathlib import Path
import json
import logging
import traceback
import socketserver
import ssl
import secrets
import threading
import pyarrow as pa
from multiprocessing import Process, cpu_count, Event, Manager, Lock
from loadit.resource_lock import Res... |
master.py | # Copyright 2022 kuizhiqing
#
# 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 writing, s... |
verify_buffer.py | """
"""
import threading
from data_pipe.any_buffer import AnyBufferCore
def verify_buffer_sync(buffer:AnyBufferCore):
print()
print(f"buffer: {buffer}")
count = buffer.ring_size * 10
source = []
target = []
def buffer_writer_sync():
for index in range(count):
source.a... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
run_nvmf.py | #!/usr/bin/env python3
import os
import re
import sys
import json
import zipfile
import threading
import subprocess
import itertools
import configparser
import time
import uuid
from collections import OrderedDict
import paramiko
import pandas as pd
import rpc
import rpc.client
from common import *
class Server:
... |
websoctest.py | # (c) Copyright 2017-2018 SUSE 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... |
terminal.py | import sublime
import os
import time
import base64
import logging
import tempfile
import threading
from queue import Queue, Empty
from .ptty import TerminalPtyProcess, TerminalScreen, TerminalStream
from .utils import panel_window, view_size, responsive, intermission
from .key import get_key_code
from .image import g... |
daisy_brain.py | #!/usr/bin/env python3
import sys
import os
import face_recognition
import cv2
from daisy_spine import DaisySpine
from daisy_spine import Dir
from daisy_eye import DaisyEye
from multiprocessing import Process, Queue
from multiprocessing.managers import SyncManager
import time
import argparse
class NeuronManager(SyncMa... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
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 sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional
from PyQt5.QtCore i... |
event.py | import inspect
import multiprocessing
import threading
import logging
logger = logging.getLogger('pywebview')
class Event:
def __init__(self, should_lock=False):
self._items = []
self._should_lock = should_lock
self._event = threading.Event()
def _initialize(self, is_multiprocessing)... |
base.py | # coding: utf-8
import threading
import unittest
import time
import datetime
from beaker._compat import u_
from beaker.cache import Cache
from beaker.middleware import SessionMiddleware, CacheMiddleware
from webtest import TestApp as WebTestApp
class CacheManagerBaseTests(unittest.TestCase):
SUPPORTS_EXPIRATIO... |
remote.py | from __future__ import absolute_import, division, print_function
from libtbx.queuing_system_utils import communication
from six.moves import cPickle as pickle
import threading
from six.moves import queue
import time
class SchedulerActor(object):
"""
Interface to a scheduling.Manager object that is polled by anoth... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum-Ganja - Lightweight Ganjacoin Client
# Copyright (C) 2015 Thomas Voegtlin
# Copyright (C) 2018 GanjaProject
#
# 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 Softwar... |
1.py | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 8 16:33:31 2020
@author: lenovouser
"""
import multiprocessing as mp
def job(q):
res = 0
for i in range(1000):
res += i+i**2+i**3
q.put(res) # queue
if __name__ == '__main__':
q = mp.Queue()
p1 = mp.Process(target=job, args=(q,))
p2 = m... |
tf_yamnet.py | from __future__ import annotations
from datetime import datetime
import logging
import threading
import time
import zipfile
from typing import Sequence
import numpy as np
import tensorflow as tf
import audiosegment as ad
from sklearn.preprocessing import minmax_scale
from .BaseSystem import BaseSystem
logger = loggi... |
ble2lsl.py | """Interfacing between Bluetooth Low Energy and Lab Streaming Layer protocols.
Interfacing with devices over Bluetooth Low Energy (BLE) is achieved using the
`Generic Attribute Profile`_ (GATT) standard procedures for data transfer.
Reading and writing of GATT descriptors is provided by the `pygatt`_ module.
All clas... |
__init__.py | import datetime
import logging
import azure.functions as func
import json
import pathlib
import threading
import time
import array
import requests
from .crawler import Crawler
from .model.company import Company
from .model.status_processing import StatusProcessing
from typing import List
from dateutil.relativedelta im... |
EDL.py | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import re
from base64 import b64decode
from multiprocessing import Process
from gevent.pywsgi import WSGIServer
from tempfile import NamedTemporaryFile
from flask import Flask, Response, request
from netaddr import IPAd... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node
from electrum import constants
from electr... |
test_executors.py | import os
import multiprocessing
import sys
import threading
import time
import pytest
import prefect
from prefect.utilities.exceptions import TaskTimeoutError
from prefect.utilities.executors import (
run_with_thread_timeout,
run_with_multiprocess_timeout,
tail_recursive,
RecursiveCall,
)
# We will... |
chooch.py | import os
import re
import subprocess
import threading
import numpy
from mxdc.utils import converter
from mxdc.utils.log import get_module_logger
from mxdc import Engine
logger = get_module_logger(__name__)
class AutoChooch(Engine):
"""An event driven engines for performing analysis of MAD Scans with CHOOCH.
... |
dailyBuilder.py | #!/usr/bin/python
# This Python file uses the following encoding: utf-8
#__ __ _ _ _ _
#\ \ / /__| | ___ ___ _ __ ___ ___ | |_ ___ | |_| |__ ___
# \ \ /\ / / _ \ |/ __/ _ \| '_ ` _ \ / _ \ | __/ _ \ | __| '_ \ / _ \
# \ V V / __/ | (_| (_) | | | | | |... |
local_backend.py | import socket
import time
import threading
import redis
from database import *
import json
from call_maker import *
from call_listener import *
import multiprocessing
'''
The backend_server runs in a separate process, and it communicates with:
- Electron: Using a socket
- Python processes: Using pipes
The Python pro... |
record_multiplayer.py | #!/usr/bin/python3
#####################################################################
# This script presents how to use Doom's native demo mechanism to
# record multiplayer game and replay it with perfect accuracy.
#####################################################################
# WARNING:
# Due to the bug in... |
test_pipe.py | import multiprocessing as mp
def prod(pipe):
out_conn, _ = pipe
for x in range(10):
out_conn.send(x)
out_conn.close()
def square(pipe1, pipe2):
close, in_conn = pipe1
close.close()
out_conn, _ = pipe2
try:
while True:
x = in_conn.recv()
out_conn.send(x * x)
except EOFError:
out_conn.close()
d... |
auto_search.py | import os
from multiprocessing import Process
import time
runfile = "./run_search.py"
compiler = ['python']
#time limited subprocess
def run_script(i, program, search):
print("Running {} compiler on program {} using search strategy {}...".format(i,program+1,search+1))
os.system('{} {} -p {} -s {}... |
wordnet_app.py | # Natural Language Toolkit: WordNet Browser Application
#
# Copyright (C) 2001-2019 NLTK Project
# Author: Jussi Salmela <jtsalmela@users.sourceforge.net>
# Paul Bone <pbone@students.csse.unimelb.edu.au>
# URL: <http://nltk.org/>
# For license information, see LICENSE.TXT
"""
A WordNet Browser application whic... |
increase_recursion_limit.py | import sys
if "PyPy" in sys.version:
from _continuation import continulet
else:
import threading
def main():
pass
if __name__ == "__main__":
if "PyPy" in sys.version:
def bootstrap(cont):
call, arg = cont.switch()
while True:
call, arg = cont.switch(... |
loop.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import abc
import asyncio
import logging
import time
from typing import Dict, List, NoReturn, Optional,... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import collections
import fcntl
import httplib
import json
import logging
import os
import random
import shutil
import socket
import struct
import sys
import tempfile
import threading
import time
import nose.config
import nose.core
import nose.loader
import nose.p... |
kuaishou_new.py | # -*-coding:utf-8 -*-
import requests
import time
import os
import json
import threading
import re
cookies = ""
def downVideo(video,d_url,v_name):
if not os.path.exists(video):
r = requests.get(d_url)
r.raise_for_status()
with open(video, "wb") as f:
f.write(r.content)
... |
tello.py | """Library for interacting with DJI Ryze Tello drones.
"""
# coding=utf-8
import logging
import socket
import time
from threading import Thread
from typing import Optional, Union, Type, Dict
from .enforce_types import enforce_types
import av
import numpy as np
threads_initialized = False
drones: Optional[dict] = {... |
circuit_design.py | # python3
# n, m = map(int, input().split())
# clauses = [ list(map(int, input().split())) for i in range(m) ]
# # This solution tries all possible 2^n variable assignments.
# # It is too slow to pass the problem.
# # Implement a more efficient algorithm here.
# def isSatisfiable():
# for mask in range(1<<n):
# ... |
rasterize_test.py | from rasterize import rasterize, find_zombie_processes, merge_options, DEFAULT_CHROME_OPTIONS, rasterize_image_command
import demistomock as demisto
from CommonServerPython import entryTypes
from tempfile import NamedTemporaryFile
import subprocess
import os
import logging
import http.server
import time
import threadin... |
lifx.py | """
Provides physical switching of Lifx devices from a Raspberry Pi
"""
import argparse
import random
from threading import Thread, Timer
from time import time
from time import sleep
import lifxlan
import yaml
from gpiozero import Button as LifxButton
class Discovery(Thread):
"""An endless thread that discover... |
awss3.py | import datetime
import threading
import uuid
import requests
from splunk_eventgen.lib.logging_config import logger
from splunk_eventgen.lib.outputplugin import OutputPlugin
try:
import boto3
import botocore.exceptions
boto_imported = True
except ImportError:
boto_imported = False
def threaded(fn):... |
taco_refcomp.py |
import argparse
import logging
import os
import sys
import operator
import collections
import shutil
import subprocess
import multiprocessing
import taco
import share
import pkgutil
import string
import glob
from taco.lib.bx.intersection import Interval, IntervalTree #1
from taco.lib.bx.cluster import ClusterTree #lx1... |
drive.py | """
acreroad_1420 Drive software
Software designed to drive the 1420 MHz telescope on the roof of the
Acre Road observatory. This class interacts with "qp", the telescope
drive software by Norman Gray (https://bitbucket.org/nxg/qp) via a
serial (USB) interface.
The serial interfacing is done through pySerial.
Parame... |
runner.py | import time
import json
import faust
import threading, queue
from nglp.precompute.workflow import Workflow
from nglp.config import settings
wait_time = 5
q = queue.Queue()
def process(object_oid, runner):
previous_time = object_oid["timestamp"]
time_now = int(time.time())
diff = time_now - previous_time... |
DARKFB.py | # -*- coding: utf-8 -*-
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
try:
import mechanize
except ImportError:
os.system('pip2 install mechanize')
else:
try:
import requests
except ImportEr... |
part2.py | #!/usr/bin/env python3
import sys
import os
import threading
from time import sleep
from program import Program
from droid import Droid
SLEEP_DURATION = 0.0001
def play(d):
while d.is_running():
os.system("clear")
d.display()
if not d.explore():
break
sleep(SLEEP_DUR... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
mainwindow.py | # -*- coding: utf-8 -*-
# @Time : 2017/12/8
# @Author : Shu
# @Email : httpservlet@yeah.net
# coding=utf-8
import os
import datetime
import sys
import math
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from FormUI.ui_mainwindow import Ui_bwalletMW
from Forms.create_wallet import CreateWalletDialog
from Fo... |
test.py | import random
import math
from pysine import sine
import multiprocessing
f0 = 440.0
a = math.pow(2, 1/12)
# fn = f0 * a^n
NOTES = [f0 * math.pow(a, x) for x in range(-30, 30, 1)]
MIN_NOTE_LENGTH = 100
MAX_NOTE_LENGTH = 1000
NOTE_LENGTH_STEP = 50
class Note:
def __init__(self, frequency, duration):
s... |
api.py | import json
import logging
import os
import random
import secrets
import socket
import string
import threading
import time
import urllib.parse
import uuid
from collections import Counter
from collections import defaultdict
from pprint import pprint
import pandas as pd
import requests
from flask import abort
from flask... |
bartender.py |
#!/usr/bin/env python
# -*- coding: iso-8859-1 -*-
#--------------Driver Library-----------------#
import OLED_Driver as OLED
import time
import sys
import RPi.GPIO as GPIO
import json
import traceback
import threading
import textwrap
import subprocess
from PIL import Image
from PIL import ImageFont
from PIL import... |
test_full_system.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import time
import uuid
import os
from unittest import mock
from parlai.mturk.core.dev.socket_manager im... |
logger.py | from http.server import HTTPServer, BaseHTTPRequestHandler
import threading
from functools import partial
import pykka
import random
import json
from collections import namedtuple
import enum
EventCreateNode = namedtuple('EventCreateNode', ['node', 'peers', 'distance'])
EventPeersUpdated = namedtuple('EventCreateNode'... |
app.py | """
Application for writing e-cetrificates
"""
import os
import csv
import time
import toga
import smtplib
from toga.style import Pack
from threading import Thread
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
from toga.style.pack import COLUMN, ROW
from PIL import Image, ImageDraw, ImageF... |
sysk.py | import os
import logging
import subprocess
import sys
import feedparser
import collections
import threading
from atexit import register
import time
import requests
import json
from myutils import query_config, replace_invalid_filename_char
logger = logging.getLogger('pystuff')
class Podcast:
def __init__(self,ti... |
test_external.py | import os
from hks_pylib.logger.standard import StdUsers
from hks_pylib.logger import Display
import random
import threading
from hks_pynetwork.external import STCPSocket
from hks_pylib.cryptography.ciphers.symmetrics import AES_CTR, AES_CBC
from hks_pylib.logger import StandardLoggerGenerator
logger_generator = Stan... |
TargetExtractor.py | import sm
import numpy as np
import sys
import multiprocessing
try:
import queue
except ImportError:
import Queue as queue # python 2.x
import time
import copy
import cv2
def multicoreExtractionWrapper(detector, taskq, resultq, clearImages, noTransformation):
while 1:
try:
task = tas... |
http.py | """
homeassistant.components.httpinterface
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module provides an API and a HTTP interface for debug purposes.
By default it will run on port 8123.
All API calls have to be accompanied by an 'api_password' parameter and will
return JSON. If successful calls will return status ... |
ChannelPointsSFXTrigger_StreamlabsSystem.py | # -*- coding: utf-8 -*-
#---------------------------
# Import Libraries
#---------------------------
import clr, codecs, json, os, re, sys, threading, datetime
clr.AddReference("IronPython.Modules.dll")
clr.AddReferenceToFileAndPath(os.path.join(os.path.dirname(os.path.realpath(__file__)) + "\References", "TwitchLi... |
ProxyListener.py | import socket
import socketserver
import threading
import sys
import glob
import time
import importlib
import queue
import select
import logging
import ssl
from OpenSSL import SSL
from .ssl_utils import ssl_detector
from . import *
import os
BUF_SZ = 1024
class ProxyListener(object):
def __init__(
s... |
tools.py | import threading
def concurrent(func):
'''
For functions that end but need to run concurrently
:param func:
:return:
'''
def decorator(*args, **kwargs):
thread = threading.Thread(target=func, args=args, kwargs=kwargs)
thread.start()
return decorator
|
copycat.py | import argparse
import json
import os
import shutil
import sys
import threading
import time
import urllib
import urllib.request
import eyed3
import requests
import spotipy
import youtube_dl
from bs4 import BeautifulSoup
from spotipy.oauth2 import SpotifyClientCredentials
configs = {
'threads': 12, # use this man... |
run_exp.py |
##########################################################
# pytorch-kaldi v.0.1
# Mirco Ravanelli, Titouan Parcollet
# Mila, University of Montreal
# October 2018
##########################################################
from __future__ import print_function
import os
import ... |
Controller.py | from Keytracker import Keytracker
from Synchronizer import Synchronizer
from threading import Thread
from collections import deque
# REPLACE THIS WITH YOUR WORKING DIRECTORY FOR YOUR PROJECT
WORKING_DIRECTORY = "/home/pi/Projects/Headless-Keyboard-Notetaker"
class Controller:
def __init__(self):
self.__keytracker ... |
test_operator_gpu.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 u... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_dash.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_dash.bip32 import BIP32Node
from electrum_dash import constants
from elect... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.