source
stringlengths
3
86
python
stringlengths
75
1.04M
volume.py
from threading import Thread import threading from lib.testconstants import STANDARD_BUCKET_PORT from couchbase_helper.document import DesignDocument, View from basetestcase import BaseTestCase from rebalance.rebalance_base import RebalanceBaseTest from membase.api.rest_client import RestConnection, RestHelper class ...
dashboard.py
try: import bokeh.command.bootstrap import bokeh.document # NOQA import bokeh.layouts import bokeh.models import bokeh.models.widgets import bokeh.plotting import bokeh.themes import tornado.gen _available = True except ImportError as e: _available = False _import_error = e ...
common.py
"""Test the helper method for writing tests.""" import asyncio import collections from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta import functools as ft from io import StringIO import json import logging import os import pathlib import threading import time impor...
msg.py
from utlis.rank import setrank ,isrank ,remrank ,setsudos ,remsudos ,setsudo,IDrank,GPranks from utlis.send import send_msg, BYusers, sendM,Glang,GetLink from handlers.delete import delete from utlis.tg import Bot, Ckuser from handlers.ranks import ranks from handlers.locks import locks from handlers.gpcmd import...
base_worker.py
import base64 import json import random import time from threading import Thread from bitcoin import base58 from ..lib import utils from ..services.broadcast_known_workers import BroadcastKnownWorkersService from ..services.whoami import WhoamiService class GridWorker(): def __init__(self, node_type, email=None...
tester.py
#!/usr/bin/python # # tester.py # # This source file is part of the FoundationDB open source project # # Copyright 2013-2018 Apple Inc. and the FoundationDB project 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 ob...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
reader.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
data_plane.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...
CamCSI.py
import cv2 import threading import numpy as np class CSI_Camera: def __init__(self, sensor_id): # Initialize instance variables # OpenCV video capture element self.video_capture = None # The last captured image from the camera self.frame = None self.grabbed = False...
pyCov_multithreading.py
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
test_utils.py
import unittest import heapq import random import threading from garage.threads import utils class UtilsTest(unittest.TestCase): def test_atomic_int(self): i = utils.AtomicInt() self.assertEqual(0, i.get_and_add(0)) self.assertEqual(0, i.get_and_add(1)) self.assertEqual(1, i.get...
test_etcd_util.py
import copy import logging import threading import time import pytest from salt.utils.etcd_util import EtcdClient, EtcdClientV3, get_conn from tests.support.pytest.etcd import * # pylint: disable=wildcard-import,unused-wildcard-import pytest.importorskip("docker") log = logging.getLogger(__name__) pytestmark = [ ...
relay_integration.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...
SAv3.py
#Author: Jaspreet Jhoja #contact:Jaspreetj@ece.ubc.ca import random,copy, statistics, timeit, threading, math from math import * import numpy as np import matplotlib.pyplot as plt import plot as pt import queue as Queue print("SIMULATED ANNEALING BASED PLACER") files = ['cm138a.txt', 'cm150a.txt', 'cm151...
PC_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official PC Miner 2.74 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2021 """ from time import time, sleep, strptime, ctime from hashlib import sha1 from socket import socket from multiprocessing import L...
script.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2020-2021 Alibaba Group Holding Limited. # # 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/LI...
crawler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import calendar import datetime import json import logging import math import re import ssl import threading import urllib.parse import urllib.request from queue import Queue from time import sleep, time import requests from geopy import Point from geopy.distance import g...
test_message.py
# # This file is part of python-tdbus. Python-tdbus is free software # available under the terms of the MIT license. See the file "LICENSE" that # was provided together with this source file for the licensing terms. # # Copyright (c) 2012 the python-tdbus authors. See the file "AUTHORS" for a # complete list. import l...
service.py
# -*- coding: utf-8 -*- def start(api): core = api.core monitor = core.kodi.xbmc.Monitor() class XBMCPlayer(core.kodi.xbmc.Player): def onPlayBackStarted(): pass def onPlayBackEnded(): pass def onPlayBackStopped(): pass player = XBMCPlayer() watched = lambda: None watc...
aiy_trigger.py
# Copyright 2017 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, ...
main.py
import multiprocessing as mp from multiprocessing import Process, Value, Array import time from UI.uimain import showui from opencv.main import cv from motor.main import line_run from config import * from control.maincontrol import CarControlRun, FlagRun from init import init if __name__ == '__main__': # 图像共享队列 ...
thread-python.py
from threading import Thread from time import sleep def timer(t): for i in range(t): print(i) sleep(1) thread1 = Thread(target=timer, args=(7, )) thread1.start() thread2 = Thread(target = timer, args = (8, )) thread2.start()
processor.py
import os import re import subprocess import sys from functools import partial from threading import Thread from gooey.gui import events from gooey.gui.pubsub import pub from gooey.gui.util.casting import safe_float from gooey.gui.util.taskkill import taskkill from gooey.util.functional import unit, bind ...
module.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...
agentFreLib.py
################################################################################ # The Frenetic Project # # frenetic@frenetic-lang.org # #############################################################################...
view_global_position.py
#!/usr/bin/env python3 # Copyright 2020, NTRobotics # # 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...
start.py
#!/usr/bin/env python3 from concurrent.futures import ThreadPoolExecutor, as_completed from contextlib import suppress from itertools import cycle from json import load from logging import basicConfig, getLogger, shutdown from math import log2, trunc from multiprocessing import RawValue from os import urandom as randb...
actor_runner.py
"""Helper class to run an actor on child process.""" import logging import multiprocessing as mp from functools import partial from queue import Queue from typing import Callable class ActorRunner: """Actor runner. To start actors' sampling task you need to not only init Runner object but also call `start()` to k...
server.py
import websockets import asyncio import traceback import jsonpickle import json import inspect from . import utils from http.server import HTTPServer, SimpleHTTPRequestHandler import threading import os import io import cgi from .manager import * class ReqHandler(SimpleHTTPRequestHandler): def log_message(se...
hypothesis_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy import time from functools import partial, reduce from future.utils import viewitems, viewkeys from hypothesis import assume, given, settings import hypothesis.strategies as st im...
transport.py
# -*- coding: utf-8 -*- """ bromelia.transport ~~~~~~~~~~~~~~~~~~ This module defines the TCP transport layer connections that are used by the Diameter application protocol underlying. :copyright: (c) 2020-present Henrique Marques Ribeiro. :license: MIT, see LICENSE for more details. """ ...
analyzer_threading.py
import os import re import sys import queue import datetime import threading import requests compile = re.compile(r'(?P<ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}) .* .* \[(?P<time>.*)\] "(?P<method>\w+) (?P<url>[^\s]*) (?P<version>[\w|/\.\d]*)" (?P<status>\d{3}) (?P<length>\d+) "(?P<referer>[^\s]*)" "(?P<ua>.*)"') event =...
recipes.py
"""Disk Cache Recipes """ import functools import math import os import random import threading import time from .core import ENOVAL, args_to_key, full_name class Averager(object): """Recipe for calculating a running average. Sometimes known as "online statistics," the running average maintains the to...
data_queue.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import os import multiprocessing import threading import time import warnings from queue import Empty from typing import TypeVar, Generic, Sequence, cast from qlib.log import get_module_logger _logger = get_module_logger(__name__) T = TypeVar(...
fred.py
#!/usr/bin/env python3 import threading from concurrent.futures import thread from datetime import time from time import sleep from pyfeld.upnpCommand import UpnpCommand from pyfeld.rfcmd import RfCmd def handle_volume(roomName, value): zoneIndex = RfCmd.get_room_zone_index(roomName) print("Room found in ...
map_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...
__init__.py
import os import zstandard import ujson as json import time import tarfile import codecs from functools import reduce import jsonlines import io from zipfile import ZipFile import gzip from math import ceil import mmap import multiprocessing as mp from pathlib import Path #TODO : Hook FilterData Class for processing an...
protocol.py
from twisted.internet.protocol import Protocol from twisted.internet.protocol import Factory from twisted.internet.endpoints import TCP4ServerEndpoint from twisted.internet import reactor from Crypto.Cipher import AES from Crypto.Hash import SHA256 from threading import Thread from tpm import * import json import base6...
concurrency_06.py
import multiprocessing manager = multiprocessing.Manager() namespace = manager.Namespace() def set_first_variable(): namespace.first = 42 p = multiprocessing.Process(target=set_first_variable) p.start() p.join() def set_second_variable(): namespace.second = dict(value=42) p = multiprocessing.Process(target=s...
generate_forward_simulations_fault_2ms_r.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sat May 4 13:38:15 2019 @author: bmoseley """ import shutil import sys import numpy as np import multiprocessing, queue import time sys.path.insert(0, '../shared_modules/') import io_utils from helper import run_command ### TODO: # # Consider writing ...
standalone_bot.py
import urllib3 import telegram from bs4 import BeautifulSoup import time import requests from lxml import html import argparse from urllib.parse import urlparse import threading CHECKING = "Sorry bookings are not open for Movie you wanted, Don't worry i will be checking and will tell you once it is available." BOOKIN...
base.py
#!/usr/bin/env python import json import threading import actionlib import dynamic_reconfigure.client from geometry_msgs.msg import PoseWithCovarianceStamped import rospy import std_msgs.msg as ros_msg from std_srvs.srv import Empty, EmptyRequest, EmptyResponse from kobuki_msgs.msg import WheelDropEvent from need...
emails.py
# -*- coding: utf-8 -*- """ :author: Grey Li (李辉) :url: http://greyli.com :copyright: © 2018 Grey Li <withlihui@gmail.com> :license: MIT, see LICENSE for more details. """ from threading import Thread from flask import url_for, current_app from flask_mail import Message from bluelog.extensions import ...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir from helpers.network import PartitionManager from helpers.test_tools import exec_query_with_retr...
magma_upserts.py
import copy import threading import time from Cb_constants.CBServer import CbServer import json as Json from magma_basic_crud import BasicCrudTests from remote.remote_util import RemoteMachineShellConnection from sdk_client3 import SDKClient class BasicUpsertTests(BasicCrudTests): def test_update_n_times_new(sel...
journal.py
# Copyright (c) 2015 OpenStack Foundation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless ...
tests.py
""" These are mostly tests taken verbatim from the JSON RPC v2 Spec document: http://groups.google.com/group/json-rpc/web/json-rpc-2-0 JSON-RPC v1 tests will be coming soon, as will tests for library "features" like class translation, etc. """ from jsonrpctcp import connect, config, history from jsonrpctcp.server imp...
conftest.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Pytest configuration.""" import multiprocessing import os import shutil import te...
test.py
import pytest import threading import time from helpers.cluster import ClickHouseCluster cluster = ClickHouseCluster(__file__) node1 = cluster.add_instance('node1', config_dir='configs', main_configs=['configs/logs_config.xml'], with_zookeeper=True, macros={"shard": 0, ...
interface.py
# # -*- coding: utf-8 -*- """Backend Sender - Send to internal process Manage backend sender. """ import json import logging import threading import uuid import six from six.moves import queue import wandb from wandb import data_types from wandb.proto import wandb_internal_pb2 as pb from wandb.proto import wandb_te...
state.py
""" The State Compiler is used to execute states in Salt. A state is unlike an execution module in that instead of just executing a command, it ensures that a certain state is present on the system. The data sent to the state calls is as follows: { 'state': '<state module name>', 'fun': '<state function name...
movie.py
import csv import logging import threading import unicodedata import requests from bs4 import BeautifulSoup class Model(): count = 0 def __init__(self): # 请求头 self.headers = { 'User-Agent': 'Mozilla/5.o (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) ' ...
filesystemio_test.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...
demo.py
#!/usr/bin/env python3 """ simple example of coroutine vs. threading vs. processes timing on old Windows laptop: python demo.py c => 2.3 sec. python demo.py t => 2.5 sec. python demo.py p => 0.9 sec. We didn't break out worker setup time from computation time. In real-world situations, coroutines can be faster ...
miner.py
import time import hashlib import json import requests import base64 from flask import Flask, request from multiprocessing import Process, Pipe import ecdsa from miner_config import MINER_ADDRESS, MINER_NODE_URL, PEER_NODES node = Flask(__name__) class Block: def __init__(self, index, timestamp, data, previous_...
profiler_api_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 applica...
task_queue.py
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin import logging import queue import sys import threading import time from sqlalchemy.exc import ProgrammingError, OperationalError from flexget.task import TaskAbort log ...
bc-analysis.py
# source: https://github.com/joshuamorton/Machine-Learning/blob/master/P3/analysis.py # source: https://github.com/iRapha/CS4641/blob/master/P3/analysis.py import argparse # import multiprocessing as mp from pprint import pprint from StringIO import StringIO import numpy as np import matplotlib matplotlib.use('Agg')...
__init__.py
#!/usr/bin/python3 import os import sys import json import websocket import time import datetime from tkinter import * from PIL import ImageTk, Image from threading import Thread from textwrap3 import wrap from ..database.datalocal import * from ..database.database import * class ChatSocket_C: def _...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
OSC3.py
#!/usr/bin/python """ This module contains an OpenSoundControl implementation (in Pure Python), based (somewhat) on the good old 'SimpleOSC' implementation by Daniel Holth & Clinton McChesney. This implementation is intended to still be 'simple' to the user, but much more complete (with OSCServer & OSCClient classes) ...
px_subscribe.py
import asyncio from .pxgrid import PxgridControl from .config import Config from sync.models import ISEServer import json import sys import time import logging import threading import hashlib from websockets import ConnectionClosed, ConnectionClosedOK from .ws_stomp import WebSocketStomp from signal import SIGINT, SIGT...
rest.py
#!/usr/bin/env python # -*- coding:utf-8 -*- """ IG Markets REST API Library for Python https://labs.ig.com/rest-trading-api-reference Original version by Lewis Barber - 2014 - https://uk.linkedin.com/in/lewisbarber/ Modified by Femto Trader - 2014-2015 - https://github.com/femtotrader/ """ # noqa import json import...
test_app.py
import contextlib import io import sys import time import unittest import unittest.mock import importlib import requests import simple_web_server from threading import Thread class TestApp(unittest.TestCase): @contextlib.contextmanager def _capture_output(self): new_out, new_err = io.StringIO(), io....
app.py
import multiprocessing import threading import sys import logging from multiprocessing.dummy import Pool as ThreadPool import smbcrawler.monkeypatch # noqa monkeypatch impacket scripts from smbcrawler.io import get_targets, output_files_are_writeable, \ DataCollector from smbcrawler.scanner import CrawlerThr...
live_server.py
import logging import multiprocessing import os import signal import socket import time import pytest from ._internal import deprecated class LiveServer: """The helper class used to manage a live server. Handles creation and stopping application in a separate process. :param app: The application to run...
ssl_test.py
#!/usr/bin/env python """Tests for API client + HTTPS server integration.""" from __future__ import absolute_import from __future__ import unicode_literals import datetime import io import os import socket import threading from cryptography import x509 from cryptography.hazmat import backends from cryptography.hazma...
soal1.py
import random import time import multiprocessing def SoalA(): for i in range(10,20): if i%2 == 1: print("==Proses 1=>-----",i) time.sleep(random.randrange(1,2)) def SoalB(): for i in range(2,12): for o in range(2,i): if i%o == 0: ...
server.py
import socket import time from threading import Thread users = [] len_сhar = 8 # количество байт для кодирования количества символов в строке len_name = 10 # максимальный размер логина len_sec = 16 # количество байт для кодирования секунд ip = '127.0.0.1' port = 7777 def creation_sock(): server_socket = sock...
botany.py
#!/usr/bin/python2 from __future__ import division import time import pickle import json import os import random import getpass import threading import errno import uuid import sqlite3 from menu_screen import * # TODO: # - Switch from personal data file to table in DB class Plant(object): # This is your plant! ...
btn_client.py
#!/usr/bin/env python import socket import struct import threading from sololink import btn_msg HOST = "10.1.1.1" PORT = 5016 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) print "connecting to", HOST, ":", PORT, "...", s.connect((HOST, PORT)) print "OK" def in_thread(s): while True: msg = btn_ms...
trezor.py
import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path from electrum import constants...
SimConnect.py
from ctypes import * from ctypes.wintypes import * import logging import time from .Enum import * from .Constants import * from .Attributes import * import os import threading _library_path = os.path.abspath(__file__).replace(".py", ".dll") LOGGER = logging.getLogger(__name__) def millis(): return int(round(time.t...
test_manager_options.py
import pytest import shutil import os import glob import subprocess import time as ttime import multiprocessing from bluesky.callbacks.zmq import RemoteDispatcher from bluesky_queueserver.manager.profile_ops import gen_list_of_plans_and_devices from bluesky_queueserver.manager.comms import zmq_single_request from ._c...
processing.py
# vim: set et nosi ai ts=2 sts=2 sw=2: # coding: utf-8 from __future__ import absolute_import, print_function, unicode_literals import argparse import io import sys import threading from schwa.dr import Reader, Writer from six.moves import xrange try: import zmq except ImportError: zmq = None def stream_corouti...
client_agent.py
#!/usr/bin/env python3 import matplotlib import socket import os import ast import struct import random as r import time import datetime as dt import subprocess as sp import paho.mqtt.client as mqtt import matplotlib.pyplot as plt from drawnow import * import smtplib import config import pickle import algorithms.data_h...
build.py
# Copyright 2014 The Oppia 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 ...
test_general.py
""" Collection of tests for unified general functions """ # global import os import math import time import einops import pytest import threading import numpy as np from numbers import Number from collections.abc import Sequence import torch.multiprocessing as multiprocessing # local import ivy import ivy.functional....
GameHelper.py
# -*- coding: utf-8 -*- # Created by: Vincentzyx import win32gui import win32ui import win32api from ctypes import windll from PIL import Image import cv2 import pyautogui import matplotlib.pyplot as plt import numpy as np import os import time import threading from win32con import WM_LBUTTONDOWN, MK_LBUTTON, WM_LBUTTO...
feeder.py
import os import threading import time import traceback import numpy as np import tensorflow as tf from infolog import log from sklearn.model_selection import train_test_split from tacotron.utils.text import text_to_sequence _batches_per_group = 32 class Feeder: """ Feeds batches of data into queue ...
maskdetection.py
import os import threading import argparse import filetype from flask import Flask, Response, make_response, send_file from flask import flash, request, redirect, jsonify from flask import render_template from models.realStream import RealStream from models.facenet import FaceNet from models.util import utils UPLOAD...
schema.py
""" Schemas ======= Schemas defines the structure of the fields of your table. The schema handles fields validations, and ensure index unicity. There are 5 main concepts around the schemas: **Indexes** An index defines which key (or set of keys) should be unique within your table. The schema will perform checks on t...
server.py
from socket import * from threading import * import pickle import DB clientes = {} direcciones = {} clientes_on = [] DB.CREATE_DB() DB.CREATE_TABLES() def configuracion(): global servidor, mensaje servidor = socket() servidor.bind(("", 9999)) servidor.listen(10) print("Esperando conexiones...") ...
session_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test.py
import json import os.path as p import random import socket import subprocess import threading import time import logging import io import string import avro.schema import avro.io import avro.datafile from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient from confluent_kafka.avro.se...
__init__.py
# We import importlib *ASAP* in order to test #15386 import importlib import importlib.util from importlib._bootstrap_external import _get_sourcefile import builtins import marshal import os import py_compile import random import shutil import subprocess import stat import sys import threading import time...
test_pooled_pg.py
"""Test the PooledPg module. Note: We don't test performance here, so the test does not predicate whether PooledPg actually will help in improving performance or not. We also assume that the underlying SteadyPg connections are tested. Copyright and credit info: * This test was contributed by Christoph Zwerschke """ ...
env_stock_papertrading_erl.py
import datetime import threading import time import alpaca_trade_api as tradeapi import gym import numpy as np import pandas as pd import torch from finrl_meta.data_processors.alpaca import Alpaca class AlpacaPaperTrading_erl(): def __init__(self, ticker_list, time_interval, agent, cwd, net_dim,...
whatsapp_web.py
import os import io import re import base64 import tkinter import urllib.parse from PIL import ImageTk, Image from threading import Thread, Event from selenium import webdriver from selenium.webdriver import ChromeOptions from selenium.common.exceptions import NoSuchElementException USER_AGENT = 'Mozilla/5.0 (Window...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import wampum from wampum.bitcoin import TYPE_ADDRESS from wampum import WalletStorage, Wallet from wampum_gui.kivy.i18n import _ from wampum.paymentrequest import InvoiceStore from wampum.util impo...
new1.py
import numpy as np import cv2 import time import threading import wave from pyaudio import PyAudio, paInt16 from automatedtest.common.tools.logger.logger import logger from automatedtest.common.tools.logger.utils import Utils class BaseCamera(object): def __init__(self): self._utils = Utils() sel...
test_pooled_pg.py
"""Test the PooledPg module. Note: We don't test performance here, so the test does not predicate whether PooledPg actually will help in improving performance or not. We also assume that the underlying SteadyPg connections are tested. Copyright and credit info: * This test was contributed by Christoph Zwerschke """ ...
main.py
import time import functools import threading def async(func): @functools.wraps(func) def wrapper(*args, **kwargs): my_thread = threading.Thread(target=func, args=args, kwargs=kwargs) my_thread.start() return wrapper @async def foo(x,y): c = 0 while c < 5: c = c + 1 p...
Northcliff_Doorbell_Monitor_Gen.py
#!/usr/bin/env python3 # Northcliff Doorbell Monitor Version 2.6 GEN # Requires Home Manager >= V8.5 import RPi.GPIO as GPIO import time from datetime import datetime import subprocess import http.client import urllib import mmap import requests from threading import Thread import paho.mqtt.client as mqtt import struct...
test_commits.py
import threading from ..base import BaseTest from seafobj import commit_mgr from seafobj.commits import SeafCommit Success = True class TestSeafCommitManager(BaseTest): def setUp(self): self.repo_id = self.TEST_CEPH_REPO_ID self.repo_id_2 = self.TEST_CEPH_REPO_ID_2 self.head_commit = se...
_app.py
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, ...
alert_system.py
import requests import logging import datetime from threading import Thread import uuid import cv2 import smtplib from os.path import basename from email.mime.application import MIMEApplication from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from email.utils import COMMASPACE, forma...
relay_integration.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...
host.py
import abc import os import pathlib import asyncssh import asyncio import getpass import stat import time import logging import posixpath from io import BytesIO from datetime import datetime from aiofile import async_open from queue import Queue, Empty from threading import Thread from fnmatch import fnmatchcase log = ...