source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
machine.py | from threading import Thread
import time
import micropython
from sim_console import console
def machine(*args, **kwargs):
console('machine dummy')
return 'machine dummy'
class Timer:
PERIODIC = "DUMMY"
def __init__(self, timid=0, *args, **kwargs):
self.timid = timid
self.thread = No... |
multiprocessing.py | """
Generic tools for distributing computationally intensive tasks across multiple threads.
"""
import os
import numpy as np
import shutil
from tempfile import mkdtemp
import multiprocessing as mp
from hylite import HyCloud, HyImage
from hylite import io
def _split(data, nchunks):
"""
Split the specified HyC... |
kernel.py | from __future__ import print_function
from ipykernel.kernelbase import Kernel
from ipykernel.comm import CommManager
from ipykernel.zmqshell import ZMQInteractiveShell
from IPython.core.display_trap import DisplayTrap
from subprocess import check_output
from traitlets import Instance, Type
import pkg_resources
impo... |
lektor_npm_support.py | import os
import threading
import collections
from builtins import object
from lektor.pluginsystem import Plugin
from lektor.reporter import reporter
from lektor.utils import locate_executable, portable_popen
popen_args_type = collections.namedtuple('popen_args_type', ['args', 'cwd'])
class ProcessSequence(object... |
RestClientSingle.py | #RestClientThreads.py
import requests
import json
import time
import threading
#Date:15-04-2020
#Description
#This script attempts to create an independent thread used to publish to each URL.
detected_hazards_urls=['http://192.168.122.104:15151/detected_hazard'] #URL of the server NOT using AdvantEDGE
#detected_haz... |
lupus-hue.py | #
# lupus-hue server - Automate Philips Hue lights from LUPUS XT2+ alarm system
#
# Copyright (c) 2017 stadtplandienst
#
# MIT License
#
# 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 Soft... |
miniterm.py | #!E:\HK8\RacingRobot\venv\Scripts\python.exe
#
# Very simple serial terminal
#
# This file is part of pySerial. https://github.com/pyserial/pyserial
# (C)2002-2015 Chris Liechti <cliechti@gmx.net>
#
# SPDX-License-Identifier: BSD-3-Clause
import codecs
import os
import sys
import threading
import serial
from seria... |
base.py | """Contains the abstract interface for sending commands back to a vehicle
interface.
"""
import numbers
import time
import threading
import binascii
try:
from queue import Queue
from queue import Empty
except ImportError:
# Python 3
from queue import Queue
from queue import Empty
class ResponseRec... |
app_test.py | from __future__ import unicode_literals
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from tiny_test_fw import Utility
import glob
import json
import os
import re
import threading
import ttfw_idf
class IDEWSProtocol(WebSocket):
def handleMessage(self):
try:
j = json.loads... |
hvacControl.py | import threading
from time import sleep
import RPi.GPIO as GPIO
import logging
logging.basicConfig()
class hvacControl(threading.Thread):
def __init__(self, temperature,
update_rate = 10,
hysterisis = 0.5):
threading.Thread.__init__(self)
self.logger = logging.get... |
event.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2012-2013 by the SaltStack Team, see AUTHORS for more details
:license: Apache 2.0, see LICENSE for more details.
tests.integration.modules.event
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python ... |
App.py | '''
Created on 3 dic 2021
@author: emilio
'''
import psutil as ps
import numpy as np
from multiprocessing import Process
import time
import subprocess
import os
class myApp(object):
ps=None
def doWork(self,stime):
if(self.ps==None):
self.ps=ps.Process()
#print("... |
MainFrame.py | # -*- coding: utf-8 -*-
# author: liuxu
import os
import threading
import hashlib
import urllib
import webbrowser
import Tkinter
import tkFont
from Tkinter import Label
from Tkinter import Entry
from Tkinter import Button
from Tkinter import Frame
from Tkinter import LabelFrame
from Tkinter import Menu
from PIL import... |
test_execution.py | # Copyright 1999-2018 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
main.py | import subprocess
import socket
import threading
import sys
import os
import time
## REceiving messages from other party
def connect(s):
'''receive messages from other party, and decode them'''
received=''
while received != 'exit':
received = s.recv(4096)
if received == '':
p... |
dev_Signal.py | # implemenation of the compute methods for category
import numpy as np
import random
import time
import os.path
from os import path
import matplotlib.pyplot as plt
import scipy.interpolate
from nodeeditor.say import *
import nodeeditor.store as store
import nodeeditor.pfwrap as pfwrap
print ("reloaded: "+ __file__... |
userMainWindow.py | import os
import sys
from subprocess import call
from cv2 import VideoCapture, cvtColor, COLOR_BGR2RGB
from PyQt5 import QtCore, QtWidgets
from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtGui import QImage, QPixmap, QIcon
from PyQt5.QtWidgets import QMainWindow, QFileDia... |
Mashina 1.04.py | #cd C:\Mashina\Mashina-bot
from work_with_wiki import *
from transliterations import *
from bot_config import *
from py_translators import *
import discord
from discord.ext import commands
from pandas import read_excel
import re
def update_slovnik():
print("list aploduje se")
global dfs
dfs = read_exc... |
main_gui.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import ctypes
import inspect
import os
import re
import sys
import threading
import traceback
import PyQt5
import keyboard
import pinyin
import yaml
from PyQt5 import uic, QtCore, QtWidgets
from PyQt5.QtCore import QStringListModel
from PyQt5.QtWidgets import *
from utils... |
_app.py | """
"""
"""
_app.py
websocket - WebSocket client library for Python
Copyright 2021 engn33r
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 ... |
test_flask.py | import threading
from flask import Flask
from flask_discord_interactions import (
DiscordInteractions,
ResponseType,
InteractionType,
Message,
)
def test_flask():
app = Flask(__name__)
app.config["DONT_VALIDATE_SIGNATURE"] = True
app.config["DONT_REGISTER_WITH_DISCORD"] = True
disco... |
papa2.py | # !/user/bin/env pyhton解释器路径
# -*-coding:utf-8-*- 脚本编码
import os,time,tkinter,threading,requests
from configparser import ConfigParser
from tkinter import *
import tkinter.messagebox
from tkinter.ttk import Progressbar
from playwright.sync_api import Playwright, sync_playwright
file100 = 'configmsg.ini'
de... |
TDCameraDecoder.py | #Copyright (C) 2021,2022 Andrew Palardy
#See LICENSE file for complete license terms
#CameraDecoder class
#Implements a single camera-based fiducial marker tracker
#And publishes the resulting data to both MQTT and the in-memory data store
import cv2
import numpy as np
from datetime import datetime
import time
from apr... |
basic_3.py | import uuid
import multiprocessing
def my_function():
print 'My Unique Id: {0}'.format(uuid.uuid1())
if __name__ == '__main__':
for x in range(16):
process = multiprocessing.Process(target=my_function)
process.start()
|
run_benchmarks.py |
import os, sys, subprocess, re, time, threading
last_benchmarked_commit_file = '.last_benchmarked_commit'
def log(msg):
print(msg)
FNULL = open(os.devnull, 'w')
benchmark_runner = os.path.join('build', 'release', 'benchmark', 'benchmark_runner')
out_file = 'out.csv'
log_file = 'out.log'
benchmark_results_folder... |
networking.py | import os
import asyncio
import ipaddress
from threading import Thread
from typing import Optional, List, Dict, TYPE_CHECKING, Tuple
from urllib.parse import urlparse
import grpc
from grpc.aio import AioRpcError
from jina.logging.logger import JinaLogger
from jina.proto import jina_pb2_grpc
from jina.enums import Pol... |
subproc_vec_env.py | import multiprocessing as mp
import numpy as np
from pytorchrl.agent.env.openai_baselines_dependencies.vec_env.vec_env import VecEnv, CloudpickleWrapper,\
clear_mpi_env_vars
def worker(remote, parent_remote, env_fn_wrappers):
def step_env(env, action):
ob, reward, done, info = env.step(action)
... |
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... |
test_master_slave_connection.py | # Copyright 2009-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
jobs.py | # coding=utf-8
from __future__ import unicode_literals, absolute_import, print_function, division
import copy
import datetime
import sys
import threading
import time
if sys.version_info.major >= 3:
unicode = str
basestring = str
py3 = True
else:
py3 = False
try:
import Queue
except ImportError:
... |
pwn.py | class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
import re, os, json, threading, time, socket, sys, subprocess, sys, logging
from json import dumps
directories=['stati... |
job_log.py | # Copyright 2020-2021 The Kraken 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... |
__init__.py | #!/usr/bin/env python
#
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
#
# Copy this script to /sbin/mount.efs and make sur... |
exercicio_threads.py | # processamento em paralelo
from time import sleep
from threading import Thread
from threading import Lock
"""
class MeuThread(Thread):
def __init__(self, texto, tempo):
self.texto = texto
self.tempo = tempo
super().__init__()
def run(self):
sleep(self.tempo)
print(sel... |
test_unittest_tools.py | # (C) Copyright 2005-2021 Enthought, Inc., Austin, TX
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in LICENSE.txt and may be redistributed only under
# the conditions described in the aforementioned license. The license
# is also available online at... |
main.py | #Program written by Ali Turkman (40111059), Mattieu Pourrat (40089209) and Zeineb Ben Mami (40024877)
#find() function code snippet from StackOverflow
import os
import re
import fnmatch
import threading
#first string that designates what will be user string
userInput = str
#loop integer to keep while loop going until... |
main.py | from threading import Thread
from time import sleep
from selenium.webdriver.common.by import By
from core.browser import Browser
from core.product_handler import ProductHandler
from core.progress import Progress
from core.upgrade_handler import UpgradeHandler
from settings import NUMBER_OF_COOKIE_THREADS, SAVE_INTERV... |
test_runner.py | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Copyright (c) 2017 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run regression test suite.
This module calls down into ind... |
uwsgidecorators.py | from functools import partial
import sys
from threading import Thread
try:
import cPickle as pickle
except:
import pickle
import uwsgi
if uwsgi.masterpid() == 0:
raise Exception(
"you have to enable the uWSGI master process to use this module")
spooler_functions = {}
mule_functions = {}
postfork... |
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... |
server.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from time import sleep, time
from threading import Thread, RLock, Event
from queue import Queue, Empty
import logging
from epics import PV
from epics.ca import CAThread
from pypvserver import PypvServer, PyPV
logger = logging.getLogger(__name__)
class ADPluginServer:
... |
retina_sample.py | import pandas as pd
from tqdm import tqdm
import os
from os import listdir
from os.path import isfile, join
from PIL import Image
import multiprocessing
freport = "/media/hdd/data/imcaption/retina_dataset_resize/label.xlsx"
reportlist = pd.read_excel(freport)
reportlist.fillna('',inplace=True)
# words = []
# sentences ... |
worker.py | #!/usr/bin/python3
#-*-coding:utf-8-*-
import os
import pickle
import time
import json,struct
import threading
import socket
import utils
'''记录共享目录并返回UUID'''
def makeserver(path):
#目录必须存在
if not os.path.exists(path):
raise FileNotFoundError("路径[%s]不存在,请重新输入"%path)
dws = DataWorker('servers'... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement
import os
import re
import sys
import copy
import time
import types
import signal
import random
import fnmatch
import logging
import threading
import traceback
import c... |
HiwinRA605_socket_ros_test_20190625185440.py | #!/usr/bin/env python3
# license removed for brevity
#接收策略端命令 用Socket傳輸至控制端電腦
import socket
##多執行序
import threading
import time
##
import sys
import os
import numpy as np
import rospy
import matplotlib as plot
from std_msgs.msg import String
from ROS_Socket.srv import *
from ROS_Socket.msg import *
import HiwinRA605_s... |
api.py | import time, threading, json
import feedparser
from widgets.Podcast import Podcast, DEFAULT_COVER
from widgets.Episode import Episode
from widgets.SearchItem import SearchItem
from utils import file_request
from gi.repository import GObject
def expect(fn):
def wrapped(*args):
threading.Thread(target=fn, a... |
ko5.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from bs4 import BeautifulSoup
import time,random,sys,re,os,json,subprocess,threading,string,codecs,requests,ctypes,urllib,urllib2,wikipedia,tempfile,glob,shutil,unicodedata,goslate
from gtts import gTTS
cl = L... |
data_plane_test.py | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... |
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.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import threading
import ar... |
stream.py | import os
import io
import sys
import socket
import threading
from stve import PYTHON_VERSION
if PYTHON_VERSION == 3:
from queue import Queue
else:
from Queue import Queue
PATH = os.path.abspath(os.path.dirname(
os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
if not PATH in s... |
acer_simple.py | import time
import warnings
import numpy as np
import tensorflow as tf
from reinforcement_learning.gym.spaces import Discrete, Box
from collections import deque
from reinforcement_learning import logger
from reinforcement_learning.common.schedules import Scheduler
from reinforcement_learning.common.tf_util import bat... |
testGrabs.py | #!/usr/bin/env python3
#
# Jan Feitsma, december 2019
#
# automate the procedure of testing multiCam on a set of grabs
# (the procedure was something like: terminal 1 run cdrx, edit Makefile to select proper grab, make, in terminal 2 run cdmN where N is the appropriate robot, when done in terminal 1 run 'make kill')
#
... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_xzc as electrum
from electrum_xzc.bitcoin import TYPE_ADDRESS
from electrum_xzc import WalletStorage, Wallet
from electrum_xzc_gui.kivy.i18n import _
from electrum_xzc.paymentrequest... |
lichess-bot.py | import argparse
import chess
import chess.pgn
from chess.variant import find_variant
import chess.polyglot
import engine_wrapper
import model
import json
import lichess
import logging
import logging.handlers
import multiprocessing
import logging_pool
import signal
import time
import backoff
import sys
import random
imp... |
Wallet.py | #!/usr/bin/env python3
###############################################
# Duino-Coin Wallet (v1.5)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © revox, MrKris7100 2020
#############################################
import time, socket, sys, os, datetime, configparser, tkinter, getp... |
__init__.py | import codecs
import functools
import io
import logging
import os
import select
import shutil
import subprocess
import sys
import time
import timeit
import warnings
from multiprocessing import Pipe
from threading import Thread
#
# run() - A function to synchronously run an external process, supporting
# the ... |
streaming.py | # Tweepy
# Copyright 2009-2010 Joshua Roesslein
# See LICENSE for details.
# Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets
from __future__ import absolute_import, print_function
import logging
import re
import requests
import sys
from requests.exceptions imp... |
bot.py |
import re
import time
import queue
import logging
import threading
import collections
import json as json_
import os
import psutil
import websocket
import numpy as np
import Api as GPT
WS_URL = "ws://127.0.0.1:6700/ws" # WebSocket 地址
NICKNAME = ["BOT", "ROBOT"] # 机器人昵称
SUPER_USER = [1237545454] # 主... |
main.py | ############################## debut des importations ##############################
import os, cytron, time
import tkinter as tk
import threading
from traceback import format_exc
from ssl import create_default_context
from smtplib import SMTP_SSL
from webbrowser import open as webopen
from _thread import... |
test_gc.py | import unittest
from test.support import (verbose, refcount_test, run_unittest,
strip_python_stderr, cpython_only, start_threads,
temp_dir, requires_type_collecting, TESTFN, unlink,
import_module)
from test.support.script_helper import assert... |
test_parser.py | #!/usr/bin/env python
import re
import random
import string
import threading
from tests import unittest, OrderedDict
from jmespath import parser
from jmespath import visitor
from jmespath import ast
from jmespath import exceptions
class TestParser(unittest.TestCase):
def setUp(self):
self.parser = parser... |
test_funcs.py | from flexx.util.testing import run_tests_if_main, raises
from flexx.util.logging import capture_log
import time
import asyncio
import threading
import multiprocessing
from flexx import app, event
def test_add_handlers():
server = app.current_server()
tornado_app = server.app
assert tornado_app.add_handl... |
artifacts.py | import hashlib
import json
import mimetypes
import os
import pickle
from six.moves.urllib.parse import quote
from copy import deepcopy
from datetime import datetime
from multiprocessing import RLock, Event
from multiprocessing.pool import ThreadPool
from tempfile import mkdtemp, mkstemp
from threading import Thread
fro... |
palette.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# palette.py
# palette_detect
#
"""
Detect the main colors used in an image.
"""
import colorsys
import matplotlib.colors as colors
import multiprocessing
import sys
from PIL import Image, ImageChops, ImageDraw
from collections import Counter, namedtuple
from colormath... |
multiprocess_test.py | from multiprocessing import Pool, Queue, Process, Manager
import time
def task(i, queue):
# print('runs here', queue)
queue.put((i, i+1, i+2))
if __name__ == '__main__':
pool = Pool(processes=10)
queue = Manager().Queue(maxsize=500)
procs = []
res = []
for i in range(50):
# proc... |
test_subprocess.py | """Unit tests specifically for the components of SubprocessWorker.
End-to-end tests (e.g. does SubprocessWorker properly implement the
WorkerBase API) still live in `test_worker`.
"""
import functools
import os
import sys
import textwrap
import threading
import typing
from torch.testing._internal.common_utils import... |
leapDataExtraction.py |
################################################################################
# https://developer.leapmotion.com/sdk_agreement, or another agreement #
# between Leap Motion and you, your company or other organization. #
###########################################################################... |
mt_benchmark.py | #!/usr/bin/env python
# Copyright 2019 Xilinx 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 ... |
chisel2.py | """
A simple client that uses the Python ACME library to run a test issuance against
a local Boulder server. Unlike chisel.py this version implements the most recent
version of the ACME specification. Usage:
$ virtualenv venv
$ . venv/bin/activate
$ pip install -r requirements.txt
$ python chisel.py foo.com bar.com
""... |
sniffer.py | #!/usr/bin/env python3
#
# Copyright (c) 2016-2017, The OpenThread 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/LIC... |
robusta_sink.py | import base64
import json
import logging
import time
import threading
import traceback
from collections import defaultdict
from hikaru.model import (
Deployment,
StatefulSetList,
DaemonSetList,
ReplicaSetList,
Node,
NodeList,
Taint,
NodeCondition,
PodList,
Pod,
)
from typing imp... |
_wdaproxy.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Created on Wed Feb 03 2021 10:22:15 by codeskyblue
"""
import abc
import logging
import subprocess
import sys
import threading
import time
import typing
import logzero
import requests
from cached_property import cached_property
from . import requests_usbmux
from ._de... |
core.py | # -*- coding: utf-8 -*-
"""
The MIT License
Copyright (c) 2013 Helgi Þorbjörnsson
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 u... |
mmalobj.py | # vim: set et sw=4 sts=4 fileencoding=utf-8:
#
# Python header conversion
# Copyright (c) 2013-2017 Dave Jones <dave@waveform.org.uk>
#
# Original headers
# Copyright (c) 2012, Broadcom Europe Ltd
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted... |
test_connection.py | #!/usr/bin/env python
# test_connection.py - unit test for connection attributes
#
# Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au>
#
# psycopg2 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 Foun... |
WinSignalHandler.py | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# 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 SOFTWARE IS PROVIDED "AS I... |
test_base.py | import os
import pytest
def test_help(testdir):
result = testdir.runpytest(
'--help'
)
result.stdout.fnmatch_lines([
'embedded:',
])
def test_services(testdir):
testdir.makepyfile("""
import pytest
import pexpect
def class_names(services):
c... |
alphabacktest.py | import os, progressbar, threading, random, string
from datetime import datetime, timedelta
from time import time
import pandas as pd
import numpy as np
class Account():
def __init__(self):
self.symbol = ''
self.__settings()
self.free_balance = self._capital
self.user_portfolio = pd... |
server.py | #!/usr/bin/env python3
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
clients = {}
addresses = {}
HOST = '127.0.0.1'
PORT = 8000
BUFSIZ = 1024
ADDR = (HOST, PORT)
#print(ADDR)
SERVER = socket(AF_INET, SOCK_STREAM)
SERVER.bind(ADDR)
def accept_incoming_connections():
while True:
... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from scaled_yolov4.general import xyxy2xywh, xywh2xyxy, ... |
spinner.py | import time
import threading
class Spinner:
busy = False
delay = 0.1
@staticmethod
def spinning_cursor():
while 1:
for cursor in '|/-\\': yield cursor
def __init__(self, delay=None):
self.spinner_generator = self.spinning_cursor()
if delay and float(delay): self.delay = delay
def spinner_task(self):
... |
test_partition.py | import threading
import time
from multiprocessing import Pool, Process
import pytest
from utils import util_pymilvus as ut
from common.constants import default_entities, default_fields
from common.common_type import CaseLabel
from utils.util_log import test_log as log
TIMEOUT = 120
default_nb = ut.default_nb
default_t... |
async_sub.py | import datetime as dt
from threading import Thread
code = ['fu2006', 'sc2109', 'sc2106', 'sc2006', 'CF007', 'TA007', 'ag2103', 'al2103', 'au2104', 'bu2203', 'cu2103',
'hc2103', 'ni2103', 'pb2103', 'rb2103', 'ru2103', 'sn2103', 'sp2103', 'wr2103', 'zn2103', 'PM103', 'RI103',
'RM103', 'SF103', 'SM10... |
udp.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source code mus... |
pvctrls.py | import sys
import time
import traceback
import threading
import socket
import struct
from p4p.nt import NTScalar
from p4p.server.thread import SharedPV
from psdaq.pyxpm.pvseq import *
from psdaq.pyxpm.pvhandler import *
# db support
from psdaq.configdb.typed_json import cdict
import psdaq.configdb.configdb as cdb
from ... |
server.py | #!/usr/bin/env python3
"""
This was originally pilfered from
https://github.com/adeept/Adeept_RaspTank/blob/a6c45e8cc7df620ad8977845eda2b839647d5a83/server/app.py
Which looks like it was in turn pilfered from
https://blog.miguelgrinberg.com/post/flask-video-streaming-revisited
"Great artists steal". Thank you, @a... |
test_md.py | #!/usr/bin/env python
import ctp
import pytest
import sys
import time
import hashlib
import tempfile
import os, os.path
import threading
@pytest.fixture(scope="module")
def spi(front, broker, user, password):
assert front and broker and user and password, "missing arguments"
_spi = MdSpi(front, broker, user, ... |
test_graceful_shutdown.py | import asyncio
import logging
import time
from collections import Counter
from multiprocessing import Process
import httpx
PORT = 42101
def test_no_exceptions_when_cancel_pending_request(app, caplog):
app.config.GRACEFUL_SHUTDOWN_TIMEOUT = 1
@app.get("/")
async def handler(request):
await asy... |
run_triggers.py | from flask import Flask, current_app
import logging
import os
import sys
import json
from kafka import KafkaConsumer, TopicPartition, KafkaProducer
from threading import Thread
import eventlet
import requests
from pathlib import Path
from apscheduler.schedulers.background import BackgroundScheduler
from context impo... |
test_threads.py | #!/usr/bin/env python
from confluent_kafka import Producer, KafkaError, KafkaException
import threading
import time
try:
from queue import Queue, Empty
except:
from Queue import Queue, Empty
class IntendedException (Exception):
pass
def thread_run(myid, p, q):
def do_crash(err, msg):
raise ... |
test_functional.py | import errno
import logging
import multiprocessing
import os
import signal
import socket
import string
import subprocess
import sys
import time
import unittest
from awaitress import server
from awaitress.compat import httplib, tobytes
from awaitress.utilities import cleanup_unix_socket
dn = os.path.dirname
here = dn(_... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from socketserver import ThreadingMixIn
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
import threading
import http.server
import json
import queue
import socket
import subprocess
import time
... |
manager.py | from dataclasses import dataclass
import logging
import threading
import time
import traceback
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Set, Tuple
from concurrent.futures.thread import ThreadPoolExecutor
from blspy import G1Element
from chiapos import DiskProver
from shibgreen.... |
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... |
testcase.py | # -*-coding: utf-8-*-
#
# Copyright (c) 2019 Chorus Team.
#
"""
The main test logic
"""
import time
import datetime
import inspect
import re
import sys
import traceback
import pdb
from .log import log
from .utils import ChorusThread, roclassproperty
class Testcase(object):
"""The base class of chorus testcases.... |
data_iterator.py | # Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
map_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
utils.py | import os
import sys
import time
from collections import defaultdict
import threading
from queue import Queue
import requests
from bs4 import BeautifulSoup
from mutagen.easyid3 import EasyID3
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QByteArray
N_THREADS = 4
def get_mp3_file_paths(paths):
fil... |
core.py | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2020, Battelle Memorial Institute.
#
# 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... |
server.py | __author__ = 'v-whao'
import time
from SocketServer import *
from socket import error as SocketError
import sys
class TCPHandler(StreamRequestHandler):
def handle(self):
log_fd = open("./FlowGen.txt", "a")
start_time = time.clock()
size = 0
try:
while 1:
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.