source
stringlengths
3
86
python
stringlengths
75
1.04M
test_ssl.py
# -*- coding: utf-8 -*- # Test the support for SSL and sockets import sys import unittest from test import test_support as support import asyncore import socket import select import time import datetime import gc import os import errno import pprint import tempfile import urllib2 import traceback import weakref import...
main.py
from tkinter import * import os import time import threading from mutagen.mp3 import MP3 from tkinter import filedialog import tkinter.messagebox from tkinter import ttk # to improve the styles of buttons and widgets from ttkthemes import themed_tk as tk from pygame import mixer def show_Details(play_it): Main_t...
ib_api.py
import logging from ktrade.config import is_configured, configuration_for from time import sleep from ktrade.queues import inbound_queue, outbound_queue from ibapi.client import EClient from ibapi.wrapper import EWrapper from threading import Thread class IBApi(EWrapper, EClient): def __init__(self): EClient.__i...
splink_server_project.py
""" server-side sPLINK project to aggregate the local parameters from the clients Copyright 2021 Reza NasiriGerdeh and Reihaneh TorkzadehMahani. 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...
test_client.py
import asyncio import concurrent.futures import copy import datetime import functools import os import re import threading import warnings from base64 import b64decode, b64encode from queue import Empty from unittest.mock import MagicMock, Mock import nbformat import pytest import xmltodict from ipython_genutils.py3co...
test_dispatcher.py
from __future__ import print_function, division, absolute_import import errno import multiprocessing import os import platform import shutil import subprocess import sys import threading import warnings import inspect import pickle import weakref from itertools import chain try: import jinja2 except ImportError: ...
accessories.py
# # Copyright (c) 2021 Project CHIP 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 applica...
tests.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # MinIO Python Library for Amazon S3 Compatible Cloud Storage, # (C) 2015, 2016, 2017, 2018 MinIO, 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 Lice...
raputil.py
#!/usr/bin/python from __future__ import division import numpy as np import math import os import time import numpy.linalg as la from tfinterp import interp1d_ sqrt=np.sqrt pi = math.pi def hexagonal_uniform(N,as_complex=False): 'returns uniformly distributed points of shape=(2,N) within a hexagon whose minimum ra...
utils_test.py
# Copyright 2016 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 or agreed to in writing, ...
utils.py
from bitcoin.rpc import RawProxy as BitcoinProxy from pyln.testing.btcproxy import BitcoinRpcProxy from collections import OrderedDict from decimal import Decimal from ephemeral_port_reserve import reserve from pyln.client import LightningRpc import json import logging import lzma import math import os import random i...
thread_queue.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import logging from threading import Thread try: from queue import Queue, Empty except ImportError: from Queue import Queue, Empty __author__ = 'Tim Martin' __em...
individual_coverage.py
#!/usr/bin/env python3 import io import contextlib import os import sys import glob import multiprocessing import configparser import itertools import pytest def run_tests(src, test, fail): stderr = io.StringIO() stdout = io.StringIO() with contextlib.redirect_stderr(stderr): with contextlib.redi...
grpcserver.py
import grpc from concurrent import futures from google.protobuf import json_format import threading import base64 def grpc_server(pb2, pb2_grpc): class OpenapiServicer(pb2_grpc.OpenapiServicer): def __init__(self): super(OpenapiServicer, self).__init__() def SetConfig(self, request, c...
turing_learning.py
import numpy as np import matplotlib.pyplot as plt import threading import math from channel import Channel from environment import Environment from replica_fish import ReplicaFish from DelightFish import Fish from observer import Observer from utils import generate_distortion, generate_fish, generate_replica_fish, ge...
app.py
import db import threading import configparser import detected import json from facerec import capture_faces from flask import Flask, flash, redirect, render_template, request, jsonify from time import sleep from helpers import f_encode, camtest, init_db from PIL import Image, ImageOps from io import BytesIO # Confi...
audio_transcribe.py
# Audio Transcriptor # This script will create the folder structure in the same manner as LJSpeech-1.1 dataset. # This script will splitt the audio files on silenses and send the audio chunks to google recognition service # Google will return the recognized text. # This text will be writen to metadata.csv in the same m...
run_optimization.py
"""This is the core of the genetic algorithm (GA) used for optimization. It uses the `NSGA-II <https://www.sciencedirect.com/science/article/pii/S1877705811022466>`_ algorithm for multi-objective optimization of smooth components. ********** How to use ********** To use, call run_optimization with a configuration dict...
dataset.py
# Copyright (c) MONAI Consortium # 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, so...
sftp_test.py
# -*- coding: utf-8 -*- import paramiko import six import socket import stat import threading from .. import base from girder.api import sftp from girder.models.collection import Collection from girder.models.folder import Folder from girder.models.upload import Upload from girder.models.user import User from six.move...
gdbclientutils.py
import ctypes import errno import io import os import os.path import threading import socket import lldb import binascii import traceback from lldbsuite.support import seven from lldbsuite.test.lldbtest import * from lldbsuite.test import lldbtest_config def checksum(message): """ Calculate the GDB server pro...
tick_manager.py
from threading import Thread, Lock from config import config from slq_lite_database import Storage from tick_listener import TickListener from position import Position from trade_algorithm import TradeAlgorithm class TickManager(TickListener): def __init__(self, priceHistory) -> None: self.MAX...
OKX_cusID_open_1007.py
import okex.Public_api as Public import okex.Trade_api as Trade import okex.Account_api as Account import okex.Market_api as Market import okex.Funding_api as Funding from multiprocessing import Process, Queue, Pool,Manager import os,sys import numpy as np import asyncio import websockets import json import requests im...
goal_generation_node.py
#!/bin/python3 from math import sqrt import time import rospy import std_msgs.msg as ros_std_msg import geometry_msgs.msg as ros_geom_msg from threading import Thread import numpy as np from datetime import datetime import tf import actionlib import move_base_msgs.msg as ros_mb_msg import gazebo_msgs.srv as ros_gz_srv...
Hiwin_RT605_ArmCommand_Socket_20190627160421.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import numpy as np from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import math import enum pos_feedback_times = 0 mode_feedback_times = 0 msg_feedback = 1 #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 i...
keep_alive.py
#code to connect uptimerobot.com to this repl to refresh it every 5 mins to keep it online import flask import threading from flask import Flask from threading import Thread app = Flask("") @app.route("/") def home(): return "MagBot is online on DevServer" def run(): app.run(host = "0.0.0.0", port = 8080) d...
test_retry_on_blocked_accounts.py
import os from proxy.common_neon.constants import SYSVAR_INSTRUCTION_PUBKEY from proxy.environment import ETH_TOKEN_MINT_ID, MINIMAL_GAS_PRICE os.environ['SOLANA_URL'] = "http://solana:8899" os.environ['EVM_LOADER'] = "53DfF883gyixYNXnM7s5xhdeyV8mVk9T4i2hGV9vG9io" os.environ['ETH_TOKEN_MINT'] = "HPsV9Deocecw3GeZv1FkA...
bot.py
"""A simple socket interface.""" import socket from multiprocessing import Process from botbot.debug import debug class Bot(object): """Socket bot""" def __init__(self, host, port, debug=False): """Initialize the bot with host and port. Debig is an optional flag that enables all reads and w...
code70.py
#!/usr/bin/env python2 import socket import threading import time import SocketServer import random HOST = "0.0.0.0" PORT = 11071 WELCOME_MSG = "Hi, I like math and cryptography. Can you talk to me?!\n" ERROR_MSG = "Ooops, something went wrong here. Please check your input!\n" CORRECT_MSG = "Yay, that's right!\n" WRO...
properties.py
import logging, subprocess import threading, random class Properties(object): GAMMA = 0.0 CUSHION = 0 SENSITIVITY = 0.0 MAX_WINDOW_SIZE = 0 ENSEMBLE_SIZE = 0 CONFTHRESHOLD = 0.0 CONFCUTOFF = 0.0 INITIAL_DATA_SIZE = 0 MAXVAR = 0 IDENTIFIER = '' OUTFILENAME = '' TEMPDIR = '' LOGFILE = '' BASEDIR = '' S...
xla_client_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
notify.py
#!/usr/bin/env python3 # _*_ coding:utf-8 _*_ import base64 import hashlib import hmac import json import os import re import threading import time import urllib.parse import requests # 原先的 print 函数和主线程的锁 _print = print mutex = threading.Lock() # 定义新的 print 函数 def print(text, *args, **kw): """ 使输出有序进行,不出现多线...
ecmwf_era5_request.py
#!/usr/bin/python3 """ This module provides functionality to download the needed weather data """ from gisme import (era5_path, lon_min, lon_max, lat_min, lat_max) import os import cdsapi import urllib3 import threading # to suppress InsecureRequestWarning thrown when using mobile network or some sorts of networks ...
pt_engine.py
import logging import smtplib from abc import ABC from queue import Empty, Queue from threading import Thread from email.message import EmailMessage from ..event import EventEngine, Event from ..api.db import MongoDBService from ..api.pytdx_api import PYTDXService from ..utility.setting import SETTINGS from ..utility....
conftest.py
import logging import os import random import time import tempfile import threading from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime from math import floor from shutil import copyfile from functools import partial from botocore.exceptions import ClientError import pytest from ocs...
main_queue_test.py
import multiprocessing import keyboard def getData(queue_raw): #while True: for num in range(1000): queue_raw.put(num) print("getData: put "+ str(num)+" in queue_raw") def calcFeatures(queue_raw, queue_features): while not queue_raw.empty(): data = queue_raw.get() queue_fea...
test_bootstrap.py
#coding:utf-8 import os import shutil import tarfile import tempfile import unittest import zipfile import threading import random from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler from cactus.bootstrap import bootstrap from cactus.tests import BaseTestCase from cactus.utils.f...
ocs_start_of_night_process.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # + # import(s) # - from OcsCameraEntity import * from OcsSequencerEntity import * import multiprocessing import os # + # function: worker_code() # - def worker_code(entity='', entobj=None): # debug output print('name: {0:s}'.format(multiprocessing.current_proc...
app.py
''' Brick's Scanner Version: 0.02 Date: 6/6/2021 www.brick.technology www.coinlab.pro Notes: 1. This is a quick fun project i made last night. Use this as a launch pad to build your own, more effective scanner. 2. You can add any symbol on binance to the 'coins' list and it will be added to the scanner 3....
tracer.py
from sys import argv, stderr from time import sleep from json import dumps from bottle import post, get, request, run from serial import Serial, SerialException from pathlib import Path from threading import Thread from mekpie.util import file_as_str from mekpie.cli impor...
webcam.py
"""Raspberry Pi Face Recognition Treasure Box Webcam OpenCV Camera Capture Device Copyright 2013 Tony DiCola Webcam device capture class using OpenCV. This class allows you to capture a single image from the webcam, as if it were a snapshot camera. This isn't used by the treasure box code out of the box, but is usef...
firs.py
import sys import time import json import os import glob from pprint import pprint import threading import timeit import times import requests import flickr_api config = json.load(open('./config.json.default')) TAG = 'philMeta' API_KEY = config['flickr_api_key'] API_SECRET = config['flickr_api_secret'] REST_ENDPO...
ThreadedInstaller.py
###################################################################### # PACKAGE MANAGER # ###################################################################### from logger import log_info, close_log from Classes.Download import Download from Classes.Install import ...
tester.py
import asyncio import time from threading import Thread class Test: def __init__(self, func, ignored_exception, *args): self.func = func self.value = args self.ignored_exception = ignored_exception self.completed = None self.time = 0 self.result = None self....
log.py
# coding=utf8 from datetime import datetime from Queue import Queue, Empty from threading import Thread, Lock from threading import Event as TEvent import hashlib import sys,traceback, re _logger = None def sstr(obj): """ converts any object to str, if necessary encodes unicode chars """ try: return str(obj) exc...
lib.py
""" Test library. """ import difflib import inspect import json import subprocess import os import posixpath import shlex import shutil import string import threading import urllib #import time import pprint import SocketServer import SimpleHTTPServer class ThreadedTCPServer(SocketServer.ThreadingMixIn, SocketServer...
utils.py
# # Copyright (c) 2017 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...
rman_stats.py
import re import os import sys import json import bpy import rman import threading import time from collections import OrderedDict import rman_utils.stats_config.core as stcore from . import rman_render from .rfb_utils import prefs_utils from .rfb_logger import rfb_log __oneK2__ = 1024.0*1024.0 __RFB_STATS_MANAGER__ ...
threadPool.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- import threading import time from queue import Queue # 创建队列实例,用于存储任务 queue = Queue() # 定义需要线程池执行的任务 def do_job(): while True: i = queue.get() # Remove and return an item from the queue. time.sleep(1) print("index {}, current: {}".for...
dfu.py
#!/usr/bin/env python """ Tool for flashing .hex files to the ODrive via the STM built-in USB DFU mode. """ from __future__ import print_function import argparse import sys import time import threading import platform import struct import requests import re import io import os import usb.core import fibre import odriv...
Server.py
import socket import threading import time import re import os ## SERVER SCRIPT HEADER = 2048 DISCONNECT_MESSAGE = "!DISCONNECT" FORMAT = "utf-8" all_connected = [] all_address = [] all_username = [] all_message = [] blacklist = [] users = { "USERNAME" : all_username, "ADDRESS" : all_address ...
ng.py
#!/usr/bin/env python # # Copyright 2004-2015, Martian Software, 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 app...
getdata.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : getdata.py @Time : 2020/02/14 18:16:06 @Author : Gui XiaoMo @Version : 1.0 @Contact : 2572225959@qq.com @License : (C)Copyright 2020-2021, QINGDAO-QUST @Desc : None ''' # here put the import lib import os import cv2 as cv import n...
cardApi.py
# -*- coding:utf-8 -*- ''' Created on 2017. 4. 26. @author: sanghyun ''' import json import os import threading import time import zipfile import hashlib import httplib import sys from datetime import datetime from urllib import urlencode from urllib2 import HTTPError from flask import Blueprint, request from flask...
AChannel.py
# -*- coding: utf-8 -*- # Copyright 2017-2020 NTT Communications # # 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 b...
ntp.py
#!/usr/bin/env https://github.com/Tandelajr/mr.tandela # MIT License # # Copyright (C) 2020, Entynetproject. All Rights Reserved. # # 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 re...
task.py
from threading import Thread import time import easygui class Task: def __init__(self, remind_interval, completion_date, next_remind, description): self.remind_interval = remind_interval self.completion_date = completion_date self.next_remind = next_remind self.description = ...
run-tests.py
#!/usr/bin/env python # Copyright 2015 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import difflib import fnmatch import multiprocessing import os import Queue import re import shlex import subproce...
base.py
#!/usr/bin/env python """ fs.base ======= This module defines the most basic filesystem abstraction, the FS class. Instances of FS represent a filesystem containing files and directories that can be queried and manipulated. To implement a new kind of filesystem, start by sublcassing the base FS class. For more infor...
process_executor.py
#!/usr/bin/env python # _*_ coding: utf-8 _*_ # @author: XYZ # @file: process_executor.py # @time: 2021.01.28 13:12 # @desc: import time import logging import threading from abc import ABCMeta, abstractmethod from multiprocessing import Process, JoinableQueue import nspider.utilities.constant as const from nspider.co...
create_images.py
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import _ from electrum....
manager.py
# Ant-FS # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy...
test_config.py
import asyncio import copy import pytest import random import yaml from silicoin.util.config import create_default_silicoin_config, initial_config_file, load_config, save_config from silicoin.util.path import mkdir from multiprocessing import Pool from pathlib import Path from threading import Thread from time import ...
santa_claus.py
#!/usr/bin/python # -*- coding: utf-8 -*- import threading import time import random prob_falla = 0.03 num_renos = 9 num_elfos = 100 elfos_atorados = 0 umbral_elfo = 3 mutex_elfos = threading.Semaphore(1) barrera_elfo = threading.Semaphore(0) sem_santa = threading.Semaphore(0) renos = [] renos_en_casa = 0 mutex_ctr_r...
server.py
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under t...
test_executor.py
############################################################################## # Copyright (c) 2016 EMC and others. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Apache License, Version 2.0 # which accompanies this distribution, and is available at # ht...
ReactiveManager.py
import threading import time import sys sys.path.append("../../build/bindings/python") from libpydiamond import * from twisted.internet import reactor NO_NOTIFICATION = 18446744073709551615L funcArgMap = dict() # function <-> arguments map idFuncMap = dict() # reactive_id <-> function map funcIdMap = dict() # functio...
runner.py
import sys import random from multiprocessing import Process from cache import * from network import * # The number of times each experiment is run runs = 10 def run_simulation(T, net, prefixes, caches, auxiliary_distribution, request_distribution): global runs results = [] cache_indexes = range(len(ca...
test_integer_incrementer.py
import threading from typing import List, Set from json import dumps as jsondumps import pytest import gevent from gevent.greenlet import Greenlet from grizzly.testdata.variables.integer_incrementer import atomicintegerincrementer__base_type__ from grizzly.testdata.variables import AtomicIntegerIncrementer from .....
mosquitto_byte.py
import socket import random import time import sys import argparse import math import os import os.path import select import subprocess import difflib import threading from os import path from datetime import datetime from difflib import SequenceMatcher # Remove bytes in a string # f : the fuzzable object # nb : the ...
test_linharn.py
from pytest import raises, fixture from os import environ from time import sleep, time from copy import deepcopy from multiprocessing import Process import brain import docker from Harness_client import linharn CLIENT = docker.from_env() class Linharn_proc: def __init__(self): self.procs = [] de...
fast_multiplier_utils.py
import tools from multiprocessing import SimpleQueue, Process import numpy as np __all__ = ['fast_multiply'] def get_b(i, level_to_nodes, max_level, b): indices = level_to_nodes[max_level][i].Indices start, end = indices[0], indices[-1] res = b[start:end + 1] return res def get_G(k, i, level_to_no...
test_router.py
import threading from typing import List, Tuple import pytest import requests import werkzeug from werkzeug.exceptions import NotFound from localstack.http import Request, Response, Router from localstack.http.router import E, RequestArguments from localstack.utils.common import get_free_tcp_port def noop(*args, **...
provider_buttons.py
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
common.py
"""Test the helper method for writing tests.""" import asyncio from collections import OrderedDict from datetime import timedelta import functools as ft import json import os import sys from unittest.mock import patch, MagicMock, Mock from io import StringIO import logging import threading from contextlib import contex...
__init__.py
from threading import Thread from flask import Flask from flask import request from flask_babel import Babel from flask_redis import FlaskRedis from flask_migrate import Migrate from flask_sqlalchemy import SQLAlchemy babel = Babel() redis = FlaskRedis() db = SQLAlchemy() migrate = Migrate() def create_app(): a...
test_util.py
# # test_util # # Copyright (c) 2011-2021 Akinori Hattori <hattya@gmail.com> # # SPDX-License-Identifier: MIT # import collections.abc import os import pickle import random import threading import time from ayame import util from base import AyameTestCase class UtilTestCase(AyameTestCase): def test_fqon_of...
quasibot_mastoonly.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import sys import random import hashlib import os import atexit import json import traceback import subprocess from subprocess import call from multiprocessing import Process, Queue, Value from mastodon import Mastodon wordfile = open("wordlist.txt", "r") w...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
test_download.py
# -*- coding: utf-8 -*- # Author: Florian Mayer <florian.mayer@bitsrc.org> #pylint: disable=W0613 import pytest import os import tempfile import threading from functools import partial import sunpy from sunpy.net.download import Downloader, default_name class CalledProxy(object): def __init__(self, fn): ...
_testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import operator import os import re from shutil import rmtree import string import tempfile from typing import Any, Callable, ContextManager, List, Optional, Type, Union...
misc.py
import os, asyncio, logging, subprocess, tempfile, multiprocessing from types import FunctionType import requests from consts import LOCAL_FILE_CACHE log = logging.getLogger(__name__) async def get_size_at_path(start_path, *, if_none=None): if start_path is None: return if_none total_size = 0 f...
Variation_ViewerServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
test.py
import boto3 import os import sys import cv2 import numpy import requests import json import logging import threading import queue import coco_label_map ENDPOINT = 'http://localhost:8501/v1/models/default:predict' TMP_FILE = "./tmp.mov" FRAME_BATCH=5 FRAME_MAX=20 logging.basicConfig( level=logging.INFO, fo...
tether_task_runner.py
#!/usr/bin/env python ## # 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 #...
test_network.py
import random import socket import threading import unittest import telethon.network.authenticator as authenticator from telethon.extensions import TcpClient from telethon.network import Connection def run_server_echo_thread(port): def server_thread(): with socket.socket(socket.AF_INET, socket.SOCK_STREA...
test_smbserver.py
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2021 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # Basic unit tests for the SMB Server. # # Author: # M...
generate_tfrecords.py
from __future__ import print_function import os import numpy as np import h5py import cv2 import tensorflow as tf import sys import threading import time import glob import argparse parser = argparse.ArgumentParser(description="Creates .tfrecord") parser.add_argument('--path', type=str, help="The path where to look f...
Perf_runner.py
#!/usr/bin/env python3 import os import argparse import time import sys from threading import Thread, Lock global txns global clients clients = 100 txns = 100 # ==================== Notes and information ==================== # This script will run multiple instances (threaded) of the the Perf_Add_ny...
server.py
from gettext import find import socket import threading import spotipy from spotipy.oauth2 import SpotifyOAuth HEADER = 64 PORT = 5050 SERVER = socket.gethostbyname(socket.gethostname()) ADDR = (SERVER, PORT) FORMAT = 'utf-8' DISCONNECT_MESSAGE = "!DISCONNECT" server = socket.socket(socket.AF_INET, socket.SOCK_STREAM...
tt_server.py
from socket import * import datetime import time import threading class ThreadedServer(): def listenToClient(self, client, addr): userName = (client.recv(1024)).decode("utf-8") print(userName, "logged in") while True: counter = 0 answers = [] questions ...
test_transmission.py
from HaPPPy.Transmission.TransmissionCalculator import TransmissionCalculator from threading import Thread from scipy.constants import codata import threading import unittest import pytest import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation _x = [] _psi_plot = [] _V = [] cla...
test_server.py
import json import logging import time from multiprocessing import Process, Queue from time import sleep from unittest import TestCase, mock from unittest.mock import call from hoststats.app import app from hoststats.collection import SLEEP_INTERVAL_MS, collect_metrics from hoststats.stats import FORWARD_HEADER SLEEP...
test_operator_gpu.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
code.py
import json import websocket import re import requests import colorama from colorama import Fore import threading import time import asyncio import inspect import os import datetime class Client: def __init__(self, username, password, source=None): """ Creates a Scratch Client so you can start con...
microphone.py
# microphone.py (pi-topPULSE) # Copyright (C) 2017 CEED ltd. # import codecs import binascii import math from tempfile import mkstemp import os import serial import signal import struct import sys from threading import Thread import time # local from ptpulse import configuration _debug = False _bitrate = 8 _continu...
test_telnetlib.py
import socket import selectors import telnetlib import threading import contextlib from test import support from test.support import socket_helper import unittest HOST = socket_helper.HOST def server(evt, serv): serv.listen() evt.set() try: conn, addr = serv.accept() conn.close() exce...
gui.py
import os import sys import threading import tkinter as tk from tkinter import font as tkfont, messagebox from tkinter.ttk import Style from openbiolink import openBioLink from openbiolink.gui.confirmFrame import ConfirmFrame from openbiolink.gui.console import ConsoleFrame from openbiolink.gui.graphCreationFrame impo...
model.py
import glob import json import copy import importlib import threading import logging import pytz #for tables import numpy import numpy as np import datetime import dateutil.parser import sys import os import time import uuid import hashlib import random import traceback from dates import * # type hints from typing im...