source
stringlengths
3
86
python
stringlengths
75
1.04M
PythonCommand.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from abc import ABCMeta, abstractclassmethod from time import sleep import threading import Command import Keys import cv2 from Keys import Button, Direction, Stick # the class For notifying stop signal is sent from Main window class StopThread(Exception): ...
utils.py
import os import subprocess from pathlib import Path from queue import Queue from subprocess import PIPE, Popen from threading import Thread from typing import Any, Dict, Iterable, List, Optional, Tuple, Union import pydantic PROJECT_ROOT = Path(__file__).parents[1] def title_if_necessary(string: str): if strin...
master.py
import copy import os import threading import time from collections import defaultdict from typing import Dict import numpy as np from ultraopt.facade.utils import get_wanted from ultraopt.multi_fidelity.iter import WarmStartIteration from ultraopt.multi_fidelity.iter_gen.base_gen import BaseIterGenerator from ultrao...
cli.py
# Copyright (c) 2017 Sony Corporation. 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 applicabl...
Pan_blog.py
from flask import Flask,request,render_template,session,redirect,url_for,flash from flask_bootstrap import Bootstrap from flask_moment import Moment from flask_wtf import FlaskForm from flask_script import Shell,Manager from datetime import datetime from wtforms import StringField, SubmitField from wtforms.validators ...
e2e.py
""" This is an end to end release test automation script used to kick off periodic release tests, running on Anyscale. The tool leverages app configs and compute templates. Calling this script will run a single release test. Example: python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-...
state.py
# -*- coding: utf-8 -*- """This class maintains the internal dfTimewolf state. Use it to track errors, abort on global failures, clean up after modules, etc. """ import logging import sys import threading import traceback from dftimewolf.lib import errors from dftimewolf.lib import utils from dftimewolf.lib.modules ...
test_conveyor_beam.py
#!/usr/bin/env python """ Script to test that the input of break beams are read correctly, and the conveyor controls are functionining correctly. This program will stop the respective conveyors for 5 seconds before resuming whenever its respective break beam detects sth. Author: James Lin Date: 29/07/2020 """ impor...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
generators.py
""" This module contains classes for all the sequence data generators Classes MSequenceGenerator - The main base class for all generators. Multi task batch data generation for training deep neural networks on high-throughput sequencing data of various geonmics assays MBPNetSequ...
exposition.py
import base64 from contextlib import closing from http.server import BaseHTTPRequestHandler import os import socket from socketserver import ThreadingMixIn import sys import threading import logging from urllib.error import HTTPError from urllib.parse import parse_qs, quote_plus, urlparse from urllib.request import ( ...
arduinoePython.py
import serial import threading import time conectado = False porta = 'COM3' # linux ou mac em geral -> '/dev/ttyS0' velocidadeBaud = 115200 mensagensRecebidas = 1; desligarArduinoThread = False try: SerialArduino = serial.Serial(porta,velocidadeBaud, timeout = 0.2) except: print("Verificar port...
sandboxjs.py
from __future__ import absolute_import import errno import json import logging import os import re import select import sys import threading from io import BytesIO from typing import Any, Dict, List, Mapping, Text, Tuple, Union import six from pkg_resources import resource_stream from .utils import json_dumps, onWin...
http_com.py
from __future__ import print_function import base64 import copy import json import logging import os import random import ssl import sys import threading import time from builtins import object from builtins import str from flask import Flask, request, make_response, send_from_directory from werkzeug.serving import W...
progress.py
"""Small GUI for displaying resource discovery progress to the user.""" import collections import threading import tkinter as tk import tkinter.messagebox import tkinter.ttk class LifetimeError(Exception): """Progress was interrupted (i.e., window closed or cancel button was pressed).""" pass c...
common.py
import typing as tp import datetime import os import logging from urllib.parse import urljoin import urllib.error import sys import urllib.request import time import json import math import gzip import xarray as xr import numpy as np import pandas as pd import re from qnt.log import log_info, log_err import pickle, has...
test_html.py
from functools import partial from importlib import reload from io import BytesIO, StringIO import os import re import threading from urllib.error import URLError import numpy as np from numpy.random import rand import pytest from pandas.compat import is_platform_windows from pandas.errors import ParserError import p...
Hiwin_RT605_ArmCommand_Socket_20190627164529.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import numpy as np from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * from std_msgs.msg import Int32MultiArray import math import enum pos_feedback_times = 0 mode_feedback_times = 0 msg_feedback = 1 #接收策略端...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') # import threading after _multiprocessing to raise a more revelant error # message: "No module n...
fslinstaller.py
#!/usr/bin/python # Handle unicode encoding import csv import errno import getpass import itertools import locale import os import platform import threading import time import shlex import socket import sys import tempfile import urllib2 from optparse import OptionParser, OptionGroup, SUPPRESS_HELP from re import co...
windowcapture.py
from threading import Lock, Thread import numpy as np import win32con import win32gui import win32ui class WindowCapture: # threading properties stopped = True lock = None screenshot = None # properties w = 0 h = 0 hwnd = None cropped_x = 0 cropped_y = 0 offset_x = 0 ...
firmware_updater.py
import io import sys import time import json import serial import zipfile import threading as th import urllib.request as ur from os import path from io import open from base64 import b64encode, b64decode from importlib import import_module as im from urllib.error import URLError from modi.module.module import Mo...
engine.py
""" """ import logging import smtplib from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any from vnpy.event import Event, EventEngine from .app import BaseApp from .event import ( EVENT_TICK, ...
views.py
"""Defines a number of routes/views for the flask app.""" from functools import wraps import io import os import sys import shutil from tempfile import TemporaryDirectory, NamedTemporaryFile import time from typing import Callable, List, Tuple import multiprocessing as mp import zipfile from flask import json, jsonif...
replay_actions.py
#!/usr/bin/python # Copyright 2017 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 ...
test_heal.py
import datetime import json import threading import time import heal def test_configuration_directory_not_exists(tmp_path, capsys): configuration_directory = tmp_path.joinpath("not-exists") status_file = tmp_path.joinpath("status-file") heal.heal(configuration_directory, status_file, threading.Event()) ...
test_operator.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...
periodicrun.py
''' MIT License Copyright (c) 2016 Burak Kakillioğlu 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, copy, modify, merge, publ...
transport.py
import logging import threading from queue import Queue, Full from urllib.request import Request, urlopen, HTTPError from time import sleep from typing import Dict logger = logging.getLogger(__name__) class Transport(object): def send(self, url: str, headers: Dict[str, str], data: bytes): raise NotImpl...
regen.py
#!/usr/bin/env python3 import os import time import multiprocessing from tqdm import tqdm import argparse # run DM procs os.environ["USE_WEBCAM"] = "1" import cereal.messaging as messaging from cereal.services import service_list from cereal.visionipc.visionipc_pyx import VisionIpcServer, VisionStreamType # pylint: d...
helpers.py
"""Supporting functions for polydata and grid objects.""" import os import collections.abc import enum import logging import signal import sys from threading import Thread import threading import traceback import numpy as np from pyvista import _vtk import pyvista from .fileio import from_meshio from . import transf...
forsund.py
# -*- coding: utf-8 -*- # 15/6/27 # create by: snower from __future__ import absolute_import, division, print_function, with_statement import os import sys import argparse import multiprocessing import atexit from ..forsun import config from ..utils import is_py3 parser = argparse.ArgumentParser(description='High-pe...
censor_realtime_mac.py
""" Censors audio chunks in a continuous stream """ import os import threading import sounddevice as sd import soundfile as sf from pydub import AudioSegment from audio import improve_accuracy, convert_and_write_chunk, \ read_and_convert_audio from utils import create_env_var, create_temp_dir, append_before_ext, \...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electroncash.util import bfh, bh2u, UserCancelled from electroncash.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT, deserialize_xpub from electroncash import networks from electroncash.i18n import _ from electroncash.transaction import deserialize, Tra...
server.py
from socket import * import threading from hardware import Hardware from storage import Storage from physicalMemory import PhysicalMemory from swap import Swap from datetime import datetime import subprocess #initialize objects h = Hardware() m = PhysicalMemory() s = Swap() st = Storage() logAccess = {} def analyze(b...
tf-16.py
import re, sys, operator, Queue, threading # Two data spaces word_space = Queue.Queue() freq_space = Queue.Queue() stopwords = set(open('../stop_words.txt').read().split(',')) # Worker function that consumes words from the word space # and sends partial results to the frequency space def process_words(): word_fr...
plugin.py
from binascii import hexlify, unhexlify from electrum.util import bfh, bh2u from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, is_segwit_address) from electrum import constants from electrum.i18n import _ from e...
face2rec2.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...
client.py
from socket import * import threading from tkinter import * address='127.0.0.1' #服务器的ip地址 port=9000 buffsize=1024 s=socket(AF_INET, SOCK_STREAM) s.connect((address,port)) def recv(): while True: recvdata = s.recv(buffsize).decode('utf-8') gui.listBox.insert(END, recvdata) ...
manual_control_test.py
import random import threading import time def inp_handler(name): from pynput.keyboard import Controller as KeyboardController from pynput.keyboard import Key keyboard = KeyboardController() time.sleep(0.1) choices = ["w", "a", "s", "d", "j", "k", Key.left, Key.right, Key.up, Key.down] NUM_TE...
test_faster_fifo.py
import logging import multiprocessing from queue import Full, Empty from unittest import TestCase from faster_fifo import Queue ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) log = logging.getLogger('rl') log.setLevel(logging.DEBUG) log.handlers = [] # No duplicated handlers log.propagate = False # workar...
action.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2016 kirmani <sean@kirmani.io> # # Distributed under terms of the MIT license. """ Action. """ from multiprocessing import Process import os import signal class Action: def __init__(self, name, entities, preconditions, postconditions...
test_shared_mem_store.py
import dgl import sys import random import time import numpy as np from multiprocessing import Process from scipy import sparse as spsp import mxnet as mx import backend as F import unittest import dgl.function as fn num_nodes = 100 num_edges = int(num_nodes * num_nodes * 0.1) rand_port = random.randint(5000, 8000) pr...
LabelingClient.py
import sys import threading from NatNetClient import NatNetClient import numpy as np import math import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import tensorflow as tf import socket import struct import queue as queue import time # performs all processing and runs the neural network # the labeled data is s...
generate_alignment_viz.py
import json import os import re import time import traceback from collections import defaultdict import subprocess import threading from idseq_dag.engine.pipeline_step import PipelineStep from idseq_dag.util.lineage import INVALID_CALL_BASE_ID import idseq_dag.util.log as log import idseq_dag.util.command as command i...
main.py
from flask import Flask from flask_restful import Api from ressources import Bluetooth,task import threading app = Flask(__name__) api = Api(app) api.add_resource(Bluetooth, '/'); def first_func(): app.run() def second_func(): task.main() if __name__ == '__main__': first_thread = threading.Thread(targ...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Picscoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test picscoind shutdown.""" from test_framework.test_framework import PicscoinTestFramework from test_fram...
dataloader copy.py
import os import torch from torch.autograd import Variable import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image, ImageDraw from SPPE.src.utils.img import load_image, cropBox, im_to_torch from opt import opt from yolo.preprocess import prep_image, prep_frame, inp_to_i...
douyu_danmaku_assistant.py
# -*- coding: utf-8 -*- from bs4 import BeautifulSoup import socket import struct import hashlib import threading import urllib import urllib2 import json import uuid import time import sys import re __author__ = 'JingqiWang' reload(sys) sys.setdefaultencoding('utf-8') def welcome(): def filter_tag(tag): ...
common.py
"""Test the helper method for writing tests.""" import asyncio import functools as ft import json import logging import os import sys import threading from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta from io import StringIO from unittest.mock import MagicMock, Mo...
utils.py
# -*- coding: utf8 -*- from __future__ import print_function from binascii import hexlify import collections import errno import functools import itertools import os import random import socket import string import sys import threading import time import contextlib2 import futurist from monotonic import monotonic ...
operator.py
import asyncio import logging import multiprocessing as mp import os import threading from typing import Any from typing import Callable from typing import Dict from typing import Tuple from typing import Optional import kopf import yaml import ray.autoscaler._private.monitor as monitor from ray._private import servi...
multi_processing.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Created by yetongxue<me@xander-ye.com> import time from concurrent.futures import as_completed,ProcessPoolExecutor,ThreadPoolExecutor #耗cpu的操作,用多进程编程, 对于io操作来说, 使用多线程编程,进程切换代价要高于线程 def fib(n): """计算""" if n<=2: return 1 return fib(n-1)+ fib(n-2) ...
win32gui_dialog.py
# A demo of a fairly complex dialog. # # Features: # * Uses a "dynamic dialog resource" to build the dialog. # * Uses a ListView control. # * Dynamically resizes content. # * Uses a second worker thread to fill the list. # * Demostrates support for windows XP themes. # If you are on Windows XP, and specify a ...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest import warnings from pathlib import Path from unittest import mock, skipIf from ...
app.py
############################################################################# # Copyright (c) 2018, Voila Contributors # # Copyright (c) 2018, QuantStack # # # # Distri...
local_runner.py
import os import logging import pdb import time import random from multiprocessing import Process import numpy as np from client import MilvusClient import utils import parser from runner import Runner logger = logging.getLogger("milvus_benchmark.local_runner") class LocalRunner(Runner): """run local mode""" ...
GoSublime.py
import os import sublime import sublime_plugin import sys import traceback st2 = (sys.version_info[0] == 2) dist_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, dist_dir) ANN = '' VERSION = '' MARGO_EXE = '' fn = os.path.join(dist_dir, 'gosubl', 'about.py') execErr = '' try: with open(fn) as f: ...
queued.py
import os import multiprocessing from six.moves import queue import threading import traceback from pulsar.managers.unqueued import Manager from logging import getLogger log = getLogger(__name__) STOP_SIGNAL = object() RUN = object() # Number of concurrent jobs used by default for # QueueManager. DEFAULT_NUM_CONCURR...
bpytop.py
#!/usr/bin/env python3 # pylint: disable=not-callable, no-member, unsubscriptable-object # 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 ...
king_bot.py
from .custom_driver import client from .adventures import adventures_thread from threading import Thread import platform import sys import getopt from .account import login import time from .util_game import close_welcome_screen from .utils import log from .farming import start_farming_thread, start_custom_farmlist_thr...
pipeline_ops_test.py
# Copyright 2020 Google LLC. 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...
thread.py
import threading import multiprocessing """ @desc :多线程 @author Pings @date 2018/05/15 @version V1.0 """ # **多线程无法利用多核心cpu def loop(): x = 0 while True: x = x ^ 1 print(threading.current_thread().name, x) for i in range(multiprocessing.cpu_count()): t = threading.Thread(target=loop) ...
client.py
class CLIENT: SOCK = None KEY = ")J@NcRfU" KEYLOGGER_STATUS = False KEYLOGGER_STROKES = "" def __init__(self, _ip, _pt): self.ipaddress = _ip self.port = _pt def send_data(self, tosend, encode=True): if encode: self.SOCK.send(base64.encodebytes(tosend...
server.py
from starlette.applications import Starlette from starlette.responses import HTMLResponse, JSONResponse from starlette.staticfiles import StaticFiles from starlette.middleware.cors import CORSMiddleware import uvicorn, aiohttp, asyncio from io import BytesIO import requests, hashlib from fastai import * from fastai.vi...
tree_apx.py
#!/usr/bin/env python """ Solve FLSA on trees by computing the derivative at one point per time. From here, the C++ code for tree12.cpp and tree12c.cpp was developed. A lot of experimental code concerning orderings is included. """ import argparse import sys import h5py import numpy as np import numba import multiproc...
test_sparqlstore.py
from rdflib import Graph, URIRef, Literal from urllib.request import urlopen import unittest from nose import SkipTest from http.server import BaseHTTPRequestHandler, HTTPServer import socket from threading import Thread from unittest.mock import patch from rdflib.namespace import RDF, XSD, XMLNS, FOAF, RDFS from rdfli...
test.py
import unittest import os import subprocess import sys import ast import noise_observer as no from utils import * from config_manager import ConfigManager from threading import Thread class TestCli(unittest.TestCase): """ Tests used to test command line interface. Tests are based on the execution o...
videocaptureasync.py
# https://github.com/gilbertfrancois/video-capture-async import threading import cv2 import time WARMUP_TIMEOUT = 10.0 class VideoCaptureAsync: def __init__(self, src=0, width=640, height=480): self.src = src self.cap = cv2.VideoCapture(self.src) if not self.cap.isOpened(): ...
adb_enhanced.py
#!/usr/bin/python # Python 2 and 3, print compatibility from __future__ import absolute_import, print_function # Without this urllib.parse which is python 3 only cannot be accessed in python 2. from future.standard_library import install_aliases install_aliases() import psutil import re import signal import subproces...
client.py
import socket from multiprocessing import Queue from threading import Thread from classes.inventory import Inventory, _ITEMS from classes.player import Player from common.listtools import find from common.vec import Vec2d _max_buffer_size = 4096 def parse_response_array(s: str) -> []: translator = str.maketrans(''...
crop_img.py
import numpy as np from skimage import io, color, exposure, img_as_float, transform, util from matplotlib import pyplot as plt import pathlib import cv2 import multiprocessing import time import argparse from keras.models import load_model from keras.preprocessing.image import ImageDataGenerator import os ...
relay_integration.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...
io.py
from threading import Thread from time import time def benchmark(func): def bench(*args, **kwargs): start = time() func(*args, **kwargs) end = time() duration = (end - start) * 1000 print("Run took {}ms".format(int(duration))) return bench def run(start, stop=None): ...
isp-pseudo.py
class ServiceHandlerService(rpyc.Service): # RPyC implementation def on_connect(self, conn): pass def on_disconnect(self, conn): pass def exposed_echo(self, attrs[] ): proc = pool.Process(target=echo, args=(main_queue, main_event, value, return_list)) proc.daemon = True p...
__main__.py
#!/usr/bin/env python # -*- coding:utf-8 _*- """ @author: HJK @file: main.py @time: 2019-01-08 """ import sys import re import threading import click import logging from . import config from .utils import colorize from .core import music_search, music_download, music_list_merge, get_sequence def run(): logger = ...
streamcopy.py
#!/usr/bin/env python2 import os import sys import time import optparse import threading import signal import glob import traceback # the size of block used to find the position of end of DST in SRC. # note: false-positive (too small) or false-negative (too large) will # cause data duplication. PATTERN_SIZE = 4096 BU...
TcpClient.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ------------------------------------------------------------------- # Copyright (c) 2010-2021 Denis Machard # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # ...
Trading.py
# -*- coding: UTF-8 -*- # @yasinkuyu # Define Python imports import os import sys import time import config import threading import math import logging import logging.handlers # Define Custom imports from Database import Database from Orders import Orders formater_str = '%(asctime)s,%(msecs)d %(levelname)s %(name)...
__init__.py
######## This is the main file that creates an instance of the game using Tkinter ######## Run the "server.py" file before you run this file import socket import threading from queue import Queue HOST = input("Enter server's IP address: ") # user should enter the IP address displayed on the server window PORT = int...
reddit.py
import time import praw import threading import settings from crawlers.generic import BaseCrawler reddit_praw = praw.Reddit(client_id=settings.REDDIT_CLIENT_ID, client_secret=settings.REDDIT_CLIENT_SECRET, password=settings.REDDIT_PASSWORD, user_agent='memeID-C7', ...
engine.py
""" """ import logging from logging import Logger import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Sequence, Type, Dict, List, Optional from vnpy.event import Event, Eve...
process.py
from __future__ import print_function """ Utility class for spawning and controlling CLI processes. See: http://stackoverflow.com/questions/375427/non-blocking-read-on-a-subprocess-pipe-in-python """ import sys, time from subprocess import PIPE, Popen from threading import Thread try: from Queue import Queue, Em...
py_utils.py
# Lint as: python3 # Copyright 2018 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 ...
follow_waypoints.py
#!/usr/bin/env python import threading import rospy import actionlib from smach import State,StateMachine from april_docking.msg import DockingAction, DockingGoal #from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal #from mbf_msgs.msg import MoveBaseAction, MoveBaseGoal from geometry_msgs.msg import PoseWithCo...
run_reforms.py
#!/usr/bin/env python ''' ''' from __future__ import print_function try: import traceback from multiprocessing import Process import argparse import json import os from pprint import pformat import sys import time import uuid sys.path.append("../") import matplotlib matp...
common.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...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
websocket.py
import json import pymongo import threading import time import websocket import cbpro.auth import cbpro.check import cbpro.utils def get_default_message() -> dict: return { 'type': 'subscribe', 'product_ids': ['BTC-USD'], 'channels': ['ticker'] } def get_message(value: dict = None) ...
cv_videostream.py
# import the necessary packages from threading import Thread import cv2, time class CV_VideoStream: """ Maintain live RTSP feed without buffering. """ def __init__(self, src=0, name="WebcamVideoStream", videocapture=cv2.VideoCapture, verbose = False ): """ src: the path to an RTSP server. should start with...
atrace_agent.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import py_utils import re import subprocess import sys import threading import zlib from devil.android import device_utils from py_trace_eve...
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 la...
mp_consume.py
from collections import namedtuple import logging import queue from multiprocessing import Process, Manager as MPManager from .confluent_python_consumer import _mp_consume as _mp_consume_confluent_kafka from .kafka_python_consumer import _mp_consume as _mp_consume_kafka_python Events = namedtuple("Events", ["start", ...
main.py
# Copyright 2020 Google Research. 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...
main_nao.py
import os import threading from naoqi import ALProxy import time def intro(subject_id): start_working(subject_id) time.sleep(60) def start_working(subject_id): subject_id = subject_id def worker1(): os.system('roslaunch skeleton_markers markers.launch') return def worker2(): ...
emanemanager.py
""" emane.py: definition of an Emane class for implementing configuration control of an EMANE emulation. """ import logging import os import threading from core import CoreCommandError, utils from core import constants from core.api.tlv import coreapi, dataconversion from core.config import ConfigGroup from core.conf...
master.py
"""Galaxy CM master manager""" import commands import fileinput import logging import logging.config import os import subprocess import threading import time import datetime as dt import json import shutil from cm.services import ServiceRole from cm.services import ServiceType from cm.services import service_states f...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
p8.py
import asyncio import threading from threading import Thread # 循环存在与循环策略的上下文中, # DefaultEventLoopPolicy 检查每个线程的循环并且不允许通过asyncio.get_event_loop()在主线程之外创建循环 asyncio.get_event_loop() def create_event_loop_thread(worker, *args, **kwargs): def _worker(*args, **kwargs): # 线程本地事件循环 loop = asyncio.new_ev...
engine.py
# -*- coding: utf-8 -*- """The multi-process processing engine.""" import abc import ctypes import os import signal import sys import threading import time from plaso.engine import engine from plaso.engine import process_info from plaso.lib import definitions from plaso.multi_process import logger from plaso.multi_pr...