source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_perfs.py | from wxasync import AsyncBind, WxAsyncApp
import wx
import asyncio
from asyncio.events import get_event_loop
from wx.lib.newevent import NewEvent
import time
from collections import deque
import json
from multiprocessing import Process
import multiprocessing
import itertools
TestEvent, EVT_TEST_EVENT = NewEvent()
cla... |
imagen.py | from datetime import datetime as dt
from pathlib import Path
from os import kill
from os.path import exists, getmtime
from signal import SIGKILL
import subprocess
import time
import requests
import streamlit as st
from torch.multiprocessing import Process, set_start_method
import yaml
from generate import generate, V... |
test_client_multi.py | import os
import sys
import pytest
import ray
@pytest.mark.skipif(
sys.platform == "win32", reason="PSUtil does not work the same on windows."
)
@pytest.mark.parametrize(
"call_ray_start",
["ray start --head --ray-client-server-port 25001 --port 0"],
indirect=True,
)
def test_multi_cli_basic(call_ray_... |
conftest.py | """
Pytest configuration that spins up a single localstack instance that is shared across test modules.
See: https://docs.pytest.org/en/6.2.x/fixture.html#conftest-py-sharing-fixtures-across-multiple-files
It is thread/process safe to run with pytest-parallel, however not for pytest-xdist.
"""
import logging
import mu... |
threading_example2.py | #!/usr/bin/python3
import threading
import time
class myThread(threading.Thread):
def __init__(self, threadID, name, counter):
threading.Thread.__init__(self)
self.threadID = threadID
self.name = name
self.counter = counter
def run(self):
print('Starting ' + self.name... |
test_webserver.py | import subprocess
import time
import sys
import os
import re
import threading
import queue
import pytest
import requests
from pytest_test_filters import skip_on_windows
pytestmark = skip_on_windows(
reason="Subprocess based approach is problematic on windows."
)
from testplan.common.utils.process import kill_pr... |
viewer_3d_7_24_4.py | #-------------------------
#3d Renderer
#Daniel Miron
#7/5/2013
#
#Allows 3d viewing of nerve cord or neuron stacks.
#Includes ability to fully rotate image in 3 dimensions and to mark locations in 3-space
#-------------------------
import sys
sys.path.append(r'c:\Python27\Lib\site-packages')
sys.path.append('.')
impo... |
sap_connection.py | """ SAP connection module """
import os
from os import path
import time
from threading import Thread
from connection.abstract_connection_type import AbstractConnectionType
class SapConnection(AbstractConnectionType):
""" SAP connection class """
KEY_CONN = "conn"
KEY_CLNT = "clnt"
KEY_USER = "user"
... |
test_cache.py | # Copyright (c) 2020-2021 CRS4
#
# 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, publish, distribut... |
pacman.py | import re
from threading import Thread
from typing import List, Set, Tuple
from bauh.commons.system import run_cmd, new_subprocess, new_root_subprocess, SystemProcess, SimpleProcess
from bauh.gems.arch.exceptions import PackageNotFoundException
RE_DEPS = re.compile(r'[\w\-_]+:[\s\w_\-\.]+\s+\[\w+\]')
RE_OPTDEPS = re.... |
transform.py | # -*- mode: python; coding: utf-8 -*-
# Copyright 2020-2021 the AAS WorldWide Telescope project
# Licensed under the MIT License.
"""
Within-tile data transformations. Mainly, transforming floating-point data to
RGB.
"""
__all__ = '''
f16x3_to_rgb
u8_to_rgb
'''.split()
from astropy import visualization as viz
import... |
user.py | #!/usr/bin/env python2.7
import argparse # new in Python2.7
import os
import time
import string
import atexit
import threading
import logging
import sys
logging.basicConfig(level=logging.ERROR)
from yapsy.PluginManager import PluginManager
# Load the plugins from the plugin directory.
manager = PluginManager()
if ... |
remoteConnectorRover.py | # Copyright (c) 2010-2013, Regents of the University of California.
# All rights reserved.
#
# Released under the BSD 3-Clause license as published at the link below.
# https://openwsn.atlassian.net/wiki/display/OW/License
import logging
log = logging.getLogger('remoteConnectorRover')
log.setLevel(logging.ERROR)
log.ad... |
multiprocess.py | from multiprocessing import Process, Value, Array
# def f(n):
# flag = True
# while flag :
# if n.value == 0 :
# flag = False
# print (1)
# print (2)
# if __name__ == '__main__':
# num = Value('i', 1)
# p = Process(target=f, args=(num))
# p.start()
# # p.jo... |
preCode.py | import sys
import threading
import json
import codecs
import logging
import os
from time import sleep
'''
List : Global Variables
Descriptions :
threadExit : A variable for detecting whether a thread executing the body source has exited"
loggerStdout : A variable logging the stream passed out on STDOUT... |
mail-unread.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import sys
import os
import subprocess
from multiprocessing import Process
import threading
import time
from imapclient import IMAPClient
from account_checker import AccountChecker
from network import Network
from evolution_accounts import EvolutionAccountsList
import gi
g... |
RealTimeAnalysisOption.py | from tkinter import *
import threading
from RealTimeAnalyzer import RealTimeAnalyzer
from matplotlib.figure import Figure
from matplotlib import pyplot as plt
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
class PageLiveAnalysis(LabelFrame):
def __init__(self, parent, controller):
LabelF... |
mp_manager.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
mp_manager.py
@author Cassandra Henderson
cassandra.s.henderson@gmail.com
Handles running a multiprocessing queue
"""
import multiprocessing as mp
import gc
import psutil
import time
def queue(targs, args, n_thread_override = None, verbose=True,
cpu_thrott... |
__init__.py | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
__all__ = ['ToastNotifier']
# #############################################################################
# ########## Libraries #############
# ##################################
# standard library
... |
train.py | # MIT License
#
# Copyright 2019 Google LLC
# Copyright (c) 2019 Franck Dernoncourt, Jenny Lee, Tom Pollard
#
# 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 wi... |
feeder.py | import os
import threading
import time
import numpy as np
import tensorflow as tf
from datasets import audio
from infolog import log
from keras.utils import np_utils
from sklearn.model_selection import train_test_split
from .util import is_mulaw_quantize, is_scalar_input
_batches_per_group = 32
_pad = 0
class Feed... |
schedules.py | import os, sys, time, datetime
import threading
import django
from django.http import JsonResponse
from Qn.models import Survey
base_apth = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
# print(base_apth)
# 将项目路径加入到系统path中,这样在导入模型等模块时就不会报模块找不到了
# 定时更新数据库信息,不过维护数据较好的话不必使用
sys.path.appen... |
test_mp.py | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
video_classifier.py | import os
import time
import cv2
#import couchdb
import numpy as np
from threading import Thread
from skimage.measure import compare_ssim as ssim
from db_handler import *
import subprocess
import shlex
import json
import datetime
import resource
class video_classifier():
def __init__(self, files, tags = None):
... |
fleetspeak_client.py | #!/usr/bin/env python
"""Fleetspeak-facing client related functionality.
This module contains glue code necessary for Fleetspeak and the GRR client
to work together.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
import logging
import pdb
import platform
import struct
import thread... |
websocket_server.py | #!/usr/bin/env python3
"""A simple websocket server. Producer and consumer routines may be
passed in that will generate messages to be sent to the websocket
(producer) and will take messages retrieved from the websocket and
process them (consumer).
The attached executable script uses default routines that look for
mes... |
showoff_s1.py | # type: ignore
import time
import patch_ftp
import robomaster.config # noqa
from robomaster import robot, logger, logging # noqa
import robomaster.conn
import robomaster.camera
import cv2
import sys
# import threading
import patch_ftp # noqa
# IP = "127.0.0.1" # Leave to None to scan for IPs on (0.0.0.0)
IP = ""
... |
GoogleCalendar.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "MPZinke"
##########################################################################################
#
# created by: MPZinke
# on 2020.03.31
#
# DESCRIPTION:
# BUGS:
# FUTURE:
#
#################################################################################... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask("")
@app.route("/")
def home():
return "Hello. I am alive!"
def run():
app.run(host="0.0.0.0", port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
processor.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_stream.py | from unittest import TestCase
import threading
import time
import mock
from twitter_monitor import DynamicTwitterStream
class TestDynamicTwitterStream(TestCase):
def setUp(self):
# Mock tweepy.Stream
self.stream_patcher = mock.patch('tweepy.Stream')
self.MockTweepyStream = self.stream_pa... |
gdvfs.py | #!/usr/bin/env python
"""
gdvfs - Google Drive Video File System for FUSE
(C) 2015 - Weston Nielson <wnielson@gmail.com>
"""
# Standard library modules
import calendar
import ConfigParser
import errno
import getopt
import logging
import os
import re
import sys
import thread
import threading
import time
import u... |
ExportIndicators.py | import demistomock as demisto
from CommonServerPython import *
from CommonServerUserPython import *
import re
import json
import traceback
from base64 import b64decode
from multiprocessing import Process
from gevent.pywsgi import WSGIServer
from tempfile import NamedTemporaryFile
from flask import Flask, Response, req... |
serialize_tensorboard.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
image_server.py | # Copyright 2022 The pybadge Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
test_events.py | """Tests for events.py."""
import functools
import gc
import io
import os
import platform
import re
import signal
import socket
try:
import ssl
except ImportError:
ssl = None
import subprocess
import sys
import threading
import time
import errno
import unittest
from unittest import mock
import weakref
import... |
multiprocessing_simple.py | #
"""Creating and waiting for a process
"""
# end_pymotw_header
import multiprocessing
def worker():
"""worker function"""
print("Worker")
if __name__ == "__main__":
jobs = []
for i in range(5):
p = multiprocessing.Process(target=worker)
jobs.append(p)
p.start()
|
coubs.py | from coub_api.schemas.constants import Period
from coub_api import CoubApi
import vk_api
from vk_api.bot_longpoll import VkBotLongPoll, VkBotEventType
from threading import Thread
import time
import datetime
from admin_panel import warn, get_user_id
vk_session = vk_api.VkApi(token='ТОКЕН')
longpoll = VkBotLongPoll(vk_... |
cli.py | import sys
sys.path.append('')
from src.interface.readUDP import read
from src.interface.interface import Interface
import threading
CLI_FILE = 'src/interface/cli_start.txt'
class CLI():
def __init__(self):
self._interface = Interface()
thread = threading.Thread(target=self.dataListener, args=())
... |
build.py | ## @file
# build a platform or a module
#
# Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR>
# Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
# Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
... |
runner.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache 2.0 License.
import getpass
import time
import http
import logging
from random import seed
import infra.jwt_issuer
import infra.network
import infra.proc
import infra.remote_client
import infra.rates
import cimetrics.upload
import t... |
DCPBase.py | import logging
import time
import typing
from datetime import datetime
from io import RawIOBase
from typing import Any, List, Optional, AnyStr, Union
from pyserialdrivers import MICROPYTHON
from pyserialdrivers.exo.constants import Commands, Param
log = logging.getLogger(__name__)
try:
if MICROPYTHON:
im... |
speedtest.py | #!/usr/bin/env python3
import re
import sys
import string
import bisect
import logging
import subprocess
try:
import requests
except ImportError:
raise ImportError(
"'requests' library is required for running this program")
from time import time
from multiprocessing import Process, Manager
from math ... |
objDet_utils.py | # from google.cloud import vision
# from google.cloud.vision import types
import os
import time
import sys
import cv2
sys.path.append('..')
from utils.app_utils import *
import numpy as np
import tensorflow as tf
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as... |
key-recorder.py | # Requirements: python3, numpy, opencv, mss, tkinter
import time
import numpy as np
import cv2
# from matplotlib import pyplot as plt
import mss
import threading
import main_overlay
from tkinter import *
from tkinter import scrolledtext
HUE_80_90_THRESHOLD = 0.3
KEYS = [['Q','W','E','R','T','Y','U'... |
ip_lib.py | # Copyright 2012 OpenStack Foundation
# 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 requ... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import platform
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
try:... |
SAC_run_v8.py | #!/usr/bin/env python3
import threading, queue
import time
import os
import shutil
import numpy as np
import math
import rospy
import tensorflow as tf
from sac_v14 import SAC
from env_v22 import Test
from manipulator_h_base_module_msgs.msg import P2PPose
MAX_EPISODES = 100000
MAX_EP_STEPS = 600
MEMORY_CAPACITY = 100... |
device_serve.py | import argparse
import json
import threading
import time
from queue import Queue, Empty
import jax
import numpy as np
import optax
from mesh_transformer import util
from mesh_transformer.checkpoint import read_ckpt
from mesh_transformer.sampling import nucleaus_sample
from mesh_transformer.transformer_shard import Ca... |
send.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import multiprocessing as mp
import numpy as np
from maro.communication import Proxy, SessionMessage, SessionType
def worker(group_name):
"""
The main worker logic includes initialize proxy and handle jobs from the master.
Args:... |
run.py | # -*- coding: utf-8-*-
from src.components.logger import init as loggingConfiger
import logging
from src.conversation import Conversation
from src.config import profile, load_yaml_settings
from src.config.path import APP_RESOURCES_DATA_PATH
import argparse
from src.components.aliyun_iotx.iot_mqtt_client import IotClie... |
impersonate.py | # Copyright 2021 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 ctypes
import logging
import os
import threading
import msvcrt
import pywintypes
import win32api
import win32con
import win32event
import win32file
i... |
r6-svchanger.py | import tkinter as tk
import tkinter.ttk as ttk
from tkinter import filedialog
from tkinter import messagebox as msgbox
import os
import sys
import subprocess
import requests
import threading
import locale
import gettext
from ruamel.yaml import YAML
from packaging import version
VERSION = '1.1'
LOCALE = locale.getdefau... |
test_threads.py | import threading
import queue as stdlib_queue
import time
import pytest
from .. import _core
from .. import Event, CapacityLimiter, sleep
from ..testing import wait_all_tasks_blocked
from .._threads import (
to_thread_run_sync, current_default_thread_limiter, from_thread_run,
from_thread_run_sync, BlockingTri... |
data_provider.py | import socket
import threading
from tello.synchronized_variable import SynchronizedVariable
from tello.utils import TELLO_IP, TELLO_COMMAND_PORT
class DataProvider(object):
"""
Base class for all data providers.
Object that subscribes and creates a new thread to listen on the given port of the Tello dro... |
zfs-error.py | #PSC zfs file system errors
# Chris Ganas, Tim Becker
import re, logging, smtplib
import time, gspread, paramiko
import sys, os, signal
from threading import Thread
from argparse import ArgumentParser
import ssh
logger = logging.getLogger("slash2")
hang_file = "zfs-error.hang.pid"
alert_emails = []
class Spread(o... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a bitcoind node can load multiple wallet files
"""
from decimal import D... |
http_kernel_manager.py | #
# Copyright 2018-2020 IBM 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 wr... |
main.py | """
PyWRM ASGI endpoints
"""
from base64 import b64decode
from importlib import import_module
import json
import logging
import os
import sys
import time
import threading
from uuid import uuid4
from fastapi.responses import (HTMLResponse,
JSONResponse)
from fastapi.encoders import jsona... |
test_tensorflow2_autolog.py | # pep8: disable=E501
import collections
import pytest
from distutils.version import LooseVersion
import numpy as np
import pandas as pd
import tensorflow as tf
from tensorflow.keras import layers
import mlflow
import mlflow.tensorflow
import mlflow.keras
from mlflow.utils.autologging_utils import BatchMetricsLogger
... |
cooker.py | #!/usr/bin/env python
#
# Copyright (C) 2003, 2004 Chris Larson
# Copyright (C) 2003, 2004 Phil Blundell
# Copyright (C) 2003 - 2005 Michael 'Mickey' Lauer
# Copyright (C) 2005 Holger Hans Peter Freyther
# Copyright (C) 2005 ROAD GmbH
# Copyright (C) 2006 - 2007 Richard Purdie
#
# SPDX-License-Identifie... |
Merlin.py | from .Detector import (
Detector, SoftwareLiveDetector, TriggeredDetector, BurstDetector)
from ..recorders.Hdf5Recorder import Link
from ..environment import env
import time
import numpy as np
import os
import requests
import json
import zmq
from threading import Thread
TRIG_MODES = {'internal': 0, 'rising_ttl': ... |
server.py | #!/usr/bin/env python
"""
classic rpyc server running a SlaveService + angrdbg + IPython shell
usage:
angrdbg-srv.py # default settings
angrdbg-srv.py --host HOST --port PORT # custom settings
# ssl-authenticated server (keyfile and certfile are required)
angrdbg-srv.py --... |
local_elastic_agent_test.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import multiprocessing
import os
import time
import unittest
import uuid
from unittest.moc... |
optimize_alarm2_grid_search.py | import EncoderFactory
from DatasetManager import DatasetManager
import pandas as pd
import numpy as np
from sklearn.metrics import roc_auc_score
from sklearn.pipeline import FeatureUnion
import time
import os
import sys
from sys import argv
import pickle
import csv
from conf_constant_costfunctions import get_consta... |
views.py | # _
# /\ | |
# / \ _ __ ___| |__ ___ _ __ _ _
# / /\ \ | '__/ __| '_ \ / _ \ '__| | | |
# / ____ \| | | (__| | | | __/ | | |_| |
#/_/ \_\_| \___|_| |_|\___|_| \__, |
# __/ |
# |___/
# Copyright (C) 201... |
conftest.py | import array
import functools
import logging
import os
import signal
import subprocess
import sys
import threading
import time
import uuid
from types import SimpleNamespace
import pytest
import caproto as ca
import caproto.asyncio # noqa
import caproto.benchmarking # noqa
import caproto.threading # noqa
from capro... |
server.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
__author__ = 'andyguo'
import datetime
import json
import threading
import zmq
from config import *
from util import tprint, recursive_update
from worker import LocalAsyncWorker
class ServerBase(object):
worker_count = None
workers = {}
available_workers... |
controller.py | import time
import traceback
from argparse import Namespace
from threading import Thread
from typing import List, Set, Type
from bauh.api.abstract.controller import SoftwareManager, SearchResult, ApplicationContext
from bauh.api.abstract.disk import DiskCacheLoader
from bauh.api.abstract.handler import ProcessWatcher
... |
test_ssl.py | # Test the support for SSL and sockets
import sys
import unittest
from test import support
import socket
import select
import time
import datetime
import gc
import os
import errno
import pprint
import urllib.request
import threading
import traceback
import asyncore
import weakref
import platform
import functools
impor... |
cleanup_dataset.py | import ftfy
import json
from langdetect import detect
import numpy as np
import time
import os
import sys
import re
import argparse
from multiprocessing import Process
MIN_DOCUMENT_LENGTH = 128
def parse_arguments():
"""
Parser.
"""
parser = argparse.ArgumentParser()
parser.add_argument("--data_d... |
tcp_s_dict.py | """
author: Lewizo
email: 615905244@qq.com
env: Python3.8
socket tcp
"""
from socket import *
from multiprocessing import *
from signal import *
import pymysql
class DatabaseDict:
def __init__(self):
self.db = pymysql.connect(host='localhost', port=3306, user='root', password='123456', database='stu',
... |
pipe_test.py | import io
import os
import tarfile
import multiprocessing as mp
mp.set_start_method("spawn", True)
test_file = "./test.tar"
def test_decrypt():
reader, proc = get_reader(test_file)
with os.fdopen(reader, "rb", buffering=4096) as fr:
# load data to memory
byte_array = io.BytesIO(fr.read())
... |
socketio_events.py | import os
import queue
import subprocess
import threading
from flask import current_app, request
from flask_socketio import emit
from . import socketio
from .utils import escape_ansi
from .views import requires_auth
clients = {}
@socketio.on('connect')
@requires_auth
def connect():
print('connected with client... |
__init__.py | from __future__ import print_function, division, absolute_import
import os
import sys
import shutil
import subprocess
import optparse
import math
import signal
import threading
import atexit
import imp
import pwd
import grp
import re
import pprint
import time
import traceback
import locale
try:
import Queue as qu... |
scheduler_job.py | # -*- coding: utf-8 -*-
#
# 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
#... |
Saver.py | #!/usr/bin/env python
import multiprocessing
from subprocess import call
import csv
try:
import mapnik2 as mapnik
except:
import mapnik
import sys, os, random as rd
import tensorflow as tf, cv2 , pickle, time
from GSV import GSV
def _int64_feature(value):
return tf.train.Feature(int64_list=tf.train.Int64... |
_sp_impl.py | # -*- coding: utf-8 -*-
import collections
from concurrent import futures
from six.moves import queue
import time
import threading
from . import settings, issues, _utilities, tracing
class SessionPoolImpl(object):
def __init__(
self,
logger,
driver,
size,
workers_threads_co... |
Main.py | from packages.networking.Connection import Connection
from packages.networking.Server import Server
from packages.networking.Client import Client
from packages.cipher import *
import threading
import time
PORT = 1337
MESSAGE = "This is a test."
REAL_TIME = True
SERVER_HEADER = "\n====== Server ======"
CLIENT_HEADER... |
receive_twin_desired_properties_patch.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import os... |
__init__.py | __author__ = "Johannes Köster"
__copyright__ = "Copyright 2015-2019, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import sys
import contextlib
import time
import datetime
import json
import textwrap
import stat
import shutil
import shlex
import threading
import concurrent.futu... |
compute.py | #!/usr/bin/env python
import time
import os
import sys
import threading
import traceback
from oslo.config import cfg
from virtman.drivers import fcg
from virtman.drivers import volt
from virtman.image import LocalImage
from virtman.image import BlockDeviceImage
from virtman.utils import exception
from virtman.utils.s... |
URPPipelines.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2017-07-29 16:53:19
# @Author : mayongze (1014057907@qq.com)
# @Link : https://github.com/mayongze
# @Version : 1.1.1.20170705
import os
import DBHelper
import URPCrawlerDAO
import traceback
import asyncio,aiohttp
import userapiconfig
import NETinterface a... |
OnlineSystem.py | import argparse
import time
from multiprocessing import Queue, Process, freeze_support
import keyboard
import Online.Controller as Controller
import Online.Stimulator as Stimulator
from config import cfg, merge_cfg_from_file
def parse_args():
parser = argparse.ArgumentParser(
description='Online typing B... |
ray.py | #! /usr/bin/env python
# Copyright (c) 2019 Uber Technologies, 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 a... |
printer_server.py | #!/usr/bin/python
# __author__="ihciah"
# Need twisted and pyopenssl
from twisted.web import resource
from twisted.web import server as webserver
from twisted.internet import reactor
from OpenSSL.SSL import Context, TLSv1_METHOD
import time, requests, cv2, threading, logging
import numpy as np
from message_process imp... |
minitouch.py | # -*- coding: utf-8 -*-
import os
import re
import socket
import sys
import threading
import time
import warnings
import six
from six.moves import queue
from airtest.core.android.constant import STFLIB
from airtest.utils.logger import get_logger
from airtest.utils.nbsp import NonBlockingStreamReader
from airtest.utils... |
screens.py | import asyncio
from weakref import ref
from decimal import Decimal
import re
import threading
import traceback, sys
from typing import TYPE_CHECKING, List, Optional
from kivy.app import App
from kivy.cache import Cache
from kivy.clock import Clock
from kivy.compat import string_types
from kivy.properties import (Objec... |
_RPIO.py | # -*- coding: utf-8 -*-
#
# This file is part of RPIO.
#
# Copyright
#
# Copyright (C) 2013 Chris Hager <chris@linuxuser.at>
#
# License
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Softw... |
test_threadable.py | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.threadable}.
"""
import pickle
import sys
from unittest import skipIf
try:
import threading
except ImportError:
threadingSkip = True
else:
threadingSkip = False
from twisted.trial.unittest import Syn... |
managers.py | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
#
# Imports
#
import sys
import threading
import array
from traceback import ... |
GUI_interface.py |
#!/usr/bin/env/python
import Tkinter
from Tkinter import Entry, StringVar, Label
import weather_DAQ
import air_quality_DAQ
import adc_DAQ
import plot_manager_D3S
import threading
import os
# pressure, temp, humidity, co2, air, spectra, waterfall
plot_jobs = [None, None, None, None, None, None, None]
def close(index... |
test_sys.py | from test import support
from test.support.script_helper import assert_python_ok, assert_python_failure
import builtins
import codecs
import gc
import locale
import operator
import os
import struct
import subprocess
import sys
import sysconfig
import test.support
import textwrap
import unittest
import warnings
# coun... |
main.py | #coding=utf-8
#created by SamLee 2018/10/17
import sys
import os
import traceback
import time
import optparse
import json
import shlex
import shutil
import multiprocessing
import threading
import pathlib
from walle import apk_util, walle_writer, walle_reader, channel_config
def displayApkSignInfo(apkFiles,options):... |
email.py | # -*- coding: UTF-8 -*-
__author__ = 'Sliver'
from app import mail
from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
def send_async_email(app, msg):
# 因为线程隔离的影响,所以需要创建应用上下文
with app.app_context():
try:
mail.send(msg)
except ... |
assay.py | # coding: utf-8
import gimpbbio.gpio as gpio
import threading, time, signal
class GeigerCounterDataCollector:
def __init__(self):
self.count_accumulator = 0
self.counts = [0] * 10
self.count_index = 0
self.counts_per_second = 0
self.counts_per_minute = 0
self.total_counts = 0
self.elapsed_seconds = 0
... |
client.py | # ***************************************************************************************
# Title: LabAdvComp/parcel
# Author: Joshua S. Miller
# Date: May 26, 2016
# Code version: 0.1.13
# Availability: https://github.com/LabAdvComp/parcel
# *****************************************************************************... |
futures.py | """
Support for Futures (asynchronously executed callables).
If you're using Python 3.2 or newer, also see
http://docs.python.org/3/library/concurrent.futures.html#future-objects
Pyro - Python Remote Objects. Copyright by Irmen de Jong (irmen@razorvine.net).
"""
import sys
import functools
import logging
import thre... |
dooropen.py | #http://doc.aldebaran.com/2-5/naoqi/core/almemory-api.html
#http://doc.aldebaran.com/2-5/family/pepper_technical/pepper_dcm/actuator_sensor_names.html#ju-sonars
import qi
import argparse
import sys
import time
import threading
import os
sonarValueList = ["Device/SubDeviceList/Platform/Front/Sonar/Sensor/Value",
... |
engine.py | # !/usr/bin/env python
# -*- coding: utf-8 -*-
import multiprocessing
import time
import random
import os
import string
from flask import Flask
from flask import jsonify
from flask import request as flask_request
from flask import render_template
from flask import abort
from flask import Response
from flask import mak... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.