source
stringlengths
3
86
python
stringlengths
75
1.04M
__init__.py
import logging import requests from flask import Flask from flask_restful import Api from multiprocessing import Process import cli from api.resources import HelloWorld, Shutdown def create_api(config_name='default'): app = Flask(__name__) api = Api(app) app.config.from_object(cli.api_config) api.ad...
test_distributed.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2021 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
bash.py
# -*- coding: utf-8 -*- import asyncio import os import sys import threading import pyte from bashbot import bot class BashSession: def __init__(self, terminal): self.name = None self.description = None self.status = "dead" self.controls = None self.message = None ...
__init__.py
import argparse import ipaddress import functools import os import signal import sys import threading import wsgiref.simple_server import prometheus_client import prometheus_client.core as core import pyudev from . import exporter from . import temper from . import wsgiext def main(): ''' You are here. '...
main_window.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import atexit import os import sys import time import json import logging import signal import socket import threading import configparser import platform #from tkinter import filedialog#, ttk #import tkinter import numpy as np from . import widgets impo...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum_ltc.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_ltc.bip32 import BIP32Node from electrum_ltc import constants from electrum...
DPPO_CHP.py
""" """ import tensorflow as tf from tensorflow.contrib.distributions import Normal import numpy as np import matplotlib.pyplot as plt import threading, queue from CHP.CHP_MODEL import CHPEnv import datetime EP_MAX = 2500 EP_LEN = 300 N_WORKER = 4 # parallel workers GAMMA = 0.9 # reward discount factor A_LR = 0.00...
marathonpoller.py
import requests import json import time import threading from .marathonevents import * from performance.driver.core.classes import Observer from performance.driver.core.events import TickEvent, TeardownEvent, StartEvent from performance.driver.core.reflection import subscribesToHint, publishesHint from performance.dr...
hplugins.py
import logging import os import uuid import threading import sys from PyQt5.QtCore import pyqtWrapperType log = logging.getLogger(__name__) log_i = lambda a: None log_d = lambda a: None log_w = lambda a: None log_e = lambda a: None log_c = lambda a: None class PluginError(ValueError): pass class PluginIDError(Plug...
master.py
import atexit import logging import multiprocessing import queue from collections import defaultdict, deque from functools import lru_cache from multiprocessing import Process, Queue from threading import Thread, RLock from time import sleep, time import flask import psutil import sentry_sdk from main import simple_s...
main.py
#!/usr/bin/env python # # Author: Younis Bensalah <younis.bensalah@gmail.com> # import os import sys import logging import threading import argparse sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../common')) from server import * from socketserver import UDPServer, BaseRequestHandler cla...
cache.py
from __future__ import absolute_import, division, print_function from builtins import filter, object, zip import io import multiprocessing as mp import os import platform import sqlite3 import time from datetime import datetime from glob import glob from itertools import groupby from blackfynn import log from blackfy...
Hover.py
#!/usr/bin/env python import rospy import tf from crazyflie_driver.msg import Hover from std_msgs.msg import Empty from crazyflie_driver.srv import UpdateParams from threading import Thread class Crazyflie: def __init__(self, prefix): self.prefix = prefix worldFrame = rospy.get_param("~worldFrame...
parmap.py
from multiprocessing import Process, Pipe from itertools import izip import time ## from https://stackoverflow.com/questions/3288595/multiprocessing-how-to-use-pool-map-on-a-function-defined-in-a-class def spawn(f): def fun(pipe,x): pipe.send(f(x)) pipe.close() return fun def parmap(f,X): ...
GoNord.py
import base64 import os from io import BytesIO from math import ceil import threading from PIL import Image, ImageFilter try: import importlib.resources as pkg_resources except ImportError: # Try backported to PY<37 `importlib_resources`. import importlib_resources as pkg_resources from .palettes impor...
core.py
#!/usr/bin/env python import enum import requests import logging import logging.handlers import os import socket import signal import sys import time import threading from configparser import ConfigParser from rpi_ws281x import PixelStrip from rpi_metar import cron, sources, encoder from rpi_metar.airports import Airp...
executor.py
# Copyright 2019 The Meson development 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 ...
test_sched.py
import queue import sched import time import unittest try: import threading except ImportError: threading = None TIMEOUT = 10 class Timer: def __init__(self): self._cond = threading.Condition() self._time = 0 self._stop = 0 def time(self): with self._cond: ...
Rain_geometry.py
from tkinter import * import random, threading, time, os # 初始雨滴纵坐标 INIT_HEIGHT = 1 # 雨滴创建 def rainmake(canvas, imagefile): rainlist = [] for i in range(5): # 根据图片,创建一排福字 rainlist.append(canvas.create_image(100 + 80 * i, INIT_HEIGHT, anchor=NE, image=imagefile)) return rainlist # 雨滴下落 def r...
snippet.py
#! /usr/bin/env python """ Pounce on an open OpenTable reservation. """ import sys, os, time, re, mechanize, gtk, webkit, threading, random rid = 1180 # OpenTable restaurant ID; 1180 = French Laundry people_choices = [3, 3, 3, 4] # number of people to request for; cycles through choices targetdate = parsedate ((5, 1...
extract_fuzzy_matches.py
"""Given source and target TM files, extract fuzzy matches for a new input file by using a variety of methods. You can use formal matching methods such as edit distance and set similarity, as well as semantic fuzzy matching with sent2vec and Sentence Transformers.""" import logging import multiprocessing import ...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fut...
manager.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...
ponselfbot.py
# -*- coding: utf-8 -*- #Cakmin_BOTeam Newbie #Owner:https://line.me/ti/p/~agsantr #Official Account:http://line.me/ti/p/%40fvz4767v #Instagram:cakminofficial import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, str...
test_cgroupconfigurator.py
# Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
a-lot-of-parallel-tasks.py
#!/usr/bin/env python """ More complex demonstration of what's possible with the progress bar. """ import random import threading import time from prompt_toolkit_dev import HTML from prompt_toolkit_dev.shortcuts import ProgressBar def main(): with ProgressBar( title=HTML('<b>Example of many parallel ...
queue_runner.py
# Copyright 2015 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...
test_model.py
import sqlite3 import threading import unittest from deepstar.models.model import Model from .. import deepstar_path class TestModel(unittest.TestCase): """ This class tests the Model class. """ def test_init(self): with deepstar_path(): self.assertEqual(type(Model.db), sqlite3....
bitmex_websocket.py
import hashlib import hmac import json import os import threading import time import traceback import urllib import websocket from datetime import datetime from src import logger, to_data_frame def generate_nonce(): return int(round(time.time() * 1000)) def generate_signature(secret, verb, url, nonce, data): ...
capture_cell_coordinates.py
#!/usr/bin/env python import rospy import roslib from std_msgs.msg import Int8, String import math import time import csv import threading from geometry_msgs.msg import PoseArray import sys import json #Defining a class class Record_Coordinates(): def __init__(self): rospy.init_node('whycon_record_nodes',anonymou...
watchers.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from app.utils import read_config from app.classes.iocs import IOCs from app.classes.whitelist import WhiteList import requests import json import urllib3 import time from multiprocessing import Process """ This file is parsing the watchers present ...
rest.py
import threading from queue import Queue from celery.task.control import inspect from flask import Blueprint, jsonify, current_app from app import db from app.errors import register_errors base_blueprint = Blueprint('', __name__) register_errors(base_blueprint) def are_celery_workers_running(): def worker(q): ...
interface.py
#!/usr/bin/python -OO # Copyright 2007-2019 The SABnzbd-Team <team@sabnzbd.org> # # 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 2 # of the License, or (at your option) any later...
example_sync.py
#!/usr/bin/env python3 """ This is an example of how the pytradfri-library can be used sync. To run the script, do the following: $ pip3 install pytradfri $ Download this file (example_sync.py) $ python3 example_sync.py <IP> Where <IP> is the address to your IKEA gateway. The first time running you will be asked to i...
_debugpy.py
"""Tools to enable debugpy attachment to a process.""" import threading import debugpy import portpicker _dap_port = None def enable_attach_async(): """Enable a debugger to attach to this process. Returns: The debug adapter port which can be connected to using the Debug Adapter Proxy protocol. """ ...
thread-spinner.py
import threading import itertools import sys import time class Signal: go = True def spin(msg, signal): write, flush = sys.stdout.write, sys.stdout.flush for char in itertools.cycle('|/-\\'): status = msg + ' ' + char write(status) flush() write('\x08' * len(status)) ...
test_ipc_log_listener.py
import tempfile import logging from multiprocessing import Process from pathlib import Path import uuid import pytest from trinity._utils.logging import IPCListener, IPCHandler @pytest.fixture def ipc_path(): with tempfile.TemporaryDirectory() as dir: yield Path(dir) / "logging.ipc" def test_queued_lo...
socketServer.py
import logging import sys import SocketServer import time logging.basicConfig(level=logging.DEBUG, format='%(name)s: %(message)s', ) class EchoRequestHandler(SocketServer.BaseRequestHandler): def __init__(self, request, client_address, server): self.logger = loggin...
photo.py
import os import tempfile import threading from gi.repository import Gdk from rawkit.options import Options from rawkit.raw import Raw class AutoUpdatingOptions(Options): """ A set of options that update the photo when they are updated. """ def __init__(self, attrs=None, photo=None): super...
run.py
import os import sys import argparse import time import multiprocessing import platform from fHDHR import fHDHR_VERSION, fHDHR_OBJ import fHDHR.exceptions import fHDHR.config from fHDHR.http import fHDHR_HTTP_Server from fHDHR.db import fHDHRdb ERR_CODE = 1 ERR_CODE_NO_RESTART = 2 if sys.version_info.major == 2 or ...
middleware.py
from multiprocessing import Process, Queue import requests import gevent def child_process(queue): while True: print(queue.get()) requests.get('http://requestb.in/15s95oz1') class GunicornSubProcessTestMiddleware(object): def __init__(self): super(GunicornSubProcessTestMiddleware, self...
eqpay_transaction_receipt_origin_contract_address.py
#!/usr/bin/env python3 from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.mininode import * from test_framework.address import * import threading def waitforlogs(node, contract_address): logs = node.cli.waitforlo...
bazel_build.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright 2016 The Tulsi 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/LICE...
__init__.py
#!/usr/bin/env python """ fs.tests: testcases for the fs module """ # Send any output from the logging module to stdout, so it will # be captured by nose and reported appropriately import sys import logging logging.basicConfig(level=logging.ERROR, stream=sys.stdout) from fs.base import * from fs.path import ...
engine.py
""" Main BZT classes Copyright 2015 BlazeMeter Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
test_time.py
import os import threading import time from datetime import datetime as dt from datetime import timezone as tz import pytest from astropy import units as u from panoptes.utils import CountdownTimer from panoptes.utils import current_time from panoptes.utils import error from panoptes.utils.time import wait_for_events ...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import multiprocessing import os import socket import shutil import s...
webhook.py
# # Copyright 2021, NTT Communications Corp. # # 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 applic...
test_conveyor.py
# -*- coding: utf-8 -*- # Copyright 2015-2022 CERN # # 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...
newswrapper.py
#!/usr/bin/python -OO # Copyright 2008-2017 The SABnzbd-Team <team@sabnzbd.org> # # 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 2 # of the License, or (at your option) any later...
sfor_simple.py
# -*- coding: utf-8 -*- import logging import time import datetime import httplib import random from threading import Thread, Lock class SforNodeInfo: def __init__(self, host, port, check_path): self.host = host self.port = port self.check_path = check_path self.status = True self.l...
bilibiliapi.py
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- """Bilibili Toolkit 哔哩哔哩工具箱 https://github.com/Hsury/Bilibili-Toolkit""" banner = r""" \\ // \\ // ##################### ________ ___ ___ ___ ________ ___ ___ ___ ## ## |\ __ \ |\ ...
xml_reporter_test.py
# Copyright 2017 The Abseil Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
conftest.py
"""Fixtures and setup / teardown functions Tasks: 1. setup test database before starting the tests 2. delete test database after running the tests """ import os import copy import random from collections import namedtuple from logging import getLogger from logging.config import dictConfig import pytest from pymongo ...
project_files_monitor_test.py
# Copyright (c) 2019-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import os import socket import tempfile import threading import unittest from unittest.mock import MagicMock, patch from .. import language_server_...
bpytop.py
#!/usr/bin/env python3 # pylint: disable=not-callable, no-member # indent = tab # tab-size = 4 # Copyright 2020 Aristocratos (jakob@qvantnet.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 a copy of the...
udpserverex2.py
import socketserver from multiprocessing import Process, Pool class MyTCPHandler(socketserver.BaseRequestHandler): """ The request handler class for our server. It is instantiated once per connection to the server, and must override the handle() method to implement communication to the client. ...
motion_sensor_component.py
"""This module contains the MotionSensorComponent type.""" import threading from datetime import datetime from raspy.invalid_operation_exception import InvalidOperationException from raspy.object_disposed_exception import ObjectDisposedException from raspy.components.sensors.motion_sensor import MotionSensor from ras...
run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ fMRI preprocessing workflow ===== """ import os import os.path as op from pathlib import Path import logging import sys import gc import re import uuid import json import tempfile import psutil import warnings import subprocess from argparse import ArgumentParser from...
runner.py
from __future__ import division from collections import deque import numpy as np import os from os.path import abspath, dirname, join import subprocess import sys import time import threading from relay import log, configure_logging, add_zmq_log_handler from relay import util from relay import argparse_shared as at ...
RoutingAttackKit.py
#!/usr/bin/python # # Currently implemented attacks: # - sniffer - (NOT YET IMPLEMENTED) Sniffer hunting for authentication strings # - ripv1-route - Spoofed RIPv1 Route Announcements # - ripv1-dos - RIPv1 Denial of Service via Null-Routing # - ripv1-ampl - RIPv1 Reflection Amplification DDoS # - ripv...
test_async_cached_property.py
# -*- coding: utf-8 -*- import asyncio import time import unittest from threading import Lock, Thread from freezegun import freeze_time import property_cached as cached_property def unittest_run_loop(f): def wrapper(*args, **kwargs): coro = asyncio.coroutine(f) future = coro(*args, **kwargs) ...
schedule.py
import time from multiprocessing import Process import asyncio import aiohttp try: from aiohttp.errors import ProxyConnectionError,ServerDisconnectedError,ClientResponseError,ClientConnectorError except: from aiohttp import ClientProxyConnectionError as ProxyConnectionError,ServerDisconnectedError,ClientRespons...
util.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # 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 t...
fisheye_stream_to_rtsp.py
#!/usr/bin/env python3 import sys sys.path.append('/usr/local/lib/') import pyrealsense2 as rs import cv2 import gi import time import numpy as np gi.require_version('Gst', '1.0') gi.require_version('GstRtspServer', '1.0') from gi.repository import Gst, GstRtspServer, GLib frame_left = None frame_right = None last...
global_manager.py
from multiprocessing import Lock from threading import Thread from message import * class GlobalManger(object): __instance = None __inited = False _l = Lock() def __new__(cls, *args, **kwargs): if not cls.__instance: cls.__instance = super().__new__(cls) return cls.__insta...
analysis.py
from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import str from builtins import range from builtins import object import re import collections import threading import queue import time from androguard.core.androconf import warning, debug, is_as...
utils.py
import os import threading from http.server import HTTPServer, SimpleHTTPRequestHandler from tempfile import mkdtemp import requests import requests_cache from . import get_logger lgr = get_logger() class LoggingRequestHandler(SimpleHTTPRequestHandler): def log_message(self, format, *args): lgr.debug(fo...
utils_test.py
from __future__ import print_function, division, absolute_import import collections from contextlib import contextmanager import copy from datetime import timedelta import functools import gc from glob import glob import itertools import logging import logging.config import os import re import shutil import signal imp...
serv.py
import os,sys,logging import signal, time, atexit, threading from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler import xmlrpclib import threading import Queue try: import sqlite3 except ImportError: from pysqlite2 import dbapi2 as sqlite3 import bb.server.xmlrpc import prserv import...
ch.py
#!/usr/bin/env python # Filename: jpp.py # pylint: disable= """ Pump for the jpp file read through aanet interface. """ from thepipe import Module, Blob from km3pipe.controlhost import Client from km3pipe.time import Cuckoo from km3pipe.logger import get_logger import threading import socket import time import numpy ...
securecore.py
from pox.core import core from pox.lib.revent import revent import pox.openflow.libopenflow_01 as of import pox.openflow.nicira as nx from pox.openflow.discovery import Discovery from pox.lib.util import dpid_to_str from pox.lib.util import str_to_bool from pox.lib.addresses import IPAddr from pox.lib.addresses import ...
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...
n1ql_aggregate_pushdown_recovery.py
import itertools import logging import threading from couchbase_helper.tuq_helper import N1QLHelper from membase.api.rest_client import RestConnection from remote.remote_util import RemoteMachineShellConnection from tuq import QueryTests log = logging.getLogger(__name__) AGGREGATE_FUNCTIONS = ["SUM", "MIN", "MAX", ...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import math import sys import re import subprocess import select import shutil import shlex import signal import hashlib import thre...
tabulator.py
# Copyright (c) 2012 # Jakob van Santen <jvansanten@icecube.wisc.edu> # Claudio Kopper <claudio.kopper@icecube.wisc.edu> # and the IceCube Collaboration <http://www.icecube.wisc.edu> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided th...
platform_utils.py
# -*- coding:utf-8 -*- # # Copyright (C) 2016 The Android Open Source Project # # 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 re...
reconstruction.py
########################################################################## # MediPy - Copyright (C) Universite de Strasbourg # Distributed under the terms of the CeCILL-B license, as published by # the CEA-CNRS-INRIA. Refer to the LICENSE file or to # http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html # for de...
downloadclient.py
# -*- coding: utf-8 -*- # Copyright European Organization for Nuclear Research (CERN) since 2012 # # 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-...
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_dash.dash_ps_util import (PSPossibleDoubleSpendError, PSSpe...
colector.py
import os import sys sys.path.insert(0, os.path.abspath(os.path.dirname(os.path.realpath(__file__)))) import requests import urllib.request import json from io import StringIO import time import colect_exceptions import pandas as pd from datetime import datetime, timezone import threading class Colect...
sensors.py
import RPi.GPIO as GPIO import Adafruit_DHT import time, threading, spidev from pubnub.callbacks import SubscribeCallback from pubnub.enums import PNStatusCategory from pubnub.pnconfiguration import PNConfiguration from pubnub.pubnub import PubNub pnconfig = PNConfiguration() pnconfig.subscribe_key = 'sub-c-c96cd480-...
concurrency_test.py
#!/usr/bin/env python # coding: utf-8 import os import sys import datetime import time import random import threading import socket from it.paxoscli import PaxosClient, PaxosError, ids_dic, init_view, request, request_ex from it.ngxctl import ngx_start, ngx_stop, ngx_restart from it.sto import init_sto g1 = ids_dic(...
compare_with_pip_compile.py
from __future__ import print_function import os import shutil import subprocess import sys import tempfile import threading import time from argparse import ArgumentParser import pkg_resources from req_compile.utils import reqs_from_files, normalize_project_name, has_prerelease def run_qer_compile(reqfile, index_u...
downloader.py
from __future__ import unicode_literals import os, sys import re import shutil import traceback import threading from youtube_dl.downloader.http import HttpFD from youtube_dl.downloader.hls import HlsFD from youtube_dl.downloader.M3u8Downloader import FFmpegFD as FFmpegFDEx from youtube_dl.downloader.OldM3u8...
droplets.py
from .digitaloceanapiconnection import DigitalOceanAPIConnection import os import time import queue import threading import datetime import random import json class Droplets(DigitalOceanAPIConnection): """[summary] Args: DigitalOceanAPIConnection ([type]): [description] API Returns Droplet Attri...
plot_mode_base.py
from __future__ import print_function, division from pyglet.gl import * from plot_mode import PlotMode from threading import Thread, Event, RLock from color_scheme import ColorScheme from sympy.core import S from sympy.core.compatibility import is_sequence from time import sleep import warnings class PlotModeBase(Pl...
oradock.py
#!/usr/bin/env python """ Oradock project is an Oracle Database 11g manager system integrated with Docker, where you can easily start a database from the scratch or download & recover a backup from s3 (aws). For more information, please visit https://github.com/rafaelmariotti/oradock Usage: oradock.py (restore |...
kaldi_egs.py
from utils.misc import get_logger log = get_logger() import threading, time import utils.kaldi_io import numpy as np def load_and_prep_dev_set_tar(egs_dir, nnet3_copy_egs_to_feats): dev_feat_rsp = "ark:" + nnet3_copy_egs_to_feats + " ark:" + egs_dir + "/valid_egs.1.ark ark:- |" dev_feats_generator = u...
console.py
"""Acquire debugging information from usb hid devices cli implementation of https://www.pjrc.com/teensy/hid_listen.html """ from pathlib import Path from threading import Thread from time import sleep, strftime import hid import usb.core from milc import cli LOG_COLOR = { 'next': 0, 'colors': [ '{fg...
test_win32file.py
from __future__ import print_function import unittest from pywin32_testutil import str2bytes, TestSkipped, testmain import win32api, win32file, win32pipe, pywintypes, winerror, win32event import win32con, ntsecuritycon import sys import os import tempfile import threading import time import shutil import socket import ...
test_run.py
import contextvars import functools import platform import sys import threading import time import types import warnings from contextlib import contextmanager, ExitStack from math import inf from textwrap import dedent import gc import attr import outcome import sniffio import pytest from .tutil import ( slow, ...
main_frontend.py
import datetime import ftplib import os import sys from threading import Thread from typing import List import logging from PyQt5.QtCore import QDate, pyqtSignal, QObject from PyQt5.QtWidgets import QApplication, QMainWindow, QCheckBox, QMessageBox, QWidget, QVBoxLayout from SPSLib import SPSLib, SPSConnectionExcepti...
subproc_vec_env.py
import multiprocessing as mp import numpy as np from .vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars def worker(remote, parent_remote, env_fn_wrappers): def step_env(env, action): ob, reward, done, info = env.step(action) if done: ob = env.reset() return ob, rew...
game_ver4.py
import pygame from random import * from turtle import* import time import led_display as led import threading #################### T-REX RUN #################### pygame.init() Pixel = 30 win = pygame.display.set_mode((32*Pixel, 16*Pixel)) X = 3 * Pixel Y = 16 * Pixel - Pixel vel_x = 10 vel_y = 10 jump...
interface.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Quantum Calculator User Interface Module Author: Hideto Manjo Licence: Apache License 2.0 ''' import sys import time import threading import os import configparser import wx from libqc import QC VERSION_TEXT = '0.0.2' CONFIG_FILENAME = './default.conf' # default con...
okcoinGateway.py
# encoding: UTF-8 ''' vn.okcoin的gateway接入 注意: 1. 前仅支持USD和CNY的现货交易,USD的期货合约交易暂不支持 ''' import os import json from datetime import datetime from time import sleep from copy import copy from threading import Condition from Queue import Queue from threading import Thread from time import sleep from vnpy.api.okcoin impo...
main.py
# Setup logging import logging # logging.basicConfig(filename="main.log", filemode="w", level=logging.DEBUG) import sys import websocket import json import unity_socket from threading import Thread from event_data import EventData from actions import InvokeMethodAction, SetFieldPropertyAction, PlayModeAction, PauseMod...