source
stringlengths
3
86
python
stringlengths
75
1.04M
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 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...
progress.py
"""Small GUI for displaying resource discovery progress to the user.""" import collections import threading # from tkinter import ttk # # import tkinter as tk # import tkinter.messagebox # import ttk # import tk class LifetimeError(Exception): """Progress was interrupted (i.e., window closed or cancel button was...
rust_test_common.py
import sublime import queue import sys import os import unittest import subprocess import threading import time # Used for debugging. from pprint import pprint # Depends on how you install the plugin. plugin = sys.modules.get('sublime-rust', sys.modules.get('Rust Enhanced', None)) if not plugin: raise ValueErr...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import sys import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseM...
online_for_frame_and_prediction.py
""" Run the online classification system. Capture an image, classify, do it again. """ import time from picamera import PiCamera from picamera.array import PiRGBArray import tensorflow as tf from pythonosc import osc_message_builder from pythonosc import udp_client import cv2 import numpy as np import threading #...
test_ki.py
import outcome import pytest import sys import os import signal import threading import contextlib import time from async_generator import ( async_generator, yield_, isasyncgenfunction, asynccontextmanager ) from ... import _core from ...testing import wait_all_tasks_blocked from ..._util import signal_raise, is_...
twitter_corpus.py
# Copyright (C) 2012-2013 Wesley Baugh # # This work is licensed under the Creative Commons # Attribution-NonCommercial-ShareAlike 3.0 Unported License. # To view a copy of this license, visit: # http://creativecommons.org/licenses/by-nc-sa/3.0/ # # This file was created using the streaming example from Tweepy # as a g...
NetworkHandler.py
import json import queue import threading import time from typing import Optional import requests import Uncuffed.transactions as Transactions import Uncuffed.chain as Chain from Uncuffed import log from .PeerNetwork import PeerNetwork from .Peer import Peer import Uncuffed.web.routes class NetworkHandler: __...
common.py
"""Test the helper method for writing tests.""" import asyncio import collections from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta import functools as ft from io import StringIO import json import logging import os import sys import threading import time import uu...
movo_comm.py
"""-------------------------------------------------------------------- Copyright (c) 2017, Kinova Robotics inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code mus...
tracker.py
""" Tracker script for DMLC Implements the tracker control protocol - start dmlc jobs - start ps scheduler and rabit tracker - help nodes to establish links with each other Tianqi Chen """ # pylint: disable=invalid-name, missing-docstring, too-many-arguments, too-many-locals # pylint: disable=too-many-branches, too...
seleniumServerStart.py
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- ''' @author: yuejl @application: @contact: lewyuejian@163.com @file: seleniumServerStart.py @time: 2021/7/10 0010 23:42 @desc: ''' import multiprocessing import os import platform import subprocess from common import BASE_PATH from common.base.read_web_ui_config import R...
terminal.py
#!/usr/bin/env python3 #author : Kade Cooper kaco0964@colorado.edu #name : terminal.py #purpose : Foundation for terminal commands and possible GUI linkage #date : 2018.02.02 #version: 1.0.2 #version notes (latest): Optimized for python2/3 import os import sys from multiprocessing import Process #For multiprocessi...
dirstructure.py
################################################################################ # RelMon: a tool for automatic Release Comparison # https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon # # # # Danilo Piparo CER...
job_sender.py
import time import json import threading from collections import Counter from loguru import logger from config import SYSTEM_CONFIG from utils import send_post_request class JobSender: @staticmethod def _send_req_in_thread(job): headers = {"Content-Type": "application/json", "username": "ncku"} ...
omsagent_mc.py
#!/usr/bin/env python # # OmsAgentForLinux Extension # # Copyright 2015 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....
baseloader.py
import threading import logging from ..core.config import settings logging.root.setLevel(level=logging.INFO) class Loader: def __init__(self): self._in_progress = True self._data_bucket = settings.DATA_BUCKET self._cadai_bucket = settings.CADAI_BUCKET self._fs = settings.FILE_SYS...
potc_gui_v_4.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'potc_analysis_gui.ui' # # Created by: PyQt5 UI code generator 5.11.3 # # WARNING! All changes made in this file will be lost! from PyQt5 import QtCore, QtGui, QtWidgets #import rospy import math import pandas as pd im...
launcher.py
import os import time import socket import json import argparse import threading import subprocess import itertools import logging import elftools.elf.elffile import service import riscv.constants def tx(conns, msg): _message = { str: lambda : json.dumps({'text': msg}), dict: lambda : json.dumps(...
wyzesense_custom.py
from builtins import bytes from builtins import str import os import time import six import struct import threading import datetime import argparse import binascii import errno import logging log = logging.getLogger(__name__) def bytes_to_hex(s): if s: return binascii.hexlify(s) else: return ...
main.py
""" An example demonstrating a stand-alone "terminal". Copyright (c) Jupyter Development Team. Distributed under the terms of the Modified BSD License. Example ------- To run the example, see the instructions in the README to build it. Then run ``python main.py`` and navigate your browser to ``localhost:8765``. Not...
shuffled_louvain.py
# -*- coding: utf-8 -*- """ Created on Wed Jul 27 2016 Module: shuffled_louvain - Louvain community detection with shuffled node sequence Authors: Fabio Saracco, Mika Straka Description: Louvain community detection with shuffled node sequence are performed and the community structure with the highest...
utils.py
import random import operator import time import numpy as np import tensorflow as tf from multiprocessing import Process, Pipe def safemean(xs): return np.nan if len(xs) == 0 else np.mean(xs) def tf_sum(x, axis=None, keepdims=False): axis = None if axis is None else [axis] return tf.reduce_sum(x, axis=a...
Misc.py
## @file # Common routines used by all tools # # Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license m...
safe_t.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, versiontuple, UserCancelled, UserFacingException from electrum_ltc.bip32 import BIP32Node from electrum_ltc import constants...
app.py
import json from threading import Thread from flask import Flask, request from Utils.PackageUtils import get_packaging_sign app = Flask(__name__) @app.route('/say_hi') def hello_world(): return 'hello' @app.route('/package/feeler', methods=['POST']) def package_feeler(): feeler_config_dict = {"aar_file":...
apollo_client.py
# -*- coding: utf-8 -*- import os import json import logging import threading import time import requests class ApolloClient(object): def __init__(self, app_id, cluster='default', config_server_url='http://localhost:8080', timeout=35, ip=None): self.config_server_url = config_server_url self.appI...
mem_prof.py
import os import time from termcolor import colored import datetime import threading from threading import Event, Thread # 5 pages from the monitoring to dpdk # cgroup seems including dpdk memory usage # DPDK_MEM = (5 * 2 * 1024 * 1024) # seems you cannot pass 1.2M to cgroup. # you should first do "export TMPDIR=/t...
test_utils.py
"""Utilities shared by tests.""" import collections import contextlib import io import unittest.mock import os import sys import threading import time import unittest import unittest.mock from wsgiref.simple_server import make_server, WSGIRequestHandler, WSGIServer try: import ssl except ImportError: # pragma: no...
airtest_bot.py
#! /usr/bin/python # -*-coding: UTF-8 -*- # airtest 机器人框架 # import re import inspect from airtest_ext.debug_wnd import DebugWindow from airtest_ext.utils import * from mitmproxy import http from airtest_ext.mitmproxy_svr import MitmDumpThread from abc import abstractmethod from frida_hooks.agent import FridaAgent from ...
sync.py
# Copyright (C) 2008 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 required by applicable law ...
pyflow.py
#!/usr/bin/env python # # pyFlow - a lightweight parallel task engine # # Copyright (c) 2012-2015 Illumina, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source ...
hybrid_offset.py
# import threading import multiprocessing import time import numpy as np from types import SimpleNamespace import pybullet import pybullet_data import pybullet_utils.bullet_client as bc def setup_exp(p,offset_x,offset_y): mu = 0.65 object_ids = [] local_path = "./" state = ([-0.0404755 +offset_x, -0...
misc.py
# -*- coding: utf-8 -*- from __future__ import print_function import logging import random import socket import threading from datetime import datetime import requests from bs4 import BeautifulSoup from six.moves import urllib import settings hds = [{'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv...
pycotcp.py
#!/usr/bin/env python """ pycotcp main module Contains DeviceInfo and Pyco :platform: Unix, Windows :synopsis: Main module .. moduleauthor:: Federico Giuggioloni <federico.giuggioloni@gmail.com> """ from picotcpadapter import PicoTCPAdapter from threading import Thread from time import sleep class Dev...
logger.py
"""Module of logging""" from typing import ClassVar, List, Optional, TypeVar, Union import abc import functools import os import sys import warnings import logging import logging.config from logging import LogRecord import datetime import multiprocessing import time import rich.logging from rich.console import ConsoleR...
Tron_Environment.py
from enum import Enum import time import copy import sys import subprocess import random from threading import Thread def monitorFile(connection, queue): while True: try: line = connection.readline() except: break if not line: queue.append(None) break line = line.rstrip("\n") queue.append(line)...
main_program.py
import server, subprocess, threading from midiutil import MidiFile3 # Starts server and other processes # Uses concurrency to monitor user input def run_processes(stop_event): child = subprocess.Popen('sketch_150125a\\application.windows64\\sketch_150125a') server.start_server() def stop_processes(stop_event): ...
multiprocess_test_case.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import multiprocessing import os import sys import tempfile import traceback import unittest import warnings from func...
main.py
from globals import * import tkinter as tk import serial import threading, time from os import path # Creating the root (window) root = tk.Tk() # Create serial port ser = serial.Serial('com3', 9600, timeout=1) class MotorUI(): def __init__(self) -> None: self.buttonWidth1 = 100 self.labelWidth1 =...
build_nexe.py
#!/usr/bin/python # Copyright (c) 2012 The Native Client Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """NEXE building script This module will take a set of source files, include paths, library paths, and additional arguments, and ...
dorna_moveit_real.py
#!/usr/bin/env python2 import sys from threading import Thread import rospy import tf2_ros import moveit_commander from moveit_python import PlanningSceneInterface from geometry_msgs.msg import PoseStamped, Pose from moveit_msgs.msg import RobotState, RobotTrajectory, DisplayTrajectory, CollisionObject from pix_2_w...
async_data.py
# Copyright (c) Microsoft, Inc. 2020 # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # # Author: penhe@microsoft.com # Date: 05/15/2019 # from queue import Queue,Empty from threading import Thread class AsyncDataLoader(object): def __init_...
client.py
import argparse import requests import random import threading import time import logging import socket import sys def do_request(s, args): addrs = socket.getaddrinfo(args.target, args.port) addrs = [a for a in addrs if a[0] == socket.AF_INET] if len(addrs) <= 0: logging.info("Could not resolve %s", ...
callbacks_test.py
# Copyright 2016 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...
extractor_balances.py
from threading import Thread from queue import Queue import logging import pandas as pd from src.utils_eth import get_balance from src.utils_bigquery import get_df from config import PROJECT_ID, ERC20_ROW_BALANCES_TABLE_NAME, ERC20_ANALYSIS_DATASET_NAME def _get_address_and_token(token_address: str, limit: int) -> p...
brutespray.py
#!/usr/bin/python # -*- coding: utf-8 -*- from argparse import RawTextHelpFormatter import readline, glob import sys, time, os import subprocess import xml.dom.minidom import re import argparse import argcomplete import threading import itertools import tempfile import shutil from multiprocessing import Process servic...
line_detector_node.py
#!/usr/bin/env python from anti_instagram.AntiInstagram import AntiInstagram from cv_bridge import CvBridge, CvBridgeError from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment, SegmentList, Vector2D) from duckietown_utils.instantiate_utils import instantiate from duckietown_utils.jpg import...
viewer.py
import numpy as np import Tkinter as tk import matplotlib.pyplot as plt import seaborn as sns from threading import Thread import matplotlib.backends.tkagg as tkagg from matplotlib.backends.backend_agg import FigureCanvasAgg import plotting class Viewer: def __init__(self, master, data, bg, cmap): sel...
ng.py
#!/usr/bin/env python # # Copyright 2004-2015, Martian Software, Inc. # Copyright 2017-Present Facebook, 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/license...
test_local_api_service.py
""" Function test for Local API service """ import os import shutil import random import threading import requests import time import logging from samcli.commands.local.lib.provider import Api from samcli.local.apigw.local_apigw_service import Route from samcli.commands.local.lib import provider from samcli.commands....
gossip_client.py
#!/usr/bin/python3 import argparse import hexdump import socket import struct import threading import time from typing import List from util import connect_socket, sync_read_message GOSSIP_ANNOUNCE = 500 GOSSIP_NOTIFY = 501 GOSSIP_NOTIFICATION = 502 GOSSIP_VALIDATION = 503 class GossipClient: def __init__(self...
trezor.py
import traceback import sys from typing import NamedTuple, Any from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path from electrum import const...
util.py
"""Test utilities.""" from importlib import reload as reload_module import io import logging from multiprocessing import Event from multiprocessing import Process import shutil import sys import tempfile import unittest import warnings from cryptography.hazmat.backends import default_backend from cryptography.hazmat.p...
43_multiprocess_manager.py
""" 与共享内存相比,Manager更加灵活,因为它可以支持多种对象类型,包括:list、dict、Value、Array、Namespace, Lock、RLock、Semaphore、BoundedSemaphore、Condition、Event、Barrier、Queue等。此外,Manager还可以通过网络被不同计算机上的进程所共享。但是,Manager的速度比共享内存要慢。 """ from multiprocessing import Process from multiprocessing import Manager def f(): d[1] = 18 d[2] = 56 l.rev...
test_base.py
import unittest import subprocess as sp import threading import os import time import taish TAI_TEST_MODULE_LOCATION = os.environ.get('TAI_TEST_MODULE_LOCATION', '') if not TAI_TEST_MODULE_LOCATION: TAI_TEST_MODULE_LOCATION = '0' TAI_TEST_TAISH_SERVER_ADDRESS = os.environ.get('TAI_TEST_TAISH_SERVER_ADDRESS', '') ...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
multiprocessing_no_inheritance.py
#!/usr/bin/env python # # Author: Daniela Duricekova <daniela.duricekova@gmail.com> # import multiprocessing NUMS = list(range(25, 33)) def fib(n): if n <= 1: return 1 else: return fib(n - 1) + fib(n - 2) def n_fib(n, results): results.put((n, fib(n))) if __name__ == '__main__': ...
dynamic.py
# 以子线程方式启动事件循环,主线程用于往其中动态添加任务 # 内存峰值 300M, 花费 20 秒 import asyncio import datetime , time from threading import Thread # import uvloop t_now = time.time() now = datetime.datetime.now() def start_loop(loop): asyncio.set_event_loop(loop) loop.run_forever() async def do_some_work(x): print('Waiting {}'.forma...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io> import sys import threading import time import uuid import warnings from collections import namedtuple import numpy as np import zmq from zmq.utils import jsonapi __all__ = ['__version__', 'BertClient'] # in th...
parasol.py
# Copyright (C) 2015-2016 Regents of the University of California # # 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 app...
featurator.py
# =============================================================================== # Copyright 2011 Jake Ross # # 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/licens...
rest.py
''' Modular Input Script Copyright (C) 2012 Splunk, Inc. All Rights Reserved ''' import sys,logging,os,time,re,threading import xml.dom.minidom import tokens from datetime import datetime SPLUNK_HOME = os.environ.get("SPLUNK_HOME") RESPONSE_HANDLER_INSTANCE = None SPLUNK_PORT = 8089 STANZA = None SESSION_TOKEN = N...
sample_generator.py
from collections import deque import threading import randomgen from .perlin import create_perlin_noise, calc_fade class SampleGenerator: """ Multi-threaded util that runs in the background and precalculates noise samples. To be used in with statement! Not a python "generator". Sorry about th...
camera_main.py
""" ********************************************************************* This file is part of: The Acorn Project https://wwww.twistedfields.com/research ********************************************************************* Copyright (c) 2019-2021 Taylor Alexande...
sensor.py
import os import random import datetime import json import sys import pika from threading import Thread, Lock from time import sleep class Sensor: metric = os.getenv("S_METRIC", "temperature") unit = os.getenv("S_UNIT", "C") min = float(os.getenv("S_MIN", 0)) max = float(os.getenv("S_MAX", 30)) st...
PublicApi.py
# Subject: This is GMOcoin.publicAPI's feature provided by below code. # Apiref: https://api.coin.z.com/docs/#ws-ticker Refalence at symbol. import websocket import json as js from threading import Thread import time from logging import getLogger, StreamHandler, DEBUG defalut_logger = getLogger(__name__) ...
trezor.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, versiontuple, UserCancelled from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import deserialize_xpub from electrum import constants from electrum.i18n import _ from electrum.plugin import ...
observerclient.py
import paho.mqtt.client as mqtt import os,json,time, random from threading import Thread # we are going to maintain this dictionary todos = [] # This class is wrapper for mqtt client, copied from # paho examples class MyMQTTClass: def __init__(self, clientid=None): self._mqttc = mqtt.Client(clientid) ...
conductor.py
# Conductor import sys import math import mido import time import pprint import copy import re import threading from solace.client import SolaceMQTTClient from os import listdir, getcwd, getpid from os.path import isfile, join import json def get_unique_notes_in_channel(notes_in_channel): """ Utility funct...
cluster_test.py
# Copyright (c) 2018 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 app...
process_helper.py
#!/usr/bin/env python3 import queue import time import os import atexit import subprocess import shutil import threading import errno from typing import Any, Dict, List, TextIO, Optional class Runner: def __init__(self, log_dir: str, model: str, case: str, ...
TFCluster.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """ This module provides a high-level API to manage the TensorFlowOnSpark cluster. There are three main phases of operation: 1. **Reservation/Startup** - reserves a port for the T...
Drivers.py
import logging, math def get(name,modus): driver = None logging.info('try to get %s driver'%name) if('keyboard' == name):driver = KeyboardDriver().create() elif('gamepad' == name):driver = GamepadDriver().create() elif('default' == name):driver = DefaultDriver() else: # search in directory ...
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...
opencv_inmemory_display_experimental.py
# Copyright 2020 Wearless Tech 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...
optimization.py
import hashlib import json from copy import copy from datetime import datetime from itertools import product from logging import getLogger from threading import Thread, Event from time import time from typing import Union, Any, Sequence, Optional, Mapping, Callable from .job import TrainsJob from .parameters import Pa...
stream.py
##python3.7 ##Dixon Styres 8/29/18 ##Work@Crowdstrike #streaming.py This class interacts with the streaming API and fills a common Queue with detection Events import hashlib import os import base64 import time import datetime import hmac import requests import json import threading import traceback class Stream(): ...
test_stream.py
import gc import threading import unittest import pytest import cupy from cupy._creation import from_data from cupy import cuda from cupy import testing @testing.parameterize( *testing.product({ 'stream_name': ['null', 'ptds'], })) @testing.gpu class TestStream(unittest.TestCase): def setUp(sel...
server.py
''' This module defines the behaviour of server in your Chat Application ''' import sys import getopt import socket import util import threading import queue import time import random q_dic={} class Server: ''' This is the main Server Class. You will to write Server code inside this class. ''' def __in...
env_runner.py
import collections import logging import os import signal import time from multiprocessing import Value from threading import Thread from typing import List from typing import Union import numpy as np from yarr.agents.agent import Agent from yarr.agents.agent import ScalarSummary from yarr.agents.agent import Summary...
test_utils_test.py
import asyncio from contextlib import contextmanager import socket import threading from time import sleep import pytest from tornado import gen from distributed import Scheduler, Worker, Client, config, default_client from distributed.core import rpc from distributed.metrics import time from distributed.utils_test i...
test.scan.run.py
import os import time import threading LK = threading.Lock() Ni = 20 + 1 Nj = 20 + 1 Np = 4 FF = [] CC = [] for i in range( Ni ): for j in range( Nj ): CC.append( ( i, j ) ) FF.append( not os.path.isfile( "pes.%d.%d"%( i, j ) ) ) NN = len( FF ) def worker( num ): global LK, CC, FF, NN ...
copy.py
import calendar import functools import os import struct import tempfile import threading from datetime import date, datetime try: from itertools import izip as zip except ImportError: pass from psycopg2.extensions import encodings from . import inspect, util __all__ = ['CopyManager'] BINCOPY_HEADER = stru...
notifymaster.py
#! /usr/bin/env python3 import os import re import ssl import sys #import bs4 # apt-get install python3-bs4 import time import json import socket import string import threading import subprocess # Setup the IRC connection irc = socket.socket() irc = ssl.wrap_socket(irc) # List of currently active threads threadlist ...
peripherals.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import RPi.GPIO as GPIO #import io import time from threading import Timer import threading try: import queue as Queue except ImportError: import Queue as Queue import spidev from math import ceil def clean(): GPIO.cleanup() global status status = False de...
routes.py
# ****************************************************************************** # Copyright (c) 2020 University of Stuttgart # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. # # Licensed under the Apache License, Version 2.0 (the "License"); # you m...
target.py
"""The target command.""" import os import re import socket import sys import threading from urllib.parse import urlsplit from anubis.scanners.anubis_db import search_anubisdb, send_to_anubisdb from anubis.scanners.crt import search_crtsh from anubis.scanners.dnsdumpster import search_dnsdumpster from anubis.scanners....
stream.py
# stream.py/Open GoPro, Version 1.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Tue May 18 22:08:50 UTC 2021 """Entrypoint for taking a picture.""" import sys import time import logging import argparse import threading from pathlib import Path from typing import...
sctreeshap.py
__name__ = 'sctreeshap' __version__ = "0.7.5" headers = {'User-Agent':'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'} import time import threading import numpy as np import anndata as ad import pandas as pd def checkUpdates(): import requests try: url = "htt...
spcconvert.py
# -*- coding: utf-8 -*- """ spcconvert - batch conversion and webpage building for SPC images """ import cvtools import cv2 import os import sys import glob import time import datetime import json import shutil import math import tarfile from multiprocessing import Pool, Process, Queue from threading import Thread im...
conftest.py
import os from threading import Thread import pytest from tanit.master.client.factory import ClientType from tanit.master.client.factory import ThriftClientFactory from tanit.master.config.config import MasterConfig from tanit.master.server.server import MasterServer from tanit.worker.server.server import WorkerServe...
train_pg.py
import numpy as np import tensorflow as tf import gym import logz import scipy.signal import os import time import inspect from multiprocessing import Process #============================================================================================# # Utilities #====================================================...
temp_http_server.py
from http.server import SimpleHTTPRequestHandler from socketserver import TCPServer import tempfile from os import path from multiprocessing import Process, Barrier import time def simple_http_handler(directory): class Handler(SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): sup...
framework.py
#!/usr/bin/env python3 from __future__ import print_function import logging import sys import os import select import signal import subprocess import unittest import re import time import faulthandler import random import copy import platform import shutil from collections import deque from threading import Thread, Ev...
webhost.py
def find_chromium(): import shutil import platform import os uname = platform.system() if uname == 'Windows': executables = ['chrome.exe', 'msedge.exe'] prefixes = [ os.getenv('ProgramFiles', os.devnull), os.getenv('ProgramFiles(X86)', os.devnull), ...
custom_lookup.py
""" This is a base-class for writing custom external lookups. This is licensed under the Apache License Version 2.0 See https://www.apache.org/licenses/LICENSE-2.0.html To use this, you will need to: 1) A lookup command script that implements from CustomLookup 2) Create a transforms.conf that declares your lookup ...
connect.py
from rtmp.message import * from rtmp import commands from queue import Queue import threading, time #sender receiver 관리 #일단은 rtmp_test connect 과정에서만 작동하게끔 구상 class Connect: def __init__(self, clientSock): self.clientSock = None self.rque = Queue() self.chunkSize = 128 self.desir...
test_timestamps.py
# Copyright 2013-2016 DataStax, 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 writi...
log.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """Utility classes for logging the output of blocks of code. """ from __future__ import unicode_literals import multiproc...