source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
MakeNodeGraph.py | #! /usr/bin/env python
# This script will create node graph for a given k-mer size and query file (can be used as input to QueryDNADatabase.py)
import khmer
from khmer.khmer_args import optimal_size
import os
import argparse
import screed
import threading
import multiprocessing
def restricted_float(x):
x = float(x)
... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
managers.py | #
# Module providing the `SyncManager` class for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import os
import sys
import weakref
import threa... |
probe_endtoend.py | """
This probe runs in a Telepresence created and managed execution context.
It observes things about that environment and reports about them on stdout.
The report can be inspected by the test suite to verify Telepresence has
created the execution context correctly.
"""
from argparse import ArgumentParser
from http.se... |
irc.py | from __future__ import unicode_literals, division, absolute_import, with_statement
from builtins import * # noqa pylint: disable=unused-import, redefined-builtin
from past.builtins import basestring
from future.moves.urllib.parse import quote
import os
import re
import threading
import logging
from xml.etree.ElementT... |
stream_hls.py | from dataclasses import dataclass
import re
import logging
import os
import sys
import glob
from cv2 import cv2
import requests
import json
import shutil
import siaskynet as skynet
from tabulate import tabulate
from threading import Thread
import time
import base58
import secp256k1
import hashlib
import ipfshttpclient
... |
app.py | from distutils.version import LooseVersion
from logging import getLogger
import select
import sys
from threading import Thread
from time import sleep
import webbrowser
import wx
from wx.adv import TaskBarIcon, TBI_DOCK
from .._utils import IS_OSX, IS_WINDOWS
from ..plot._base import CONFIG
from .about import AboutFra... |
reborn.py | # encoding=utf-8
import api
import importlib
import logging
import re
import config
import threading
import traceback
import sys
from time import gmtime
import datetime as dt
from calendar import timegm
from random import random,randint
logging.basicConfig(format='%(asctime)s.%(msecs)d %(levelname)-8s [%(filename)s:... |
test_actor.py |
from unittest import TestCase
from test.test_utils import StoreDependentTestCase, ActorDependentTestCase
from src.nexus.actor import Actor, RunManager, AsyncRunManager, Spike
from src.nexus.store import Limbo
from src.nexus.nexus import AsyncQueue, Link
from multiprocessing import Process
import numpy as np
from pyarr... |
hub.py | import json
import logging
import paho.mqtt.client as mqtt
import schedule
import serial
import threading
import time
from modbus_tk import modbus_rtu
from threading import Thread
from .slave import Slave
from .devicefactory import DeviceFactory
from .devices import Device
from .exceptions import DeviceNotFound, Inva... |
test_cgo_engine.py | import os
import threading
import unittest
import time
import torch
import torch.nn as nn
from pytorch_lightning.utilities.seed import seed_everything
from pathlib import Path
import nni
from nni.experiment.config import RemoteConfig, RemoteMachineConfig
import nni.runtime.platform.test
from nni.runtime.tuner_command... |
Mspectrum.py | from datetime import datetime
import copy
import multiprocessing as mp
import numpy as np
import ChiantiPy.tools.data as chdata
import ChiantiPy.tools.constants as const
import ChiantiPy.tools.filters as chfilters
import ChiantiPy.tools.util as util
import ChiantiPy.Gui as chGui
from ChiantiPy.base import ionTrails
f... |
test_operator_gpu.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_eventprocessor.py | #-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
import pyte... |
translate_selenium.py | from selenium import webdriver
import threading
from queue import Queue
from tqdm import tqdm
import warnings
import time
warnings.filterwarnings('ignore')
span = '/html/body/div[2]/div[2]/div[1]/div[2]/div[1]/div[1]/div[2]/div[3]/div[1]/div[2]/div/span[1]/span'
base_url = 'https://translate.google.com/#'
class Tra... |
sensel_osc.py | #!/usr/bin/env python
##########################################################################
# MIT License
#
# Copyright (c) 2013-2017 Sensel, Inc.
#
# 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... |
context_in_headers.py | """Demonstrates a Trace distributed across multiple machines.
A SpanContext's text representation is stored in the headers of an HTTP request.
Runs two threads, starts a Trace in the client and passes the SpanContext to the server.
"""
import argparse
import errno
import socket
import sys
import threading
try:
... |
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... |
storage.py | import asyncio
from datetime import datetime, timedelta
import aioredis
import threading
import queue
import sqlite3
from typing import Optional
class StorageBackend:
async def store(self, key: str, value: bytes, ttl: Optional[timedelta]):
"""
Stores a given key with it's serialized value.
... |
testplus.py | #
# The contents of this file are subject to the Mozilla Publics
# License Version 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS
# IS" bas... |
PyGameVisualizer.py | import sys
from threading import Thread
import pygame
class PygameVisualizer:
def __init__(self, num_agents, width=400, height=400):
agent_colors = [(200, 100, 255, 255)] + [(0, 0, 255, 255) for _ in range(num_agents - 1)]
prey_colors = (255, 255, 0)
assert ((isinstance(agent_colors, t... |
collector.py | import heg
import heg.app
import logging
import multiprocessing as mp
from colorama import Fore
class Collector(heg.app.App):
def __init__(self, arguments=[]):
"""
Keyword Arguments:
arguments {list} -- The cli options as a list (default: {[]})
"""
super().__init__(argu... |
test_artifact_cache.py | import SimpleHTTPServer
import SocketServer
import os
from threading import Thread
import unittest
from twitter.common.contextutil import pushd, temporary_dir, temporary_file
from twitter.common.dirutil import safe_mkdir
from twitter.pants.base.build_invalidator import CacheKey
from twitter.pants.cache import create_a... |
threaded_printer.py | import re
import time
import string
import logging
import threading
import collections
import datetime
from printer import BasePrinter
from printer import BreakPointThread
from serial_connection import SerialConnection
# import config
# import log
class Printer(BasePrinter):
positive_acks = ['start', 'Grbl ', 'o... |
test_direct_transfer.py | import pickle
import threading
import time
import ray
import ray.streaming._streaming as _streaming
import ray.streaming.runtime.transfer as transfer
from ray.function_manager import FunctionDescriptor
from ray.streaming.config import Config
@ray.remote
class Worker:
def __init__(self):
core_worker = ray... |
tempHumidityLogger.py | import os
import time
import readTempHumidity as read
from threading import Thread
#Pins where the DHT22 sensors are connected.
DHT1_PIN = 4
DHT2_PIN = 18
PINLIST = [DHT1_PIN, DHT2_PIN]
#Threads will save their results here
result = [None] * 4
#Start threads to read sensors
threads = []
index = 0
for pin in PINLIST:... |
bidi.py | # Copyright 2017, 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 writing,... |
test_threading_2.py | # testing gevent's Event, Lock, RLock, Semaphore, BoundedSemaphore with standard test_threading
from __future__ import print_function
from _six import xrange
setup_ = '''from gevent import monkey; monkey.patch_all()
from gevent.event import Event
from gevent.lock import RLock, Semaphore, BoundedSemaphore
from gevent.t... |
interactive.py | # Copyright (C) 2003-2007 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
#
# Paramiko 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
# Software Foundation; either version 2.1 of the License, or (at your op... |
executors.py | # Copyright: (c) OpenSpug Organization. https://github.com/openspug/spug
# Copyright: (c) <spug.dev@gmail.com>
# Released under the MIT License.
from channels.consumer import SyncConsumer
from apps.setting.utils import AppSetting
from django_redis import get_redis_connection
from libs.ssh import SSH
from libs.engine im... |
data_preprocess.py | """
Usage: blender --background --python data_preprocess.py
***注意:先修改stl路径, obj保存路径 和 下采样后obj存放路径***
"""
import sys
sys.path.append(r"/home/heygears/work/github/MeshCNN/hgapi")
import hgapi
import os
import glob
from multiprocessing import Process
class SampleProcess:
def __init__(self, obj_path, target_faces, e... |
cli.py | import click
import importlib
import json
import metadrive
from metadrive import utils
from typology.utils import slug
from metawiki import name_to_url
import os
from urllib.parse import urlparse
from metadrive.config import (
ENSURE_SITES,
SITES_DIR,
)
from metadrive.mnt import mount
# Cause ecryptfs supports... |
KBaseReportPyServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
AttachmentFetcherGUI.py | from datetime import datetime
import Tkinter as tk
import ttk
import calendar
import threading
import AttachmentFetcher
class GUI(tk.Tk):
def __init__(self):
tk.Tk.__init__(self)
self.title("Attachment Fetcher")
self.geometry("300x510")
self.service = self.optionMenu("Select email... |
run-tests.py | #!/usr/bin/env python
import argparse
import collections
import errno
import glob
import imp
import os
import platform
import posixpath
import re
import shlex
import SimpleHTTPServer
import socket
import SocketServer
import ssl
import string
import cStringIO as StringIO
import subprocess
import sys
import threading
im... |
unnenberg.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
from backgroundaudio import BackgroundAudio
from play_audiofile import PlayAudioFile
from datetime import datetime, timedelta
import calendar
import time
from contextlib import closing
import logging
from vws import vws
from glob import glob
from itertools import cycle
f... |
api.py | """Remotely control your Kucoin account via their API"""
import re
import json
import hmac
import hashlib
import time
import math
import requests
import base64
import sys
import pandas as pd
from numpy import floor
from datetime import datetime
from requests import Request
from models.helper.LogHelper import Logger
fr... |
base_monitor.py | from ..utils import get_containers, get_container_pid, get_host_ip, receive, send_to, filter_dict
from ..decorators import wrap_exceptions
from ..config import START_MESSAGE, DEFAULT_MONITOR_INTERVAL
from typing import Callable
from threading import Thread, Lock
from ..log import create_logger
import socket
impo... |
pyflow.py | #!/usr/bin/env python
#
# pyFlow - a lightweight parallel task engine
#
# Copyright (c) 2012-2017 Illumina, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source ... |
spyder.py | # -*- coding: utf-8 -*-
#
# Copyright © 2009-2013 Pierre Raybaut
# Licensed under the terms of the MIT License
# (see spyderlib/__init__.py for details)
"""
Spyder, the Scientific PYthon Development EnviRonment
=====================================================
Developped and maintained by the Spyder Dev... |
test.py | #!/usr/bin/env python
#
# 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 (t... |
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... |
compile_shaders_spirv.py | import os
import threading
import xml.etree.ElementTree as ET
from subprocess import check_output
# The shader compiler scripts parses the Shaders_SOURCE project filters to determine which shaders to compile and how
# Right now it depends on dxc.exe and dxcompiler.dll being available in the same directory as the scr... |
object_storage_service_benchmark.py | # Copyright 2016 PerfKitBenchmarker 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... |
video_recorder.py | # 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, software
# d... |
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... |
voiceEngine.py | #! usr/bin/python
import pytz, time
import speech_recognition as sr
import pyaudio
import threading
import subprocess
from multiprocessing import process
from voiceCommands import *
def engine(source, r):
audio=r.listen(source)
test=None
test=str(r.recognize(audio))
switch(test)
def main():
r=s... |
Controller.py | from curses.ascii import SP
import sys
import time
import logging
import asyncio
import os
import markdown2
from copy import deepcopy
from threading import Thread,Event
from node_funcs import *
from nodes import AreaNode,OutputNode,LightNode,CounterNode,TaskNode
from udi_interface import Node,LOGGER,Custom,LOG_HANDLER
... |
intelligent-scissors.py | import queue
import cv2
import argparse
from cv2 import waitKey
from src.costs import *
from src.algorithm import *
from multiprocessing import Process, shared_memory, Queue
from time import sleep
def get_args():
parser = argparse.ArgumentParser('intelligent-scissors')
parser.add_argument('impath', help='ima... |
actor_max_memory_test.py | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... |
executor.py | """Driver of the test execution framework."""
from __future__ import absolute_import
import threading
import time
from . import fixtures
from . import hook_test_archival as archival
from . import hooks as _hooks
from . import job as _job
from . import report as _report
from . import testcases
from .. import config a... |
dGui.py | import tkinter as tk
import sys
import os
import webbrowser
from middlewares import DownloadautioSpiderMiddleware
import re
from scrapy import cmdline
import settings
import multiprocessing
from tkinter.filedialog import askdirectory
from tkinter.simpledialog import messagebox
from tkinter.messagebox impor... |
test_nanny.py | import gc
import logging
import os
import random
import sys
import multiprocessing as mp
import numpy as np
import pytest
from toolz import valmap, first
from tornado import gen
from tornado.ioloop import IOLoop
from tornado.locks import Event
import dask
from distributed.diagnostics import SchedulerPlugin
from dist... |
castsocket.py | # -*- coding: utf8 -*-
import logging
import SocketServer
import ssl
import threading
import socket
import struct
import json
import requests
from google.protobuf.message import DecodeError
from leapcast.cast_proto import cast_channel_pb2
from leapcast.environment import Environment
class ApplicationDatabase(object... |
runParallel.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import threading
import shutil
import fnmatch
import os
import subprocess
import os.path
import time
import glob
import run
from multiprocessing import Process
DATA_FOLDER_ALL = ['/0113_NRRD_CROPPED','/0117_NRRD_CROPPED','/0120_NRRD_CROPPED','/0123_NRRD_CROPPED','/0128_... |
faucet_mininet_test_unit.py | #!/usr/bin/env python
"""Mininet tests for FAUCET."""
# pylint: disable=missing-docstring
import os
import re
import shutil
import threading
import time
import unittest
from SimpleHTTPServer import SimpleHTTPRequestHandler
from BaseHTTPServer import HTTPServer
import ipaddress
import yaml
from mininet.net import ... |
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:
ssl = None
imp... |
trezor.py | import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum.bip32 import BIP32Node, convert_bip32_path_to_list_of_uint32 as parse_path
from electrum import constants... |
gui.py | import tkinter as tk
from tkinter import messagebox
import threading
import time
from tkinter import filedialog
from os import mkdir
from os.path import join, abspath, exists
from voc2yolo import voc2yolo
imgs_folder = ''
labels_folder = ''
out_folder = ''
class EntryWithPlaceholder(tk.Entry):
def __init__(self, ... |
callbacks_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
vpp_papi.py | #!/usr/bin/env python3
#
# Copyright (c) 2016 Cisco and/or its affiliates.
# 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 require... |
gui_server.py | # Copyright 2018 Mycroft AI 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 writin... |
test_util.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... |
simulate_data.py | #!/usr/bin/env python3
"""Simulate a live data feed by sending stored logger data to
specified UDP ports and/or simulated (temporary) serial ports.
May either be invoked for a single data feed with command line
options, or by specifying a YAML-format configuration file that sets
up multiple feeds at once.
To invoke a... |
screentime.py | from __future__ import print_function
from desktopmagic.screengrab_win32 import (getScreenAsImage, getDisplaysAsImages)
from os import listdir
from os.path import isfile, join
import time
import threading
PATH = 'D:/Temp/ScreenTime/'
FFMPEG = ""
VOUTPUT = "Daily"
INC = 1
EXT = '.png'
INTERVAL = 5
END = 0
def screensh... |
test_spark.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import json
import os
import ssl
import threading
import time
import mock
import pytest
import requests
import urllib3
from requests import RequestException
from six import iteritems
from six.moves import... |
process.py | import atexit
import logging
import os
import shlex
import subprocess
import threading
import time
from http import HTTPStatus
from urllib.request import Request, urlopen
import yaml
from pyngrok import conf, installer
from pyngrok.exception import PyngrokNgrokError, PyngrokSecurityError
__author__ = "Alex Laird"
__... |
broadcaster.py | import Queue
import threading
import logging
import requests
import re
import time
import base64
from status import Status
class HTTPBasicThenDigestAuth(requests.auth.HTTPDigestAuth):
"""Try HTTPBasicAuth, then HTTPDigestAuth."""
def __init__(self):
super(HTTPBasicThenDigestAuth,... |
uls-loader.py | #!/usr/bin/env python3
import time
import logging
import argparse
import multiprocessing as mp
import uls.parser as parser
import uls.transfer as ftp
from uls.postgres import Loader
def process_file(f, p):
try:
p['db_method'](p['parser'](f))
except:
logging.exception("Error processing data from file " +... |
smtpd.py | """
Implements handlers required on top of aiosmtpd for testing.
"""
import asyncio
import base64
import logging
import socket
import threading
from email.errors import HeaderParseError
from email.message import Message
from aiosmtpd.handlers import Message as MessageHandler
from aiosmtpd.smtp import MISSING
from aios... |
repository.py | import atexit
import os
import re
import subprocess
import tempfile
import threading
import time
from contextlib import contextmanager
from pathlib import Path
from typing import Callable, Dict, Iterator, List, Optional, Tuple, Union
from tqdm.auto import tqdm
from huggingface_hub.constants import REPO_TYPES_URL_PREF... |
foxy_qtl_pipeline_known_markers.py | #/usr/bin/python
# import librariers
import sys
from optparse import OptionParser
import os.path
import subprocess
import re
import multiprocessing as mp
import glob
# Define variables used in the program
version = "1.05" # Version of the pipeline
pwd = os.getcwd()
# Get arguments
parser = OptionParser()
parser.add... |
test_crt_sg_with_max_threads.py | '''
New Perf Test for creating SG and other SG rules related operations.
The created number will depends on the environment variable: ZSTACK_TEST_NUM
The default max threads are 1000. It could be modified by env variable:
ZSTACK_THREAD_THRESHOLD
This case might need to run in KVM simulator environemnt, if t... |
go_tool.py | import argparse
import copy
import json
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
arc_project_prefix = 'a.yandex-team.ru/'
std_lib_prefix = 'contrib/go/_std/src/'
vendor_prefix = 'vendor/'
vet_info_ext = '.vet.out'
vet_report_ext = '.vet.txt'
FIXED_CGO1_SUFFIX='.f... |
test_sanity_sample.py | """
Copyright (c) 2019-2020 Intel 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 w... |
main.py | # The system is developed for Virushack hackathon
# It allows to work with self-service ticket office via voise commands
from random import random
import threading
import time
import random
from text_to_command_conversion.command_to_kos import ThereIsNoProductWithCurrentName, TryOneMoreTime
from text_to_command_conv... |
close_test.py | #!/usr/bin/python3
from __future__ import print_function
import fnfqueue
import sys
import os
import threading
import time
def out(*args, **kwargs):
print(*args, **kwargs)
sys.stdout.flush()
out('close test: ', end='')
queue = 1
conn = fnfqueue.Connection()
conn.bind(queue)
conn.queue[queue].set_mode(1000,... |
connector_test.py | import asyncio
import http.server
import multiprocessing
import os
import unittest
import warnings
import osuapi
def async_test(f):
def wrapper(*args, **kwargs):
coro = f(*args, **kwargs)
loop = asyncio.get_event_loop()
loop.run_until_complete(coro)
return wrapper
class FiveOhFourHa... |
server.py | from contextlib import contextmanager
from flask import Flask
import functools
from multiprocessing import Process
from OpenSSL import SSL
import os.path
import time
@contextmanager
def server(port, use_ssl=False):
app = Flask('abc')
@app.route('/')
def route():
return 'abc'
def run():
... |
cc.py | #!/usr/bin/python3
#Coded by L330n123
#########################################
# I removed the mixed proxies flood #
# because in my perspective, it doesn't #
# give more performance when flooding. #
# -- L330n123 #
#########################################
import requests
import socket
... |
synced_enforcer.py | from casbin.enforcer import Enforcer
from casbin.util.rwlock import RWLockWrite
import threading
import time
class AtomicBool():
def __init__(self, value):
self._lock = threading.Lock()
self._value = value
@property
def value(self):
with self._lock:
return self._value
... |
czujnikiled.py | #!/usr/bin/python
import RPi.GPIO as GPIO
from rpi_ws281x import *
import argparse
from threading import Thread, Lock
import threading
import time
# LED strip configuration:
LED_COUNT = 10 # Number of LED pixels.
LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!).
# LED_PIN = 10 # GPIO pin ... |
donkey_sim.py | '''
file: donkey_sim.py
author: Tawn Kramer
date: 2018-08-31
'''
import os
import json
import shutil
import base64
import random
import time
from io import BytesIO
import math
from threading import Thread
import numpy as np
from PIL import Image
from io import BytesIO
import base64
import datetime... |
asyncServer.py | import logging
import pickle
import random
import math
from threading import Thread
import torch
from queue import PriorityQueue
import os
from server import Server
from .record import Record, Profile
class Group(object):
"""Basic async group."""
def __init__(self, client_list):
self.clients = client_... |
debug_helper.py | #!/usr/bin/env python
import os
os.environ['RADICAL_DEBUG'] = 'TRUE'
import time
import radical.utils as ru
# ------------------------------------------------------------------------------
#
# This example demonstrates the DebugHelper class. Once started, use the
# printed pid to send a SIGUSR1 like this:
#
# ki... |
Control.py | from ..Magnetometer import magnetometer_factory
from ..Magnetorquer import magnetorquerMT
from ..Gyro import gyro_factory
from ..Control import Scale_Convert
from ..Communications.comm2 import *
from threading import Thread
import math
import numpy
import time
__radius = 7370 * 1000
__circle_time = 90 * 60
axes = ["x"... |
CommandManager.py | #
# CommandManager.py
# Botpy
#
# Created by Ashish Ahuja on 4th September 2017.
#
#
import threading
import chatexchange as ce
class CommandManager:
def __init__(self, commands):
self.commands = commands
self.running_commands = []
def run_command(self, command):
if command.privileges... |
multicapconverter.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "Abdelhafidh Belalia (s77rt)"
__credits__ = ['Jens Steube <jens.steube@gmail.com>', 'Philipp "philsmd" Schmidt <philsmd@hashcat.net>', 'ZerBea (https://github.com/ZerBea)', 'RealEnder (https://github.com/RealEnder)']
__license__ = "MIT"
__maintainer__ = "Abde... |
test_arxiv_parser.py | from copy import deepcopy
import json
import pytest
import time
import threading
import requests
from tests.conftest import (
ARXIV_URL,
PDF_EXTRACTOR_URL,
API_KEY,
CAT,
MAX_RESULTS,
... |
alarm_serial_comms.py | '''
Handles the (usb) serial communication to/from the Paradox alarm panel.
Created on 10 Aug 2016
@author: Paul Burger
'''
import threading
from multiprocessing import Lock
import re
import time
import logging
import serial
from serial.serialutil import SerialException
_LOGGER = logging.getLogger(__name__)
class ... |
use_threadlocal.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import threading
# 创建全局ThreadLocal对象:
local_school = threading.local()
def process_student():
# 获取当前线程关联的student:
std = local_school.student
print('Hello, %s (in %s)' % (std, threading.current_thread().name))
def process_thread(name):
# 绑定ThreadLocal的... |
ThreadedGenerators.py | # Copyright 2018, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The BitcoinDX Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test bitcoindxd shutdown."""
from test_framework.test_framework import BitcoinDXTestFramework
from t... |
MspConnector.py | import threading
import logging
from time import sleep
from DataModel.Hud import Hud
from lib.pyMultiwii import MultiWii
logging.basicConfig(level=logging.DEBUG,
format='(%(threadName)-10s) %(message)s',
)
class MspConnector:
board = None
port = "/dev/ttyACM0"
de... |
callbacks_test.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
max-resources-in-system.py | import multiprocessing
import socket
import os
import sys
import threading
import time
import _thread # for except _thread.error
def make_many_udp_sockets():
udp_sockets = []
# for port in range(port_start, 65536):
# print('port =', port)
while True:
try:
udp_sock = socket.socket(so... |
count_down_latch_test.py | import os
from threading import Thread
from hazelcast.errors import DistributedObjectDestroyedError, OperationTimeoutError
from hazelcast.future import ImmediateExceptionFuture
from hazelcast.util import AtomicInteger
from tests.integration.backward_compatible.proxy.cp import CPTestCase
from tests.util import get_curr... |
connection.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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... |
bt-terminal-gui.py | import tkinter as tki
import pygatt
import re
from tkinter import messagebox
from threading import Thread, Lock
# DEFINES
adapter = pygatt.BGAPIBackend()
mutex = Lock()
ENABLE_STATE = True
DISABLE_STATE = False
CONNECT_TEXT = ' Connect '
DISCONNECT_TEXT = 'Disconnect'
CHARACTERISTIC_ADDR = 'e7add780-b042-4876-aae1-11... |
ledtest.py | import LED_display as LMD
import threading
def LED_init():
thread=threading.Thread(target=LMD.main, args=())
thread.setDaemon(True)
thread.start()
return
LMD.set_pixel(5, 5, 0) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.