source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
job_concurrency1_test.py | # -*- coding: utf-8 -*-
u"""Concurrency testing
This test does not always fail when there is a problem (false
positive), because it depends on a specific sequence of events
that can't be controlled by the test.
:copyright: Copyright (c) 2020 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/license... |
GraphClientMultiThreadExample.py | #!/usr/bin/env python
# --coding:utf-8--
# Copyright (c) 2020 vesoft inc. All rights reserved.
#
# This source code is licensed under Apache 2.0 License,
# attached with Common Clause Condition 1.0, found in the LICENSES directory.
import sys
import time
import threading
sys.path.insert(0, '../')
from nebula2.gcl... |
notionify.py | #!/usr/bin/env python3
import json
from subprocess import Popen, PIPE
from threading import (Thread, Semaphore)
from time import sleep
from argparse import ArgumentParser
import sys
from notion.client import NotionClient
from notion.block import BulletedListBlock
from notion.block import HeaderBlock
parser = Argume... |
__init__.py | """
集成定时任务。
"""
import time
from typing import Union
import threading
from apscheduler.schedulers.background import BackgroundScheduler
# noinspection PyProtectedMember
from apscheduler.util import undefined
from funboost import funboost_config_deafult
from funboost.consumers.base_consumer import AbstractConsumer
... |
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... |
s4alib.py | import serial
from time import sleep
import sys
import threading
class s4a_start(object):
def __init__(self,port):
self.ser = serial.Serial(port,38400,8,'N',1)
self.pin_outputs = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1] # dev id : 4 ~ 13
self.pin_inputs = [0,0,0,0,0,0,0,0,0,0,0] # analog... |
HiwinRA605_socket_ros_20190604111632.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... |
server.py | __all__ = [
'change_dir',
'suppress_stderr',
'start_server',
]
import contextlib
import http.server
import io
import os
import socketserver
import sys
import threading
@contextlib.contextmanager
def change_dir(path):
cwd = os.getcwd()
os.chdir(str(path))
try:
yield path
finally:
... |
blogDWdata.py | from __future__ import generators, print_function
import numpy as np
from random import shuffle
from scipy.io import loadmat
from copy import deepcopy
import functools
import Queue
#from multiprocessing import Process, Queue, Manager, Pool
import threading
import time
from collections import defaultdict
def async_pre... |
nightminer.py | # The MIT License (MIT)
#
# Copyright (c) 2014 Richard Moore
#
# 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, mod... |
batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
server.py | import sys
import http.server
import ssl
import argparse
from datetime import datetime
from threading import Thread
def run(*args, **kwargs) -> http.server.HTTPServer:
parser = argparse.ArgumentParser()
parser.add_argument('-p', '--port', type=int,
help='Server port for listening reque... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
import contextlib
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import struct
import operator
import weakref
from test impo... |
mavproxy.py | #!/usr/bin/env python
'''
mavproxy - a MAVLink proxy program
Copyright Andrew Tridgell 2011
Released under the GNU GPL version 3 or later
'''
import sys, os, struct, math, time, socket
import fnmatch, errno, threading
import serial, Queue, select
import logging
# find the mavlink.py module
for d in [ 'pymavlink',
... |
engine.py | # -*- coding: utf-8 -*-
import datetime
from iemlav import logger
import multiprocessing
import netfilterqueue
from iemlav.lib.firewall.packet_filter import PacketFilter
from iemlav.lib.firewall.firewall_monitor import FirewallMonitor
from iemlav.lib.firewall import utils
class FirewallEngine(object):
def __in... |
evaluator.py | import os
import cv2
import numpy as np
import time
from tqdm import tqdm
import torch
import torch.multiprocessing as mp
from tools.engine.logger import get_logger
from tools.utils.pyt_utils import load_model, link_file, ensure_dir
from tools.utils.img_utils import pad_image_to_shape, normalize
logger = get_logger(... |
progress.py | #!/usr/bin/python
# -*- coding:utf-8 -*-
# Copyright 2019 Huawei Technologies Co.,Ltd.
# 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 r... |
train_dist.py | # coding: utf-8
###
# @file train_dist.py
# @author Arsany Guirguis <arsany.guirguis@epfl.ch>
#
# @section LICENSE
#
# Copyright (c) 2019 Arsany Guirguis.
#
# @section DESCRIPTION
#
# Distributed training in PyTorch.
###
#!/usr/bin/env python
import os
import torch
import torch.distributed as dist
import... |
syslog_monitor.py | # Copyright 2014 Scalyr 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 writing, so... |
bridge.py | """
bridge-like integrator for amuse
the bridge class provides a bridge like coupling between different
gravitational integrators. In this way a system composed of multiple
components can be evolved taking account of the self gravity of the whole
system self consistently, while choosing the most appropi... |
blend_multiple_multithread.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import time
import threading
import pconvert_rust as pconvert
PATH_TO_ASSETS = os.path.join(os.path.dirname(__file__), "../../assets/demo/")
print(f"VERSION: {pconvert.VERSION}")
print(f"COMPILED ON: {pconvert.COMPILATION_DATE}, {pconvert.COMPILATION_TIM... |
recorder.py | import speech_recognition as sr
import pyaudio
import wave
import time
import threading
import os
def read_audio(stream, filename):
chunk = 1024 # Record in chunks of 1024 samples
sample_format = pyaudio.paInt16 # 16 bits per sample
channels = 2
fs = 44100 # Record at 44100 samples per se... |
test_pastebin_plugin.py | import re
import socket
import threading
import time
import tkinter
import traceback
import types
from http.client import RemoteDisconnected
import pytest
import requests
from pygments.lexers import PythonLexer, TextLexer, get_lexer_by_name
import porcupine.plugins.pastebin as pastebin_module
from porcupine import ge... |
bot.py | import asyncio
import base64
import concurrent.futures
import datetime
import glob
import json
import math
import os
import pathlib
import random
import sys
import time
from json import dumps, loads
from random import randint
import re
from re import findall
import requests
import urllib3
from Crypto.... |
test_video_analysis_server.py | # =======================================================================
#
# Copyright (C) 2018, Hisilicon Technologies Co., Ltd. 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 Re... |
test_target_codegen_vulkan.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... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
download_data.py | #!/usr/bin/env python3
"""This script downloads the latest data from:
- German corona-warn app (exported exposures)
- Austrian stop-corona app (exported exposures)
- Austrian department of health: https://info.gesundheitsministerium.at/
"""
import requests
from pathlib import Path
from datetime import datetime
fro... |
widget.py | # -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
The widget is called from web2py
----------------------------------
"""
import sys
from gluon._compat import StringIO, thr... |
utils.py | from __future__ import division
from threading import Thread
from time import time, sleep
from math import sin, pi
class Sinus(object):
update_frequency = 25.0
def __init__(self, motor, frequency, amplitude, offset, phase):
self.motor = motor
self.frequency = frequency
self.amplitud... |
newswrapper.py | #!/usr/bin/python3 -OO
# Copyright 2007-2021 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 late... |
test_parameters.py | """CSI Node plugin parameters feature tests."""
import os
import pytest
import threading
import time
from pytest_bdd import given, scenario, then, when, parsers
import subprocess
import csi_pb2 as pb
from common.apiclient import ApiClient
from common.deployer import Deployer
from common.nvme import nvme_find_device
f... |
__init__.py | # -*- coding: utf-8 -*-
"""
Created on Mon Dec 18 11:15:00 2017
@author: Prashant Kumar, RCCIIT
@mail: kr.prashant94@gmail.com
@supervision: Dilip Kumar , NIT Jsr
"""
import matplotlib.patches as patches
import matplotlib.pyplot as plt
import csv
import time
import datetime
import random
import n... |
test_dataloader.py | import math
import sys
import errno
import multiprocessing
import os
import ctypes
import faulthandler
import torch
import gc
import time
import signal
import unittest
import itertools
import warnings
import tempfile
from torch import multiprocessing as mp
from torch.utils.data import (
ChainDataset,
ConcatData... |
o_server.py | # coding=utf-8
from multiprocessing import Process
from threading import Thread
from socket import *
import select
# sendfile 零拷贝
def recv_data(new_socket, client_info):
print("客户端{}已经连接".format(client_info))
# 接受数据
raw_data = new_socket.recv(1024)
while raw_data:
print(f"收到来自{client_info}的数据:... |
engine.py | # Copyright 2019 The Microsoft DeepSpeed Team
import time
import logging
import copy
import os
from types import MethodType
from queue import Queue
from threading import Thread
from numpy import prod
from contextlib import ExitStack
import torch
import torch.nn as nn
import torch.optim as optim
import torch.distrib... |
time_based_sampler_node.py | #!/usr/bin/python3
import rospy as rp
import threading
from statistics import mean, median
from pump_driver import Pump
from std_msgs.msg import Int32
from mavros_msgs.msg import RCIn
from watersampling_msgs.msg import MS5837Stamped, PumpInfo
class SamplerNode():
"""
A ROS node that monitors the water sens... |
test_logging.py | #!/usr/bin/env python
#
# Copyright 2001-2010 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright n... |
tello_pilot_node.py | #!/usr/bin/env python3
import time
import math
import rospy
from tf.transformations import quaternion_from_euler
from std_msgs.msg import Empty
from sensor_msgs.msg import Image, Imu
from geometry_msgs.msg import TwistStamped
from tello_pilot.msg import CameraDirection
import numpy as np
from utils.RospyLogger impo... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau... |
lifecycle_test.py | # Copyright (c) 2018-2020, NVIDIA CORPORATION. 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 must retain the above copyright
# notice, this list of conditi... |
algo_six.py | from functools import reduce
import numpy as np
import random as r
import socket
import struct
import subprocess as sp
import threading
from threading import Thread
import ast
import time
import datetime as dt
import os
import psutil
from netifaces import interfaces, ifaddresses, AF_INET
import paho.mqtt.client as mqtt... |
mod_best_sentences.py | from modules.module_base import ModuleBase
from tools.bestSentences import *
import threading
class ModuleDtc(ModuleBase):
def __init__(self, bot):
ModuleBase.__init__(self, bot)
self.name = "BestSentences"
self.best_sentences = BestSentences()
threading.Thread(target=self.best_sen... |
stage_op_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
broadcast.py | import os
import torch
import torch.distributed as dist
import torch.multiprocessing as mp
def run(rank_id, size):
tensor = torch.arange(2, dtype=torch.int64) + 1 + 2 * rank_id
print('before broadcast',' Rank ', rank_id, ' has data ', tensor)
dist.broadcast(tensor, src = 0)
print('after broadcast',' Ra... |
scheduler.py | import logging
import sched
import time
import pytz
from time import sleep
from datetime import datetime, date, time, timedelta
from threading import Thread
from db_manager import ManagedSession
from server.models import WatchedTicker
from server.price_cache import PriceCache
log = logging.getLogger(__name__)
schedu... |
play.py | from configobj import ConfigObj
import sys
import threading
import requests
import chess
import chess.svg
import chess.polyglot
import time
import traceback
import chess.pgn
import chess.engine
from flask import Flask, Response, request
import pyttsx3
from chess_utils import get_white_score, get_best_move_with_score, g... |
worker.py | import logging
import os
import shutil
from subprocess import PIPE, Popen
import threading
import time
import traceback
import socket
import http.client
import sys
from typing import Optional, Set, Dict
import psutil
import docker
from codalab.lib.telemetry_util import capture_exception, using_sentry
import codalab.w... |
setting.py | import abc
import time
import threading
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
class Driver(object, metaclass = abc.ABCMeta):
def __init__(self, options: list, executable_path: str = '', time_out: int = ... |
proc.py | # -*- coding: utf-8 -*-
"""Interface for running Python functions as subprocess-mode commands.
Code for several helper methods in the `ProcProxy` class have been reproduced
without modification from `subprocess.py` in the Python 3.4.2 standard library.
The contents of `subprocess.py` (and, thus, the reproduced methods... |
Platform.py | from sys import platform
from traceback import format_exc
from pydantic.class_validators import validator
import pywebio.input as IN
import pywebio.output as OUT
import time
import threading
from modules.base.Configuration import *
from modules.base.Instances import *
@configuration
class WebActionEntityConfiguration... |
default.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... |
data_service_ops_test.py | # Copyright 2020 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... |
utils.py | from __future__ import absolute_import, division, print_function
from collections import OrderedDict, defaultdict
import contextlib
import fnmatch
import hashlib
import json
from locale import getpreferredencoding
import libarchive
import logging
import logging.config
import mmap
import operator
import os
from os.path... |
main.py | """
mlperf inference benchmarking tool
"""
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import array
import collections
import json
import logging
import os
import sys
import threading
import time
from queue import Queue
import mlperf_l... |
drawingLib.py | import time
import threading
import importlib
# do not import writeYourProgram unqualified. Otherwise, we get problems because of
# module schizophrenia. This goes away once we are sure that we can always rely on wypp
# being installed in the site path.
try:
# First, we try to import the module installed in user si... |
main.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import face_recognition
import cv2
import numpy as np
import pymongo
import sys
import time
import logging as log
from imutils.video import WebcamVideoStream
from openvino.inference_engine import IENetwork, IEPlugin
from sklearn.metri... |
autoreload.py | import functools
import itertools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from zipimport import zipimporter
import django
from django.apps i... |
multiprocessing_names.py | import multiprocessing
import time
def worker():
name = multiprocessing.current_process().name
print name, 'Starting'
time.sleep(2)
print name, 'Exiting'
def my_service():
name = multiprocessing.current_process().name
print name, 'Starting'
time.sleep(3)
print name, 'Exiting'
if __name__ == '__main__':
ser... |
P2P_Server.py | from datetime import *
import json
import os
import math
import socket
from threading import *
def func_ip1():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("255.255.255.255", 1))
ip = s.getsockname()[0]
s.close()
return ip
def func_ip():
#You need to enter your own Hamachi ... |
commands.py | '''
Entry points for the nbdiff package.
'''
from __future__ import print_function
import argparse
from .merge import notebook_merge
from .notebook_parser import NotebookParser
import sys
from .notebook_diff import notebook_diff
from .adapter.git_adapter import GitAdapter
from .adapter.hg_adapter import HgAdapter
from ... |
util.py | """Utilities for saving/loading Trackable objects."""
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.o... |
devtools.py | #--------------------------------------------------------------------------------------------------------------
from .solver import AmazonCaptcha
from io import BytesIO
import multiprocessing
import requests
import os
#-------------------------------------------------------------------------------------------... |
serialization.py | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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_closablequeue.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from threading import Thread
import unittest
from infinibatch.closablequeue import ClosableQueue, ClosedException
class TestClosableQueue(unittest.TestCase):
def setUp(self):
self.queue = ClosableQueue(maxsize=10)
def put_item... |
rcmd.py | import paramiko
import sys
import getpass
import threading
import os
def rcmd(host, password, cmd, port=22, username='root'):
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect(
hostname=host,
username=username,
password=password,
... |
pyMechCon.py | #!/usr/bin/env python
"""
PyMech Controller Ver A.0
Copyright (c) 2009 Michael E. Ferguson. All right reserved.
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 Lic... |
views.py | import os
import socket
import simplejson
import threading
import commonware.log
from django.conf import settings
from django.contrib.auth.decorators import user_passes_test
from django.http import HttpResponse
from django.shortcuts import render_to_response, get_object_or_404
from django.template import RequestContex... |
joy_detection_demo.py | #!/usr/bin/env python3
# Copyright 2017 Google 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... |
main.py | from telegram.ext import (
Updater, CommandHandler, MessageHandler, Filters,
ConversationHandler, CallbackContext
)
from telegram import ReplyKeyboardMarkup, KeyboardButton, Update
from data_source import DataSource
import os
import threading
import time
import datetime
import logging
import sys
ADD_REMINDER_... |
tests.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 us... |
core.py | import threading, queue, time
from queue import Queue
from threading import Thread, currentThread
import os
from CalibrateTransfer.img_operation import ScreenSHot_batch
from CalibrateTransfer.data_preprocess import write_data_to_json_file, read_data_from_json_file_v2
import numpy as np
import torch.utils.data as data... |
function_cache.py | import time
from threading import Thread, Lock
import atexit
cache = {}
cache_cleaner_thread = None
cache_lock = Lock()
cache_cleaner_running = False
def cached(seconds, cattr=None):
"""
Decorator, registers function to the cache.
"""
def wrapper(f):
def function(*args, **kwargs):
... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
import csv
f... |
go.py | #!/usr/bin/python3
import os
try:
import settings
except (ModuleNotFoundError):
from shutil import copyfile
print("Creating new config file.")
print("To change settings such as the destination folder edit settings.py.")
copyfile("defaults.py", "settings.py")
import settings
from state import state
from serve imp... |
nanny.py | from datetime import timedelta
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
import uuid
import warnings
import weakref
import dask
from tornado import gen
from tornado.ioloop import IOLoop, TimeoutError
from tornado.locks import Event
from .comm import... |
tasks.py | from __future__ import absolute_import, unicode_literals
from django.contrib.auth.models import User
from django.utils.crypto import get_random_string
from django.conf import settings
from django.db.models import Q
from celery import shared_task
import time
import os
import random
import queue
import threading
from... |
cothread.py | #!usr/bin/env python3
# -*- coding: utf-8 -*-
"""
An example showing how to wrap a thread within a coroutine.
The calling thread and the new thread communicate via a message queue.
"""
import threading
import xml.sax
from queue import Queue
from typing import Coroutine
from coroutine import coroutine
from cosax impo... |
conftest.py | # This file is automatically loaded and run by pytest during its setup process,
# meaning it happens before any of the tests in this directory are run.
# See the pytest documentation on conftest files for more information:
# https://docs.pytest.org/en/2.7.3/plugins.html#conftest-py-plugins
import logging
import os
impo... |
servo.py | #!/usr/bin/python3
import time
from multiprocessing import Process, Queue
import RPi.GPIO as GPIO
class Servo:
def __init__(self, queue, pin, verbose=False, name='Servo'):
self.q = queue
self.servopin = pin
self.verbose = verbose
self._name = name
# intrinsic const, must ... |
application_runners.py | from __future__ import print_function
import sys
import os
import uuid
import shlex
import threading
import shutil
import subprocess
import logging
import inspect
import runpy
import flask
import requests
from future import utils
from dash.testing.errors import NoAppFoundError, TestingTimeoutError, ServerCloseError
... |
MultiCast.py | # -- coding: utf-8 --
import sys
import threading
import msvcrt
from ctypes import *
sys.path.append("../MvImport")
from MvCameraControl_class import *
g_bExit = False
# 为线程定义一个函数
def work_thread(cam=0, pData=0, nDataSize=0):
stOutFrame = MV_FRAME_OUT()
memset(byref(stOutFrame), 0, sizeof(stOutFrame))
... |
consloadingbar.py | # v3.0.2
import time, random, concurrent.futures, threading, termcolor, sys
class Bar:
def __init__(self, barLength=20, useETACalculation=False, taskCount=None, mainBarChar='█', progressPointBarChar=None, endPointChars=['|','|'], title='Running Tasks...\n', useColor=False, emptyBarChar=' ', maxValue=100, maxValueL... |
runtests.py | #!/usr/bin/env python
"""
This script is for running the Android tests on android devices from the build
server. It may take as a parameter the build number (e.g. the build number from
Jenkins). The build number may also be a string.
The script removes all the apps whose ids contain "mapswithme", and cleans up
the... |
scanner.py | import socket
import os
import struct
from ctypes import *
import threading
import time
from netaddr import IPNetwork, IPAddress
# -*- coding: utf-8 -*-
class ICMP(Structure):
_fields_ = [
("type", c_ubyte),
("code", c_ubyte),
("checksum", c_ushort),
("unused", c_ushort),
... |
socket.py | import time
import json
import websocket
import threading
import contextlib
from sys import _getframe as getframe
from .lib.util import objects
class SocketHandler:
def __init__(self, client, socket_trace = False, debug = False):
websocket.enableTrace(True)
self.socket_url = "wss://ws1.narvii.com... |
temperusb_exporter.py | #!/usr/bin/env python3
# Imports
import prometheus_client
import threading
import argparse
import temper
import json
import time
# Arguments
parser = argparse.ArgumentParser(description='Prometheus exporter for TemperUSB data.')
parser.add_argument('--web.listen-address', action='store', dest='listen_addr', help='Spe... |
dataflow.py | import asyncio
from typing import Optional, Tuple, List, Union, Dict, Any, AsyncIterator
from ..df.types import DataFlow, Input
from ..df.memory import MemoryOrchestrator
from ..df.base import BaseInputSetContext, BaseOrchestrator, BaseInputSet
async def run(
dataflow: DataFlow,
*input_sets: Union[List[Input... |
crawler.py | # Copyright 2017 The Forseti Security 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 ap... |
test_cursor.py | # Copyright 2009-present MongoDB, 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 wri... |
__init__.py | # -*- coding: utf-8 -*-
# Copyright (c) 2014, KOL
# Copyright (c) 2019, Tim Angus
# 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 must retain the above copyr... |
test_search_20.py | import pytest
from time import sleep
from base.client_base import TestcaseBase
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from utils.utils import *
from common.constants import *
prefix = "se... |
__init__.py | import os
import sys
def _get_run_args(print_args: bool = True):
from jina.parsers import get_main_parser
silent_print = {'help', 'hub'}
parser = get_main_parser()
if len(sys.argv) > 1:
from argparse import _StoreAction, _StoreTrueAction
args, unknown = parser.parse_known_args()
... |
archiver.py | import argparse
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import ConfigParser
from datetim... |
fsspec_utils.py | #
# Copyright (c) 2022, NVIDIA 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 ... |
Package.py | import os, sys, copy, shutil, subprocess, shlex
import time
import datetime
import socket
from threading import Thread
import sconsconfig.utils as utils
from sconsconfig.utils import conv
from SCons.Variables import BoolVariable
## Backup a list of environment variables.
# @param[in] env An SCons environment.
# @param... |
sniff.py | from threading import Thread
import queue
from scapy.all import *
import netifaces
from plugins import *
from config.config import Settings
import sys
class Sniffer(Thread):
def __init__(self, options):
super(Sniffer, self).__init__()
self.parser_options = options
self.plugins =... |
tasks.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple
import errno
import functools
import importlib
import json
import logging
import os
import shutil
import stat
import tempfile
import time
import traceback
from distutils.dir_util ... |
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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.