source
stringlengths
3
86
python
stringlengths
75
1.04M
mitmproxy.py
import arpspoof as spoof import ndpspoof import ssl_server import http_server import netifaces as ni import time import argparse import subprocess from multiprocessing import Process if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("interface", type=str, ...
tcp.py
import sys import socket import threading from relay import status _kill = False _relay_port = 0 _remote_address = '' _remote_port = 0 _clients = 0 _servers = 0 _socks = [] def accept_clients(): global _socks client_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client_sock.bind(('0.0.0.0', ...
main.py
# RPLIDAR Script from adafruit_rplidar import RPLidar from math import pi, floor import datetime from queue import Queue from tkinter import messagebox import time from tkinter import * from tkinter import font as tkFont import threading import subprocess from matplotlib.backends.backend_tkagg import ( FigureCan...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import (verbose, import_module, cpython_only, requires_type_collecting) from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import thre...
utility.py
import os import math import time import datetime from multiprocessing import Process from multiprocessing import Queue import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import imageio import torch import torch.optim as optim import torch.optim.lr_scheduler as lrs class time...
client.py
import socket import time import select import pygame import pickle from threading import Thread pygame.init() class Client(): def __init__(self): self.serverHost = "127.0.0.1" self.serverPort = 5000 self.s = None def connect(self): self.s = socket.socket() self.s.connect((self.serverHost, s...
VkBot.py
import json import threading import vk_api from vk_api import VkApi, VkUpload from vk_api.bot_longpoll import VkBotLongPoll from vk_api.utils import get_random_id from apps.bot.classes.bots.Bot import Bot as CommonBot from apps.bot.classes.consts.ActivitiesEnum import VK_ACTIVITIES, ActivitiesEnum from apps.bot.class...
Subreader4.py
import pysrt,pyttsx,time from threading import Thread from Tkinter import * from idlelib.idle_test.mock_tk import Event set1 = 0 set2 = 0 subcount = 0 interupt = 0 settozero = 0 subs = pysrt.open(r"C:\Users\admin\Desktop\Python-files\Deskinfo\eternal-loveSUBS\Eternal.Love_E19.srt") compsrt = [] ...
tests.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...
main.py
from threading import Thread, Lock import logging import webview from time import sleep from server import run_server server_lock = Lock() logger = logging.getLogger(__name__) def url_ok(url, port): # Use httplib on Python 2 try: from http.client import HTTPConnection except ImportError: ...
launcher.py
import argparse, yaml, os, signal import multiprocessing from athena import gpu_ops as ad _procs = [] def signal_handler(signal, frame): print("SIGINT signal caught, stop Training") for proc in _procs: proc.kill() exit(0) def launch(target, args): file_path = args.config settings = yaml.l...
main.py
"""The main file of the dcr-cc that is executed""" from threading import Thread import datetime import process_mining.cmd_parser as cmd_parser import process_mining.eventlog_parser as eventlog_parser from process_mining.conf_data import ConformanceAnalysisData, TraceConformanceAnalysisData from process_mining.graph im...
aa.py
#!/usr/bin/python # coding=utf-8 # (ZeDD) RedDemons # Source : Python2 Gerak" # DARK-FB version1.7 #Import module import os,sys,time,datetime,random,hashlib,re,threading,json,getpass,urllib,cookielib from multiprocessing.pool import ThreadPool try: import mechanize except ImportError: os.system("pip2 install mechani...
fuzzer.py
# Copyright (C) 2016-present the asyncpg authors and contributors # <see AUTHORS file> # # This module is part of asyncpg and is released under # the Apache 2.0 License: http://www.apache.org/licenses/LICENSE-2.0 import asyncio import socket import threading import typing from asyncpg import cluster class StopServ...
TestKeywordEmbeddingExtender.py
import logging import sqlalchemy_dao from sqlalchemy_dao import Dao from SmartAnno.utils.ConfigReader import ConfigReader from SmartAnno.db.ORMs import Filter from SmartAnno.gui.Workflow import Workflow from SmartAnno.utils.AnnotationTypeDef import AnnotationTypeDef from SmartAnno.utils.KeywordsFiltering import Keywo...
pipeline.py
from utils.functions import current_time_millis, overrides, get_class_name, deprecated from threading import Thread import logging import numpy as np from config.config import * class Pipeline(object): """ Base object for all pipelines""" def __init__(self): self.execute_callbacks = [] self._...
process.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import import os import sys import time import types import signal import subprocess import logging import multiprocessing import multiprocessing.util import threading # Import salt libs import salt.defaults.exitcodes import salt.utils impo...
s3cp.py
#!/usr/bin/env python # S3 Operation Examples import argparse import random import sys import string import time import uuid import Queue import threading import boto3 import boto3.session import botocore from collections import defaultdict from datetime import datetime from cStringIO import StringIO # Utilities ...
main_window.py
#!/usr/bin/env python3 # # 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 with...
base.py
import hashlib import httplib import os import threading import traceback import socket import urlparse from abc import ABCMeta, abstractmethod from ..testrunner import Stop here = os.path.split(__file__)[0] # Extra timeout to use after internal test timeout at which the harness # should force a timeout extra_timeou...
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_'. from collections import OrderedDict import _thread import importlib.machinery import importlib.util import os import pickle import random import re import subprocess impo...
dns_test.py
#!/env/bin python # ------------------------------------------------------------ # dns_test.py # Exercise DNS requests using IPv4 and IPv6 transport # and evaluate capture response and remdiation of SCAPY # DNS packet bug. # ------------------------------------------------------------ # references # http://stackoverfl...
utils.py
from __future__ import print_function, division, absolute_import import atexit from collections import Iterable, deque from contextlib import contextmanager from datetime import timedelta import functools import json import logging import multiprocessing from numbers import Number import operator import os import re i...
AcquireRessource.py
#!/usr/bin/env python # Action Server zur Organisation der Client-Verbindung zum Simulink-Modell # Lucas Jürgens (BA), lucas.juergens@zubox.de, 2017-02 # Moritz Schappler, schappler@irt.uni-hannover.de # (C) Institut für Regelungstechnik, Leibniz Universität Hannover import rospy import actionlib import threading fr...
server.py
#!/usr/bin/env python # -*- Coding: UTF-8 -*- # @Time : 12/8/18 7:02 PM # @Author : Terry LAI # @Email : terry.lai@hotmail.com # @File : keyboard.py from pymouse import PyMouse from pykeyboard import PyKeyboard from socket import socket, AF_INET, SOCK_STREAM port = 20000 # -*- coding: utf-8 -*- client_addr...
network_manager.py
import errno import datetime import threading from time import sleep from futu.common.utils import * from futu.quote.quote_query import parse_head from .err import Err from .sys_config import SysConfig from .ft_logger import * if IS_PY2: import selectors2 as selectors import Queue as queue else: import que...
vodloader_video.py
from vodloader_chapters import vodloader_chapters from threading import Thread from math import floor import logging import os import datetime import streamlink import requests import json import pytz class vodloader_video(object): def __init__(self, parent, url, twitch_data, backlog=False, quality...
02_islaunch_thread.py
from threading import Thread, Event import time # Code to execute in an independent thread def countdown(n, started_evt): time.sleep(10) print('countdown starting') # relieve the event started_evt.set() while n > 0: print('T-minus', n) n -= 1 time.sleep(5) # C...
test_index.py
""" For testing index operations, including `create_index`, `describe_index` and `drop_index` interfaces """ import logging import pytest import time import pdb import threading from multiprocessing import Pool, Process import numpy import sklearn.preprocessing from milvus import Milvus, IndexType, MetricType from u...
Controller.py
import sys, os from gui.gamesense import steelseries_gamesense import steelseries_gamesense import threading import time import Threads import mod_gamesense_logger as logger from config import Config as cfg class Controller(object): def __init__(self): # Controller configuration self.Ctr...
ecoute.py
#!/usr/bin/env python import socket import threading def ajout(addr): print "new bot ", addr fichier = open("lstbot","r") with open("lstbot","r") as f: lines = f.readlines() with open("lstbot","w") as f: for line in lines: if line.split(' ')[0] != addr[0]: ...
utils_learn.py
import argparse import json import logging import math import os from os.path import exists, join, split import threading import shutil from fnmatch import filter from PIL import Image import torch from torch import nn import torch.backends.cudnn as cudnn import torch.optim as optim from torchvision import datasets, t...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.utils import xyxy2xywh, xywh2xyxy help_url =...
shell.py
import os import queue import shlex import select import threading as mt import subprocess as sp from .constants import RUNNING, DONE, FAILED from .misc import is_string # ------------------------------------------------------------------------------ # def sh_callout(cmd, stdout=True, stderr=True, shell=Fals...
test_cpp_extensions_jit.py
import os import shutil import sys import unittest import warnings import re import tempfile import subprocess import glob import textwrap from multiprocessing import Process import torch.testing._internal.common_utils as common import torch import torch.backends.cudnn import torch.utils.cpp_extension from torch.util...
placebo.py
import logging import os import queue import threading from typing import Callable, Optional import requests import google_client import slack_client import util logging.basicConfig(format='{asctime} {name} {levelname}: {message}', style='{') logging.getLogger('googleapiclient').setLevel(logging.ERROR) # It's real ...
test_streams.py
"""Tests for streams.py.""" import gc import os import queue import pickle import socket import sys import threading import unittest from unittest import mock from test import support try: import ssl except ImportError: ssl = None import asyncio from test.test_asyncio import utils as test_ut...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum import Wallet, WalletStorage from electrum.util import UserCancelled, InvalidPassword from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET from elec...
queue.py
# # Copyright (C) 2010-2017 Vinay Sajip. See LICENSE.txt for details. # """ This module contains classes which help you work with queues. A typical application is when you want to log from performance-critical threads, but where the handlers you want to use are slow (for example, :class:`~logging.handlers.SMTPHandler`)...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') # import threading after _multiprocessing to raise a more relevant error # message: "No module n...
sip-server.py
#!/usr/bin/python3 ### Simple SIP Server - natty slipstream ### Just handles SIP part (no HTTP magic) ### Inspired by NAT Slipstream code (https://samy.pl/slipstream) from socket import socket, SOL_SOCKET, SOCK_STREAM, SO_REUSEADDR, AF_INET from re import search from http.server import HTTPServer from handler import H...
firehose.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # (c) B.Kerler 2018-2019 import binascii import io import platform import time import json from struct import unpack from binascii import hexlify from queue import Queue from threading import Thread from edlclient.Library.utils import * from edlclient.Library.gpt import gpt f...
wait_for_tests.py
#pylint: disable=import-error from six.moves import queue import os, time, threading, socket, signal, shutil, glob #pylint: disable=import-error from distutils.spawn import find_executable import logging import xml.etree.ElementTree as xmlet import CIME.utils from CIME.utils import expect, Timeout, run_cmd_no_fail, sa...
test_stats_collector.py
import os import sys import logging import requests import time import traceback import random import pytest import ray import redis import threading import ray.new_dashboard.modules.stats_collector.stats_collector_consts \ as stats_collector_consts import ray.new_dashboard.utils as dashboard_utils import ray.ray_c...
test_thread_safety.py
import random import threading import time import pytest from antidote import Tagged, factory, new_container from antidote.core import DependencyContainer from antidote.providers.tag import TaggedDependencies class Service: pass class AnotherService: pass def make_delayed_factory(service, a=0.01, b=0.01...
test_curlhttpconnection.py
"""Unit tests for CurlHTTPConnections.""" from cStringIO import StringIO import unittest import BaseHTTPServer import threading import tempfile import pycurl from friendly_curl import CurlHTTPConnection from friendly_curl import CurlHTTPResponse try: import httplib2 except ImportError: httplib2 = None clas...
multiprocess_test_case.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 multiprocessing import os import sys import tempfile import traceback import unittest import warnings from func...
proxy.py
#! /usr/bin/env python3.6 import asyncio import contextlib import logging import threading import time # Singleton class where class variables will only be instantiated once. class Proxy: # Class variable _host: str = None _port: int = None _loop: asyncio.AbstractEventLoop = None _queue: asyncio....
testclient.py
# Python 3 # Usage: python3 UDPClient3.py localhost 12000 # coding: utf-8 import sys from socket import * import threading import time import datetime as dt # The argument of client servername = sys.argv[1] serverPort = sys.argv[2] udpPort = sys.argv[3] serverPort = int(serverPort) # Create the TCP soc...
main.py
import cmd, threading, queue from typing import List from .Component import Component from .interface import execute as execute_interface, commands from ..data.DictList import DictList from ..utility.Logger import Logger from ..utility.exception import exception from ..utility.process import finalize class _Main: ...
ca_util.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. Tools for creating a CA cert and signed server certs. Divined from http://svn.osafoundation.org/m2crypto/trunk/tests/test_x509.py The mk_temporary_xxx calls return a NamedTemporaryFile with certs. Usage ; ...
example2.py
import time import threading COUNT = 50000000 def countdown(n): while n > 0: n -= 1 ########################################################################### start = time.time() countdown(COUNT) print('Sequential program finished.') print(f'Took {time.time() - start : .2f} seconds.') ###############...
trezor.py
import traceback import sys from typing import NamedTuple, Any from electrum_sum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum_sum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum_sum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path from electrum_...
runDataRecording.py
# encoding: UTF-8 import multiprocessing from time import sleep from datetime import datetime, time from vnpy.event import EventEngine2 from vnpy.trader.vtEvent import EVENT_LOG from vnpy.trader.vtEngine import MainEngine, LogEngine from vnpy.trader.gateway import okcoinGateway from vnpy.trader.app import dataRecorde...
vpp_papi.py
#!/usr/bin/env python # # Copyright (c) 2016 Cisco and/or its affiliates. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required...
kb_stringtieServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
consumer.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...
feature_extract_csl.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process sys.path.append("....
block_microservice.py
from multiprocessing import Process, Queue import json from time import time from flask import Flask, jsonify, request import requests # Data Layer def _load_ready_transactions(): with open('transactions_ready.json', 'r') as infile: return json.load(infile)["transactions"] # Bussiness Layer def _create_bl...
DPS310_stream.py
from __future__ import print_function import sys import time import threading import serial import atexit import signal import Queue import numpy as np import matplotlib import matplotlib.pyplot as plt class PressureStreamer(serial.Serial): def __init__(self,param): self.param = param port_param...
tcp_server.py
import socket import threading bind_ip = "0.0.0.0" bind_port = 9999 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip,bind_port)) server.listen(5) print "[*] Listening on %s:%d" % (bind_ip,bind_port) # this is our client-handling thread, The handle_client function performs the recv(...
gen.py
""" SynthTIGER Copyright (c) 2021-present NAVER Corp. MIT license """ import os import random import sys import traceback from multiprocessing import Process, Queue import numpy as np import yaml def read_template(path, name, config=None): path = os.path.abspath(path) root = os.path.dirname(path) module...
qt.py
#!/usr/bin/env python3 # # Electron Cash - a lightweight Bitcoin Cash client # CashFusion - an advanced coin anonymizer # # Copyright (C) 2020 Mark B. Lundeberg # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to d...
train_imagenet.py
#!/usr/bin/env python """Example code of learning a large scale convnet from ILSVRC2012 dataset. Prerequisite: To run this example, crop the center of ILSVRC2012 training and validation images and scale them to 256x256, and make two lists of space- separated CSV whose first column is full path to image and second colu...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
scan.py
# Modules import socket,time,threading,sys from optparse import OptionParser # Usage text usage_text = """ Usage: scan.py [kwargs] ARGUMENTS (kwargs): REQUIRED: ------------------------------------------------ --ip: The IP of the 'victim'. -------...
tpu_estimator.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...
map_reduce.py
""" This is a multiprocessing-based map reduce computing model. It's different from normal MapReduce model: - Manager fires up mapper and reducer processes simultaneously: Output of mapper is identical to reducer, \ so reducers don't need to wait until all mappers finish. - Data can be passed to mapper gradually:...
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, ...
review.py
import p4 import discord import utils import net import time import re from threading import Thread, Lock mutex = Lock() class p4bot_review: def __init__(self): self.storage = p4.Storage() self.reviews = {} self.exit_flag = True try: self.config = utils.create_config("...
server.py
# GPS 协议分析 # http://www.techbulo.com/2508.html # https://blog.csdn.net/lzyzuixin/article/details/6161507 # https://www.cnblogs.com/happykoukou/p/5502517.html # 错误解决:WARNING: Unsupported upgrade request. # http://www.04007.cn/article/977.html import asyncio, serial, logging, time, os, random import threading from typi...
feeder.py
import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split import time import threading import os from .util import is_scalar_input, is_mulaw_quantize from infolog import log from datasets import audio from keras.utils import np_utils _batches_per_group = 32 _pad = 0 class Feed...
monitor.py
import sys import time import logging import threading import traceback import load_django from django.conf import settings from utils.heroku import HerokuInterface from utils.parser import parse from utils.rule_helper import fetch_rules def eprint(*args, **kwargs): print(*args, file=sys.stderr, **kwargs) def ...
RemoteSystem.py
from JumpScale import j # This extension is available at j.remote.system import warnings warnings.filterwarnings('ignore', r'.*sha.*') try: import paramiko except: try: j.system.platform.ubuntu.install("python-paramiko") except Exception as e: print "Could not install python-paramiko, this ...
raspi_threads.py
__author__="Jaimiey Sears, updated by Alex Schendel and Alex Reinemann, 2018" __copyright__="October 26, 2015" __version__= 0.50 import queue import threading import socket #from mpl_toolkits.mplot3d import Axes3D #from matplotlib import cm import matplotlib.pyplot as plt import numpy as np from LidarCommands.utility...
MarketAnalysis.py
import os import sys import threading import time import traceback import datetime import pandas as pd import sqlite3 as sqlite from sqlite3 import Error from poloniexlendingbot.ExchangeApi import ApiError # Bot libs import poloniexlendingbot.Configuration as Config from poloniexlendingbot.Data import truncate try: ...
rebalancetests.py
import time import unittest from TestInput import TestInputSingleton import logger from membase.api.rest_client import RestConnection, RestHelper from membase.helper.bucket_helper import BucketOperationHelper from membase.helper.cluster_helper import ClusterOperationHelper from membase.helper.rebalance_helper import Re...
multiprocessing_env.py
#This code is from openai baseline #https://github.com/openai/baselines/tree/master/baselines/common/vec_env import os import sys import numpy as np from itertools import count from multiprocessing import Process, Pipe def worker(remote, parent_remote, env_fn_wrapper, render=0, shared=None): parent_remote.close()...
__main__.py
"""isort:skip_file""" # first, logging level lower import os os.environ["KCFG_KIVY_LOG_LEVEL"] = os.environ.get("KCFG_KIVY_LOG_LEVEL", "warning") # if "KIVY_AUDIO" not in os.environ: # trying default again # os.environ["KIVY_AUDIO"] = "sdl2" # some backends hard crash / this seems to be most stable import kivy k...
web.py
#!/usr/bin/python3 __author__ = "Flavius Ion" __email__ = "igflavius@odyssee.ro" __license__ = "MIT" __version__ = "v1.3" import argparse import requests import logging import itertools import threading import queue import sys import os import re from bs4 import BeautifulSoup from urllib3.exceptions import InsecureRe...
test_html.py
from functools import partial from importlib import reload from io import ( BytesIO, StringIO, ) import os from pathlib import Path import re import threading from urllib.error import URLError import numpy as np import pytest from pandas.compat import is_platform_windows import pandas.util._test_decorators as...
parallel.py
#!/usr/bin/env python from __future__ import print_function import os import ssl import time import sys import logging import contextlib import concurrent.futures import threading import multiprocessing import six from irods.data_object import iRODSDataObject from irods.exception import DataObjectDoesNotExist import ...
sleep-sort.py
import threading import sys from time import sleep sort_list = [] def validate_list(): for num in sys.argv: try: sort_list.append(int(num)) except ValueError: pass def sleep_sort(n): sleep(n) print(n, end=", ") def main(): validate_list() for num in sort_list: threading.Thread(target=sleep_sort, ...
maint.py
# -*- coding: utf-8 -*- ''' Define the behaviors used in the maintinance process ''' # Import python libs import multiprocessing import os # Import ioflo libs import ioflo.base.deeding # Import salt libs import salt.fileserver import salt.loader import salt.utils.minions import salt.daemons.masterapi class SaltRaet...
main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # filename: main.py # modified: 2019-09-11 import os import time from optparse import OptionParser from multiprocessing import Process, Manager, Queue from autoelective import __version__, __date__ def task_run_loop(): from autoelective.loop import main as run_main...
test_io.py
import sys import gc import gzip import os import threading import time import warnings import io import re import pytest from pathlib import Path from tempfile import NamedTemporaryFile from io import BytesIO, StringIO from datetime import datetime import locale from multiprocessing import Process, Value from ctypes i...
torque_control.py
#! /usr/bin/env python3 ### # KINOVA (R) KORTEX (TM) # # Copyright (c) 2019 Kinova inc. All rights reserved. # # This software may be modified and distributed # under the terms of the BSD 3-Clause license. # # Refer to the LICENSE file for details. # ### ### # * DESCRIPTION OF CURRENT EXAMPLE: # =====================...
camera.py
""" This module contains camera class """ import os import cv2 as cv from sshtunnel import open_tunnel from contextlib import contextmanager from datetime import datetime from threading import Thread from queue import Queue from time import time from idp206.calibration import Calibration CAMERA_DEFAULT_PATH_TEMPLATE ...
Generation.py
from multiprocessing import Process, Array from BreedingPool import * class Generation(): """ A group of chromosomes """ def __init__(self, generationType, population): self.generationType = generationType self.population = population def copy(self): """ Return a ...
ChatRoom1.1Doser.py
#!/usr/bin/env python # -.- coding: utf-8 -.-y import random import socket import os import time import threading import Queue import sys import argparse from multiprocessing import Process print """\33[91m ═════════════════════════════════════════════════════════ ███████ ██████ ███████ ...
pycat.py
#!/usr/bin/env python3 from proxy import proxy from select import select import importlib import json import os import pprint import re import sys import telnetlib import threading import traceback telnetlib.GMCP = b'\xc9' class Session(object): def __init__(self, world_module, port, arg): self.mud_encod...
datapoller.py
#!/usr/bin/env python from __future__ import print_function import threading import time import api import json class DataPoller(object): """Class for polling for data from the BLiP controller Beacon Filters and Tasking will be received and stored locally and used to process each packet seen. ...
randomi.py
# Meet randomI Mk II, a random data generator for test data generation # For random generation of numbers import randint from random import randint # Importing the time for benchmarking purposes import time from datetime import date # Importing for multi core processing import multiprocessing # randomI function whi...
wiki_dump_download.py
import argparse import glob import hashlib import json import logging import os import threading import urllib.request from datetime import datetime parser = argparse.ArgumentParser(description='WikiDump Downloader') parser.add_argument('--data-path', type=str, default="./data/", help='the data directory') ...
qira.py
import idaapi import threading import time wsserver = None qira_address = None # this handles all receiving msg_queue = [] # python array is threadsafe def handle_message_queue(): global msg_queue while len(msg_queue) > 0: dat = msg_queue[0].split(" ") msg_queue = msg_queue[1:] if dat[0] == "setadd...
problem_with_builtin_queue.py
from queue import Queue from threading import Lock, Thread, currentThread from time import sleep # one way to break the built in Queue join function :is to make the put method sleep for while that way the unfinished_tasks will be 0 # and when task_done get called it will notify the join q = Queue() def producer(): ...
start.py
import cv2 import time from pathlib import Path from datetime import datetime from threading import Thread import queue from typing import Union def dt_name(dt: datetime) -> str: """Convert datetime object to path string.""" return dt.strftime('%Y%m%d-%H%M%S-%f') def create_path(root: Path, subfolder: Uni...
views.py
import json from multiprocessing.dummy import Process import os import uuid from flask import Markup, render_template, request, redirect, send_from_directory, url_for, Blueprint, current_app from werkzeug.utils import secure_filename import numpy as np import uncurl from .cache import cache from .generate_analysis ...
logic_interface.py
from oscpy.client import OSCClient from oscpy.server import OSCThreadServer import definitions import threading import asyncio import time import push2_python osc_send_host = "127.0.0.1" osc_send_port = 8000 osc_receive_port = 9004 tracks_state_fps = 4.0 transport_state_fps = 10.0 bpm_button_names = [ push2_pytho...
testcase.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...