source
stringlengths
3
86
python
stringlengths
75
1.04M
.clean_dec.py
#!/usr/bin/python2 # coding=utf-8 import os,sys,time,mechanize,itertools,datetime,random,hashlib,re,threading,json,getpass,urllib,cookielib from multiprocessing.pool import ThreadPool #### WARNA RANDOM #### P = '\033[1;97m' # putih M = '\033[1;91m' # merah H = '\033[1;92m' # hijau K = '\033[1;93m' # kunin...
netscan.py
# -*- coding: utf-8 -*- #!/usr/bin/env python3 # Authors: # Julio Costella Vicenzi # Yuri Alves # Lucas Pittella import os # cmd line programs import time # for sleep() import ipaddress import requests import subprocess import multiprocessing from datetime import datetime # for scan date import argparse imp...
scheduler_cache.py
import logging import threading from copy import deepcopy from apscheduler.schedulers.blocking import BlockingScheduler from readerwriterlock import rwlock from friend_rating_server.util.config import get_config class SchedulerCache(object): def __init__(self, func, expire=7200): self.scheduler = Blocking...
sstvProxy.py
#!/usr/bin/env python3 ### ###Copyright (c) 2016 by Joel Kaaberg and contributors. See AUTHORS ###for more details. ### ###Some rights reserved. ### ###Redistribution and use in source and binary forms of the software as well ###as documentation, with or without modification, are permitted provided ###that the follow...
_asyncio.py
import asyncio import concurrent.futures import math import socket import sys from collections import OrderedDict, deque from concurrent.futures import Future from dataclasses import dataclass from functools import wraps from inspect import isgenerator from socket import AddressFamily, SocketKind, SocketType from threa...
IntroStep.py
from threading import Thread from IPython.core.display import clear_output, display from ipywidgets import widgets from SmartAnno.utils.ConfigReader import ConfigReader from SmartAnno.gui.BranchingWidgets import BranchingStep from SmartAnno.models.GloveModel import GloveModel class IntroStep(BranchingStep): def...
basic.py
import threading as th lock=th.Lock() x=0 def a(): global x for i in range(10000): x-=2 print(x) def b(): global x for i in range(10000): x+=2 print(x) def c(): global x for i in range(10000): x-=3 print(x) def d(): global x for i in range(10000): ...
test_server.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import json import os import signal import uuid from multiprocessing import Process import pytest from builtins import str from freezegun import ...
conftest.py
import builtins from multiprocessing import Process import sys import time import pytest import torch import syft from syft import TorchHook from syft.workers import WebsocketClientWorker from syft.workers import WebsocketServerWorker def _start_proc(participant, dataset: str = None, **kwargs): # pragma: no cover ...
sdk_worker.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...
censor.py
import tkinter as tk from tkinter import * from PIL import Image from PIL import ImageTk from datetime import date import shortuuid import multiprocessing import time ### This Function is used to detect censor words ### def censor(listOfWords): listOfWords=listOfWords.split(",") ## This list contains dataset of cu...
test.py
import argparse import json import os from pathlib import Path from threading import Thread import numpy as np import torch import yaml from tqdm import tqdm from models.experimental import attempt_load from utils.datasets import create_dataloader from utils.general import coco80_to_coco91_class, check_dataset, check...
null_preview.py
import picamera2.picamera2 import threading class NullPreview: def thread_func(self, picam2): import selectors sel = selectors.DefaultSelector() sel.register(picam2.camera_manager.efd, selectors.EVENT_READ, self.handle_request) self.event.set() while self.running: ...
camera_worker.py
""" This is (for instance) a Raspberry Pi only worker! The libcamera project (in development), aims to offer an open source stack for cameras for Linux, ChromeOS and Android. It will be able to detect and manage all of the exposed camera on the system. Connected via USB or CSI (Rasperry pi camera). libcamera develope...
run_manager.py
import logging import datetime import os import re from collections import namedtuple from threading import Lock, Thread, Event, current_thread, _MainThread import sys import functools import traceback import signal import abc from contextlib import contextmanager from importlib import import_module from inspect import...
test_serialize.py
import contextlib import gc import pickle import runpy import subprocess import sys import unittest from multiprocessing import get_context import numba from numba.core.errors import TypingError from numba.tests.support import TestCase from numba.core.target_extension import resolve_dispatcher_from_str from numba.clou...
bintotxt.py
import os import numpy as np import sys from multiprocessing import Process import time import subprocess def bin2float(file,dtype): if file.endswith(".bin"): if dtype == "fp32": data = np.fromfile(file,dtype='float32') elif dtype == "fp16": data = np.fromfile(file,dtype='fl...
childserver.py
import socket from http.server import * import sys import urllib import threading import time routingsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) routingsocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1); routingsocket.bind(('', 1080)) routingsocket.listen(1000000000) number_of_servers = 3 co...
main.py
from kivy.config import Config MAX_SIZE = (500, 1050) Config.set('graphics', 'width', MAX_SIZE[0]) Config.set('graphics', 'height', MAX_SIZE[1]) from kivy.core.window import Window import kivy import Global import client import time import threading import time from kivy import * from kivy.app import App ...
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...
tello_control_ui.py
from PIL import Image from PIL import ImageTk import Tkinter as tki from Tkinter import Toplevel, Scale import threading import datetime import cv2 import os import time import platform import tello_QR_code import tello_num class TelloUI: """Wrapper class to enable the GUI.""" def __init__(self, tello, outpu...
ctf_spammaster.py
""" Released under the MIT-license: Copyright (c) 2009,2010 Earl Marcus 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, ...
rfid_auth.py
#!/usr/bin/env python # -*- coding: utf8 -*- import RPi.GPIO as GPIO import MFRC522 import signal import time import threading from multiprocessing import Process # Capture SIGINT for cleanup when the script is aborted def end_read(signal,frame): global continue_reading print "Ctrl+C captured, ending read." ...
demo-api.py
## ## ============================================= ## ============== Bases de Dados =============== ## ============== LEI 2020/2021 =============== ## ============================================= ## =================== Demo ==================== ## ============================================= ## =============...
__init__.py
""" Python Wrapper for MODFLOW 6 """ from multiprocessing import Process from . mf6 import mf6_sub # pylint: disable-msg=no-name-in-module __all__ = ['__version__', '__name__', '__author__'] __version__ = '0.5.0' __name__ = 'pymf6' # pylint: disable=redefined-builtin __author__ = 'Mike Müller' MFSIM_NAM = 'mfsim...
dag_processing.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
webServer.py
#!/usr/bin/env/python3 # File name : server.py # Production : GWR # Website : www.adeept.com # Author : William # Date : 2020/03/17 import time import threading import move import Adafruit_PCA9685 import os import info import RPIservo import functions import robotLight import switc...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM 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/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
server.py
""" Server ====== Contains the directives necessary to start the DPF server. """ from threading import Thread import io import platform import logging import time import os import socket import subprocess import grpc import psutil import weakref import atexit import copy from ansys import dpf from ansys.dpf.core.misc ...
test_utils.py
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
loader.py
# from threading import Thread from back.mongo.backups.js import load_js from back.mongo.backups.json import load_json from back.mongo.backups.sass import load_sass def load_data(path): load_js(path) load_json(path) load_sass(path) # Thread(target=load_json, args=(path,)).start()
server.py
from threading import Thread from socket import socket, AF_INET, SOCK_STREAM # from subprocess import Popen, PIPE, STDOUT import pexpect from message_handler import MessageHandler from rsa_ops import init_rsa class Server: def __init__(self, ip, port, n_con, bsize=1024): self.ip = ip self.port = p...
capture.py
# import the necessary packages from scipy.spatial import distance as dist from imutils.video import VideoStream from imutils import face_utils from threading import Thread import numpy as np import playsound import argparse import imutils import time import dlib import cv2 import subprocess status = "false" def soun...
commands_controller.py
import connexion import six import logging import time #from flask import json import pickle import json import os import threading import data_management.redisDB from swagger_server.models.simulation import Simulation # noqa: E501 from swagger_server import util from data_management.controller import gridController...
site_launcher.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
object_storage_bulk_copy.py
# coding: utf-8 # Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
ttt.py
import multiprocessing import sys,time from multiprocessing import Process, Event, Queue from threading import Thread from expressvpn import wrapper from PySide2.QtCore import QCoreApplication, QSize, Qt, Signal, QThread, QProcess import PySide2.QtGui, PySide2.QtWidgets as QtWidgets from PySide2.QtWidgets import * fro...
emoji.py
import tkinter from tkinter import * import tkinter import cv2 from PIL import Image, ImageTk import os import numpy as np import cv2 from keras.models import Sequential from keras.layers import Dense, Dropout, Flatten from keras.layers import Conv2D from keras.optimizer_v2 import adam from keras.layers imp...
test_failure.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import logging import os import sys import tempfile import threading import time import numpy as np import pytest import redis import ray import ray.ray_constants as ray_constants from ray.cluster...
proc_5.py
# -*- coding: utf-8 -*- # @Time : 2021/3/16 20:25 # @Author : sen from multiprocessing import Process, Queue import os, time, random # 写数据进程执行的代码: def write(q): print('Process to write: %s' % os.getpid()) for value in ['A', 'B', 'C']: print('Put %s to queue...' % value) q.put(value) ...
app_test.py
# SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: Apache-2.0 import re import select import socket import struct import time from threading import Event, Thread import dpkt import dpkt.dns import ttfw_idf from tiny_test_fw.Utility import console_log UDP_PORT = 5353 MCAST_G...
test_shared_ndarray.py
import multiprocessing as mp import unittest import numpy as np from . import SharedNDArray, SharedNDArrayError class TestSharedNDArray(unittest.TestCase): def test_create(self): try: shm = SharedNDArray(4) shm.array[0] = 1 def write_to_shm(q): shm = ...
sim.py
#!/usr/bin/env python3 import csv import numpy import multiprocessing def sigmoid(x): return 1.0/(1.0+numpy.exp(-(x-5.0))) def sim_func(q,alpha,beta,Nalpha,Nbeta): #parameters time_pitch=1.0 #ms save_pitch=10 save_pitch_weight=1000 simlen_sec=900.0 simlen=int(simlen_sec*1000.0/time_pitch)...
QtServer.py
import threading import sys sys.path.insert(0,'..') import os from utils import label_map_util from screen_overlay_handler import * import socket import pickle import numpy as np from PyQt5.QtCore import * from PyQt5.QtWidgets import QApplication import sys import screen_overlay_handler """ COPYRIGHT @ Grebtsew 201...
naverpop.py
import requests import time import sys import json from urllib import parse from bs4 import BeautifulSoup from threading import Thread mod = sys.modules[__name__] global totalNewsData totalNewsData = {} def getRankList(): rankList = [] url = "https://www.naver.com" req = requests.get(url) soup = Bea...
test_ipc2.py
import pytest def test_pack_unpack(): header = ('json', 301) from gpopup.ipc import _pack_header, _unpack_header header_bytes = _pack_header(*header) header_out = _unpack_header(header_bytes) assert header == header_out assert header[0] == header_out.type assert header[1] == header_out.leng...
aiflow_client.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...
client.py
import os import threading from src.components.client.client import Client from src.core.utils.channel import Channel from src.protocol.base import Message from src.protocol.client.write.initial import InitMessage from src.protocol.client.write.text_message import TextMessage def print_messages(client : Client): ...
walker.py
import os from threading import Lock, Thread from walk import RWGraph from utils import get_G_from_edges class Walker: def __init__(self,network_data, num_walks, walk_length, schema, node_type): super().__init__() self.network_data = network_data self.num_walks = num_walks self.wal...
threading.py
"""Functionality for working multi-threaded code.""" import inspect import logging import threading import time from typing import Dict, Tuple from .._internal.trace import trace_str class DeadlockMonitor: """A monitor for deadlocked LoggingLocks.""" timeout_sec: float sleep_sec: float locks: Dict[...
villas_relay.py
import threading import requests import os from villas.controller.components.manager import Manager from villas.controller.components.gateways.villas_relay import VILLASrelayGateway # noqa E501 class VILLASrelayManager(Manager): def __init__(self, **args): self.autostart = args.get('autostart', False) ...
analyze.py
#!/usr/bin/env python # Copyright 2013 AlchemyAPI # # 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 applicab...
validate_data_submission.py
#!/usr/bin/env python """ validate_data_submission.py This script is run by users to validate submitted data files and to create a data submission in the Data Management Tool. """ from __future__ import unicode_literals, division, absolute_import import argparse import datetime import itertools import json import logg...
4_1_tree_traversal.py
# python3 import sys, threading sys.setrecursionlimit(10**6) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size class TreeOrders: def __init__(self): self.n = int(sys.stdin.readline()) self.key = [0 for i in range(self.n)] self.left = [0 for i ...
fake_backend.py
import asyncio import gzip import json import socket import sys import threading from collections import OrderedDict, defaultdict from contextlib import contextmanager from queue import Queue from google.protobuf import json_format from sanic import Sanic, response from signalfx.generated_protocol_buffers import signa...
fs.py
import os,socket,threading,sys,ast, queue, shutil, xattr, struct from pathlib import Path lock = threading.Lock() Q = queue.Queue() ''' To do: 3) Deleting Replicated Files 4) Connecting using hostname 5) Smart client and file transfer with data server direct 6) Making directory and file 7) Removing from list ''' MAX_...
TFSparkNode.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """This module provides low-level functions for managing the TensorFlowOnSpark cluster.""" from __future__ import absolute_import from __future__ import division from __future__ im...
conftest.py
import pytest import socket import time from urllib.request import urlopen from flask import Flask from multiprocessing import Process from os import path from flask_rangerequest import RangeRequest class Server: def __init__(self) -> None: self.app = Flask(__name__) self.dummy_file = DummyFile...
wsdump.py
#!/home/ledger/ledger-ibithub/ledger/bin/python import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = ge...
_rpc.py
# Copyright 2017 gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
queue_logger.py
import multiprocessing as mp import csv class QueueLogger(object): """ Records data from a multiprocessing.Queue to an output file Attributes ---------- filename : string Name of the output file to write to buffersize : unsigned int Number of results to collect from the queue ...
index.py
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportEr...
my_hydrated.py
from twarc import Twarc import json from pathlib import Path import os import gzip import time from tqdm import tqdm from multiprocessing import Process, SimpleQueue from utils import load_configs def hydrate(cfs): jobs = [] squeue = SimpleQueue() data_dirs = ['2020-01', '2020-02', '2020-03', '2020-04'] ...
newcli5.py
""" cli.py Sample CLI Clubhouse Client RTC: For voice communication """ import os import sys import threading import configparser import keyboard import time from rich.table import Table from rich.console import Console from clubhouse.clubhouse import Clubhouse # Set some global variables try: import agorartc ...
category_tag_etl.py
"""CateogryTag ETL.""" import logging import multiprocessing from etl import ETL from etl.helpers import ETLHelper from files import JSONFile from transactors import CSVTransactor from transactors import Neo4jTransactor class CategoryTagETL(ETL): """Category Tag ETL.""" logger = logging.getLogger(__name__)...
docker_beacon_scan.py
""" CONFIG """ TIME_SCAN = 5 NAME_FILE_BEACON = "json_beacon_scan.json" """ Clases """ # https://github.com/bowdentheo/BLE-Beacon-Scanner class Beacon_Obj(object): mac = str() rssi = int() uuid = str() tx_power = int() major = int() minor = int() tipo = str() empresa = str() ...
opencv.py
""" Log video stream provided by OpenCV camera """ import cv2 from threading import Thread class LogOpenCVCamera: def __init__(self, config, bus): self.input_thread = Thread(target=self.run_input, daemon=True) self.bus = bus bus.register('raw') port = config.get('port', 0) ...
test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads) from test.script_helper import assert_python_ok, make_script, temp_dir import sys import time import gc import weakref try: import threading except ImportEr...
main.py
from sys import exit as sysexit from os import environ, getcwd from threading import Thread from tkinter import Tk, filedialog import pygame import chip8 CHIP8 = chip8.CPU() pygame.init() root = Tk(); root.withdraw() environ['SDL_VIDEO_CENTERED'] = '1' width, height = 1280, 720 scaleMult = 12 screen = pygame.display...
client.py
SERVER_IP = '' SERVER_PORT = 1644 import select import threading import sys import random import time import socket import termios try: def Message_recv(s,killRequest): while not killRequest.isSet(): r, w, x = select.select([s], [], []) data = r[0].recv(1024) prin...
monitor.py
# Copyright 2015 Intel Corporation. # 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 requ...
_simple_stubs.py
# Copyright 2020 The gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import sys import queue import random import select import socket import threading import time import tempfile from collections import namedtuple from functools import partial from typing import Any from typing import Any, Dict import ...
test_events.py
# coding: utf-8 from __future__ import unicode_literals from threading import Event, Thread import pytest import requests from boxsdk.object.folder import FolderSyncState @pytest.fixture def box_events(box_client): return box_client.events() @pytest.fixture def move_target(box_client): return box_client...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import...
TestEventRouterThreaded.py
# Copyright L.P.Klyne 2013 # Licenced under 3 clause BSD licence # $Id: TestEventRouterThreaded.py 2612 2008-08-11 20:08:49Z graham.klyne $ # # Unit testing for threaded event router functions # # This TestEventRouter as a base class, but substututes setUp and # tearDown functions to use the EventRouterThreaded cla...
imagenet_to_mr.py
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
worker.py
'''The Toto worker and worker connection classes are designed to help build RPC systems, allowing you to pass CPU intensive work to other processeses or machines. Workers were originally designed for use with the Toto server, making it easy to perform long running tasks without effecting the server's responsiveness, bu...
dataset.py
import numpy as np import cv2 import os import time from collections import defaultdict, namedtuple from threading import Thread, Lock from multiprocessing import Process, Queue class ImageReader(object): def __init__(self, ids, timestamps, cam=None): self.ids = ids self.timestamps = timestamps...
httpserver.py
import socket import sys import threading import time import signal import random class MockHTTPServer: """ A mock HTTP server that always responds with HTTP/200 OK, but also counts the total and maximum number of connections that were established. """ def __init__(self, backlogSize=1000, port=0, fakeLatten...
escape_stream.py
""" Welcome to the Event Synchronous Categorisation And Processing Environment, a high level, object oriented module which abstracts event processing to high level objects that can get updated from live data. """ from threading import Thread import time from .es_wrappers import EventHandler_SFEL import numpy as np fr...
client3.py
import socket from threading import Thread sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('127.0.0.1', 8888)) def send_message(): while True: sock.send(input().encode('utf-8')) def receive_message(): while True: data = sock.recv(1024) print(data.decode('utf-8'...
interface.py
from tkinter import * import tkinter.font as font import threading import speech_recognition as sr import win32com.client import json import Operations.operations import random l=sr.Recognizer() speaker=win32com.client.Dispatch("SAPI.SpVoice") def homepage(): global screen1 screen1=Tk() myFont = font.Font(s...
apiTest.py
# -*- coding: utf-8 -*- import json import sys import socket import requests import tftpServer from collections import deque import time from scapy.all import * from threading import Thread # core dump check # point out where to save it. # python check and download file # python send http / https request def searc...
asyncdns.py
# request serialization definition # the first one character decides # wehter it is a submit[s], request[r] or quit[q] # the next two char are digit ranging from 0~99 mark the length of the domain # the following is the domain name string, the length is specified by digits # The last is the type of the dns resolving re...
btcproxy.py
""" A bitcoind proxy that allows instrumentation and canned responses """ from flask import Flask, request from bitcoin.rpc import JSONRPCError from bitcoin.rpc import RawProxy as BitcoinProxy from cheroot.wsgi import Server from cheroot.wsgi import PathInfoDispatcher import decimal import flask import json import log...
Snapshot.py
from . import globals as G import requests, sys, time, os, threading class Snapshot: """ Represents a snapshot for selenium tests :param hash: the hash for this image, returned by rest api when taking a screenshot :param test: an AutomatedTest object that represents a test currently running """ ...
downloader.py
import os import re import threading import time import urllib from urllib.parse import urlparse import requests class Downloader: url_lists = [] start_index = 0 default_dldir = None window = None def __init__(self, window, txt, default_dldir, start): self.window = window self.de...
cuteprint.py
#!/usr/bin/env python # encoding: utf-8 # This script is compatible with both Python 2 and 3 import sys import threading import time class PrettyPrinter : # Colorized Output Functions def green(self, s): return '\033[1;32m{}\033[0m'.format(s) def red(self, s): return '\033[1;31m{}\033[0...
test_threading.py
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose from test.script_helper import assert_python_ok import random import re import sys thread = test.test_support.import_module('thread') threading = test.test_support.import_module('threading') import time import u...
core.py
import time from Engine.EngineTest.engineTest import EngineTest import threading, queue import time class Core: """Class Core that manages task affectation to pluggin-engines """ def __init__(self): self.task_queue = queue.Queue() threading.Thread(target=self.pooling, daemon=True).start() ...
shadow.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. import argparse from awscrt import auth, io, mqtt, http from awsiot import iotshadow from awsiot import mqtt_connection_builder from concurrent.futures import Future import sys import threading import traceback ...
admiralnet_e2e_ros.py
import argparse import skimage import skimage.io as io import os import time from concurrent import futures import logging import argparse import lmdb import deepracing.backend from numpy_ringbuffer import RingBuffer as RB import yaml import torch import torchvision import torchvision.transforms as tf import deepracing...
Migrator.py
import logging import copy from threading import Thread from Queue import Queue class Migrator(object): def __init__(self, source_registry, artifactory_access, work_queue, workers, overwrite, dir_path): self.log = logging.getLogger(__name__) self.source = source_registry self.target = artif...
threading.py
import threading import datetime from queue import Queue from random import randint import re import sys import traceback import inspect from datetime import timedelta import logging from appdaemon import utils as utils from appdaemon.appdaemon import AppDaemon class Threading: def __init__(self, ad: AppDaemon, ...
aedt_test_runner.py
import argparse import datetime import json import os import platform import re import subprocess import tempfile import threading from contextlib import contextmanager from distutils.dir_util import copy_tree from distutils.dir_util import mkpath from distutils.dir_util import remove_tree from distutils.file_util impo...
prep_luigi.py
# encoding='utf-8' """ prep_luigi.py sets up a luigid scheduler container and luigi worker sets up TLS support so they can talk to each other lets the worker execute a task see docker-py on github and docs.docker site """ import docker # to talk to docker import pprint ...
test_dag_serialization.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...
collective_ops_gpu_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
test_html.py
from functools import partial from importlib import reload from io import ( BytesIO, StringIO, ) import os from pathlib import Path import re import threading from urllib.error import URLError import numpy as np import pytest from pandas.compat import is_platform_windows import pandas.util._test_decorators as...