source
stringlengths
3
86
python
stringlengths
75
1.04M
HYDRA_client.py
import socket, threading, time, keyboard #10.35.73.141 from datetime import datetime from colorama import init, Fore, Back, Style #10.35.73.141 #8192 init() # Iniciar colorama def fprint(arg): msg = arg.split('Ç') if len(msg) == 1: msg.append(msg[0]) msg[0] = 'SERVER' print(datetime.now().s...
smarwiEmulator.py
import argparse import http.server import json import logging import paho.mqtt.client as mqtt import re import signal import socketserver import sys import time from threading import Thread, Lock, Event, current_thread DEFAULT_HTTP_SERVER_PORT = 8080 # HTTP server runs on localhost DEFAULT_MQTT_URL = "localhost" DEFAU...
error_handling.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...
card_reader.py
import threading import requests import urllib.request from time import sleep import RPi.GPIO as GPIO from mfrc522 import SimpleMFRC522 from access_control import AccessController # DBG : modified for testing mock_cardid = { 947650382188: 'person1', 146673054805: 'person2' } accessController = AccessControlle...
controller_interface.py
import os import sys import multiprocessing as mp import threading import time import queue import numpy as np from messagebus_manager import MessageBusManager, ProcessNames, TopicNames from config import Config from message import Message#, Command #from pySerialTransfer import pySerialTransfer as txfer...
test_th_cpp.py
#creates a given number of threads (pass by argument) and assigns an equal portion of the workload to each one #the main thread waits actively until they finish import threading import sys import itertools import cppinterf as cppth from multiprocessing.pool import ThreadPool num_keys = 10000 max_parallelism = int(s...
tello_manager.py
import threading from threading import Thread import socket import time import netifaces import netaddr from netaddr import IPNetwork from collections import defaultdict from stats import Stats import binascii import curses #from multi_tello import all_queue_empty class Tello: """ A wrapper class to interact w...
loop_and_thread.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import unicode_literals from __future__ import print_function import threading import asyncio import time async def test(n): print(n) await asyncio.sleep(3) def test2(n): print(n) # time.sleep(3) def thread_fun(loop): ...
path.py
from __future__ import absolute_import, unicode_literals import logging import os import re import stat import string import threading from mopidy import compat, exceptions from mopidy.compat import queue, urllib from mopidy.internal import encoding, xdg logger = logging.getLogger(__name__) XDG_DIRS = xdg.get_dir...
reaper.py
# Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
probeserver_test.py
# pyOCD debugger # Copyright (c) 2021 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 # # ...
menu.py
from threading import Thread from pygmi.util import call __all__ = 'Menu', 'ClickMenu' def inthread(args, action, **kwargs): fn = lambda: call(*args, **kwargs) if not action: return fn() t = Thread(target=lambda: action(fn())) t.daemon = True t.start() class Menu(object): def __init__...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
jetson_clocks.py
# -*- coding: UTF-8 -*- # This file is part of the jetson_stats package (https://github.com/rbonghi/jetson_stats or http://rnext.it). # Copyright (c) 2019 Raffaello Bonghi. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published...
pipeline.py
import asyncio from multiprocessing import Process,Queue import multiprocessing as multiprocessing import importlib import hashlib import random import time import os import yaml from signal import signal, SIGCHLD import sys import re def read_pipelines(fname): absdir=os.path.dirname(os.path.abspath(fname)) w...
TrainPolicyApp.py
import threading import tkinter.scrolledtext as ScrolledText from os import path from time import strftime, gmtime from tkinter import * from tkinter import filedialog import PIL.Image import PIL.ImageTk from baselines import run from comp300.App.Utils import * class SetupTrainPolicy: """This is the gui to set ...
session.py
import os import platform import queue import threading import time from datetime import datetime from dataclasses import dataclass from enum import Enum, auto from typing import Callable from typing import Optional, Dict, Type import warnings import ray from ray.train.accelerator import Accelerator from ray.train.con...
multiple_instances_advance.py
#!/usr/bin/env python from __future__ import print_function from random import choice, random from time import sleep, time from vizdoom import * # For multiplayer game use process (ZDoom's multiplayer sync mechanism prevents threads to work as expected). from multiprocessing import cpu_count, Process # For singlepl...
test_bz2.py
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import pickle import glob import random import shutil import subprocess import sys from test.support import unlink import _compression try: import threading except ImportError: ...
pickletester.py
import collections import copyreg import dbm import io import functools import os import pickle import pickletools import shutil import struct import sys import threading import unittest import weakref from textwrap import dedent from http.cookies import SimpleCookie from test import support from test.support import (...
pref_db.py
import collections import copy import gzip import pickle import queue import time import zlib from threading import Lock, Thread import easy_tf_log import numpy as np class Segment: """ A short recording of agent's behaviour in the environment, consisting of a number of video frames and the rewards it re...
script_threading.py
from threading import Thread def run(): t1 = Thread(target=f1) t1.start() t2 = Thread(target=f2) t2.start() t2.join() t1.join() return def f1(): for _ in range(5): pass return def f2(): for _ in range(5): pass return
client.py
import collections import json import logging import time import weakref from enum import Enum from json import JSONEncoder from threading import Thread from typing import Deque, Dict, Iterable, Optional, Tuple, Type, Union from .credentials import CertificateCredentials, Credentials from .errors import ConnectionFail...
AnimatedGif.py
""" AnimatedGIF - a class to show an animated gif without blocking the tkinter mainloop() Copyright (c) 2016 Ole Jakob Skjelten <olesk@pvv.org> Released under the terms of the MIT license (https://opensource.org/licenses/MIT) as described in LICENSE.md """ import time try: import Tkinter as tk # for Python2 except Im...
RawCrawler.py
from socket import socket, AF_INET, SOCK_DGRAM, IPPROTO_UDP from os import urandom from collections import deque import bencoder from loguru import logger as log from multiprocessing import Process from threading import Thread from time import sleep from struct import unpack from socket import inet_ntoa import codecs i...
opencvPy.py
from threading import Thread import cv2 import time class ThreadedCamera(object): def __init__(self, src=0): self.capture = cv2.VideoCapture(src) self.capture.set(cv2.CAP_PROP_BUFFERSIZE, 2) self.status = self.frame = None # FPS = 1/X # X = desired FPS self.FPS = ...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import argparse import json import multiprocessing imp...
artificial_data_test.py
import sys import os import platform system = platform.system() current_dir = os.getcwd() if system == 'Windows': path_dir = current_dir.split("\\Neurons")[0] + "\\Neurons" else: path_dir = a.split("/Neurons")[0] + "/Neurons" sys.path.append(path_dir) from model import NGraph, PCC import numpy as np import ...
test_samclasses.py
# ----------------------------------------------------- # test_samclasses.py: Unit tests for samclasses.py. # ----------------------------------------------------- # Make sure we can import i2p import sys; sys.path += ['../../'] import traceback, time, thread, threading, random from i2p import eep, socket, samclasse...
BuildReport.py
## @file # Routines for generating build report. # # This module contains the functionality to generate build report after # build all target completes successfully. # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made a...
msg.py
#! /usr/bin/env python3 ## import atexit import ctypes import curses import hashlib import json import socket import threading from datetime import datetime import pyaes BROADCAST = "10.0.0.255" PORT = 42069 CHUNK_SIZE = 4096 class HistoryWindow: def __init__(self, stdscr): self.stdscr = stdscr ...
Aggregator.py
from utils.typings import Errors, IdRoundPair from experiment.AggregatorConfig import AggregatorConfig from utils.FreeRider import FreeRider from datasetLoaders.DatasetInterface import DatasetInterface from torch import nn from client import Client import copy from logger import logPrint from threading import Thread fr...
httpserver.py
### # Copyright (c) 2011, Valentin Lorentz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
codecast_server.py
import sys, os, subprocess from socket import * import ssl from threading import Thread import jack class Server(): def __init__(self, password, client_table, sname): self.password = password self.client_table = client_table self.sname = sname self.max_clients = len(client_table) ...
03_static_web_server.py
# coding:utf-8 import socket import re from multiprocessing import Process # 设置静态文件根目录 HTML_ROOT_DIR = "./html" class HTTPServer(object): """""" def __init__(self): self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.server_socket.setsockopt(socket.SOL_SOCKET, socket...
test_tracer.py
import time import opentracing from opentracing import ( child_of, Format, InvalidCarrierException, UnsupportedFormatException, SpanContextCorruptedException, ) import ddtrace from ddtrace.ext.priority import AUTO_KEEP from ddtrace.opentracer import Tracer, set_global_tracer from ddtrace.opentrace...
klee_sym_explorer.py
import ConfigParser import multiprocessing import subprocess import os import sys import utils import signal from utils import bcolors def se_info(s): print bcolors.HEADER+"[KleeSym-Info]"+bcolors.ENDC," {0}".format(s) class SymExplorer: def __init__(self, config, target): self.jobs = {} self...
launcher.py
# -*- coding: utf-8 -*- from scrapy import cmdline import os from kazoo.client import KazooClient import time from multiprocessing import Process from random import randint import sys reload(sys) sys.setdefaultencoding('utf-8') main_dir = "/root/V3/project/" def run_dog(pid_list,task_type): if '_' not in task_type:...
openstuder.py
from __future__ import annotations from typing import Callable, Optional, Tuple, List from enum import Enum, Flag, auto from threading import Thread import datetime import json import websocket class SIStatus(Enum): """ Status of operations on the OpenStuder gateway. - **SIStatus.SUCCESS**: Operation was...
reverse_http_server.py
from http.server import HTTPServer, SimpleHTTPRequestHandler from queue import Queue from sys import argv from threading import Thread from time import sleep import base64 # Command and response queues command_queue = Queue() response_queue = Queue() # List of connected clients connected_clients = [] #...
email.py
from flask_mail import Message from app import mail from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, recipients=recipients) msg.body = text_body msg.h...
word2vec.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2013 Radim Rehurek <me@radimrehurek.com> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Deep learning via word2vec's "skip-gram and CBOW models", using either hierarchical softmax or negative sampling [1]_ [2]_. The train...
main.py
import model_rw import datetime import threading import logging import sys import time import model_upload from model_timer import check_time logging.basicConfig(level=logging.INFO, format='%(asctime)s %(levelname)s %(message)s', filename="log.log", datefmt='...
main_parallel.py
#!/usr/bin/env python3 import os, sys os.environ["MKL_NUM_THREADS"] = "1" import numpy as np from math import pi, sqrt, exp from scipy.sparse import csr_matrix as csr from scipy import linalg import random import torch import time from termcolor import colored import copy if __name__ == '__main__': from math import...
botakw2.py
# -*- coding: utf-8 -*- from linepy import * from datetime import datetime from time import sleep from bs4 import BeautifulSoup from gtts import gTTS from humanfriendly import format_timespan, format_size, format_number, format_length import time, random, sys, json, codecs, threading, glob, re, string, os, requests, s...
wpforce.py
import re import sys import time import socket import urllib2 import argparse import threading from urlparse import urljoin __author__ = 'n00py' # These variables must be shared by all threads dynamically correct_pairs = {} total = 0 def has_colours(stream): if not hasattr(stream, "isatty"): return False ...
test_language_server.py
# Copyright 2017 Palantir Technologies, Inc. import os import time import multiprocessing import sys from threading import Thread from pyls_jsonrpc.exceptions import JsonRpcMethodNotFound import pytest from pyls.python_ls import start_io_lang_server, PythonLanguageServer CALL_TIMEOUT = 10 PY2 = sys.version_info[0] =...
Server.py
''' Created on Mar 6, 2017 @author: wolfw ''' from socket import * import threading import time import sys import traceback import errno import os import ConfigFile ## global variables tList = [] allow_delete = False local_ip = '127.0.0.1' # socket.gethostbyname(socket.gethostname()) local_por...
thread.py
# type: ignore import threading import numpy as np from util.time_util import format_time def task_1(n_max, some_threshold, nx, ny, n): print(f"子线程_{n}开始执行{format_time()}") # A grid of c-values xs = np.linspace(-2, 1, nx) ys = np.linspace(-1.5, 1.5, ny) mandelbrot_set = np.zeros((len(xs), len(ys)...
launcher.py
import asyncio import logging import multiprocessing import signal import os import sys import time import requests from bot import ClusterBot TOKEN = "<your token>" log = logging.getLogger("Cluster#Launcher") log.setLevel(logging.DEBUG) hdlr = logging.StreamHandler() hdlr.setFormatter(logging.Form...
experiment_test.py
# Copyright 2016 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 appl...
__main__.py
import argparse import logging import multiprocessing import sys from saq.worker import check_health, start def main(): parser = argparse.ArgumentParser(description="Start Simple Async Queue Worker") parser.add_argument( "settings", type=str, help="Namespaced variable containing worke...
picasso.py
# -*- coding: utf-8 -*- """ Created on Tue Apr 10 12:20:17 2018 @author: sreimond """ import sys, os import threading from PyQt5.QtWidgets import QApplication, QMainWindow, QMessageBox from PyQt5 import QtCore import functools as ft from picasso.gui import picasso_design from picasso.gui import project_data_functions...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import codecs import unittest import subprocess import textwrap import linecache from contextlib import ExitStack from io import StringIO from test import support # This little helper class is ess...
curses_ui_test.py
# Copyright 2016 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...
uploader-gui.py
#!/usr/bin/env python3 VERSION = " v1.09" VERSION_DATE =" Apr.2020 - Apr.2021" print("Arduboy Uploader GUI/FX activator/flasher" + VERSION + VERSION_DATE + " by Mr.Blinky running\n") from tkinter import filedialog from tkinter import * from tkinter.ttk import * from threading import Thread from tkinter import...
autorefreshserver.py
from django.contrib.staticfiles.management.commands.runserver import \ Command as RunServerCommand from django.utils.autoreload import reloader_thread from http import server as BaseHTTPServer import threading as thread import os import sys import subprocess # default port number where we would run the chang...
dataloader.py
import os import sys import time from multiprocessing import Queue as pQueue from threading import Thread import cv2 import numpy as np import torch import torch.multiprocessing as mp import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image from torch.autograd import Variable ...
IMUgy86.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' This program works for Combine all of the data from chips in gy86, and add the KF support. Functions: F1. Use the IMU update to combine the data sensors. To Do: TD1. add the remote plot function to optimize the PID parameters in IMUupdate. Problem: ...
dbapi_tests.py
from datetime import datetime, date, timezone from numpy.random import randint, uniform from math import floor from queue import Queue from subprocess import Popen from time import sleep import threading, sys, os sys.path.append(os.path.abspath(__file__).rsplit('tests/', 1)[0] + '/pysqream/') import dbapi q = Queue()...
process.py
""" Functions for daemonizing and otherwise modifying running processes """ import contextlib import copy import errno import functools import io import json import logging import multiprocessing import multiprocessing.util import os import queue import signal import socket import subprocess import sys import threading...
test_854.py
import time import multiprocessing import pytest from parsl.executors.high_throughput.mac_safe_queue import MacSafeQueue import random def consumer(in_q, out_q, delay=0): while True: x = in_q.get() time.sleep(delay) if x == 'STOP': out_q.put('STOPPED') break ...
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...
barrera.py
#!/usr/bin/python3 from threading import Semaphore, Thread from time import sleep from random import random num_hilos = 10 cuenta = 0 mutex = Semaphore(1) barrera = Semaphore(0) def vida_del_hilo(id): global cuenta print('El hilo %d entra...' % id) mutex.acquire() cuenta = cuenta + 1 if cuenta ...
jobs.py
# coding=utf-8 """Sopel's Job Scheduler: internal tool for job management. .. note:: As of Sopel 5.3, :mod:`sopel.tools.jobs` is an internal tool. Therefore, it is not shown in the public documentation. """ # Copyright 2019, Florian Strzelecki <florian.strzelecki@gmail.com> # # Licensed under the Eiffel Foru...
pbsearch.py
from multiprocessing import Pool import threading import sys import time import os import Choruslib.prefilter as prefilter import Choruslib.primer3_filter as primer3_filter import Choruslib.loadfa as loadfa import Choruslib.blat as blat import random import Choruslib.exonerate as exonerate def blat_getseqlen(par): ...
async_external_data_loader.py
from Queue import Queue from threading import Thread class AsyncExternalDataLoader: """ Allows performing multiple actions in an async way, ideal to do multiple external api calls in parallel. Create a thread per action allowing all of them to run at the same time. If self._num_fetch_threads = 1 all ...
swivel.py
#!/usr/bin/env python3 # # Copyright 2016 Google Inc. All Rights Reserved. # Copyright 2017 Sourced Technologies S. L. # # 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.apach...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
test_operator.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...
dextrems-study-independence.py
# pip install opencv-python # require rehastim-integration-lib at the same directory import cv2 import numpy as np import serial import random import csv import os.path import threading # EMS import sys sys.path.append('./rehastim-integration-lib/ems_interface/modules/') sys.path.append('./rehastim-integration-lib/e...
MptaAnalyzerThread.py
""" Copyright (C) 2018 Intel 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 in writing, softw...
helper.py
""" helper.py ~~~~~~~~ 助手函数集 2020/9/9 :update: Fufu, 2020/9/7 get_date() 增加支持时间戳(秒/毫秒) :update: Fufu, 2020/12/16 get_iso_date() """ import calendar import hashlib import json import re import sys import time from datetime import datetime, timedelta, date from decimal import Decimal from functoo...
flasher.py
#!/usr/bin/env python # # Copyright (c) 2016, Pycom Limited. # # This software is licensed under the GNU GPL version 3 or any # later version, with permitted additional terms. For more information # see the Pycom Licence v1.0 document supplied with this file, or # available at https://www.pycom.io/opensource/licensing ...
online-processing.py
############################################################################### # The MIT License (MIT) # # Open3D: www.open3d.org # Copyright (c) 2018-2021 www.open3d.org # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Softwar...
web.py
# Copyright (c) 2021, Oracle and/or its affiliates. # All rights reserved. The Universal Permissive License (UPL), Version 1.0 as shown at http://oss.oracle.com/licenses/upl import multiprocessing import os import sys import uuid import flask # multiprocessing patch import mp_patch from datafetch import odatafetch f...
lib.py
# -*- coding: utf-8 -*- """Utility functions used for Avalon - Harmony integration.""" import subprocess import threading import os import random import zipfile import sys import importlib import shutil import logging import contextlib import json import signal import time from uuid import uuid4 from Qt import QtWidget...
net04_sing_dance_multiprocess.py
"""多进程实现唱歌跳舞""" ''' @Time : 2018/1/22 下午4:10 @Author : scrappy_zhang @File : net04_sing_dance_multiprocess.py ''' import multiprocessing import time def sing(): for i in range(5): print('正在唱歌呢 %d' % i) time.sleep(1) # 休息1秒 def dance(): for i in range(5): print('正在跳舞呢 %d' % i...
PyKLXfil-Client-mail.py
#PyKLXfil client to be deployed on target #### CLIENT #### # -*- coding: utf-8 -*- #Auther: 2021, Mayed Alm import os import sys import random import yagmail import logging import tempfile import threading from time import sleep from shutil import copyfile from pynput.keyboard import Listener class Py...
start_proxy.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, so...
word2vec.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...
alin1self.py
# -*- coding: utf-8 -*- #GhostRider_Bot import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime from bs4 import BeautifulSoup from threading import Thread from googletrans import Translator from gtts import gTTS import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast...
queryInterface_Tests.py
# Copyright 2010-2012 Institut Mines-Telecom # # 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 agre...
wsgi_server.py
#!/usr/bin/env python # # Copyright 2007 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
test_client.py
import time import threading import pytest from utvsapitoken import TokenClient from utvsapitoken.exceptions import TokenInvalid from utvsapitoken.fakeserver import serve_forever from utvsapitoken.fakeserver import TNUM class TestClient: @classmethod def setup_class(cls): p = pytest.config.getoption...
WebServer.py
from threading import Thread import traceback import os.path import remi.gui as gui from remi import start, App from k40nano import PngPlotter from .EgvParser import parse_egv from .EgvSend import send_egv class MyApp(App): def __init__(self, *args): res_path = os.path.join(os.path.dirname(os....
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from electrum.bitcoin import TYPE_ADDRESS from electrum.storage import WalletStorage from electrum.wallet import Wallet, InternalAddressCorruption from electrum.paymentrequest import ...
twitch.py
import requests import random import time import json import datetime import os from PyQt5 import QtWidgets import sys from PyQt5.QtCore import QTimer from PyQt5.QtWidgets import QFileDialog, QMessageBox from requests import RequestException from fake_useragent import UserAgent from python_rucaptcha import FunCaptcha f...
responder.py
from queue import Queue from threading import Thread from readerwriterlock import rwlock from teos.cleaner import Cleaner from teos.chain_monitor import ChainMonitor from teos.logger import get_logger from common.constants import IRREVOCABLY_RESOLVED CONFIRMATIONS_BEFORE_RETRY = 6 MIN_CONFIRMATIONS = 6 class Transa...
multiprocess.py
# Copyright 2020 Katsuya Shimabukuro. All rights reserved. # Licensed under the MIT License. from typing import Callable, List, Iterable import queue from contextlib import ContextDecorator from multiprocessing import Queue, Process def process( func: Callable, in_queue: Queue, out_queue: Queu...
http_mapi.py
import logging import base64 import random import os import ssl import time import copy import sys from pydispatch import dispatcher from flask import Flask, request, make_response # Empire imports from lib.common import helpers from lib.common import agents from lib.common import encryption from lib.common import pac...
serve.py
# -*- coding: utf-8 -*- from __future__ import print_function import abc import argparse import json import logging import os import platform import signal import socket import sys import threading import time import traceback from six.moves import urllib import uuid from collections import defaultdict, OrderedDict f...
search_client.py
import Pyro.core import Pyro.naming import finder.SimpleFinder import finder.AllFileCounter from threading import Thread def search(q): root = Pyro.core.getProxyForURI("PYRONAME://p") logger = Pyro.core.getProxyForURI("PYRONAME://logger") f = finder.SimpleFinder.SimpleFinder(q,logger) root....
test_shell_interactive.py
#!/usr/bin/env impala-python # -*- coding: utf-8 -*- # # 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 Apach...
scion_elem.py
# Copyright 2014 ETH Zurich # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, sof...
train.py
import argparse import os import random import time import numpy as np import torch import torch.multiprocessing as multiprocessing import torch.nn.functional as functional from gym_mdptetris.envs.tetris import TetrisFlat from mdptetris_experiments.agents.action_networks import PPONN, NN1DAction from torch import nn f...
test_scheduler.py
# global import os import time import json import threading # local from ivy_builder_tests import helpers from ivy_builder.scheduler import SequentialScheduler THIS_DIR = os.path.dirname(os.path.realpath(__file__)) def test_sequential_scheduler(dev_str, call): schedule_filepath = os.path.join(THIS_DIR, 'schedul...
rebuild_crypto.py
# encoding: UTF-8 # 数字货币砖图数据重构器 # 支持使用1分钟数据,进行快速更新 import os import copy import csv import signal import traceback import pandas as pd import numpy as np from queue import Queue from datetime import datetime, timedelta from time import sleep from threading import Thread from vnpy.data.mongo.mongo_...
test.py
from pool import PyPool import time import unittest import threading import os class TestPool(unittest.TestCase): def setUp(self): # Create an example Pool, using a callback to print returned data & no error handling. self.pool = PyPool(iteration=True, tags={ 'test': 1, 'ignore': 1 }, callback=lambda r:...
encodeInfo.py
import vapoursynth as vs import havsfunc as haf import sys import os import psutil import threading import subprocess as sp core = vs.core """ This will be imported by 'batchencode.py'. By making it a seperate file customization can be done easily without cluttering up the main script. vapoursynthFilter(): Pre-encod...