source
stringlengths
3
86
python
stringlengths
75
1.04M
session.py
import os import atexit import signal import threading from typing import Optional from aim.sdk.legacy.session.utils import exception_resistant from aim.sdk.legacy.deprecation_warning import deprecated from aim.ext.resource.configs import DEFAULT_SYSTEM_TRACKING_INT from aim.ext.resource.tracker import ResourceTracker...
dependent_operator.py
from multiprocessing import Process, Queue from nlde.engine.contact_source import contact_source, contact_source_bindings from nlde.operators.operatorstructures import Tuple from nlde.query import TriplePattern, Argument from time import time class DependentOperator(object): """ Implements a plan leaf that i...
LogCycle.py
import threading from pymongo import MongoClient import datetime, time from os import listdir from os.path import isfile, join class LogCycleDaemon: def __init__(self): super(LogCycleDaemon, self).__init__() self.thread_stop_flag = True self.MONGO_URL = "localhost" self.MONGO_PORT ...
AutoScaler.py
import zmq import threading as thd class AutoScaler: def __init__(self, signalsPort, asPorts): self.sPort = signalsPort self.asPorts = asPorts self.lock = thd.Lock() self.evContext = zmq.Context() self.evSocket = self.evContext.socket(zmq.PUB) ...
application.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # pyre-strict import argparse import json import logging import os import subprocess import tempfile import threading from pathlib import P...
experiments.py
from __future__ import print_function from .. import datasets from . import metrics from . import models from . import methods from .. import __version__ import numpy as np import sklearn import os import pickle import sys import time import subprocess from multiprocessing import Pool import itertools import copy impor...
main.py
import json import crawlKoreaData_All as crawl1 import crawlKoreaData_Gyeonggi as crawl2 import crawlKoreaData_Seoul as crawl3 import LED_Display as LMD import threading from datetime import date, timedelta today = date.today() a = str(today) def LED_init(): thread=threading.Thread(target=LMD.main, ar...
test_deploy_app.py
# -*- coding: utf-8 -*- # Script to start deployment api and make request to it. import argparse import base64 import datetime import logging import os import errno import shutil import subprocess import tempfile import threading from functools import partial from multiprocessing import Process from time import sleep f...
aggregate_loader.py
#!/usr/bin/env python """This is the main entry-point for running the ETL pipeline.""" import argparse import logging import multiprocessing import os import time import coloredlogs from etl import (BGIETL, DOETL, ECOMAPETL, ETL, GOETL, MIETL, VEPETL, AffectedGenomicModelETL, AlleleETL, ClosureETL, C...
botany.py
#!/usr/bin/env python2 from __future__ import division import time import pickle import json import os import random import getpass import threading import errno import uuid import sqlite3 from menu_screen import * # TODO: # - Switch from personal data file to table in DB class Plant(object): # This is your plan...
EchoService.py
import arc import time logger = arc.Logger(arc.Logger_getRootLogger(), 'EchoService.py') wsrf_rp_ns = "http://docs.oasis-open.org/wsrf/rp-2" echo_ns = "http://www.nordugrid.org/schemas/echo" import threading class EchoService(object): def __init__(self, cfg): logger.msg(arc.INFO, "EchoService (python) co...
dask.py
# pylint: disable=too-many-arguments, too-many-locals, no-name-in-module # pylint: disable=missing-class-docstring, invalid-name # pylint: disable=too-many-lines, fixme # pylint: disable=too-few-public-methods # pylint: disable=import-error """Dask extensions for distributed training. See https://xgboost.readthedocs.io...
__init__.py
import contextlib import datetime import errno import inspect import multiprocessing import os import re import signal import subprocess import sys import tempfile import threading from collections import namedtuple from enum import Enum from warnings import warn import yaml from six.moves import configparser from da...
Servers.py
import socket import subprocess from threading import Thread class Server: def __init__(self, ip, port): self.ip = ip self.port = port class TCPServer(Server): def __init__(self, ip, port, upload_dst=None, execute=None, command=None): super().__init__(ip, port) self.upload_ds...
polygon_node.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import rospy from rospy import Service, Publisher, Subscriber, ServiceProxy from std_msgs.msg import Int8, Bool from geometry_msgs.msg import Point from kiberdrom_interfaces.srv import VertiportSet from kiberdrom_interfaces.srv import PoliceState, PoliceStateResponse from...
main.py
""" mlperf inference benchmarking tool """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import array import collections import json import logging import os import sys import threading import time from multiprocessing import JoinableQueu...
cluster.py
# Copyright IBM Corp, All Rights Reserved. # # SPDX-License-Identifier: Apache-2.0 # import datetime import logging import os import sys import time from uuid import uuid4 from threading import Thread import socket import requests from pymongo.collection import ReturnDocument sys.path.append(os.path.join(os.path.dir...
http_listener.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 import json import os import sys from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Event, Thread """ Demonstrates code to set up an HTTP listener and receive log events """ RECEIVER_NA...
server.py
""" Base threading server class """ from threading import Thread class ThreadServer: def __init__(self): self.server_thread = None self.running = False def start(self, *args, **kwargs): if self.running: return self.running = True self.server_thread = Threa...
test_pv_scale_and_respin_ceph_pods.py
""" PV Create with ceph pod respin & Memory Leak Test: Test the PVC limit with 3 worker nodes create PVCs and check for memory leak TO DO: This Test needs to be executed in Scaled setup, Adding node scale is yet to be supported. """ import logging import pytest import threading import time from ocs_ci.helpers import h...
picam.py
import logging from io import BytesIO, StringIO import time from PIL import Image import threading import queue log = logging.getLogger(__name__) picamera_override = None class Picamera(): def __init__(self, image_format='jpeg', queue_max_size=10): self.error = None self.format = image_format ...
cobs_serial.py
import time import serial import struct import threading # This is different from cobs.py as no padding is performed here # Behavior is undefined if first byte of buf is 0 def cobs_encode(buf): if len(buf) == 0: return b"\x00" if buf[0] != 0: buf = b"\x00" + buf return cobs_encode(buf) ...
multiprocess_wrapper.py
import pickle import logging import time from logging.handlers import QueueHandler, QueueListener import argparse from flarestack.core.minimisation import MinimisationHandler, read_mh_dict from multiprocessing import JoinableQueue, Process, Queue, Value import random from multiprocessing import set_start_method logger...
tello.py
import os import socket import queue import threading import time import datetime import cv2 import numpy as np import paddlehub as hub from PIL import Image from .stats import Stats from .frame2html import VideoCamera, run_app q = queue.Queue() # q.queue.clear() class Tello: def __init__(self, te_ip: str = ...
test_lock.py
from sys import modules from threading import Thread from unittest import TestCase, skip from unittest.mock import Mock, mock_open, patch mock_os = modules["os"] = Mock() mock_logger = modules["pitop.common.logger"] = Mock() # import after applying mocks from pitop.common.lock import PTLock # noqa: E402 @skip clas...
ui_tests.py
"""Tests for the user interface.""" # # (C) Pywikibot team, 2008-2021 # # Distributed under the terms of the MIT license. # # NOTE FOR RUNNING WINDOWS UI TESTS # # Windows UI tests have to be run using the tests\ui_tests.bat helper script. # This will set PYTHONPATH and PYWIKIBOT_DIR, and then run the tests. Do not # t...
productor_customer.py
__author__ = 'Aaron Yang' __email__ = 'byang971@usc.edu' __date__ = '7/24/2020 10:29 PM' import time import queue import threading q = queue.Queue(10) # 生成一个队列,用来保存“包子”,最大数量为10 def productor(i): # 厨师不停地每2秒做一个包子 while True: q.put("厨师 %s 做的包子!" % i) time.sleep(2) def consumer(j): # 顾客不停...
exec.py
from utility import ssh, shell import threading class ExecMixin(object): def sh(self, command_args, input = None, display = True, line_prefix = '', env = None, cwd = None, sudo = False): if not env: env = {} return shell.Shell.exec(command_args, input = input, ...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading import gc import textwrap import jso...
locators.py
# -*- coding: utf-8 -*- # # Copyright (C) 2012-2015 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import gzip from io import BytesIO import json import logging import os import posixpath import re try: import threading except Impo...
devserver.py
import os import time import traceback import threading from werkzeug.serving import run_simple, WSGIRequestHandler from lektor.db import Database from lektor.builder import Builder, process_build_flags from lektor.watcher import Watcher from lektor.reporter import CliReporter from lektor.admin import WebAdmin from l...
_utils.py
# -*- coding: utf-8 -*- # # Copyright 2015 Ternaris, Munich, Germany # # 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, c...
job.py
""" **job** module handles all the job running logic: - consistent exception handling and logging - currently 2 job runners are implemented: - SimpleJobRunner runs the jobs sequentially. - ParallelJobRunner queues the jobs and run them in a dedicated thread """ from concurrent.futures import ThreadPoolExecutor, Pr...
front_end.py
#!/usr/bin/env impala-python # Copyright (c) 2015 Cloudera, 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...
numpy_compiler.py
from .lambda_compiler import LambdaCompiler,visitor import numpy as np from .. import expression as e from .. import functions as f from mpmath import mp class NumpyCompiler(LambdaCompiler): def __init__(self): super(NumpyCompiler,self).__init__() @visitor.on('expr',parent = LambdaCompiler) def ...
utils.py
from threading import Lock, Thread, active_count as threading_active_count from posixpath import join as os_join, normpath as os_normpath from json import load as json_load, dump as json_dump from subprocess import Popen, PIPE from calendar import monthrange from httplib2 import Http from shutil import rmtree from time...
webcam_demo.py
import argparse import time from collections import deque from operator import itemgetter from threading import Thread import cv2 import numpy as np import torch from mmcv import Config, DictAction from mmcv.parallel import collate, scatter from mmaction.apis import init_recognizer from mmaction.datasets.pipelines im...
system_mode.py
# -*- coding: utf-8 -*- u"""System Mode for SecureTea. Project: ╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐ ╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤ ╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴ Author: Abhishek Sharma <abhishek_official@hotmail.com> , Jul 30 2019 Version: 1.5.1 Module: SecureTea """ # Import all the modules necessary for...
fifo_queue_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
make.py
# coding: utf-8 from __future__ import print_function import argparse import multiprocessing import os import platform import re import shutil import subprocess import sys import threading import time import zipfile # The current test/decompression data version in use current_test_data = 'test_data_v5' current_decom...
rclshark_smi.py
#!/bin/python3 import subprocess import os import re import threading import sys import select import datetime import rclpy from rclpy.node import Node from computer_msgs.msg import PcStatus from computer_msgs.srv import PcStatusSrv version_mejor = 1 version_minor = 0 version_revision = 1 version_build = str(version...
kurisu.py
#!/usr/bin/env python3.8 import asyncio import discord import environs import googletrans import gtts import json import os import pykakasi import random import requests import schedule import threading import time from datetime import datetime, timedelta def are_same_day(date1, date2): return (date1.replace(hou...
transports.py
from .logging import exception_log, debug from .types import ClientConfig from .typing import Dict, Any, Optional, IO, Protocol from abc import ABCMeta, abstractmethod from contextlib import closing from queue import Queue import json import os import shutil import socket import sublime import subprocess import threadi...
networkSniffer.py
import os import threading import time import netifaces from pylibpcap import sniff from prettytable import PrettyTable ns_options_list = ['show', 'help', 'start', 'stop'] ns_help = 'This is a network sniffer tool designed to record the network packets. \n Press \'help\' to get more ' \ 'information about th...
pockint.py
#!/usr/bin/env python import datetime from threading import Thread import tkinter as tk from tkinter import messagebox import tkinter.ttk as ttk from utils import InputValidator, Database, load_icon, callback import sys __version__ = '1.2.0' class CreditsTool(tk.Toplevel): """Opens a new window prov...
scheduler.py
from future import standard_library standard_library.install_aliases() from builtins import object import threading from time import time import random import queue from ..common import log class Scheduler(object): """ A simple scheduler which schedules the periodic or once event """ i...
test_email.py
from threading import Thread from flask import Flask from flask_mail import Mail,Message app = Flask(__name__) app.debug=True app.config["MAIL_SERVER"] = "smtp.qq.com" app.config["MAIL_PORT"] = 465 app.config["MAIL_USE_SSL"] = True app.config["MAIL_USERNAME"] = "2364839934@qq.com" app.config["MAIL_PASSWORD"] = "oycims...
rollover_planner.py
import os import sys import pinocchio import crocoddyl import numpy as np import math import subprocess import threading from humanoid import SimpleHumanoidGaitProblem, plotSolution from visualizer import VisualModel from simulator import HumanoidSimulator from planner import Planner, OptimalPlanner from simple_planne...
dokku-installer.py
#!/usr/bin/env python2.7 import cgi import json import os import re import SimpleHTTPServer import SocketServer import subprocess import sys import threading VERSION = 'v0.12.5' hostname = '' try: command = "bash -c '[[ $(dig +short $HOSTNAME) ]] && echo $HOSTNAME || wget -q -O - icanhazip.com'" hostname = s...
__init__.py
from __future__ import annotations import collections from datetime import datetime from decimal import Decimal from functools import wraps import operator import os import re import string from typing import ( TYPE_CHECKING, Callable, ContextManager, Counter, Iterable, ) import warnings import nu...
dispatcher.py
#!/usr/bin/env python3 # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
mqtt_plotting.py
# 需要安装 matplotlib # 参考命令:python3.6 -m pip install matplotlib # 读取MQTT数据,动态绘制图表 # 代码编写:谢作如,2019.5.8 from pylab import * import threading import paho.mqtt.client as mqtt import time,random SERVER = "127.0.0.1" #MQTT服务器IP CLIENT_ID = "79afcb3bdb44b7aa" #在SIoT上,CLIENT_ID可以留空 TOPIC = 'xzr/001' #“topic”为“项目名称/设备...
accessories.py
# # Copyright (c) 2021 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
Interface.py
# coding=utf-8 from cmd2 import Cmd from binascii import hexlify, unhexlify from FENRIR2 import * import threading class Interface(Cmd): FENRIR = FENRIR() FenrirThread = None stop_event = None promptBase = "FENRIR" prompt = "\n\033[1m\033[31m" + promptBase + " >\033[0m " intro = """\n\033[1m ...
mock_xml_file_server.py
import os import SimpleHTTPServer import SocketServer from threading import Thread import logging log = logging.getLogger(__name__) PORT = 8999 def serve(port=PORT): '''Serves test XML files over HTTP''' # Make sure we serve from the tests' XML directory os.chdir(os.path.join(os.path.dirname(os.pa...
test_multiprocess.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt import os import sys import multiprocessing import platform import unittest from .cmdline_tmpl import CmdlineTmpl file_parent = """ import subprocess subpr...
main.py
import requests import threading def main(): links = [ "https://www.gazprom.ru/", "https://lukoil.ru/", "https://magnit.ru/", "https://www.nornickel.com/", "https://www.surgutneftegas.ru/", "https://www.tatneft.ru/", ...
test_protocol_cybinary.py
# -*- coding: utf-8 -*- import multiprocessing import os import time import pytest from thriftpy._compat import u from thriftpy.thrift import TType, TPayload from thriftpy.transport import TSocket, TServerSocket from thriftpy.utils import hexlify from thriftpy._compat import PYPY pytestmark = pytest.mark.skipif(PYP...
kvm_executor.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """A script that starts a vm, reverts it to a known snapshot, tests a submission bundle (submission + tests), and closes the vm""" from __future__ import with_statement # Use simplejson or Python 2.6 json, prefer simplejson. try: import simplejson as json except Imp...
lishogi-bot.py
import argparse import shogi import engine_wrapper import model import json import lishogi import logging import multiprocessing import traceback import logging_pool import signal import sys import time import backoff import threading from config import load_config from conversation import Conversation, ChatLine from f...
test_random.py
import warnings import numpy as np from numpy.testing import ( assert_, assert_raises, assert_equal, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings ) from numpy import random import sys class TestSeed: def test_scala...
atles_box.py
#!/usr/bin/env python3 import argparse import atexit from collections import OrderedDict try: from ConfigParser import RawConfigParser except ImportError: from configparser import RawConfigParser import logging import os import random import pipes # TODO: move to python3 and use shlex.quote() instead import ...
example_test.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
screens.py
import asyncio from weakref import ref from decimal import Decimal import re import threading import traceback, sys from typing import TYPE_CHECKING, List from kivy.app import App from kivy.cache import Cache from kivy.clock import Clock from kivy.compat import string_types from kivy.properties import (ObjectProperty,...
cost_power_monitor.py
#!/usr/bin/python3 import sys import string import time import numpy as np import datetime from . import ivi from . import usbtmc from multiprocessing import Process, Queue, cpu_count import multiprocessing from scipy.optimize import leastsq,broyden1 from scipy import stats from PyQt5 import QtCore from PyQt5.QtWidge...
test_numexpr.py
################################################################### # Numexpr - Fast numerical array expression evaluator for NumPy. # # License: MIT # Author: See AUTHORS.txt # # See LICENSE.txt and LICENSES/*.txt for details about copyright and # rights to use. ##########################################...
gui.py
import util, wx, time, threading, pprint, os, urllib from util import get_api_client, get_input_args, print_err, pprint_err from subprocess import Popen, PIPE goatc_buttons = [] property_dialog = None listbox_groupid = None label_groupid = None label_populatedgroupid = None listbox_populatedgroupid_locked = False list...
mp.py
import multiprocessing as mp def foo(q): q.put('hello') if __name__ == '__main__': mp.set_start_method('spawn') q = mp.Queue() p = mp.Process(target=foo, args=(q,)) p.start() print(q.get()) p.join()
jslam.py
#! /home/johk/anaconda3/envs/slam/bin/python import cv2 import numpy as np from matplotlib import pyplot as plt from Components.display import Display from Components.display3 import D3Engine import keyboard import time from threading import Thread if __name__ == "__main__": start_time = time.time() cap = cv2...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
gstreamer.py
# Copyright 2019 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, ...
main.py
from multiprocessing import Process, Pipe from fb2twilio import run as runF2T from twilio2fb import run as runT2F if __name__ == '__main__': Process(target=runF2T, args=()).start() Process(target=runT2F, args=()).start() print 'Facetwilio active...'
wsdump.py
#!C:\Users\louis\Documents\GitHub\instagram_bot\tidl\Scripts\python.exe 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_encod...
tk_raw_analy_ver0.5.py
## 영상 처리 및 데이터 분석 툴 from tkinter import *; import os.path ;import math from tkinter.filedialog import * from tkinter.simpledialog import * ## 함수 선언부 def loadImage(fname) : global window, canvas, paper, filename, inImage, outImage, inW, inH, outW, outH fsize = os.path.getsize(fname) # 파일 크기 확인 inH...
util.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division import base64 import binascii import colorsys import contextlib import codecs import errno import functools import gzip import hashlib import json import logging import math import numbers import traceback impo...
led_controller.py
from threading import Thread from neopixel import * from patterns import * import math class LedController: def __init__(self, queue): self.queue = queue self.looper = Thread(target=self.process) self.looper.daemon = True self.pattern_runner = Thread(target=self.run_pattern) ...
controller.py
# External Dependencies import time import re from multiprocessing import Process, Queue from subprocess import call import os, sys from embit import bip32, script, ec from embit.networks import NETWORKS from embit.descriptor import Descriptor from binascii import hexlify from threading import Thread # Internal file c...
test_partition.py
import threading import pytest from base.partition_wrapper import ApiPartitionWrapper from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from common.code_mapping import PartitionErrorMessage prefix = ...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import warnings import unittest from math import sqrt from pathlib import Path from torch.multiprocessing import Process from torch.te...
ws-server.py
#!/usr/bin/env python # USAGE: ./ws-server.py & python -m SimpleHTTPServer 8888 import socket, threading, time def handle(s): print repr(s.recv(4096)) s.send(''' HTTP/1.1 101 Web Socket Protocol Handshake\r Upgrade: WebSocket\r Connection: Upgrade\r WebSocket-Origin: http://localhost:8888\r WebSocket-Location: w...
test_odata2_client.py
#! /usr/bin/env python import decimal import logging import random import threading import time import unittest from wsgiref.simple_server import make_server, WSGIRequestHandler from pyslet import rfc2396 as uri from pyslet import rfc5023 as app from pyslet.odata2 import core from pyslet.odata2 import csdl as edm fr...
onnxruntime_test_python.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- import unittest import os import numpy as np import onnxruntime as onnxrt import threading class TestInferenceSession(unittest.TestCase): def get_name(self, name): if os.path.exists(name...
sound_to_light.py
from VisualisationPlugin import VisualisationPlugin import pygame from DDRPi import FloorCanvas import logging import math import colorsys import numpy import threading import pyaudio import scipy import scipy.fftpack import scipy.io.wavfile import wave from lib.controllers import ControllerInput class SoundToLig...
store.py
""" Library for a simple retroactively-updatable key-value store. """ import threading import views class RStore(object): """ A retroactively-updatable interface. """ def __init__(self, cls): """ Initializes a new retroactively-updatable key-value store, wrapping around the given storage class. ...
common.py
"""Test the helper method for writing tests.""" from __future__ import annotations import asyncio import collections from collections import OrderedDict from collections.abc import Awaitable, Collection from contextlib import contextmanager from datetime import datetime, timedelta import functools as ft from io import...
lishogibot.py
import argparse import shogi import engine_wrapper import model import json import lishogi import logging import multiprocessing from multiprocessing import Process import signal import backoff from config import load_config from conversation import Conversation, ChatLine from functools import partial from requests.exc...
main.py
from collections import defaultdict import copy from datetime import datetime, time from json import JSONEncoder import json import os.path import sys, os import threading import time import globals from load_config import * from logger import logger from new_listings_scraper import * from store_order import * from tr...
chess_server.py
import sys import socket import atexit import threading HOST = "127.0.0.1" PORT = 23333 MAX_CONNECTIONS = 8 MAX_BUFFER_SIZE = 2048 ENCODING = "utf-8" if len(sys.argv) > 2: HOST = sys.argv[1] PORT = int(sys.argv[2]) s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind((HOST, PORT)) # str:connection u...
server.py
#!/usr/bin/env python from math import floor from world import World, show_clouds, show_plants, show_trees import atexit import datetime import random import re #import requests import sqlite3 import sys import threading import time import traceback is_py2 = sys.version[0] == '2' if is_py2: import Queue as queue ...
tempdeck.py
from threading import Thread, Event from opentrons.drivers.temp_deck import TempDeck as TempDeckDriver from opentrons.drivers.temp_deck.driver import temp_locks from opentrons import commands TEMP_POLL_INTERVAL_SECS = 1 class MissingDevicePortError(Exception): pass # TODO: BC 2018-08-03 this class shares a fa...
run_local_test.py
################################################################################ # Name: Run Local Test Tool # Author: Zhengying Liu # Created on: 20 Sep 2018 # Update time: 5 May 2019 # Usage: python run_local_test.py -dataset_dir=<dataset_dir> -code_dir=<code_dir> VERISION = "v20190505" DESCRI...
miner.py
#!/usr/bin/python "Monero Miner (Build Your Own Botnet)" import socket import select import binascii import struct import json import sys import os import time import threading import subprocess import multiprocessing import pycryptonight import pyrx # main class Miner(multiprocessing.Process): """ Python ...
media.py
import re import time import queue import threading import cv2 import numpy as np __all__ = [ "MediaPlayer", "MediaType" ] class MediaType: """Helper class for referring meida type""" VIDEO = 1 STREAM = 2 class MediaPlayer: """General media player Arguments: src (str or int): opencv ...
client_graphql_ws.py
import json import logging import asyncio import threading from .w_socket import WSocket from .util import Util from .store import Store import nest_asyncio nest_asyncio.apply() class ClientGraphqlWs: """ """ def __init__(self, uri, store, update, ...
test_xmlrpc.py
import base64 import datetime import decimal import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import http, http.server import socket import threading import re import io import contextlib from test import support from test.support...
ObjectRecognition.py
import numpy as np import threading import time import nep import time import cv2 import sys from PIL import Image import sharo show_image = 1 model = "yolo3-320" try: model = sys.argv[1] print ("Model:" + model) show_image = int(sys.argv[2]) print ("Show image: " + str(show_image)) except: pass ...
main_new.py
import time from datetime import datetime import serial import numpy as np import math import pdb BED_ROOM = "bedroom" LIVING_ROOM = "livingroom" KITCHEN = "kitchen" OUTSIDE = "exit" TOILET = "toilet" ROOMS = [LIVING_ROOM, BED_ROOM, OUTSIDE, TOILET, KITCHEN] VALID_TRANSITIONS = { BED_ROOM: [LIVIN...
AdobeHDS.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # M6 version 0.1 par k3c import binascii import struct import sys import os import base64 import math import xml.etree.ElementTree import xml.sax import re from urlparse import urlparse, urlunparse import string import unicodedata import Queue import threading, thread impor...
processor_v2.py
import datetime import glob import json import librosa import lmdb import math import matplotlib.pyplot as plt import numpy as np import os import pickle import pyarrow import python_speech_features as ps import threading import time import torch import torch.optim as optim import torch.nn as nn import torch.nn.functio...
store.py
import datetime import json import threading import uuid from collections import defaultdict from copy import deepcopy from dictdiffer import diff from inspect import signature from threading import Lock from pathlib import Path from tzlocal import get_localzone from .logger import logger from .settings import CACHE_...