source
stringlengths
3
86
python
stringlengths
75
1.04M
__main__.py
#!/usr/bin/env python3 from importlib import import_module from threading import Thread import subprocess import logging import time import sys from .iproute import get_peer_addr from .pingc import PingHost from .pingd import PingDaemon from .bird import Bird def main(): if len(sys.argv) != 2: print(f"Us...
multiprocessing.py
import threading import time import redis import pickle class RedisHandler: def __init__(self, hostname, namespace="gym_rh_"): self._redis = redis.Redis(hostname) self._namespace = namespace self._handlers = [] def save(self, name, obj): pickled = pickle.dumps(obj) ...
main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # 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 # # Un...
test_http.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 use ...
threads.py
from time import perf_counter from typing import Tuple, NamedTuple from threading import Thread from queue import SimpleQueue import sys import os from primes import is_prime, NUMBERS class Result(NamedTuple): flag: bool elapsed: float JobQueue = SimpleQueue[int] ResultQueue = SimpleQueue[Tuple[int, Result]]...
dbestclient.py
#!/usr/bin/env python # coding=utf-8 from __future__ import print_function, division import os import sys sys.path.append(os.path.dirname(os.path.dirname(__file__))) from dbest import logs from dbest.tools import DataSource from dbest import tools from dbest.qreg import CRegression from dbest.query_engine import Query...
statMeter.pyw
import os import sys import time import psutil import tkinter import threading import pyqtgraph from PyQt5 import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * #---------------------------------------- class Worker(QObject): finished = pyqtSignal() progress = pyqtSignal(int) def run(self): ...
client.py
import socket import threading import time import os from utils import * class Client: def __init__(self, ip, file, threads): print("Client is running.") self.host = ip self.path = file self.filename = self.path.split("/")[-1] self.n_threads = threads self.basi...
test_graphics.py
''' Graphics tests ============== Testing the simple vertex instructions ''' import sys import pytest from threading import Thread from kivy.tests.common import GraphicUnitTest, requires_graphics class VertexInstructionTest(GraphicUnitTest): def test_circle(self): from kivy.uix.widget import Widget ...
client.py
import tkinter as tk import tkinter.font as tkFont from components.widgets import ScrollFrame, TagButton, TagMessage from components.utils import SaveThread import requests import time import threading class Application(tk.Frame): def __init__(self, *args, **kwargs): tk.Frame.__init__(self, *...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from pyln.client import RpcError, Millisatoshi from shutil import copyfile from pyln.testing.utils import SLOW_MACHINE from utils import ( only_one, sync_blockheight, wait_for, TIMEOUT, account_balance, first_channel_id, closing_fee, TEST_NETWORK...
qmcflac.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019-06-25 20:00 # @Author : alexknight # @Site : # @File : qmcflac.py # @Desc : import argparse import math import os import shutil import multiprocessing root_path = os.path.abspath(os.path.dirname(__file__)) qmc2flac_tool = os.path.join(root_path...
test_telescope_state.py
################################################################################ # Copyright (c) 2015-2019, National Research Foundation (Square Kilometre Array) # # Licensed under the BSD 3-Clause License (the "License"); you may not use # this file except in compliance with the License. You may obtain a copy # of the...
test_draft.py
# -*- coding: utf-8 -*- """ Created on Wed Jan 13 10:02:25 2021 @author: daham.kim 모듈화 끝나는대 graph.py 파일로 소스코드 이전할 계획 command 부분은 main.py 파일로 이전할 계획 """ #temp for quick test import pandas as pd import numpy as np import graph as gp import data_loading as load from test_main_copy import df_test_result """ graph 모둘에 있던...
train_eqa.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import h5py import time import argparse import numpy as np import os, sys, json from tqdm import tqdm import tor...
archspam.py
# coding=utf-8 #!/usr/bin/env python3 from libs.check_modules import check_modules from sys import exit from os import _exit check_modules() from os import path from libs.logo import print_logo from libs.utils import print_success from libs.utils import print_error from libs.utils import ask_question ...
chat.py
#!/usr/bin/env python3 try: from zyre_pyzmq import Zyre as Pyre # type: ignore except ModuleNotFoundError: print("using Python native module") from pyre import Pyre import argparse import asyncio import dbm import json import logging import random import sys import threading import uuid from collections...
rasp.py
from sqlite import Sqlite from matplot import TuplePlot, RealPlot from datetime import datetime from gtts import gTTS import RPi.GPIO as GPIO import time import threading import Adafruit_MCP3008 import os class Buzzer: def __init__(self, OUT): self.__out = OUT GPIO.setmode(GPIO.BCM) GP...
test_connect_attempts.py
''' Test Origin Server Connect Attempts ''' # 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 Lice...
demon.py
import threading import os import requests from numpy import * from time import sleep import console class demon(object): def __init__(self): self.miner = console.data_miner() self.miner.start() self.updater = threading.Thread(target=self.updater).start() self.quite = False ...
Lending.py
# coding=utf-8 from decimal import Decimal import sched import time import threading Config = None api = None log = None Data = None MaxToLend = None Analysis = None SATOSHI = Decimal(10) ** -8 sleep_time_active = 0 sleep_time_inactive = 0 sleep_time = 0 min_daily_rate = 0 max_daily_rate = 0 spread_lend = 0 gap_botto...
fake_streaming_service.py
#!/usr/bin/env python from __future__ import absolute_import import base64 from functools import wraps import json import logging import os import re import random import signal import ssl import string import sys import threading try: from http.server import HTTPServer, SimpleHTTPRequestHandler except ImportErro...
rpc.py
# Copyright 2017 Carnegie Mellon University. See LICENSE.md file for terms. """ This file handles RPC communication between this usersim instance and a server. This offers more fine-grained control over the usersim than any of the other communication options. """ import inspect import platform import random import thr...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.test_support import sys, cStringIO, os import struct class SysModuleTest(unittest.TestCase): def test_original_displayhook(self): import __builtin__ savestdout = sys.stdout out = cStringIO.StringIO() sys.stdout = out ...
MptaReaderThread.py
""" :copyright: (c)Copyright 2013, Intel Corporation All Rights Reserved. The source code contained or described here in and all documents related to the source code ("Material") are owned by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or its suppliers and lice...
ftp_brute.py
#!/usr/bin/env python2 import argparse, ftplib, sys, threading class ftpbruter(): def __init__(s): s.ips = [] s.users = [] s.passwds = [] s.getargs() print("[.] Hosts: %d (threads)\n[.] Users: %d * Passwords: %d * Timeout: %d\n[.] Max_runtime: %d seconds\n" % (len(s.ips), ...
transfer.py
#!/usr/bin/env python """ Downloads files to temp locations. This script is invoked by the Transfer Manager (galaxy.jobs.transfer_manager) and should not normally be invoked by hand. """ import os, sys, optparse, ConfigParser, socket, SocketServer, threading, logging, random, urllib2, tempfile, time galaxy_root = os....
commands.py
import cmd import requests import threading import simplejson import ntpath import time import subprocess import traceback from re import match from optparse import OptionParser from output import * ##################### # Exception classes # ##################### class HttpException(Exception): pass class Qui...
dxl_tracker.py
# Copyright (c) 2018, The SenseAct Authors. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import sys import time import copy import numpy as np import pickle as pkl import baselines.common.tf_util as U from bas...
process_queue_3.py
import random import sys import time from multiprocessing import Process, Queue random.seed() #crea una lista con valores entre 0 y 10 (enteros) #devuelve la lista de enteros def genList (size): randomList = [] for i in range(size): randomList.append(random.randint(0,10)) return randomList #calcul...
test__threading_vs_settrace.py
from __future__ import print_function import sys import subprocess import unittest from gevent.thread import allocate_lock script = """ from gevent import monkey monkey.patch_all() import sys, os, threading, time # A deadlock-killer, to prevent the # testsuite to hang forever def killer(): time.sleep(0.1) sy...
animation.py
from threading import Thread import time import pygame import pygame_widgets from pygame_widgets.exceptions import InvalidParameter, InvalidParameterType class AnimationBase: def __init__(self, widget, timeout, allowMultiple=False, **kwargs): """Base for animations :param widget: The widget that...
test_app.py
import json import random import threading import tornado.websocket import tornado.gen from tornado.testing import AsyncHTTPTestCase from tornado.httpclient import HTTPError from tornado.options import options from tests.sshserver import run_ssh_server, banner, Server from tests.utils import encode_multipart_formdata,...
multiple_threads_logging.py
""" Logging from multiple threads Logging from multiple threads requires no special effort. The following example shows logging from the main (initial) thread and another thread: https://docs.python.org/3/howto/logging-cookbook.html """ import logging import threading import time def worker(arg): while not arg...
test_auth.py
#------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. #-------------------------------------------------------------------------- import pytes...
pixiv.py
import json import os import requests from bs4 import BeautifulSoup as bs import threading import datetime class Pixiv: def __init__(self, mode, page, r18, cookie): assert mode in ['1', '2', '3'] assert r18 in ['y', 'n'] self.headers = { 'User-Agent': 'Mozilla/5....
trpc_comm_manager.py
import csv import decimal import os import threading import time from typing import List import torch import torch.distributed as dist import torch.distributed.rpc as rpc import torch.multiprocessing as mp from torch.distributed import rpc from .trpc_server import TRPCCOMMServicer from ..base_com_manager import BaseC...
test_core.py
""" tests.test_core ~~~~~~~~~~~~~~~~~ Provides tests to verify that Home Assistant core works. """ # pylint: disable=protected-access,too-many-public-methods # pylint: disable=too-few-public-methods import os import unittest from unittest.mock import patch import time import threading from datetime import datetime, ti...
test_remote.py
import threading import time import unittest from jina.logging import get_logger from jina.main.parser import set_gateway_parser, set_pea_parser from jina.peapods.pod import GatewayPod from jina.peapods.remote import PeaSpawnHelper from tests import JinaTestCase class MyTestCase(JinaTestCase): def test_logging_t...
router_client.py
import threading import time from signal import SIGINT, SIGTERM, signal from agents import Agent, Message class Router(Agent): def setup(self, name=None, address=None): self.create_router(address) class Client1(Agent): def setup(self, name=None, address=None): self.counter = 0 self....
webhook.py
""" This module implements a modular input consisting of a web-server that handles incoming Webhooks. """ try: # Python 2 from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer from urlparse import parse_qs except: # Python 3 from http.server import BaseHTTPRequestHandler, HTTPServer fr...
fenetre_principale.py
from tkinter import Label, Text, Menu, Button, Tk from functools import partial from threading import Thread from datetime import datetime import os from lecteur import lire_dictee from dictee import Dictee from parametres_lecture import ParametresLecture, IParametresLecture class FenetrePrincipale(Tk, IParametresLect...
manual_ctrl.py
#!/usr/bin/env python3 # set up wheel import os, struct, array from fcntl import ioctl # Iterate over the joystick devices. print('Available devices:') for fn in os.listdir('/dev/input'): if fn.startswith('js'): print(' /dev/input/%s' % (fn)) # We'll store the states here. axis_states = {} button_states ...
complex_action_server.py
#! /usr/bin/env python # Copyright (c) 2009, Willow Garage, Inc. # 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 # no...
tests.py
from unittest import TestCase import os import tempfile import pickle import itertools import numpy as np from scipy import sparse import neoml import threading class MultithreadedTestCase(TestCase): def _thread_function(self, target, args): print(f"python thread {threading.get_ident()} started") ...
sanitylib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
connection.py
# Copyright (c) 2017 David Preece - davep@polymath.tech, All rights reserved. # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDIN...
fileReader.py
import fnmatch import os import random import re import threading import json import tensorflow as tf from netCDF4 import Dataset import numpy as np from sklearn.metrics import mean_squared_error from scipy.interpolate import splev, splrep """ Data v7: statistical values ST: min 100.0000000000 max 333.1499946801 mea...
__init__.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import datetime import json import logging import os import random import re import sys import time import Queue import threading from geopy.geocoders import GoogleV3 from pgoapi import PGoApi from pgoapi.utilities import f2i, get_cell_ids import cell_w...
CrabManager.py
from __future__ import print_function import os import sys import multiprocessing import logging import httplib import datetime from metis.Utils import do_cmd, get_proxy_file, setup_logger, cached try: pass from CRABAPI.RawCommand import crabCommand from CRABClient.UserUtilities import setConsoleLogLevel...
interactive.py
''' Interactive launcher ==================== .. versionadded:: 1.3.0 The :class:`InteractiveLauncher` provides a user-friendly python shell interface to an :class:`App` so that it can be prototyped and debugged interactively. .. note:: The Kivy API intends for some functions to only be run once or before the ...
HomeScreen.py
import calendar from itertools import izip_longest import json from kivy.clock import Clock from kivy.uix.gridlayout import GridLayout from kivy.uix.label import Label from kivy.uix.spinner import Spinner import os import time from graph import Graph, MeshLinePlot, MeshStemPlot, SmoothLinePlot from kivy.uix.boxlayout i...
main.py
from keyloggerskill import keylogger import time import threading from keystroke import main """ import shutil import os name = os.getlogin() try: target = "C:\\Users\\{0}\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup".format(name) shutil.copy('main.exe', target) ...
new_crypto_checker.py
#!/usr/bin/env python3.6 # ============================================================================= # IMPORTS # ============================================================================= from threading import Thread import os import sys import configparser import requests import time import logging # =======...
study_serve.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright 2018 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Standalone local webserver to acquire fingerprints for user studies.""" from __future__ import print_fu...
azurecli.py
import json import os import signal import subprocess import sys from io import StringIO from threading import Thread, Timer from azure.cli.core import get_default_cli from fstrings import f from six.moves.queue import Empty, Queue from . import telemetry from .compat import PY2 if PY2: from .compat import FileN...
dx_replication.py
#!/usr/bin/env python # Corey Brune - Feb 2017 #Description: # This script will setup replication between two hosts. # #Requirements #pip install docopt delphixpy #The below doc follows the POSIX compliant standards and allows us to use #this doc to also define our arguments for the script. """Description Usage: dx_...
sensor.py
#!/usr/bin/env python """ Copyright (c) 2014-2018 Miroslav Stampar (@stamparm) See the file 'LICENSE' for copying permission """ from __future__ import print_function # Requires: Python >= 2.6 import sys sys.dont_write_bytecode = True import core.versioncheck import inspect import math import mmap import optpars...
extractor.py
# Copyright (c) 2020 Fellow Consulting AG # # 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, modify, merge, publish...
cpu_bound_multi.py
""" cpu bound single demo """ from collections.abc import Generator import itertools import time import multiprocessing as mp def fibonacci() -> Generator[int, None, None]: """ generate an infinite fibonacci sequence """ num_1 = 0 num_2 = 1 yield num_1 yield num_2 while True: next_...
main.py
from objects import DatapointCollection import multiprocessing as mp import time def receive_collection(flag: mp.Event): while True: flag.wait() datapoint_collection = None print(f'Received collection {datapoint_collection.checksum()}') flag.clear() time.sleep(1) def spaw...
user.py
from flask_restful import Resource, reqparse from flask_jwt_extended import jwt_required, get_jwt_identity, create_refresh_token, create_access_token from datetime import timedelta from threading import Thread from flask_mail import Message from cryptography import fernet from . import app, mail, api from conf...
websocketServer.py
import asyncio import websockets import threading import json import protocol from session import Session import UserDatabase contentLocation = "server/website/" class websocketServer: '''An instance of websocket server that will create and run in a seprate thread. Args: port (int): port to listen to...
test_util.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...
nicolive.py
import json import logging import re from streamlink.utils import websocket import threading import time from streamlink.plugin import Plugin, PluginArguments, PluginArgument from streamlink.plugin.api import useragents from streamlink.stream import HLSStream from streamlink.compat import urlparse, unquote_plus _log...
pingwidget.py
# -*- coding: utf-8 -*- #Coded By Ashkan Rafiee https://github.com/AshkanRafiee/PingWidget/ ################Libraries################ import PySimpleGUI as sg import webbrowser import time import threading from pythonping import ping ################Libraries################ status = None mypings1 = [] mypings2 = [] ...
local_assembly.py
#!/usr/bin/env python import os import sys import time import multiprocessing try: from scripts import my_utils except ImportError: import my_utils tab = '\t' endl = '\n' arg = sys.argv[1:] usage = 'python ' + __file__ + ' ' + '<input_bam_file> <out_dir> <out_del_call_file> <n_threads> <ref_fasta> <fermiki...
rst.py
"""Read ANSYS binary result files (*.rst) Used: .../ansys/customize/include/fdresu.inc """ from collections.abc import Iterable import time import warnings from threading import Thread from functools import wraps import vtk import numpy as np import pyvista as pv from tqdm import tqdm from ansys.mapdl.reader import ...
server_main.py
from server_config import * from server_handlers import * from server_prepacket import * battle_update_thread = BattleUpdateLoop() while True: client, addr = s_tcp.accept() print('new connection') client_handler = threading.Thread(target=handle_client_listener, args=(client, addr,)) client_handler.st...
trezor.py
import threading from binascii import hexlify, unhexlify from electrum.util import bfh, bh2u, versiontuple from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT) from electrum import constants from electrum.i18n import _ from electrum.plugins i...
rohon_gateway.py
""" """ import sys import json import traceback from datetime import datetime, timedelta from copy import copy,deepcopy from .vnctpmd import MdApi from .vnctptd import TdApi from .ctp_constant import ( THOST_FTDC_OAS_Submitted, THOST_FTDC_OAS_Accepted, THOST_FTDC_OAS_Rejected, THOST_FTDC_OST_NoTradeQue...
fsspec_utils.py
# # Copyright (c) 2021, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed ...
helpers.py
# -*- coding: utf-8 -*- ''' :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers ''' # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
start.py
import copyreg from datetime import datetime from logging import getLogger, basicConfig, INFO from socket import socket from threading import Thread, Lock from typing import Dict, Optional, Tuple, List from drivebuildclient import accept_at_server, create_server, create_client, process_requests from drivebuildclient.a...
client.py
""" sentry.nodestore.riak.client ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2015 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import functools import six import sys import socket from base64 import b64encode from rand...
test_local_task_job.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
machinerry.py
import cherrypy import threading import datetime _utcnow = datetime.datetime.utcnow # Simple namespace to store run-specific information. class Run(dict): def __init__(self): self.time_start = None self.time_end = None self.time_next = None self.failed = False self.pau...
t1.py
# welcome to threading from threading import * def cube(x): print("Cube of x is {0}".format(x**3)) def square(x): print("Square of x is {0} ".format(x*x)) while True: x=input() t1=Thread(target=cube,args=(x,)) t2=Thread(target=square,args=(x,)) t1.start() t2.start()
cache.py
import os import weakref import socket import threading import multiprocessing import logging import cPickle import time import zmq import shareddict from env import env logger = logging.getLogger("cache") mmapCache = shareddict.SharedDicts(1024) class Cache: map = {} nextKeySpaceId = 0 @classmethod ...
ihda_system.py
# -*- coding: utf-8 -*- # author: seongcheol jeon # email: saelly55@gmail.com # create date: 2020.04.27 22:57:06 # modified date: # description: import os import shlex import logging from imp import reload from shutil import rmtree from site import addsitedir from urllib2 import urlopen,...
player.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 对mplayer及其他播放器(TODO)的控制 player = MPlayer() 方法: player.start(url) player.pause() player.quit() player.loop() player.set_volume(50) player.time_pos player.is_alive queue自定义get_song方法, 从中取出url, 进行播放(暂时, 以后可以抽象) player.start_queue(que...
test_file_reader.py
import multiprocessing import os import tempfile import unittest import zipfile from vision_datasets.common.util import FileReader, MultiProcessZipFile def open_zipfile(zip_file, filename, queue): queue.put(zip_file.open(filename).read()) class TestMultiProcessZipFile(unittest.TestCase): def test_single_pr...
__main__.py
from threading import Thread try: from systems.clients import CanbusNet, PiNet except ModuleNotFoundError: RED = '\033[91m' BOLD = '\033[1m' END = '\033[0m' raise SystemExit(f"{RED}{BOLD}try `python -m systems` instead {END}") from systems.core import BrowserProxy, ControllerWorker, CoreServer # ...
processes.py
import time import atexit import heapq from subprocess import Popen from threading import Thread from plumbum.lib import IS_WIN32, six try: from queue import Queue, Empty as QueueEmpty except ImportError: from Queue import Queue, Empty as QueueEmpty # type: ignore try: from io import StringIO except Impo...
dbt_integration_test.py
# # MIT License # # Copyright (c) 2020 Airbyte # # 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, modify, merge, pu...
ChromePool.py
from selenium.webdriver import Chrome, ChromeOptions from selenium.webdriver.support.select import Select import time import threading class chromepool(): def __init__(self, maxsize=5, minsize=1, timeout=10, options=ChromeOptions(),monitor=False): self.pool = [] self.monitor_start = monitor ...
__init__.py
# # Copyright (C) 2018-2019 Nippon Telegraph and Telephone Corporation. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. from grpclib.client import Channel from taish import taish_pb2 from taish import taish_grpc import asyncio from ...
socket_publisher_backup.py
import socket import struct import selectors import sys import threading as thr from threading import Thread import multiprocessing import multiprocessing as mp import queue import pickle import types import time class Timer: def __init__(self, duration): self._duration = duration self._start...
garageURLCmdProcessor.py
import logging import logging.handlers import logging.config import sys, traceback import cherrypy # try: from cheroot.wsgi import Server as WSGIServer # except ImportError: #from cherrypy.wsgiserver import CherryPyWSGIServer as WSGIServer from GarageBackend.Sensor import Sensor from GarageBackend.Constants import * f...
store.py
from os import unlink, path, mkdir import json import uuid as uuid_builder from threading import Lock from copy import deepcopy import logging import time import threading # Is there an existing library to ensure some data store (JSON etc) is in sync with CRUD methods? # Open a github issue if you know something :) ...
scripts.py
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import print_function import os import sys import traceback import logging import multiprocessing import threading import time from random import randint # Import salt libs impo...
helper.py
import functools import json import multiprocessing import os import socket import subprocess from datetime import datetime from typing import List, Tuple import base58 import dateutil.tz from plenum.bls.bls_crypto_factory import create_default_bls_crypto_factory from plenum.test.node_catchup.helper import waitNodeDat...
Server.py
#!/usr/bin/python3 -u # -*- coding: utf-8 -*- import os import sys import json import time import threading import urllib.request import time import http.server import socketserver import ssl import copy import BlockChain import Block import Transaction import Key import Mine import Node import Network from Common i...
main.py
import numpy as np import enum import time from threading import Thread import matplotlib.pyplot as plt class MessageStatus(enum.Enum): OK = enum.auto() LOST = enum.auto() class Message: number = -1 real_number = -1 data = "" status = MessageStatus.OK def __init__(self): pass ...
gnupg.py
""" A wrapper for the 'gpg' command:: Portions of this module are derived from A.M. Kuchling's well-designed GPG.py, using Richard Jones' updated version 1.3, which can be found in the pycrypto CVS repository on Sourceforge: http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py This module is *not* forward-...
python_instance.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 # "...
controller2.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 1 18:56:19 2021 @author: heiko """ import asyncio import websockets import numpy as np; import COERbuoy; import threading; import json; import tempfile; import os; latch=0; def threadfkt(path): os.chdir(path) print("start server") #CO...
test_post.py
import multiprocessing import time import pytest from docarray import DocumentArray from docarray.helper import random_port @pytest.mark.parametrize( 'conn_config', [ (dict(protocol='grpc'), 'grpc://127.0.0.1:$port/'), (dict(protocol='grpc'), 'grpc://127.0.0.1:$port'), (dict(protocol...
pydevd.py
''' Entry point module (keep at root): This module starts the debugger. ''' import sys # @NoMove if sys.version_info[:2] < (2, 6): raise RuntimeError('The PyDev.Debugger requires Python 2.6 onwards to be run. If you need to use an older Python version, use an older version of the debugger.') import atexit from c...
sqs.py
import json import logging import threading from multiprocessing import Queue import boto3 from arnparse import arnparse from .model import EventSourceHook logging.getLogger('boto3').setLevel(logging.CRITICAL) logging.getLogger('botocore').setLevel(logging.CRITICAL) class SQSEventSource(EventSourceHook): def _...