source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
engine.py | import queue
import requests
import threading
import time
from shodan import Shodan
from dork.config.config import DorkerConfiguration
from dork.persist import Persistence
PAYLOADS = {
'url': "hostname:{} {}",
'org': "org:{} {}",
}
class RequestEngine(object):
def __init__(self, api_keys):
self.... |
server.py |
import logging
import threading
import queue
import sys
import pickle
import sys
import queue
import os
import signal
from gevent.server import StreamServer
import FetchAgent.MessageProcessor
import traceback
import logSetup
import mprpc
import gevent.monkey
import gevent
# from graphitesend import graphitesend
impo... |
deadpool.py | #!/usr/bin/python3
# This Python file uses the following encoding: utf-8
import getpass
import base64
import multiprocessing
import gettext
import sys
import ssl
import re
import json
import subprocess
import ctypes
from time import sleep
from os import system, environ, path, getuid
from distutils.dir_uti... |
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... |
pymongo_subscriber.py | import os
import threading
import pandas as pd
import pymongo
from bson.objectid import ObjectId
class PymongoSubscriber:
'''
Pymongo subscriber : pymongo is very slow when used in python,
this code is similar to pub/sub, trying to subscribe to pymongo data in real time without affecting your code.
... |
responder.py | import praw
import gspread
from oauth2client.service_account import ServiceAccountCredentials
import bmemcached
import re
import time
import os
import json
import threading
ARTIST_COL = 0
ALBUM_COL = 1
SCORE_COL = 2
SUBREDDITS = 'fantanoforever+hiphopheads'
COMMAND = re.compile('!fantanobot (.*)', re.IGNORECASE)
U... |
system.py | import threading
import time
from typing import Dict, List
import numpy as np
from caproto import AlarmSeverity, AlarmStatus, ChannelType
from caproto.asyncio.server import AsyncioAsyncLayer
from caproto.server import PVGroup, pvproperty
from caproto.server.autosave import autosaved
from . import util
from .util impo... |
server.py | import requests
import redis
import socket
import configparser
from threading import Thread
config = configparser.ConfigParser()
config.read('../config.ini')
def resolve(target, subdomain):
try:
r = redis.StrictRedis(host=config['DEFAULT']['redis_host'], port=int(config['DEFAULT']['redis_port']), db=0)
... |
automatic.py | #!/usr/bin/env python3
import os
import subprocess
from threading import Thread, activeCount
import time
import argparse
from shutil import rmtree
max_threads = 4
protocol_types = ['OLSR'] # ['AODV', 'OLSR', 'DSR', 'DSDV']
data_rates = []
parser = argparse.ArgumentParser(description='construct connectivity matrices... |
websocket_manage.py | import threading
import websocket
import gzip
import ssl
import logging
import urllib.parse
from huobi.constant import *
from huobi.utils import *
from huobi.exception.huobi_api_exception import HuobiApiException
from huobi.connection.impl.private_def import ConnectionState
# Key: original_connection, Value: connecti... |
test_smtplib.py | import asyncore
import email.utils
import socket
import threading
import smtpd
import smtplib
import io
import sys
import time
import select
from unittest import TestCase
from test import support
HOST = support.HOST
if sys.platform == 'darwin':
# select.poll returns a select.POLLHUP at the end of the tests
#... |
remote-command.py | #!/usr/bin/env python
# coding: utf8
import sys,argparse
import pyjsonrpc
import time
import json
import threading
class remote():
def __init__(self):
self.clientConnections = []
#Setup address range to send to 201225
'''self.clients = range(201,225)
self.clientConnections = []
for x ... |
test_sync.py | import asyncio
import threading
import time
from concurrent.futures import ThreadPoolExecutor
from unittest import TestCase
import pytest
from asgiref.sync import async_to_sync, sync_to_async
@pytest.mark.asyncio
async def test_sync_to_async():
"""
Tests we can call sync functions from an async thread
(... |
subproc_vec_env.py | import multiprocessing as mp
import numpy as np
from .vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
try:
while True:
cmd, data = remote.recv()
if cmd == 'step'... |
MultiProcesses.py | from multiprocessing import Pool, Queue, Process, Array
from pyqum.instrument.logger import clocker
from pyqum.instrument.analyzer import IQAP
from numpy import array
from pyqum.directive import multiprocessor
from subprocess import Popen, PIPE, STDOUT
from pyqum.instrument.toolbox import cdatasearch, gotocdata
# vari... |
val.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Validate a trained YOLOv5 model accuracy on a custom dataset
Usage:
$ python path/to/val.py --data coco128.yaml --weights yolov5s.pt --img 640
"""
import argparse
import json
import os
import sys
from pathlib import Path
from threading import Thread
import numpy as... |
test_runner.py | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into ind... |
weixin.py | #!/usr/bin/env python
# coding: utf-8
import http.client
import http.cookiejar
import json
import logging
# for media upload
import mimetypes
import multiprocessing
import os
import platform
import random
import re
import ssl
import subprocess
import sys
import time
import urllib.error
import urllib.error
import urllib... |
debuggerView.py | import os
import threading
from variableView import VariableView
from codePicker import CodePicker
import time
from oscExecutor import Executor
from bus import Bus
from codeView import CodeView
from tkinter import Event, Menu, Misc, Text, Tk, filedialog as fd, ttk
from loopStack8View import LoopStack8View
import gc
cl... |
tmp_test.py | from torch.multiprocessing import Process, Queue, Pool
import torch.multiprocessing as mp
import torch
import time
import random
import numpy as np
class Net_class(torch.nn.Module):
def __init__(self):
super(Net_class, self).__init__()
self.net_1 = torch.nn.Linear(3, 8)
self.net_2 = torch.... |
battery.py | # coding: utf-8
"""
Interface for accessing battery data with psutil
"""
from gi.repository import GObject
import psutil
import threading
import time
from aspinwall.shell.interfaces import Interface
class BatteryInterface(Interface):
"""
Interface for accessing battery data with psutil.
Properties:
- percentag... |
uart.py | import serial
import struct
import threading
import time
class Uart:
def __init__(self):
self.enemy_color = None
self.angle = None
self.predict = False
self.uart = serial.Serial("/dev/ttyTHS2", 115200, timeout=0.5)
if self.uart.isOpen():
print("Uart open sucessfully")
else:
print("Uart close failed... |
client_node.py | #!/usr/bin/env python3
# Copyright 2021 Morten Melby Dahl.
# Copyright 2021 Norwegian University of Science and Technology.
#
# 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... |
session_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
__init__.py | import os
import subprocess
import traceback
import threading
class ModVersion:
def __init__(self,versionStr):
self.versions = [int(i) for i in versionStr.split(".")]
def __str__(self):
return ".".join(self.versions)
def __gt__(self, other):
for i,j in self.versions,othe... |
happyeyeballs.py | #!/usr/bin/python3
# Python implementation of RFC 6555 / Happy Eyeballs: find the quickest IPv4/IPv6 connection
# See https://tools.ietf.org/html/rfc6555
# Method: Start parallel sessions using threads, and only wait for the quickest succesful socket connect
# See https://tools.ietf.org/html/rfc6555#section-4.1
# You ... |
session.py | import logging
import signal
import sys
import threading
import traceback
import time
from .eventbus import EventBus, EventBusSubscriber
from .events import StartEvent, RestartEvent, TeardownEvent, InterruptEvent, \
StalledEvent, RunTaskEvent, RunTaskCompletedEvent
from .parameters import Parameter... |
debug_events_writer_test.py | # Copyright 2019 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... |
brotail.py | #!/usr/bin/env python3
import argparse
import collections
import gc
import glob
import json
import logging
import logging.config
import multiprocessing
import os
import os.path
import pprint
import queue
import re
import signal
import socket
import subprocess
import sys
import threading
import time
import traceback
imp... |
util.py | # Electrum - lightweight Bitcoin client
# Copyright (C) 2011 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights t... |
start_msg_polling.py | import multiprocessing
from django.core.management.base import BaseCommand
from django.core.cache import cache
from carPooling import msg_polling
class Command(BaseCommand):
def handle(self, *args, **kwargs):
p = multiprocessing.Process(target=msg_polling.runserver_from_start)
p.start()
sel... |
rp1_gamepad.py | from rp1controller import Target
from rp1controller.trajectory_planners import LocalVelocityControl, WorldVelocityControl, WorldPoseControl
from rp1controller import RP1Server
from time import sleep
from inputs import get_gamepad
import threading
IP_laptop = "192.168.137.1"
class GamepadInput():
axis_FB... |
__init__.py | # -*- coding: utf-8 -*-
# Copyright 2015 MongoDB, 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... |
goRun.py | #!/usr/anaconda2/bin/python
# -*- coding: utf-8 -*-
import multiprocessing
import sys
import logging
from commands import getstatusoutput
sys.path.append("/home/ct_fota/YangShuxuan/OptFotaSalesCount")
from customPyPackageYSX.FotaEventSYNC import RealTimeEvents
from customPyPackageYSX.configInfo import *
from customP... |
test_storage_agent.py | import unittest
from threading import Thread
from queue import Queue
from time import sleep
from controller.array_action.storage_agent import StorageAgent, get_agent, clear_agents, get_agents, detect_array_type
from munch import Munch
from mock import patch, NonCallableMagicMock, Mock
from controller.array_action.error... |
runner.py | import threading
from ..runner_wrapper import RunnerWrapper
class ThreadRunner(RunnerWrapper):
""" Thread Runner class """
def start(self):
""" Starts runner thread """
if self.is_running():
raise RuntimeError("Can't start an already-running runner")
self.runner = thread... |
example.py | # ############################ Examples how to use the cube solver #####################################################
cubestring = 'DRLUUBFBRBLURRLRUBLRDDFDLFUFUFFDBRDUBRUFLLFDDBFLUBLRBD' # cube definition string of cube we want to solve
# See module enums.py for the format of the cube definition string
# #######... |
ant.py | # Ant
#
# Copyright (c) 2012, Gustav Tiger <gustav@tiger.name>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, m... |
mirrors.py | #!/usr/bin/env python
"""The mirrors module defines classes and methods for Ubuntu archive mirrors.
Provides latency testing and mirror attribute getting from Launchpad."""
from sys import stderr
from socket import (socket, AF_INET, SOCK_STREAM,
gethostbyname, setdefaulttimeout,
... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 3.18 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2022
"""
from threading import Semaphore
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket... |
server.py | import socket
import threading
import sys
import cv2
import pickle
import numpy as np
import struct
import time
import argparse
# Default camera
height = 480
width = 640
dimen = 3
class ThreadedServer(threading.Thread):
def __init__(self, host, port):
self.host = host
self.port =... |
504_distributed_training.py | """
Know more, visit my Python tutorial page: https://morvanzhou.github.io/
My Youtube Channel: https://www.youtube.com/user/MorvanZhou
Dependencies:
tensorflow: 1.4.0
"""
import tensorflow as tf
import multiprocessing as mp
import numpy as np
import os
import shutil
TRAINING = True
# training data
x = np.linspace... |
universal_local_runner.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 us... |
taskrunner.py | import sys
import time
import sys
from threading import Thread
from director import asynctaskqueue
from director.timercallback import TimerCallback
class TaskRunner(object):
def __init__(self):
self.interval = 1/60.0
sys.setcheckinterval(1000)
try:
sys.setswitchinterval(self.... |
valid.py | #!/usr/bin/env python
import sys
import os
import numpy as np
from rdkit import Chem
from rdkit.Chem import AllChem as AllChem
from rdkit.Chem.QED import qed
from rdkit.Chem.Descriptors import MolWt, MolLogP, NumHDonors, NumHAcceptors, TPSA
from rdkit.Chem.rdMolDescriptors import CalcNumRotatableBonds
from rdkit.Chem i... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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... |
cui.py | import colorama
import sys
import os
import threading
import time
import textwrap
import cursor
import console
from progressbar import progressbar
class cui():
def __init__(self, width, tasks=[], header_required=True):
self.tasklist = []
self.tmtask = None
self.noelements = 0
self.... |
1195-fizz-buzz-multithreaded.py | import threading
from typing import Callable
class FizzBuzz:
def __init__(self, n: int):
self.n = n
self.current = 1
self.fizzs = threading.Semaphore(0)
self.buzzs = threading.Semaphore(0)
self.fizzbuzzs = threading.Semaphore(0)
self.numbers = thread... |
server.py | #!/usr/bin/python
from flask import Flask, render_template, redirect, abort, Response, request
import os
from aura.core import ApplicationDescriptionParser, ApplicationDeployment
import json
from sys import argv
import uuid
from threading import Thread
import logging
from copy import deepcopy
app = Flask("aura")
cla... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
# See https://en.wikipedia.org/wiki/ISO_42... |
views.py | import paho.mqtt.client as mqtt
from API_Hardware.models import *
import multiprocessing
from django.http import JsonResponse, HttpResponse, HttpResponseForbidden, HttpResponseBadRequest
from django.core import serializers
import json
import random
import time
import calendar
mqtt_listener = None
queue = multiproces... |
pystella.py | #!/usr/bin/env python3
# #!/usr/bin/python3
import os
import readline
import subprocess
import multiprocessing as mp
# import shlex
from cmd import Cmd
from os.path import dirname
# import argparse
import numpy as np
ROOT_DIRECTORY = dirname(os.path.abspath(__file__))
# hist_file = os.path.join(ROOT_DIRECTORY, '.py... |
transfer_manager.py | import threading
import os.path
import time
from tcp import TCP
from udp import UDP
ENCODING = 'utf-8'
class TransferManager:
def __init__(self, directory, max_clients, listener_info):
self.directory = directory
self.max_clients = max_clients
self.tcp_server = TCP()
self.udp_resp... |
rdd.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 us... |
conftest.py | # ***************************************
# |docname| - pytest fixtures for testing
# ***************************************
#
# To get started on running tests, see tests/README.rst
#
# These fixtures start the web2py server then submit requests to it.
#
# **NOTE:** Make sure you don't have another server running, ... |
tmp.py | #!/usr/bin/python
import threading
import multiprocessing
import time
import random
import glob
def log(string):
print "%.3f" % time.time(), string
class Producer(object):
def __init__(self):
self.id = None
self.output = "%.8d.dat" % random.randint(0, 100000)
def write(self, prob... |
views.py | from ScanServer import app
from ScanServer.forms import NameForm, ScipyForm, PrintLogForm
from ScanServer.util import get_net, get_txt_file
from flask import render_template, request, flash, redirect, url_for , session, jsonify
from threading import Thread
import os
@app.route("/", methods=["GET", "POST"])
def index(... |
map_dataset_op_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... |
main.py | import conf
from sensors.sensor import Sensor
from sensors.fakesensor import FakeSensor
import paho.mqtt.client as mqtt
import json
import time
import threading
from sys import exit
# No pretty way to make a wrapper for this in a separate file
def on_connect(client, userdata, flags, rc):
if rc == 0:
print(... |
camera.py | # -*- coding: utf-8 -*-
from __future__ import division, print_function
import time
import cv2
from math import cos, sin
import socket
import errno
import threading
# def streamer(ns, e, port):
# serv = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
# serv.bind((socket.gethostname(), port))
# serv.listen(5)
# ... |
server.py | #!/usr/bin/python
'''
Created on Aug 26, 2011
@author: IslamM
###########################################################################################
#
# server.py
#
# Copyright 2009 Hewlett-Packard Development Company, L.P.
#
# Hewlett-Packard and the Hewlett-Packard logo are trademarks of
# Hewlett... |
client.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... |
_server.py | # Copyright 2016 gRPC 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 applicable law or agreed to in... |
script.py | from tkinter import *
from moviepy.editor import VideoFileClip
from moviepy.editor import AudioFileClip
from tkinter import filedialog
from tkinter import messagebox
from tkinter import ttk
from fpdf import FPDF
import threading
import speech_recognition as sr
import os
#variables
video_clip = ''
audio_clip = ''
#fu... |
elector.py | import logging
import threading
import time
import uuid
import arrow
from k8scontroller.election.record import ElectionRecord
class LeaderElector(threading.Thread):
def __init__(self, election_name, election_namespace, on_started_leading, on_stopped_leading):
super().__init__()
self.logger = lo... |
shell_command_helper.py | """Module to help run shell commands and retrieve output"""
from __future__ import absolute_import
import subprocess
import multiprocessing
class ShellCommandHelper():
"""Hosts methods to run shell commands and retrieve output"""
TEN_MIN_SEC = 10 * 60
def __init__(self):
pass
def _run_proc... |
independent.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
from coref import util
import coref_ops
import conll
import metrics
import optimization
from bert imp... |
websocket.py | import asyncio
import json
import logging
import os
from threading import (
Thread,
)
from types import (
TracebackType,
)
from typing import (
Any,
Optional,
Type,
Union,
)
from eth_typing import (
URI,
)
import websockets
from web3.exceptions import (
ValidationError,
)
from web3.pro... |
emuSyncCmd.py | import time
import multiprocessing as mp
from pathlib import Path
from enum import Enum
import logging as log
from engineController import EngineController
from workspaceController import CPUCommand
class MainMenuInputValue(Enum):
LOAD_WORKSPACE = "1"
ADD_WORKSPACE = "2"
REMOVE_WORKSPACE... |
start-tunnel.py | #!/usr/bin/env python3
import argparse
import os
import signal
import sys
from queue import Empty, Queue
from subprocess import PIPE, Popen
from threading import Thread
def environment_or_default(env_var_name, posix_default, nt_default):
if env_var_name in os.environ:
return os.environ[env_var_name]
e... |
mini_projTello.py | import os
import numpy as np
import cv2
import cv2.aruco as aruco
import time
# Import the necessary modules
import socket
import threading
import select
# import time
import sys
def controller(act_dist, id):
kx = 1
ky = 1
ref = [0, 0, 10] #cm (y z x for jose)
try:
x_dist =... |
test.py | import os
# To speed things up. This speeds things up
# by avoiding any parallelization of the
# numpy computations, which seem to
# happen bunch with VectorObf envs.
os.environ["OMP_NUM_THREADS"] = "1"
import math
import json
import select
import time
import logging
import threading
from typing import Callable
impo... |
FakeObjectsForTestsServer.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... |
test_rabbitmq.py | import json
import threading
import pika
import pytest
import adapter_rabbitmq
CONNECTION_HOST = "localhost"
@pytest.fixture(scope='session', autouse=True)
def consume():
def _forever():
adapter_rabbitmq.channel.start_consuming()
thd = threading.Thread(target=_forever)
thd.daemon = True
th... |
queue-test.py | import threading
import time
from queue import Queue
def job(l, q):
for i in range(len(l)):
l[i] = l[i] ** 2
q.put(l)
def multithreading(data):
q = Queue()
threads = []
for i in range(4):
t = threading.Thread(target=job, args=(data[i], q))
t.start()
threads.append... |
train_multiprocessing.py | #!/usr/bin/env python
from alpha_net import ChessNet, train
import os
import pickle
import numpy as np
import torch
import torch.multiprocessing as mp
if __name__=="__main__":
net_to_train="current_net_trained2.pth.tar"; save_as="current_net_trained_iter1.pth.tar"
# gather data
data_path = "./datasets/it... |
__main__.py | import json
import threading
import time
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
CONTROLS = ["forward", "backward", "left", "right"]
def stream_data() -> None:
"""
Streams physiological data to the client
TODO: Get the real data from the sensors
"""
if "gui" not in typ... |
test_random_mp.py | # -*- coding:utf8 -*-
# File : test_random_mp.py
# Author : Jiayuan Mao
# Email : maojiayuan@gmail.com
# Date : 2/23/17
#
# This file is part of TensorArtist.
from tartist import random as tar
from multiprocessing import Process
import multiprocessing
import unittest
class TestRandomMP(unittest.TestCase):
... |
miniirc.py | #!/usr/bin/python3
#
# miniirc - A small-ish IRC framework.
#
# © 2018-2020 by luk3yx and other contributors of miniirc.
#
import atexit, errno, threading, time, socket, ssl, sys
# The version string and tuple
ver = __version_info__ = (1,7,0)
version = 'miniirc IRC framework v1.7.0'
__version__ = '1.7.0'
# __all__ a... |
testmulti.py | import time
from multiprocessing import Pool, Process, Queue, cpu_count, current_process, JoinableQueue, get_logger
from util import *
from findstock import Trades
import logging
from datetime import datetime
import os, sys, glob
import traceback
import random
import threading
from teststrat import *
#https://pymot... |
prepro.py | # -*- coding: utf-8 -*-
import threading
import time
import numpy as np
import scipy
import scipy.ndimage as ndi
import skimage
# import tensorlayer as tl
from scipy import linalg
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
from six.moves import range
from... |
multiprocessing_manager_dict.py | # Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# end_pymotw_header
import multiprocessing
import pprint
def worker(d, key, value):
d[key] = value
if __name__ == "__main__":
mgr = multiprocessing.Manager()
d = mgr.dict()
jobs = [
multiprocessing.Process(target=worker, args... |
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 platform
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
impo... |
mitm.py | #!/usr/bin/env python3
import coloredlogs
import logging
from scapy.all import srp, Ether, ARP, send, IP, TCP, sendp, Raw, sniff
import sys
import os
import time
import multiprocessing
import binascii
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
#################
# Getting input #
#################
try:... |
usb4vc_ui.py | # https://luma-oled.readthedocs.io/en/latest/software.html
import os
import sys
import time
import threading
from demo_opts import get_device
from luma.core.render import canvas
from PIL import ImageFont
import RPi.GPIO as GPIO
import usb4vc_usb_scan
import usb4vc_shared
import json
import subprocess
from subprocess i... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
import os
import pickle
import random
import re
import subprocess
import sys
import sysconfig
import textwrap
import time
import unittest
from test import support
from te... |
dailymotion.py |
import re
import json
import itertools
import threading
from ..extractor.common import (
InfoExtractor,
)
from ..utils import (
smuggle_url,
determine_ext,
int_or_none,
sanitized_Request,
try_get,
parse_filesize,
unsmuggle_url,
std_headers,
RegexNotFoundError,
ExtractorE... |
utils.py | from __future__ import annotations
import asyncio
import contextvars
import functools
import importlib
import inspect
import json
import logging
import multiprocessing
import os
import pkgutil
import re
import socket
import sys
import tempfile
import threading
import warnings
import weakref
import xml.etree.ElementTre... |
telebot.py | from movement_assistant.bots.telebot.activate import *
from movement_assistant.bots.telebot.editgroup import *
from movement_assistant.bots.telebot.deletegroup import *
from movement_assistant.bots.telebot.groupinfo import *
from movement_assistant.bots.telebot.newcall import *
from movement_assistant.bots.telebot.call... |
repository.py | ################################################################################
# Copyright (c) 2006-2017 Franz Inc.
# All rights reserved. This program and the accompanying materials are
# made available under the terms of the MIT License which accompanies
# this distribution, and is available at http://opensource.... |
conftest.py | import pytest
import anyio
from functools import partial
from threading import Thread
from asyncclick.testing import CliRunner
class SyncCliRunner(CliRunner):
def invoke(self,*a,_sync=False,**k):
fn = super().invoke
if _sync:
return fn(*a,**k)
# anyio now protects against nest... |
main_FieldTripBuffer_Threads.py | import threading
import queue
from pyneuromodulation import nm_RealTimeClientStream
from pynput.keyboard import Key, Listener
import time
from pyneuromodulation import FieldTrip
import numpy as np
import pandas as pd
import sys
import os
import signal
def getData(queue_raw, ftc):
def on_press(key):
print(... |
test_toggle_fullscreen.py | import pytest
import threading
from .util import run_test, destroy_window
def toggle_fullscreen():
import webview
def _toggle_fullscreen(webview):
webview.toggle_fullscreen()
destroy_event.set()
t = threading.Thread(target=_toggle_fullscreen, args=(webview,))
t.start()
destroy_ev... |
monitor.py | import sqlite3
import random
import json
import threading
import RPi.GPIO as GPIO
import time
import os.path
class EventType:
FAN = 1
WATER = 2
SETTINGS = 3
class Status:
Fan = False
Water = False
last_settings_file_time = 0
temp_thresh = 35
fan_duration = 5
soil_thresh = 0.5
water_duration = 5
OPT_FILE... |
build.py | #!/usr/bin/env python
# Copyright 2020 The Defold Foundation
# Licensed under the Defold License version 1.0 (the "License"); you may not use
# this file except in compliance with the License.
#
# You may obtain a copy of the License, together with FAQs at
# https://www.defold.com/license
#
# Unless required by applica... |
ip_lib.py | # Copyright 2012 OpenStack Foundation
# 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 requ... |
dmi.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#Created by Alvin. Zixuan tongjirc
#MAY. 1th 2019
import time,sys,math,re
import threading
import PyQt5
import rospy
import std_msgs
import socket
import gurobipy
import filterpy
import time
import math
import tf
import routePlan
import numpy as np
import mpc
from PyQt5 i... |
TestQueue.py | '''
Created on Apr 6, 2016
@author: dj
'''
from queue import Queue
from threading import Thread
import time
SENTINEL = object()
def producer(id, product_queue):
for i in range(0, 4):
product = "Product" + str(i)
print(id, ": Make product =", product)
product_queue.put... |
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... |
downloadclient.py | # -*- coding: utf-8 -*-
# Copyright 2018-2021 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.