source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
tests.py | ##############################################################################
#
# Copyright (c) 2004 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOF... |
example1.py | # ch12/example1.py
import threading
import time
def thread_a():
print('Thread A is starting...')
print('Thread A waiting to acquire lock A.')
lock_a.acquire()
print('Thread A has acquired lock A, performing some calculation...')
time.sleep(2)
print('Thread A waiting to acquire lock B.')
... |
execution.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import ast
import json
import re
import ssl
import time
from datetime import datetime
from multiprocessing import Pool
from threading import Thread
import pytz
import requests
from bson import ObjectId
from flask import current_app
from requests.cookies import RequestsCookieJa... |
app.py | #!/usr/bin/env python
# encoding: utf-8
"""
@author: Shanda Lau 刘祥德
@license: (C) Copyright 2019-now, Node Supply Chain Manager Corporation Limited.
@contact: shandalaulv@gmail.com
@software:
@file: __init__.py.py
@time: 2020/8/8 16:11
@version 1.0
@descwerkzeug:
"""
import argparse
from multiprocessing import Process
... |
generate_xdata_wav.py | import threading
import subprocess
import glob
# moving all data to one dir cd ~/Downloads/aclImdb/test/neg; tar -cf - * | (cd ~/Downloads/aclImdb/data; tar -xf -)
def process_files(files, thread_id):
counter = 0
for file in files :
cleaned_text = ""
cleaned_file = file.replace('/Users/hen... |
tpu_estimator.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... |
streams.py | #!/usr/bin/env python
import time
import StringIO
from threading import Thread
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
import cv2
import numpy
from PIL import Image
class DummyStream:
def __init__(self):
self.stopped = False
self._fr... |
Server.py | #!/usr/bin/python3
#
# Copyright (C) 2017 by meiraspi@gmail.com published under the MIT License
#
# Socket Server awaiting connection to stream raspicam
#
# http://www.forum-raspberrypi.de/Thread-python-problem-tkinter-socket-client-for-raspicam-live-stream
#
import socket
import struct
import msgpack
import msgpack_n... |
playlistChanger.py | #! /usr/bin/env python
#Bryan DiLaura
from flask import Flask, request, render_template, redirect, url_for
import spotipy
from spotipy import oauth2
from webbrowser import open_new_tab
import random
import datetime
from threading import Thread
from queue import Queue
#create the flask application
app = Flask(__name_... |
MicrobialCommunitiesQCServer.py | #!/usr/bin/env python
from wsgiref.simple_server import make_server
import sys, json, traceback
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, log, ServerError, ParseError, InvalidRequestError
from os ... |
evaluator.py | # Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration.
#
# 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... |
socket_manager.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 errno
import logging
import json
import threading
import time
from queue import PriorityQueue, Empty
import webso... |
trans_uint8.py | import argparse
from glob import glob
from multiprocessing import Process
import numpy as np
def imgs_uint8(data_path):
'''
将npy转为uint8格式,减少存储量
'''
files = glob(data_path+'/*.npy')
print('begin process ', data_path)
for file in files:
pic_ = np.load(file)
pic_ = pic_.astype(np... |
capturehandler.py | from __future__ import unicode_literals
import re
import os
import six
import json
import time
import shlex
import atexit
import psutil
import requests
import tornado.gen
from orderedattrdict import AttrDict
from threading import Thread, Lock
from subprocess import Popen, PIPE, STDOUT # nosec
from six.moves.urlli... |
boost.py | # -*- coding: utf-8 -*-
'''
Auxiliary functions for parallel image processing
:Author:
`Anna Medyukhina`_
email: anna.medyukhina@leibniz-hki.de or anna.medyukhina@gmail.com
:Organization:
Applied Systems Biology Group, Leibniz Institute for Natural Product Research and Infection Biology - Hans Knöll Institute ... |
utils.py | from bitcoin.rpc import RawProxy as BitcoinProxy
from btcproxy import BitcoinRpcProxy
from collections import OrderedDict
from decimal import Decimal
from ephemeral_port_reserve import reserve
from lightning import LightningRpc
import json
import logging
import lzma
import math
import os
import random
import re
import... |
mongodb.py | import pymongo
import socket
import datetime
import sys
import ipaddress
import threading
import os
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[1;94m', '\033[1;91m', '\33[1;97m', '\33[1;93m', '\033[1;35m', '\033[1;32m', '\033[0m'
class ThreadManager(object):
i = 0
def __init__(self, ipList):
... |
spawnshell.py | import threading
import socket
#from .other import XOREncryption
from colorama import Fore,Style
class FakeCmd:
'''
Create 2 threads, one to receive the other to send commands.
'''
thread_in_progress = None
def __init__(self,sock):
self.sock = sock
def recvthread(self):
whil... |
api.py | import random
import urllib3
import json
import time
import threading
import sys
from utils import utils
API_URL = 'https://api.vk.com/method/'
class MethExecutor:
def __init__(self, meth, bot):
self._meth = meth
self._bot = bot
def __call__(self, type='POST', **params):
return self._bot.method(self._meth, ... |
server.py | # 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.
"""ParlAI Server file"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __fu... |
sipxmilter.py | #! /usr/bin/env python3
import Milter
import StringIO
import email
import email.Message
import hashlib
import mime
import os
import sys
import tempfile
import time
import rfc822
from Milter.utils import parse_addr
from email import Errors
from email.Message import Message
## == IP Information
from socket import AF... |
core.py | # Copyright 2019, David Wilson
#
# 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 code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... |
_threadedselect.py | # -*- test-case-name: twisted.test.test_internet -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Threaded select reactor
The threadedselectreactor is a specialized reactor for integrating with
arbitrary foreign event loop, such as those you find in GUI toolkits.
There are three things... |
server_db.py | # mysql.connector installed only on python2.7
# Won't compile on python3
#!/usr/bin/env python3
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
from mysql.connector import MySQLConnection,Error
from python_mysql_dbconfig import read_db_config
clients = {}
addresses = {}
HOST = '127.0.0.... |
server.py | import sys
import getopt
from webserver import ws_start
from database import Database
from database_sqlite import SqliteDatabase
from database_mysql import MysqlDatabase
from database_redcaprssi import REDCapRSSIDatabase
from database_mongo import MongoDatabase
from database_variot import VarIOTDatabase
from mycrypto i... |
resources.py | from datetime import datetime, timedelta
import time
import random
import subprocess
import os
import os.path
import time
from collections import defaultdict
import json
import logging
import numbers
import yaml
from django.db import models
from django.contrib.auth.models import AbstractUser
import pexpect, getpass
i... |
IMU.py | import serial.tools.list_ports
import os,sys
import serial
import time
import numpy as np
import threading
pwd = os.path.abspath(os.path.abspath(__file__))
father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..")
sys.path.append(father_path)
data_path = os.path.abspath(
os.path.dirname(os.path.abspa... |
main_controller.py | from PySide2.QtCore import QObject, Slot, Signal, SignalInstance, QSettings
from threading import Thread
from typing import Optional, List
from src.api.api import ValorantAPI
from src.ui.views.main_view import MainView
from src.models.models import PlayerData, Match
from src.services.analytics_service import Analytic... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
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
import test.support
import test.... |
test_process.py | import unittest
import os
import time
import select
import signal
import psutil
from pkit.process import ProcessOpen, Process, get_current_process
class TestGetCurrentProcess(unittest.TestCase):
def setUp(self):
self.process = Process(target=lambda: time.sleep(10))
def tearDown(self):
if se... |
client.py | import sys
from socket import *
from select import select
from multiprocessing import Process
from settings import *
def connect(sock_client, pipe_server, name):
# IO多路复用:循环监听套接字
rlist = [sock_client, pipe_server]
wlist = []
xlist = []
while True:
rs, ws, xs = select(rlist, wlist, xlist)
... |
kasif copy.py | import zipfile
import json
from datetime import datetime
import base64
import time
import os
import sys
import queue
import threading
import psutil
from persistqueue import Queue
import queue
import os
import time
import pygame.camera
import pygame.image
from PIL import Image
import cv2
import guid
import pika
import s... |
continuous.py | from builtins import setattr, getattr
from fractions import Fraction
import math
from multiprocessing import Process, Manager
from warnings import warn, showwarning
try:
from sympy import *
import numpy as np
from scipy.stats import norm, beta, gamma, expon
from scipy.linalg import pascal
from scip... |
stress_test_index_mp.py | """Stress test diskcache.persistent.Index."""
import itertools as it
import multiprocessing as mp
import os
import random
import time
import diskcache as dc
KEYS = 100
OPERATIONS = 10000
SEED = 0
functions = []
def register(function):
functions.append(function)
return function
@register
def stress_get(i... |
test_rate_mgr.py | import statistics
import time
import unittest
from multiprocessing import Lock
from threading import Thread
from time import sleep
from botocore.api_rate_manager import ApiRateManager
class TestRateManager(unittest.TestCase):
test_metrics = []
thread_end_times = []
mutex = Lock()
brm = None
def ... |
server.py | '''
This class will represent the iocpusher-server.
'''
# pylint: disable=C0413, C0411
import sys
import time
import json
import datetime
import random
import requests
import pytz
import gitlab
sys.path.append('..')
from threading import Thread
from libs.core.environment import envvar
from libs.kafka.logging import... |
driver_util.py | """Scripts for drivers of Galaxy functional tests."""
import http.client
import logging
import os
import random
import re
import shlex
import shutil
import signal
import socket
import string
import subprocess
import sys
import tempfile
import threading
import time
from typing import Optional
from urllib.parse import u... |
masterhead.py | # -*- coding: utf-8 -*-
"""HydraTK master module
.. module:: core.masterhead
:platform: Unix
:synopsis: HydraTK master module
.. moduleauthor:: Petr Czaderna <pc@hydratk.org>
"""
import sys
import os
import errno
import signal
import time
import multiprocessing
import pprint
import inspect
import imp
import ... |
server.py | # Copyright 2018 The MLPerf 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 applicable ... |
bot.py | import time
import praw
import prawcore
import threading
from pymongo import MongoClient
class Bot:
"""
name:
Bandit-kun
author:
/u/Rayraegah
description:
Grab downloadable video urls from reddit streams and mentions.
Scraped video urls are saved in ./data/video_list_{MM}_{DD}.csv
... |
Email_Bomber.py | import smtplib
import time
import os
import random
import string
import threading
import json
from datetime import datetime
from pyfade import Fade, Colors
import platform
from colorama import Fore, init
import sys
banner = '''
|
|
,--'#`--.
|#######|
_.-'... |
voice.py | from matrix import*
from random import*
import time
import LED_display as LMD
import threading
from score import*
import gspeech2
import fuc
def LED_init(): #LED에 불 들어오게 하기 위한 함수(threading)
thread=threading.Thread(target=LMD.main, args=())
thread.setDaemon(True)
thread.start()
return
def draw_ma... |
proc_speed.py | #sub processes to measure loading speed of a webpage
#include libs
import sys
sys.path.insert(0, '..')
from include import *
def speed():
call(["python3", "job_speed.py"])
process1 = threading.Thread(target=speed)
process1.start()
|
bittrex.py | from bitfeeds.socket.restful import RESTfulApiSocket
from bitfeeds.exchange import ExchangeGateway
from bitfeeds.market import L2Depth, Trade
from bitfeeds.util import Logger
from bitfeeds.instrument import Instrument
from bitfeeds.storage.sql_template import SqlStorageTemplate
from functools import partial
from dateti... |
notebook.py | # -*- coding: utf-8 -*-
#
# HPX - dashboard
#
# Copyright (c) 2020 - ETH Zurich
# All rights reserved
#
# SPDX-License-Identifier: BSD-3-Clause
"""Module for integration into Jupyter notebooks"""
from queue import Queue
import threading
import time
from bokeh.plotting import output_notebook, show
from ..common.logg... |
conftest.py | import json
import os
import time
from multiprocessing import Process
import pytest
import syft
import torch
from gevent import pywsgi
from geventwebsocket.handler import WebSocketHandler
from syft.grid.clients.data_centric_fl_client import DataCentricFLClient
from . import GRID_NETWORK_PORT, IDS, PORTS
@pytest.fix... |
test_window_runner.py | # Copyright 2021 Zilliz. 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 agree... |
spraygen.py | #!/usr/bin/env python3
import argparse
from datetime import datetime
from colorama import init, Fore, Back, Style
import itertools
import string
import time
from progress.bar import Bar
import threading
import random
# Global start time to keep track of process running time
start_time = time.time()
# Colorama init c... |
client.py | from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
import sys
host = 'localhost'
port = 1459
buffer_size = 1500
# Create the client socket. Connect to the server.
socket = socket(AF_INET, SOCK_STREAM)
done = False
while not done:
try:
socket.connect((host... |
semantic_tags.py | from django.views.decorators.csrf import csrf_exempt
from django.http import JsonResponse
import json
import requests
import string
from user import authentication
from . import recommendation_engine
from user.models import *
from project.models import *
from difflib import SequenceMatcher
from threading import Thread... |
layout.py | import itertools
import json
from typing import Collection, Iterable, Dict, Tuple, Callable
import threading
import random
import functools
import board
import fingermap
import corpus
from nstroke import (
all_tristroke_categories, Nstroke, applicable_function, tristroke_category
)
class Layout:
loaded = {} ... |
rest-break-linux.py | #!/usr/bin/python3
import sys
import time
from threading import Thread
from typing import Optional
from subprocess import run
from PyQt5 import QtWidgets
from apscheduler.schedulers.qt import QtScheduler
from PyQt5 import QtCore, QtGui
from PyQt5.QtWidgets import QMainWindow, QApplication
testing = False
minute = "... |
multi_nvs_partition_download.py | #!/usr/bin/env python3
# -*-coding:utf-8-*-
import os
import sys
import argparse
import threading
import re
from copy import deepcopy
class MUltiLoader():
""" Multi downloader for esp32 nvs partition """
DOWNLOAD_SUCESS_STRING = "Hard resetting via RTS pin..."
ERASE_SUCCESS_STRING = "Chip erase completed ... |
wsgi.py | """
WSGI config for youtube project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.0/howto/deployment/wsgi/
"""
import os
from threading import Thread
from django.core.wsgi import get_wsgi_application
from api... |
FindInProject.py | import time
import queue
import threading
import os
import traceback
import re
import mimetypes
import sublime_plugin
import sublime
from . import filesearcher
from . import resultbuffer
from . import tfidf_search
from . import pagerank
from . import scanners
# Split terms by non-word characters
DEFAULT_TERM_SEPARAT... |
test_locks.py | from __future__ import annotations
import queue
from threading import Thread
from typing import TYPE_CHECKING
import pytest
from django.db import OperationalError, connection, connections
from django.db.transaction import TransactionManagementError, atomic
from django.test import TestCase, TransactionTestCase
from d... |
unlogger.py | #!/usr/bin/env python
import argparse
import os
import sys
import zmq
import time
import gc
import signal
from threading import Thread
import numpy as np
from uuid import uuid4
from collections import namedtuple
from collections import deque
from multiprocessing import Process, TimeoutError
from datetime import datetim... |
batch_project.py | # =============================================================================
# Authors: PAR Government
# Organization: DARPA
#
# Copyright (c) 2016 PAR Government
# All rights reserved.
#==============================================================================
import Queue as queue
import argparse
import copy... |
subproc_vec_env.py | import numpy as np
from multiprocessing import Process, Pipe
from . import VecEnv, CloudpickleWrapper
from helpers.tile_images import tile_images
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
try:
while True:
cmd, data = remote.recv()... |
utils.py | from django_redis import get_redis_connection
from wechat import models
from wechat.core import pkl_path
from wxpy import Bot
from .const import ALIVE
from . import exception
import threading
import os
import time
def update_app_info(app_name):
if app_name is not None:
try:
app = models.Ap... |
MasterService.py | # app.py
import os, sys, time
import json
from threading import Thread
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from webwhatsapi import WhatsAPIDriver
from pprint import pprint
from ServiceImporter import *
# export PATH="$HOME/wholesomegarden/WhatsappReminder:$PATH"
from Servi... |
firewall.py | import threading
import socket
import struct
from ctypes import *
import sys
import signal
class IP(Structure):
_fields_= [
("version", c_ubyte, 4),
("ihl", c_ubyte, 4),
("tos", c_ubyte),
("len", c_ushort),
("id", c_ushort),
("offset", c_ushort),
("ttl... |
WebSocketSerial_20200223133153.py | from twisted.internet.protocol import ReconnectingClientFactory
from autobahn.twisted.websocket import WebSocketClientProtocol, WebSocketClientFactory
from twisted.internet import reactor, interfaces
from zope.interface import implementer
import json
import base64
import subprocess
from twisted.internet import task
fro... |
tempdeck.py | from threading import Thread, Event
from opentrons.drivers.temp_deck import TempDeck as TempDeckDriver
from opentrons import commands
TEMP_POLL_INTERVAL_SECS = 1
class MissingDevicePortError(Exception):
pass
# TODO: BC 2018-08-03 this class shares a fair amount verbatim from MagDeck,
# there should be an upstr... |
shadow.py | # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0.
from awscrt import mqtt
from awsiot import iotshadow
from concurrent.futures import Future
import sys
import threading
import traceback
from uuid import uuid4
# - Overview -
# This sample uses the AWS IoT Devic... |
test_kratos_debug.py | import fault
import pytest
import kratos
import multiprocessing
import time
import tempfile
import magma as m
import shutil
import operator
import hwtypes
has_runtime = fault.util.has_kratos_runtime()
def mock_debugger(fn):
# run it in a separate process to fake a debugger-simulator interaction
p = multipro... |
worker.py | from contextlib import contextmanager
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import sys
import threading
import time
import traceback
from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, Union
# Ray modules
from ra... |
launch.py | """Launching tool for DGL distributed training"""
import os
import stat
import sys
import subprocess
import argparse
import signal
import logging
import time
import json
from threading import Thread
def kubexec_multi(cmd, host, thread_list):
cmd = f'sh /etc/dgl/kubexec.sh {host} \'{cmd}\''
# thread func to ru... |
child.py | """Child worker process module."""
import os
import sys
import time
import pickle
import signal
import socket
import argparse
import threading
def parse_cmdline():
"""Child worker command line parsing"""
parser = argparse.ArgumentParser(description='Remote runner parser')
parser.add_argument('--address',... |
Ip2Db.py | import threading
from my_pool.Pool_ip import pools
from Log import log
def insert(ip):
log.info("获取新的ip:{}".format(str(ip)))
for db in pools:
threading.Thread(target=insertOne, args=(ip, db.getInputMethod(), db, db.getDesc())).start()
def insertOne(ip, fun, db, sign):
try:
if fun(ip):
... |
test_run_neon.py | # # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# # All trademark and other rights reserved by their respective owners
# # Copyright 2008-2021 Neongecko.com Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... |
test_pfcwd_warm_reboot.py | import datetime
import logging
import os
import pytest
import random
import threading
import time
from tests.common.fixtures.conn_graph_facts import fanout_graph_facts
from tests.common.helpers.assertions import pytest_assert
from tests.common.helpers.pfc_storm import PFCStorm
from tests.common.plugins.loganalyzer.log... |
grounding_concepts.py | import configparser
import json
import spacy
from spacy.matcher import Matcher
import sys
import timeit
from tqdm import tqdm
import numpy as np
import threading
import os
import pickle
blacklist = set(["-PRON-", "actually", "likely", "possibly", "want",
"make", "my", "someone", "sometimes_people", "s... |
generic_websocket.py | """
Module used as a interfeace to describe a generick websocket client
"""
import asyncio
import websockets
import socket
import json
import time
from threading import Thread, Lock, Event
from pyee import EventEmitter
from ..utils.custom_logger import CustomLogger
# websocket exceptions
from websockets.exceptions i... |
batch_util.py | # Copyright 2017-2022 TensorHub, 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 writ... |
create2.py | #!/usr/bin/env python
import binascii
import bitstring
import serial
import struct
import threading
class Create2:
"""Python class for interfacing with a locally-connected iRobot Create 2 robot"""
def __init__(self, dev = "/dev/ttyUSB0", baud=115200):
"""Open the connection with the device"""
... |
__init__.py | from distutils.version import LooseVersion
import logging
from logging.handlers import SysLogHandler, TimedRotatingFileHandler
import os
from pathlib import Path
import sys
import warnings
import appdirs
from IPython import get_ipython
from ._version import get_versions
__version__ = get_versions()["version"]
del g... |
pyth_publisher.py | #!/usr/bin/env python3
from pyth_utils import *
from http.server import HTTPServer, BaseHTTPRequestHandler
import json
import os
import random
import sys
import threading
import time
PYTH_TEST_SYMBOL_COUNT = int(os.environ.get("PYTH_TEST_SYMBOL_COUNT", "9"))
class PythAccEndpoint(BaseHTTPRequestHandler):
"""
... |
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... |
vdbench_pod.py |
import os
from multiprocessing import Process
from benchmark_runner.common.logger.logger_time_stamp import logger_time_stamp, logger
from benchmark_runner.common.elasticsearch.elasticsearch_exceptions import ElasticSearchDataNotUploaded
from benchmark_runner.workloads.workloads_operations import WorkloadsOperations
... |
test_build_api.py | """Test the kernels service API."""
from tempfile import TemporaryDirectory
import threading
from jupyterlab.labapp import LabApp
from jupyterlab_launcher.tests.utils import APITester, LabTestBase
from notebook.tests.launchnotebook import assert_http_error
class BuildAPITester(APITester):
"""Wrapper for build RE... |
driver.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
from collections import namedtuple
from threading import Thread
from time import sleep
import RPi.GPIO as GPIO
from config import Config
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BOARD)
def v_print(string):
"""
Print if verbo... |
browser.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
r"""
# .---. .-----------
# / \ __ / ------
# / / \( )/ ----- (`-') _ _(`-') <-. (`-')_
# ////// '\/ ` --- ( OO).-/( (OO ).-> .-> \( OO) ) .->
# //// / // : : --- (,------... |
test_parallel_backend.py | # -*- coding: utf-8 -*-
"""
Tests the parallel backend
"""
import faulthandler
import multiprocessing
import os
import random
import subprocess
import sys
import threading
import numpy as np
from numba import jit, vectorize, guvectorize
from numba.tests.support import (temp_directory, override_config, TestCase, tag... |
service.py | import os
import re
import sys
import json
import time
import click
import psutil
import importlib
import traceback
import threading
import subprocess
import watchdog
import anchore_engine.configuration.localconfig
from watchdog.observers import Observer
from watchdog.events import RegexMatchingEventHandler
from anch... |
nanny.py | import asyncio
import logging
from multiprocessing.queues import Empty
import os
import psutil
import shutil
import threading
import uuid
import warnings
import weakref
import dask
from dask.system import CPU_COUNT
from tornado.ioloop import IOLoop
from tornado import gen
from .comm import get_address_host, unparse_h... |
burp_bing.py | """
Basic extension of Burp Suite to output detected URLs using Microsoft Bing's API.
Get a Bing API key here:
http://www.bing.com/dev/en-us/dev-center/
"""
from burp import IBurpExtender
from burp import IContextMenuFactory
from javax.swing import JMenuItem
from java.util import List, ArrayList
from java.net import... |
test_monitoring.py | import multiprocessing
import time
import pytest
import requests as req
from docarray import DocumentArray
from jina import Executor, Flow, requests
@pytest.fixture()
def executor():
class DummyExecutor(Executor):
@requests(on='/foo')
def foo(self, docs, **kwargs):
...
@requ... |
tests.py | # -*- coding: utf-8 -*-
"""
Unit tests for reverse URL lookups.
"""
from __future__ import unicode_literals
import sys
import threading
import unittest
from admin_scripts.tests import AdminScriptTestCase
from django.conf import settings
from django.conf.urls import include, url
from django.contrib.auth.models import... |
froot.py | # Blobtastical
import threading
import logging
import serial
import time
class Port(object):
def __init__(self, dev, baud, parity):
if parity == 'e':
p = serial.PARITY_EVEN
if parity == 'n':
p = serial.PARITY_NONE
if parity == 'o':
p = serial.PARITY_ODD
... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import queue as pyqueue
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
import test.support
import test.... |
video_service.py | import threading
import sys
import zmq
from video_server import VideoServer
from video_settings import get_stream_direction
from logger import logger
import config
vserver = VideoServer(ip=config.ZMQ_IP, port=config.ZMQ_PORT)
def run(vserver: VideoServer):
try:
while vserver.on:
try:
... |
scp_upload.py | #!/usr/bin/env python3
from paramiko import SSHClient, WarningPolicy, SSHConfig, ProxyCommand
from scp import SCPClient # from https://github.com/jbardin/scp.py
import sys
import os
from multiprocessing import Process, Queue
import threading
# Define default simple progress callback that prints the current percen... |
align_dataset_mtcnn.py | """Performs face alignment and stores face thumbnails in the output directory."""
# MIT License
#
# Copyright (c) 2016 David Sandberg
#
# 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 witho... |
pololu_ticcmd_wrapper.py | """Pololu TIC Device."""
import subprocess
import logging
import asyncio
from threading import Thread
import ruamel.yaml
class TicError(Exception):
"""A Pololu TIC Error."""
pass
class PololuTiccmdWrapper:
"""A Pololu TIC Device."""
def __init__(self, serial_number, machine, debug=True):
... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
... |
network_manager.py | import errno
import datetime
import threading
from time import sleep
from futu.common.utils import *
from futu.quote.quote_query import parse_head
from .err import Err
from .sys_config import SysConfig
from .ft_logger import *
import enum
if IS_PY2:
import selectors2 as selectors
import Queue as queue
else:
... |
camera.py | """camera.py
Based on jkjung: https://github.com/jkjung-avt/tensorrt_demos
This code implements the Camera class, which encapsulates code to
handle IP CAM, USB webcam or the Jetson onboard camera. In
addition, this Camera class is further extended to take a video
file or an image file as input.
"""
import logging
im... |
process_control.py |
# TODO more comprehensive tests
from __future__ import division
from __future__ import absolute_import # XXX is this necessary?
from wx.lib.agw import pyprogress
import wx
from libtbx import thread_utils
from libtbx import runtime_utils
from libtbx import easy_pickle
from libtbx import easy_run
from libtbx.utils impo... |
reader.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.