source
stringlengths
3
86
python
stringlengths
75
1.04M
server.py
import uvicorn from fastapi import FastAPI from pydantic import BaseModel import os import logging import json import time from threading import Thread from multiprocessing import Process, Pool from functools import partial import boto3 import botocore from botocore.config import Config import sys import cache s3clie...
runner.py
import argparse import json import logging import os import threading import time import traceback import colors import docker import numpy import psutil from ann_benchmarks.algorithms.definitions import (Definition, instantiate_algorithm) from ann_benchmarks.dataset...
odd_even_transposition_parallel.py
""" This is an implementation of odd-even transposition sort. It works by performing a series of parallel swaps between odd and even pairs of variables in the list. This implementation represents each variable in the list with a process and each process communicates with its neighboring processes in the list to perfo...
proxier.py
from concurrent import futures from dataclasses import dataclass import grpc import logging import json from queue import Queue import socket from threading import Thread, Lock import time from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple from ray.job_config import JobConfig import ray.core.gener...
serial_test.py
#!/usr/bin/env python import signal import sys import serial import threading def signal_handler(signal, frame): print("Ctrl + C captured, exitting.") sys.exit(0) class fsrThread(object): def __init__(self): thread = threading.Thread(target=self.read_thread, args = ()) thread.daemon = True thread.start() d...
RPCS3 Game Update Downloader.py
## This code is trash and will make your eyes bleed. You have been warned. ## This program requires you to install PyYAML and aiohttp (python -m pip pyyaml aiohttp[speedups]) ## This program also requires Python 3.8 or higher due to using the walrus operator import yaml import asyncio import aiohttp import threading i...
test_application.py
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
test_gc.py
import unittest import unittest.mock from test.support import (verbose, refcount_test, run_unittest, cpython_only) from test.support.import_helper import import_module from test.support.os_helper import temp_dir, TESTFN, unlink from test.support.script_helper import assert_python_ok, make_scri...
sdk_main.py
from . import inter from .structs import Codes as BCd import websocket import json import requests import time from threading import Thread import typing as t import os event_types = BCd.QBot.GatewayEventName class Intents: # https://bot.q.qq.com/wiki/develop/api/gateway/intents.html GUILDS = 1 << 0 GUILD_M...
gritsbotserial.py
import serial import json import logging import threading import time global logger logging.basicConfig(format='%(asctime)s - %(levelname)s - %(module)s - %(message)s') logger = logging.getLogger('root') logger.setLevel(logging.DEBUG) # Constants MAX_IN_WAITING = 500 def _json_to_bytes(message): """Dumps json d...
proj1.py
import argparse import logging from pdb import set_trace from threading import Thread from Utils.MisclUtils import TimeUtil from Utils.RandomUtil import Random from Utils.CalcUtils import mean_wait_time from Utils.ServerUtil import Customer, Server from Utils.CalcUtils import mean_service_time from Utils.CalcUtils impo...
wrapper.py
#!/usr/bin python3 """ Process wrapper for underlying faceswap commands for the GUI """ import os import logging import re import signal from subprocess import PIPE, Popen import sys from threading import Thread from time import time import psutil from .utils import get_config, get_images, LongRunningTask if os.name...
stream_kitchen.py
""" The MIT License (MIT) Copyright (c) 2016 Jake Lussier (Stanford University) 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...
user_io.py
import os import sys import time import numpy as np import pybullet as p from collections import namedtuple from pybullet_planning.utils import INF, CLIENT, CLIENTS from pybullet_planning.utils import is_darwin # from future_builtins import map, filter # from builtins import input # TODO - use future try: user_in...
pesa.py
# -*- coding: utf-8 -*- #""" #Created on Sun Jun 28 18:21:05 2020 # #@author: Majdi Radaideh #""" from neorl.hybrid.pesacore.er import ExperienceReplay from neorl.hybrid.pesacore.sa import SAMod from neorl.hybrid.pesacore.es import ESMod from neorl.hybrid.pesacore.pso import PSOMod from copy import deepcopy...
oandastore.py
#!/usr/bin/env python # -*- coding: utf-8; py-indent-offset:4 -*- ############################################################################### # # Copyright (C) 2015, 2016, 2017 Daniel Rodriguez # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Li...
cattleman.py
#!/usr/bin/env python3 import os import sys import requests import logging import boto3 import pprint import threading import socket from requests.auth import HTTPBasicAuth from botocore.exceptions import ClientError from time import sleep class cattleman(object): def __init__(self): self.api_user = os.ge...
weights_server.py
import socket from multiprocessing import Process, Value, Lock import os def worker(socket, checkpoint_dir, dqn_checkpoint, im_checkpoint): import datetime while True: try: client, address = socket.accept() with dqn_checkpoint.get_lock(): dqn_path = checkpoint_d...
exposition.py
#!/usr/bin/python from __future__ import unicode_literals import base64 from contextlib import closing import os import socket import sys import threading from wsgiref.simple_server import make_server, WSGIRequestHandler from .openmetrics import exposition as openmetrics from .registry import REGISTRY from .utils im...
DiscordService.py
import discord import traceback import asyncio from threading import Thread from Model.ConnectTask import ConnectTask from Model.MessageTask import MessageTask from Model.Task import Task from Workers.TwitchWorker import TwitchWorker from Workers.YouTubeWorker import YouTubeWorker class DiscordService(discord.Client):...
say_to_love.py
# -*- coding:utf-8 -*- from __future__ import unicode_literals from wxpy import * from requests import get from requests import post from platform import system from random import choice from threading import Thread import configparser import time # 获取每日励志精句 def get_message(): r = get("http://open.iciba.com/dsapi...
c.py
import web3 import web3.auto as web3auto from web3.middleware import geth_poa_middleware import time import threading import hashlib import os import subprocess import json from sha3 import keccak_256 w3 = None HOST="127.0.0.1" PORT="8545" def connect(host=None,port=None,poa=False): global w3 if host is None...
ali5.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime from bs4 import BeautifulSoup from threading import Thread from googletrans import Translator from gtts import gTTS import time,random,sys,json,codecs,threading,glob,urllib,urllib2,urllib3,re,ast,os,subprocess,r...
with_notebook.py
import os import time from threading import Thread from jupyter_core.paths import jupyter_data_dir import notebook import IPython from IPython.display import display, Javascript from .vpython import GlowWidget, baseObj, canvas from .rate_control import ws_queue from . import __version__ import tornado.httpserver imp...
proxy.py
#!/usr/bin/env python # coding:utf-8 # Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com> # Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com> # Contributor: # Phus Lu <phus.lu@gmail.com> # Hewig Xu <hewigovens@gmail.com> # Ayanamist Yang <ayanamist@gmail.com> ...
watcher.py
import datetime import os import threading import time class Watcher(object): def __init__(self, files=None, cmds=None, verbose=False, clear=True): self.files = [] self.cmds = [] self.num_runs = 0 self.mtimes = {} self._monitor_continously = False self._monitor_thr...
util.py
import functools import operator from threading import Thread import hashlib import os import pprint import time pp = pprint.PrettyPrinter(indent=2) def foldl(f, init, l): for x in l: init = f(init, x) return init def foldl1(f, l): return foldl(f, l[0], l[1:]) def foldr(f, init, l): for x in reversed(l)...
test_ib_wrapper.py
"""Unit tests for module `ibpy_native.wrapper`.""" # pylint: disable=protected-access import os import enum import threading import unittest from ibapi import wrapper as ib_wrapper from ibpy_native.interfaces import listeners from ibpy_native.internal import client as ibpy_client from ibpy_native.internal import wrap...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
trex_subscriber.py
#!/router/bin/python import json import threading import time import datetime import zmq import re import random import os import signal import traceback import sys from .trex_types import RC_OK, RC_ERR #from .trex_stats import * from ..utils.text_opts import format_num from ..utils.zipmsg import ZippedMsg # basic...
PC_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official PC Miner 2.73 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2021 """ from time import time, sleep, strptime, ctime from hashlib import sha1 from socket import socket from multiprocessing import L...
caching.py
""" CherryPy implements a simple caching system as a pluggable Tool. This tool tries to be an (in-process) HTTP/1.1-compliant cache. It's not quite there yet, but it's probably good enough for most sites. In general, GET responses are cached (along with selecting headers) and, if another request arrives for the same r...
vad_test.py
#!/usr/bin/env python3 ################################################################################################### # # Project: Embedded Learning Library (ELL) # File: vad_test.py # Authors: Chris Lovett # # Requires: Python 3.x, numpy, tkinter, matplotlib # ##########################################...
all_ip_banner.py
#!/usr/bin/env/ python # coding=utf-8 __author__ = 'Achelics' __Date__ = '2017/05/15' import json as _json import multiprocessing import os import sys IP_LIST = list() def get_all_ip(raw_file_name, result_file_name, flag_num=4): result_file = open(result_file_name, 'w') with open(raw_file_name, 'r') as f: ...
parallel.py
import multiprocessing from utils.type import is_lambda def _worker(delegate, queue, rqueue): while True: i, datum = queue.get() if i < 0: break rv = delegate(datum) rqueue.put((i, rv)) def parallel(data, delegate, spawn=2): if not hasattr(data, "__iter__"): ...
application_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...
client.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import getpass import importlib import json import time from urllib.parse import urlencode import requests from .common import * class ZhihuClient: def __init__(self, username: str = None, password: str = None): self.username = usernam...
Thread01.py
#Python Thread 예제1 import threading import time def execute(number): """ 쓰레드에서 실행 할 함수 """ time.sleep(number) print(threading.currentThread().getName(), number) def execute_noThread(number): """ 쓰레드에서 실행 할 함수 """ time.sleep(number) print(threading.currentThread().getName(), nu...
lisp.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
tests.py
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import copy import datetime import re import threading import unittest import warnings from decimal import Decimal, Rounded from django.conf import settings from django.core.exceptions import Improperly...
processor.py
import asyncio from .utils import * from multiprocessing import Process, Pipe, Lock SOURCE_ID = 0 SENTINEL = -1 class Processor: '''A camera processor''' def __init__(self, camera, streams, stride, has_consumer=False, name=None): self.streams = streams if name is None: self.name...
TProcessPoolServer.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
python_ls.py
# Copyright 2017 Palantir Technologies, Inc. import logging import socketserver import threading from pyls_jsonrpc.dispatchers import MethodDispatcher from pyls_jsonrpc.endpoint import Endpoint from pyls_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWriter from . import lsp, _utils, uris from .config impor...
abs_task.py
from abc import ABC from abc import abstractmethod import argparse from distutils.version import LooseVersion import functools import logging import os from pathlib import Path import sys from typing import Any from typing import Callable from typing import Dict from typing import List from typing import Optional from ...
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...
EE2CameraController.py
import time import rospy import picamera from rospy import Service from std_srvs.srv import (Empty, EmptyRequest, EmptyResponse) from tactics.ee2.EE2ClientDisableable import EE2ClientDisableable import threading class CameraController(EE2ClientDisableable): # Operational variable __camera = None # Predefi...
controller.py
#!/usr/bin/env python3 import os import time import math import atexit import numpy as np import threading import random import cereal.messaging as messaging from common.params import Params from common.realtime import Ratekeeper from can import can_function, sendcan_function import queue pm = messaging.PubMaster(['fr...
temporary.py
"""Temporary worker module.""" import logging import os import threading import time from typing import Optional from celery import Celery from celery.utils.nodenames import default_nodename logger = logging.getLogger(__name__) class TemporaryWorker: """Temporary worker that automatically shuts down when queue ...
PC_Miner.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Python PC Miner (v2.5.1) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2019-2021 ########################################## # Import libraries import sys from configparser import ...
views.py
from django.shortcuts import render, redirect from django.shortcuts import render, redirect from datasets.models import Dataset, Modality, Term from django.template import RequestContext, Context, loader from django.http import ( HttpResponse, HttpResponseNotFound, HttpResponseForbidden) from models.models ...
photobooth_test.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os, os.path import sys import time import signal import traceback import logging from logging import handlers import argparse import gzip import gphoto2 as gp import serial import threading import SimpleHTTPServer import SocketServer # Project-related imports import ph...
dataloader.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
followers.py
""" Calls the Github API to populate User and Follower CSV data to build the followers relationship graph Users aren't distinct in the outputted CSV User-Follows are distinct """ import os import json import csv import requests from queue import Queue from threading import Thread from _base import DATA_DIR, argparse...
MeterRead.py
#!/usr/bin/env python # # Query the metersvc on a SmartHUB directly. # # Pre-requisites: # # # apt install python-is-python3 python3-pip python3-virtualenv # # pip3 install aiohttp==3.7.4.post0 pytz requests Sphinx sphinx_rtd_theme # # mkdir -m 775 /var/log/metersummary import os, sys, signal, threading, queue, ...
conftest.py
import asyncio from functools import partial from multiprocessing import Process import pytest from server.tcp import start_server from tests.integration.tcp.bot import TcpBot @pytest.fixture def tcp_bot_factory(running_server): host, port = running_server return partial(TcpBot, host, port) @pytest.fixtur...
threads.py
from queue import Queue, Empty import threading import time class ThreadingMixin(object): def _thread_wrapper(self, *args): ''' Wrapper for the worker method defined in the module. Handles calling the actual worker, cleanly exiting upon interrupt, and passing exceptions back to the main process.''...
__init__.py
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals __all__ = ['ToastNotifier'] # ############################################################################# # ########## Libraries ############# # ################################## # standard library ...
conftest.py
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2014 Sean Vig # Copyright (c) 2014-2015 Tycho Andersen # # 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 Soft...
dns.py
#Servidor intermediario para acesso indireto de Felipe Gemmal, Carlos Henrique Rorato Souza # -*- coding: utf-8 -*- import socket import sys import threading #dados guardados em maps #names = {"1":("localhost","1234")} #keys = {"1":(listaS1)} names = {} keys ={} #Para cada serviço, uma lista com suas palavras-chave #...
mainfile.py
from tkinter import * import os from pygame import mixer import tkinter.messagebox from tkinter import filedialog import time import threading from tkinter import ttk from ttkthemes import themed_tk as tk from mutagen.mp3 import MP3 import pyttsx3 import datetime engine=pyttsx3.init('sapi5') voices=engine.getProperty(...
server.py
import asyncio import os import traceback from functools import partial from inspect import isawaitable from multiprocessing import Process from signal import SIG_IGN, SIGINT, SIGTERM, Signals from signal import signal as signal_func from socket import SO_REUSEADDR, SOL_SOCKET, socket from time import time from httpt...
__init__.py
#coding=utf-8 from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime import multiprocessing import concurrent.futures import os, queue from queue import Queue import subprocess import sys import traceback from util import Log def queueThread(taskQueue, errorQueue...
__init__.py
import sys import struct import abc import queue import threading # constants RMF_CMD_START_ADDR = 0x3FFFFC00 RMF_FILE_TYPE_FIXED = 0 RMF_FILE_TYPE_DYNAMIC = 1 RMF_FILE_TYPE_STREAM = 2 RMF_CMD_ACK = 0 # reserved for future use RMF_CMD_NACK = 1 # reserved for future...
apt_tdc_roetdec.py
""" This is the main script for controlling the experiment. It contains the main control loop of experiment. """ import time import datetime import multiprocessing from multiprocessing.queues import Queue import threading import numpy as np import logging import sys # Serial ports and NI import serial.tools.list_po...
moduleinspect.py
"""Basic introspection of modules.""" from typing import List, Optional, Union from types import ModuleType from multiprocessing import Process, Queue import importlib import inspect import os import pkgutil import queue import sys class ModuleProperties: def __init__(self, name: str, ...
email.py
from threading import Thread from flask import render_template from flask_mail import Message from app import app, mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, reci...
test_tcp.py
"""Test tcp connection. Connection will happen on localhost and at a random free port. """ import socket import threading import socketserver import pytest from src import nuke_tools LOCALHOST = '127.0.0.1' with socketserver.TCPServer((LOCALHOST, 0), None) as s: FREE_PORT = s.server_address[1] def socket_ser...
machine.py
from contextlib import _GeneratorContextManager from pathlib import Path from queue import Queue from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple import base64 import io import os import queue import re import shlex import shutil import socket import subprocess import sys import tempfile import t...
rss_feed.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import PyRSS2Gen import threading import requests from all_channel import get_all_channel def rss_parse(thread_id, r_ids): headers = { "acPlatform": "ANDROID_PHONE", "User-agent": "acvideo core/5.13.0.635(Xiaomi;MI 5;7.0)", "d...
sleepycat.py
from rdflib.store import Store, VALID_STORE, CORRUPTED_STORE, NO_STORE, UNKNOWN from rdflib.term import URIRef from rdflib.py3compat import b def bb(u): return u.encode('utf-8') try: from bsddb import db has_bsddb = True except ImportError: try: from bsddb3 import db has_bsddb = True ex...
__init__.py
import os import sys import cmd import time import serial import select import struct import threading import math import cPickle as pickle from cancat import iso_tp # defaults for Linux: serialdev = '/dev/ttyACM0' # FIXME: if Windows: "COM10" is default baud = 4000000 # command constants (used to identify me...
eval_real_robot.py
import argparse import json import logging import os import threading import time from copy import copy # from concurrent.futures import ThreadPoolExecutor # from queue import Queue import numpy as np import rospy from matplotlib import pyplot as plt from sensor_msgs.msg import JointState from std_msgs.msg import Floa...
controlsd.py
#!/usr/bin/env python3 import os import math import requests import threading from numbers import Number from cereal import car, log from common.numpy_fast import clip from common.realtime import sec_since_boot, config_realtime_process, Priority, Ratekeeper, DT_CTRL from common.profiler import Profiler from common.par...
email.py
# coding=utf-8 from threading import Thread from flask import render_template from flask_mail import Mail, Message from flask import current_app from . import mail def send_async_email(msg): with current_app.app_context(): mail.send(msg) def send_email(to, subject, template, **kwargs): """发送电子邮件"""...
build_update_part.py
# Copyright 2010-2012 Opera Software ASA # # 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 ...
http_json_poster.py
import sys import threading import requests class HttpJsonPoster: __headers = { "Content-Type": "application/json", "Accept": "application/json", } def __init__(self, url, timeout=3): self.__cond = threading.Condition() self.__url = url self.timeout = timeout ...
tiger-calculator.py
#!/usr/bin/python3 import sys import argparse import formats import multiprocessing PARSER_DESC = "Simple TIGER rates calculator." FORMAT_ERROR_MSG = "Please specify one of the available formats: " + formats.getFormatsAsString() N_PROCESSES = int(multiprocessing.cpu_count()) class ActivePool(object): def __init_...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir MINIO_INTERNAL_PORT = 9001 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) CONFIG_PA...
test_base.py
import datetime import json import os import pytest import signal import sys import tempfile import time from multiprocessing import Pool, Process from freezefrog import FreezeTime from tasktiger import ( JobTimeoutException, StopRetry, Task, TaskNotFound, Worker, exponential, fixed, l...
ipygpulogger.py
import time, psutil, gc, tracemalloc from collections import namedtuple import threading from IPython import get_ipython have_cuda = 0 import torch if torch.cuda.is_available(): have_cuda = 1 import pynvml pynvml.nvmlInit() process = psutil.Process() def preload_pytorch(): if have_cuda: torch.ones((1...
lisp-core.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
HslCommunication.py
''' GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2017 - 2018 Richard.Hu <http://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser Gen...
create_rdb.py
#!/usr/bin/env python #coding:utf-8 ''' Created on 2019-03-05 @author: yunify ''' import qingcloud.iaas import threading import time from optparse import OptionParser import sys import os import qingcloud.iaas.constants as const import common.common as Common def get_topslave_rdb_instance_id(conn,user_id,rdb_id): ...
container.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
__init__.py
'''FLAsk support for OIDC Access Tokens -- FLAAT. A set of decorators for authorising access to OIDC authenticated REST APIs.''' # This code is distributed under the MIT License # pylint # vim: tw=100 foldmethod=indent # pylint: disable=invalid-name, superfluous-parens # pylint: disable=logging-not-lazy, logging-format...
history.py
# # This file is: # Copyright (C) 2018 Calin Culianu <calin.culianu@gmail.com> # # MIT License # from . import utils from . import gui from oregano import WalletStorage, Wallet from oregano.address import Address, PublicKey from oregano.util import timestamp_to_datetime, PrintError, profiler from oregano.i18n impor...
proxy.py
#!/usr/bin/env python3 import base64 import copy import datetime import json import math import re import socket import threading from collections import namedtuple from itertools import count from urllib.parse import urlparse, ParseResult, parse_qs, urlencode from subprocess import Popen, PIPE from http import cooki...
connection.py
import argparse import threading import socket import queue import enum DEFAULT_LOCAL_IP_ADDRESS = '0.0.0.0' DEFAULT_LOCAL_PORT_NUMBER = 8888 DEFAULT_REMOTE_IP_ADDRESS = 'localhost' DEFAULT_REMOTE_PORT_NUMBER = 9999 DEFAULT_BUFFER_SIZE = 1024 class LocalStatus(enum.Enum): SERVER_INITIALIZED = 'Local socket ini...
framereader.py
# pylint: skip-file import json import os import pickle import struct import subprocess import tempfile import threading from enum import IntEnum from functools import wraps import numpy as np from lru import LRU import _io from tools.lib.cache import cache_path_for_file_path from tools.lib.exceptions import DataUnre...
camera.py
import configparser import logging import math import os import pathlib import threading import time import glob from contextlib import contextmanager from functools import wraps from io import BytesIO from pathlib import Path from queue import Queue from typing import List import cv2 from PIL import Image, _webp from...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
bot.py
# coding=utf-8 # Copyright 2008, Sean B. Palmer, inamidst.com # Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> # Copyright 2012-2015, Elsie Powell, http://embolalia.com # # Licensed under the Eiffel Forum License 2. from __future__ import unicode_literals, absolute_import, print_function, division import col...
ManyHellosServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
app.py
from tkinter import Tk from multiprocessing import Process from application import Application from config import Config from upnp.upnp import Upnp import asyncio import websockets import concurrent.futures import json async def open_port_register(): upnp=Upnp() upnp.delete_port_mapping(tensorflow_port) up...
balance_server.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
terminal.py
import sublime import os import time import base64 import logging import tempfile import threading from queue import Queue, Empty from .ptty import TerminalPtyProcess, TerminalScreen, TerminalStream from .utils import responsive, intermission from .view import panel_window, view_size from .key import get_key_code fro...
bot_base.py
''' @ Harris Christiansen (Harris@HarrisChristiansen.com) January 2016 Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot Generals Bot: Base Bot Class ''' import logging from Queue import PriorityQueue import random import threading import time from client import generals from viewe...
client.py
import argparse import json import requests from threading import Thread from server import create_server class KeyValueClient: def __init__(self, host, port): self.url = f"http://{host}:{port}" self.session = requests.Session() def get_keys(self, keys): response = self.session.get(s...
gameserver.py
import board as b import chatroom import threading import time import sys, traceback import gameserverstatus as gss import warcode as wc # menu options SINGLE_PLAYER_OPTION = "1" MULTI_PLAYER_OPTION = "2" JOIN_PLAYER_OPTION = "3" QUIT_OPTION = "4" class TheGameServer: def __init__(self, m...
runtime.py
from concurrent.futures import ThreadPoolExecutor from functools import lru_cache, partial, wraps import inspect import threading import uuid import sublime import sublime_plugin MYPY = False if MYPY: from typing import Any, Callable, Dict, Iterator, Literal, Optional, Tuple, TypeVar T = TypeVar('T') F =...