source
stringlengths
3
86
python
stringlengths
75
1.04M
rfc2217.py
#! python # # This module implements a RFC2217 compatible client. RF2217 descibes a # protocol to access serial ports over TCP/IP and allows setting the baud rate, # modem control lines etc. # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C) 2001-2015 Chris Liechti <cliechti@gmx.net> ...
standalone_app.py
import gi gi.require_version('Gtk', '3.0') gi.require_version('AppIndicator3', '0.1') from gi.repository import Gtk, AppIndicator3, GLib import signal import time import threading import os class Indicator(): def __init__(self): self.app = 'battery_power_use' iconpath = os.path.join(os.path.dirname...
JumpscriptFactory.py
from JumpScale import j import imp import linecache import inspect import multiprocessing import tarfile from io import BytesIO import collections import os import base64 import time class Jumpscript(object): def __init__(self, ddict=None, path=None): self.logger = j.logger.get('Jumpscript') sel...
integration_test.py
import socket import threading import unittest import time import happybase import os from hdfs3 import HDFileSystem from pyspark.streaming.tests import PySparkStreamingTestCase from python.dte_app import DataTransformationEngine from python.processors.processors import DummyProcessor from python.socket_server impor...
CREEPS.py
# import required module from tkinter import filedialog from tkinter import ttk import tkinter.messagebox from tkinter import * import os import threading from ttkthemes import themed_tk as tk from mutagen.mp3 import MP3 import time from pygame import mixer root = tk.ThemedTk() #root.geometry("555x290") root["bg"]="#...
_test_modbus_controller.py
import unittest import mp_modbus import threading class Test(unittest.TestCase): def test_read_write_coil(self): cl = mp_modbus.modbus_tcp_client("127.0.0.1", 502) cl.connect() self.assertTrue(cl.write_coil(2, 1)) self.assertEqual(cl.read_coils(2, 1)[0], 1) self.assertFalse(...
alerter.py
import threading import time import json import os.path import logging import collections log = logging.getLogger(__name__) class Alerter: def __init__(self, alerters, item_file_name, check_interval, tiers): self.alerters = alerters self.item_file_name = item_file_name self.check_interval...
regrtest.py
#! /usr/bin/env python """ Usage: python -m test.regrtest [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] If no arguments or options are provided, finds all files matching the pattern "test_*" in the Lib/test subdirectory and runs them in alphabeti...
send_sms.py
from django.conf import settings from qsmstoken.clients.aliyunsms import AliyunSMSClient from threading import Thread from apps.config.models import BoolConfig from .models import SmsRecord, SmsBalance # def async_send(phone, params, template_code): # client = AliyunSMSClient(settings.SMS_CONFIG) # client.se...
module_EdgeClientCLI_put.py
import sys sys.path.append('./gen-py') import math import random import time from thrift import Thrift from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from fogclient import FogService from fogclient.ttypes import * from EdgeServices import EdgeSer...
creator.py
import sh, os, re, threading, hashlib, subprocess from gi.repository import Gtk from pywinusb.decorators import chain_method, event_method from pywinusb.events import EventHandler from pywinusb.decorators import installer_method # Dialog potwierdzenia def MessageBox(parent, title, message, buttons=Gtk.ButtonsType.OK_...
exchange_rate.py
from datetime import datetime import inspect import requests import sys 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_4217 CCY_PRECISIONS = {'...
project_files_monitor_test.py
# Copyright (c) 2019-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-unsafe import os import socket import tempfile import threading import unittest from unittest.mock import MagicMock, patch from .. import j...
_24qiushi_thread.py
#coding:utf-8 import requests from lxml import etree import json from queue import Queue import threading class Qiushi(object): def __init__(self): self.url = 'https://www.qiushibaike.com/8hr/page/{}/' self.url_list = None self.headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; ...
stage_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...
text_feats_to_hdf5_replacezero.py
import numpy as np import h5py import multiprocessing as mp import argparse def firstpass_worker(task_q, results_q): """ gets mention offsets """ while True: d,line = task_q.get() # blocks if d == -1: return ment_starts = [] fields = line.split("|") m...
background_caching_job.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...
service.py
import logging from threading import Thread from typing import List import six from xrcon.client import XRcon from xrcon.utils import QUAKE_PACKET_HEADER from src.config import get_yaml_file from src.events.listener import EventListener from src.events.models import GameEvent, Plugin from src.models import Server c...
ex6.py
#!/usr/bin/env python from net_system.models import NetworkDevice, Credentials from netmiko import ConnectHandler import django, datetime, threading def show_arp(device): remote_conn = ConnectHandler(device_type=device.device_type, ip=device.ip_address, ...
main.py
import threading import time import datetime import sys def log(s): t = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') sys.stdout.write('[%s] %s\n' % (t, s)) sys.stdout.flush() def loop(): log('Started SampleWorker(python version)') while running: log('Running') time.sleep(1...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform imp...
xvfb_server.py
""" xvfb_server.py Copyright 2011 Andres Riancho This file is part of w3af, http://w3af.org/ . w3af is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation version 2 of the License. w3af is distributed in the hope that...
wsdump.py
#!/Users/copainfabricebienaime/Desktop/Projects/slack-bot-python/starterbot/bin/python3.7 import argparse import code import sys import threading import time import ssl import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding():...
grpc_indirect_client.py
# -*- coding: utf-8 -*- import sys import threading from importlib import import_module import grpc import zmq from grpc._cython.cygrpc import CompressionAlgorithm, CompressionLevel from nameko_grpc.constants import Cardinality from nameko_grpc.errors import GrpcError from helpers import Command, RemoteClientTranspo...
controller.py
from keypad import keypad import paho.mqtt.client as mqtt import picamera import json import time import threading import RPi.GPIO as GPIO from lock import lock from tran_message import send_email def on_message(client, userdata, message): if(message.topic == mqtt_pwd_update_t): password_list_update(str(message....
cluster_coordinator_test.py
# Copyright 2020 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 applicable ...
tb_twisted_service.py
import threading from threading import Thread from twisted.internet import reactor, endpoints, defer from logging import getLogger from thingsboard_gateway.twisted.usr.usr_protocol_factory import UsrProtocolFactory from pymodbus.framer.ascii_framer import ModbusAsciiFramer from pymodbus.framer.binary_framer import Mo...
main-updated.py
import argparse import threading import time from pathlib import Path import cv2 import depthai as dai import numpy as np parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent debug output") parser.add_argument('-cam', '--camera', action="store_true", ...
env_ops.py
# Copyright 2018 Oiki Tomoaki. 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 applicable law or...
test_tls.py
import datetime as dt import multiprocessing as mp import socket import sys import pytest from mbedtls import hashlib from mbedtls.exceptions import TLSError from mbedtls.pk import RSA from mbedtls.tls import * from mbedtls.tls import _DTLSCookie as DTLSCookie from mbedtls.tls import _PSKSToreProxy as PSKStoreProxy f...
main_follow_algo.py
import datetime import re import socket import threading # from tkinter import * # from threading import Event import time # import datetime as dt import tkinter as tk # import winsound from collections import deque from queue import Queue from time import monotonic import matplotlib.pyplot as plt import rasterio impo...
debugger_v2_plugin_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...
example_subscribe.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_subscribe.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html # Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://unicorn...
stats.py
import collections import os from pynvml import * import time from numbers import Number import threading from wandb import util from wandb import termlog psutil = util.get_module("psutil") class SystemStats(object): def __init__(self, run, api): try: nvmlInit() if "CUDA_VISIBLE_DE...
test_dynamic_routing.py
import logging import threading import time import pytest from google.protobuf import json_format from jina.helper import random_identity from jina.parsers import set_pea_parser from jina.peapods.zmq import Zmqlet, AsyncZmqlet, ZmqStreamlet from jina.proto import jina_pb2 from jina.types.message import Message from j...
adc_worker.py
import busio import digitalio import board import adafruit_mcp3xxx.mcp3008 as MCP from adafruit_mcp3xxx.analog_in import AnalogIn import threading import variables import time import json import importlib class ADCMCP3008Worker: """ Analog-Digital-Converter Worker """ PINS = { '4': board.D4, ...
cocotb_test.py
import cocotb from cocotb.clock import Clock from cocotb.triggers import Timer from cocotb.triggers import FallingEdge from cocotb.triggers import RisingEdge from cocotb.triggers import ClockCycles from cocotb.result import TestFailure from threading import Thread from functools import partial p = [] async def run_t...
fixtures.py
# -*- coding: utf-8 -*- import binascii from contextlib import contextmanager import hashlib import socket import struct import threading import time try: # py3 import socketserver except ImportError: # py2 import SocketServer as socketserver import pytest import httmock import mock import pushjack ...
ThreadedAppServer.py
#!/usr/bin/env python2 """Threaded Application Server The AppServer is the main process of WebKit. It handles requests for servlets from webservers. ThreadedAppServer uses a threaded model for handling multiple requests. At one time there were other experimental execution models for AppServer, but none of these wer...
mysql_impromptu.py
#!/usr/bin/env python import os from classes import * import threading import datetime def get_info(server_name, https, injection_path, row, field_name, table_name, evl, text, comments, f_name): core = Impromptu() # Getting each row length rLen = core.getLength_bj(server_name, https, injection_path, row, field_name...
lisp-rtr.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
downloader.py
#!/usr/bin/python3 -OO # Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...
abcutils.py
# -*- coding: utf-8 -*- """ Utilities for working with the AnyBody Console applicaiton. Created on Fri Oct 19 21:14:59 2012 @author: Morten """ import os import io import sys import time import copy import types import ctypes import shelve import atexit import pathlib import logging import warnings import collections...
openlistings.py
from config import BaseConfig, LocalConfig from datetime import datetime from opensea import OpenSea from pushcontainer import push_container from singleton import Singleton from threading import Thread from time import time from webbrowser import open_new_tab import dearpygui.dearpygui as dpg class OpenListings(metac...
dev.py
#!/usr/bin/env python from multiprocessing import Process import time import os CWD = os.path.abspath(os.path.curdir) def front(): os.system(f'cd {CWD}; ./front.sh') def server(): os.system(f'cd {CWD}; ./server.sh') Process(target=front, daemon=True).start() Process(target=server, daemon=True).start() ...
data_provider.py
""" the class provides batch training data need to give arguments -> img_folder, batch_size, training_dim, stride it can be served as 1. a infinite iterator which keeps providing data, each image in the folder will be provided before next epoch, the image will be randomly selected (the 'shuffle' ...
run_post_pnr_msim_task.py
##################################################################### # Python script to run ModelSim simulations for all the post-pnr testbenches # in a project directory # This script will # - Collect all the testbenches in a given directory # For instance: # ../k4_arch/pre_pnr/verilog_testbenches/and2_post_pnr...
broadcast.py
from threading import Thread from ._messages import debug, echo, info, warn, error, success from pavo.helpers.decorators import singleton @singleton class Broadcast(object): """Singleton Broadcast class that holds all sent messages in memory. The Broadcast functionality works with sending and listening. Whe...
test_tensorflow2_autolog.py
# pep8: disable=E501 import collections import pytest import numpy as np import pandas as pd import tensorflow as tf from tensorflow.keras import layers import mlflow import mlflow.tensorflow import mlflow.keras from mlflow.utils.autologging_utils import BatchMetricsLogger from unittest.mock import patch import os ...
direct_view_window.py
from gui.gui_builder import GBuilder, GEnums, try_ex import os from gui.plugins.widget_factories import ViewerPluginFactory from PyQt4.Qt import QVBoxLayout, QHBoxLayout, QThread, QWidget import api.ecu_sim_api as api from PyQt4 import QtGui, QtCore import sys import threading import pickle from tools.ecu_logging imp...
test_interpreters.py
import contextlib import os import threading from textwrap import dedent import unittest import time import _xxsubinterpreters as _interpreters from test.support import interpreters def _captured_script(script): r, w = os.pipe() indented = script.replace('\n', '\n ') wrapped = dedent(f""" ...
conftest.py
from functools import wraps, partial from http.server import SimpleHTTPRequestHandler import sys import pytest import threading import torch.multiprocessing as mp def pytest_configure(config): config.addinivalue_line("markers", "spawn: spawn test in a separate process using torch.multiprocessing.spawn") @pytes...
schedule.py
import time from multiprocessing import Process import asyncio import aiohttp try: from aiohttp.errors import ProxyConnectionError except: from aiohttp import ClientProxyConnectionError as ProxyConnectionError from proxypool.db import RedisClient from proxypool.error import ResourceDepletionError from proxypoo...
test_kafka.py
# 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 # # Unless required by applic...
main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from flask import Flask, redirect, url_for, send_from_directory import threading import iptv class Main (object): def __init__ (self) : pass def scan (self): Crawler = iptv.Iptv() Crawler.run() def site (self): web = Flask(__...
spanprocessor.py
# Copyright The OpenTelemetry 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 ...
visual.py
"""VPython as a target: Documentation on which we're basing our implementation: http://www.vpython.org/webdoc/visual/index.html What are the key determinants in the visual python API's success: geometry is simply created system has interactive operation (shell) flat hierarchies used throughout ...
main.py
#!/usr/bin/env python3 #MIT License # #Copyright (c) 2021 Sloobot # #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...
s3op.py
from __future__ import print_function import time import math import string import sys import os import traceback from hashlib import sha1 from tempfile import NamedTemporaryFile from multiprocessing import Process, Queue from collections import namedtuple from itertools import starmap, chain, islice try: # pytho...
common.py
"""Test the helper method for writing tests.""" import asyncio import functools as ft import json import logging import os import uuid import sys import threading from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta from io import StringIO from unittest.mock import M...
multiprocess1.py
import time import multiprocessing def calc_square(numbers): print("calculate square numbers") for num in numbers: print("square", num * num) def calc_cube(numbers): print("calculating cubes") for num in numbers: print("cube", num * num * num) # Note if you are not using the follow...
mmctree.py
# !/usr/bin/python # -*- coding:utf-8 -*- import multiprocessing as mp import tensorflow as tf from sub_tree import sub_tree from sub_tree import node import sys import logging import time import Queue import numpy as np from treelib import Tree import copy from utils import compute_bleu_rouge from utils import norma...
oop_detection_webcam.py
""" Webcam Detection with Tensorflow calssifier and object distance calculation """ __version__ = "0.1.0" __author__ = "Tim Rosenkranz" __email__ = "tim.rosenkranz@stud.uni-frankfurt.de" __credits__ = "Special thanks to The Anh Vuong who came up with the original idea." \ "This code is also based o...
textPlayer.py
import os, sys, signal, time, re from signal import signal, SIGPIPE, SIG_DFL from subprocess import PIPE, Popen from threading import Thread from Queue import Queue, Empty ''' Currently, for games that require several clicks to get start info, it doesn't scrape everything. Lost.z5 is one. The first couple commands wi...
test_statestore.py
#!/usr/bin/env python # Copyright (c) 2015 Cloudera, Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requir...
client_aux_runner.py
# Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to...
send_parallel.py
import logging import queue import threading import time import requests THREADS_COUNT = 25 logging.basicConfig(level=logging.DEBUG) def send_thread(server, api, result_queue): logging.debug(f"Running request to server: {server}{api}") link = server + api base = exponent = 1 try: result = re...
singer.py
#coding:UTF-8 import requests import threading import queue from peewee import * queue = queue.Queue() db = MySQLDatabase(host='localhost', user='root', database='song', charset='utf8') class BaseModel(Model): class Meta: database = db # @classmethod # def getOne(cls, *query, **kwargs): # #为了方便使用,新增此接口,查询不到...
test_xmlrpc.py
import base64 import datetime import sys import time import unittest import xmlrpclib import SimpleXMLRPCServer import mimetools import httplib import socket import StringIO import os import re from test import test_support try: import threading except ImportError: threading = None try: import gzip except...
FunctionFinder.py
import inspect, time, math, random, multiprocessing, queue, copy, sys, os import numpy from . import StatusMonitoredLongRunningProcessPage from . import ReportsAndGraphs import settings import zunzun.forms import zunzun.formConstants import multiprocessing import pyeq3 from . import pid_trace externalDataCache = ...
qira_program.py
from qira_base import * import qira_config import qira_analysis import os import shutil import sys import subprocess import threading import time import collections from hashlib import sha1 from subprocess import (Popen, PIPE) import json import struct import qiradb import arch # new home of static2 sys.path.appen...
geniushub.py
''' This module connects to the Genius hub and shares the data''' import json from hashlib import sha256 as hash import aiohttp import asyncio import threading import logging _LOGGER = logging.getLogger(__name__) class GeniusHub: _auth = '' _ip_address = '' _results = None _STATUS = 200 _t = Non...
testMyPc.py
import numpy as np import cv2 from multiprocessing import Process, Queue, Lock import time import sys from speech_to_text import get_voice_feedback # import myservo as servo import mysound as sound aliveP = Queue() aliveP.put(1) mylock = Lock() imageQ = Queue() # ------- close everything -------- def exit_all(): ...
x.py
import socket import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt import csv import pandas as pd import time import os from itertools import islice from datetime import datetime import pytz import threading import random ''' r_t #_real,_time v_a #_Vind,...
test_autograd.py
import contextlib import gc import sys import io import math import random import tempfile import time import threading import unittest import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, partial...
meanfield_montecarlo_multi_external.py
#!/usr/bin/env python3 import multiprocessing import numpy import sys sys.path.append("..") from meanfield_share import calc_meanfield_montecarlo def calc_meanfield_multi_external(q,P,R,c,p,init,ext_pos,rand_seed): numpy.random.seed(rand_seed) Pinit=numpy.argmax(init) input_amp=0.0 overlap=init n...
process_helper.py
#!/usr/bin/env python3 import queue import time import os import atexit import subprocess import threading import pathlib import errno from typing import Dict, List, TextIO, Optional class Runner: def __init__(self, log_dir: str, model: str, case: str, ...
test.py
import os.path as p import random import threading import time import pytest from random import randrange import pika from sys import getdefaultencoding from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV from helpers.client import QueryRuntimeException from helpers.network import Partiti...
findContaminants.py
#!/usr/env/bin python3 """ " File: findContaminants.py " Date: 05-21-2018 """ import time import os import cv2 import utils import argparse import tkinter as tk import multiprocessing as mp from matplotlib import pyplot as plt SLEEP_TIME = 2 DEFAULT_PIXEL_SIZE = 10000 DEFAULT_WHITE_PERCENTAGE = 99.4 DEFAULT_...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from multiprocessing import Process from typing import Dict, List import re from common.dp_conf import init_params_vals fro...
service_failure_mixin.py
import os import random import signal import threading import time class ServiceFailureMixin(object): def start_failure_generator(self): thread = threading.Thread(target=self._failure_thread_worker) thread.start() def _failure_thread_worker(self): while True: time.s...
scorecard.py
import time import collections import datetime import os import sys from flask import Flask, render_template, request, jsonify, abort, url_for from github import Github import random import threading import humanize import logging fmt = logging.Formatter( # NB: no space after levename because WARNING is so long ...
BrokerActions.py
import sys import io import subprocess import threading import time import uuid import os.path import requests import json from random import randint from UniqueConfiguration import UniqueConfiguration from CommonConfiguration import CommonConfiguration from printer import console_out class BrokerActions: def __in...
__main__.py
from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3 import os import labscript_utils.excepthook try: from labscript_utils import check_version except ImportError: raise ImportError('Require labscript_utils > 2.1.0') check_version('la...
stream_reasoner.py
import re import json import time import os from rdflib import Graph from kafka import KafkaConsumer from multiprocessing import Manager from multiprocessing import Process from datetime import datetime import task import stardog global message_queue, file_base KAFKA_BROKER_URL = os.environ.get('KAFKA_BROKER_URL') SE...
trezor.py
import traceback import sys import base64 from typing import NamedTuple, Any from electrum_mona import bitcoin from electrum_mona.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum_mona.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT, msg_magic from electrum_mona.bip32 import BIP32Node, co...
carhandler.py
""" Folkrace Car code Developed by: Stefan Larsson of CASE Assosiation 2020 """ import numpy as np import threading as mt import time class CarHandler: def __init__(self, car_size, camera_car_offset): """ Main Car object. Defines the model of car and camera position relation. Hol...
celue_save.py
""" 为日线数据添加全部股票的历史策略买点列。 由于策略需要随时修改调整,因此单独写了策略写入文件,没有整合进readTDX_lday.py """ import os import sys import time from multiprocessing import Pool, RLock, freeze_support import numpy as np import pandas as pd from tqdm import tqdm from rich import print import CeLue # 个人策略文件,不分享 import func import user_config as ucfg # 变...
test_base_events.py
"""Tests for base_events.py""" import concurrent.futures import errno import math import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from test.test_asyncio import utils as test_utils from test imp...
subfinder_thread.py
# -*- coding: utf8 -*- """ SubFinder的多线程版本 """ from __future__ import unicode_literals from .subfinder import SubFinder try: from queue import Queue except ImportError as e: from Queue import Queue from threading import Thread, Lock class Pool(object): """ 线程池 """ def __init__(self, size): ...
process_parallelism.py
from multiprocessing import Process import os # processes are spawned by creating a Process object and then calling the start method def info(title): print title print 'module name:', __name__ if hasattr(os, 'getppid'): # only available on Unix print 'parent process:', os.getppid() print 'pro...
test_etcd_client.py
# Copyright 2020 The FedLearner 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...
pnda-cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Cisco and/or its affiliates. # This software is licensed to you under the terms of the Apache License, Version 2.0 # (the "License"). # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 # The code, technical ...
pi_baseline.py
import time from queue import Queue from data_sender import send import argparse from threading import Thread, Event import cv2 import numpy as np from redis import Redis import pickle from baseline_rpc_rgb import make_ucf, make_infer from sklearn.metrics import confusion_matrix def load_image(video_path, queue, even...
run_parallel_QuickSort_multiprocessing.py
import random, time from quicksort import * from merge import merge from multiprocessing import Process, Manager def multiSorter(A, l, h, p, R): R1 = manager.list() R2 = manager.list() m = l + (h - l)/2 if p == 2: p1 = Process(target=quickSort, args=(A, l, m )) p2 = Process(target=quickSort, args=...
trainers.py
import os, sys, yaml, time, random from queue import Queue from threading import Thread, Lock import numpy as np import nvidia_smi import pickle, json, cv2, h5py, re import tensorflow as tf from tensorflow.keras.metrics import Metric, Mean, SparseCategoricalAccuracy from tensorflow.keras.optimizers import Adam, SGD fro...
spygrapher.py
import time, os, sys import pyautogui, pyscreeze import zipfile import smtplib import argparse import threading from socket import gaierror from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from email import encoders #TODO: Add Threading class Dir...
demo.py
########### Python 3.6 ############# import http.client, urllib.request, urllib.parse, urllib.error, base64, requests, json, cv2 import numpy as np import cv2 import os import keyboard from time import sleep import time import pygame import sys import random import keyboard import threading from threadin...
process.py
''' @author Mark Vismer Functions related to string stuff ''' from string import * import win32api, win32process, win32con import subprocess import threading def set_app_id(app_id='mycompany.myproduct.subproduct.version'): ''' This is necessary to use the main window (or app icon) as the task bar icon. ...
pure.py
import copy import inspect import os import sys import threading import traceback from collections import namedtuple, defaultdict from .common import fail, warn from .constopt import ConstantOptBase from .errors import Errors, Warnings, InterpretError from .env import env from .graph import Graph from .ir import Ctx, L...