source
stringlengths
3
86
python
stringlengths
75
1.04M
insepction.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This module ... __author__ = "Magnus Kvendseth Øye" __copyright__ = "Copyright 2019, Sparkie Quadruped Robot" __credits__ = ["Magnus Kvendseth Øye", "Petter Drønnen", "Vegard Solheim"] __version__ = "1.0.0" __license__ = "MIT" __maintainer__ = "Magnus Kvendseth Øye" _...
MPWorker.py
import multiprocessing import threading import time import traceback import weakref from typing import List class MPWorker: def __init__(self, sub_args : List = None, process_count : int = None ): """ base class for multi process worker provides messaging interface b...
_task.py
"""ESMValtool task definition.""" import abc import contextlib import datetime import logging import numbers import os import pprint import subprocess import sys import textwrap import threading import time from copy import deepcopy from multiprocessing import Pool from multiprocessing.pool import ApplyResult from path...
fileProcessing.py
import os from glob import glob import threading import shutil import numpy as np import h5py import pandas as pd from scipy.spatial.transform import Rotation as R from pathlib import Path class FileProcessing(): """ Processes the raw data in the postProcessing folder of an OpenFOAM case. ...
thread_daemon.py
import threading import time def func_thread(): time.sleep(3) print("this thread is called %s" % threading.current_thread().name) print("the main thread is called %s" % threading.main_thread().name) other_thread = threading.Thread(target=func_thread, name="Background Thread") print('Is other_thread dae...
monitor.py
from enum import Enum import time import threading from auth import a from vrchat_api.enum import Status check_interval_sec = 30 class UserMonitor: def __init__(self, user, monitor_type, message): self.user = user self.user_state = {} self.save_user_state(user, initial=True) self.mon...
_test_search_server.py
from kthread import KThread from os.path import join, dirname from os import remove from unittest import TestCase from ariesk.search_server import ( SearchServer, SearchClient, ) GRID_COVER = join(dirname(__file__), 'small_grid_cover.sqlite') KMER_TABLE = join(dirname(__file__), 'small_31mer_table.csv') POR...
server.py
# the name of allah # designed by MrZahaki # !/usr/bin/env python3.8 import threading import socket import queue from _queue import Empty import tqdm import os class DeleteError(Exception): pass class PathError(Exception): pass class Tools: @staticmethod def number_to_bytes(...
temp_humid_i2c.py
""" Description Read from the SHT10 Teperature/Humidity Sensor and push the data over the websocket connection """ import time import threading import websocket import RPi.GPIO as GPIO from pi_sht1x import SHT1x try: import simplejson as json except ImportError: import json GPIO.setwarnings(False) ...
email.py
from flask import render_template from flask_mail import Message from app import mail from app import app from threading import Thread def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, recipients=recipients) msg.body = text_body msg.html = html_body ...
consume_requests_threaded.py
import platform import os import sys import queue import threading from confluent_kafka import Consumer from confluent_kafka import Producer from .produce_records import ProduceRecords from .util import msg_value_to_dict, get_python_dict_hash_sha256, msg_key_to_string from modules.command_parse import command_parse fro...
test_signal.py
import errno import os import random import signal import socket import statistics import subprocess import sys import threading import time import unittest from test import support from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi except ImportError: _testcapi = None ...
v4mpack.py
# -*- coding: utf-8 -*- import os import sys import smbus import time import datetime import RPi.GPIO as GPIO import Yi2k_ctrl import subprocess import gpsd import threading import runpy import argparse import Adafruit_Nokia_LCD as LCD import Adafruit_GPIO.SPI as SPI import lcd_menu as menu from queue import Queue fr...
__init__.py
""" # an API for Meshtastic devices Primary class: SerialInterface Install with pip: "[pip3 install meshtastic](https://pypi.org/project/meshtastic/)" Source code on [github](https://github.com/meshtastic/Meshtastic-python) properties of SerialInterface: - radioConfig - Current radio configuration and device setting...
__init__.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Logging utils """ import warnings from threading import Thread import torch #from torch.utils.tensorboard import SummaryWriter from utils.general import colorstr, emojis from utils.loggers.wandb.wandb_utils import WandbLogger from utils.plots import plot_images, plot_r...
win32.py
from pytermfx.constants import * from pytermfx.color import Color, ColorMode from pytermfx.adaptors.base import BaseAdaptor from pytermfx.adaptors.input import InputAdaptor from pytermfx.adaptors.vt100 import VT100Adaptor from threading import Thread from time import sleep from ctypes import windll, Structure, byref fr...
Face_rec.py
# -*- coding: utf-8 -*- """ Created on Wed Oct 24 06:05:57 2018 @author: Mikko Pohja, modified by Tommi Honkanen """ import os import sys import cv2 import dlib import numpy as np import time import threading import glob from skimage import io face_recognition = dlib.face_recognition_model_v1('./models/dlib_face_re...
socket_handler.py
""" MIT License Copyright (c) 2021 B.Jothin kumar 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...
exporter.py
import argparse import logging import threading import sys import time from salt import client from tornado import web, ioloop from prometheus_client import generate_latest from prometheus_client import CONTENT_TYPE_LATEST from prometheus_client.core import GaugeMetricFamily from prometheus_client.core import CounterMe...
storage.py
import os, time, fnmatch, socket, errno from django.conf import settings from os.path import isdir, isfile, join, exists, splitext, basename, realpath import whisper import Queue import threading from graphite.logger import log from graphite.remote_storage import RemoteStore from graphite.util import unpickle try: ...
test_concurrent_futures.py
from test import support # Skip tests if _multiprocessing wasn't built. support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. support.import_module('multiprocessing.synchronize') from test.support.script_helper import assert_python_ok import contextlib import itertools import l...
models.py
import os import threading import uuid from ipaddress import ip_address, ip_interface, ip_network import yaml from django.db import models from ansible_api.models.mixins import AbstractExecutionModel from cloud_provider import get_cloud_client from common import models as common_models from fit2ansible import settings...
strategy_ui.py
#!usr/bin/env python #-*- coding:utf-8 _*- """ @version: author:Sleepy @time: 2017/08/08 @file: DataTable.py @function: @modify: """ import copy import traceback import threading from PyQt5.QtCore import QTimer, pyqtSignal from PyQt5.QtWidgets import QHeaderView, QLineEdit, QFileDialog from Utiltity.common import * f...
chathan_benchmark_echo.py
from gevent.server import StreamServer import multiprocessing import time import gevent from gevent import socket, spawn from gevent import queue import os NUM_CALLS = 10000 # * 50 * 2 # 0000 POOL = 100 SZ = 4096 server = None def run_server(): global server def _reader(f, q): print "on reader.....
__init__.py
# coding=utf-8 from __future__ import absolute_import import threading import octoprint.plugin from octoprint.events import Events import re import logging import flask import json import math class bedlevelvisualizer( octoprint.plugin.StartupPlugin, octoprint.plugin.TemplatePlugin, octoprint.plugin.Ass...
test_zeromq.py
# -*- coding: utf-8 -*- ''' :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import time import threading import multiprocessing import ctypes from concurrent.futures.thread import ThreadPoolExecutor # ...
tiles.py
""" TODO: In Fill Room, replace npc search with simpler Sub-Class search TODO: Eliminate need to pass character to the npcs. """ import time as time import random as random import threading as threading import textwrap as textwrap import logging as logging import config as config import items as items import en...
mqtt_firmware_client.py
# Copyright 2021. IoT Hub # # # 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 appl...
pid.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Author: i2cy(i2cy@outlook.com) # Project: FFC_PC # Filename: pid # Created on: 2021/9/19 import time import threading class PID(object): def __init__(self): self.kp = 0 self.ki = 0 self.kd = 0 self.err = 0 self.measures = 0 ...
process.py
"""The module handles running a command line.""" import os import signal import subprocess import threading import time LAST_PID_FILE = '/python-daemon-data/last_pid' DEFAULT_TIMEOUT = 30 * 60 # 30 minutes. def call(cmd, cwd='.', env=None, capture=False, raise_on_error=True, timeout=DEFAULT_TIMEOUT): "...
py_thread_exit.py
import threading import signal import os import time def handle(signum,frame): print "fuck!!" print signum os._exit(0) def func(): signal.signal(signal.SIGINT,handle) print "hello!!!" while 1: time.sleep(1) P1 = threading.Thread(target = func) P1.start() P1.join() print ...
writer.py
from os import fdopen, pipe from threading import Thread from typing import Any, List class Writer: """ Provides piped, buffered access to PG COPY binary stream. To use: __init__, providing table and cursor to execute PG COPY on. Please note, the cursor will be shared with worker threa...
SublimeLinter.py
from functools import partial import os import re import sys import time import threading import sublime import sublime_plugin from sublimelinter.loader import Loader from sublimelinter.modules.base_linter import INPUT_METHOD_FILE LINTERS = {} # mapping of language name to linter module QUEUE = {} # views ...
cgminer-monitor.py
# # cgminer-monitor # Romain Dura | romain@shazbits.com # https://github.com/shazbits/cgminer-monitor # BTC 1Kcn1Hs76pbnBpBQHwdsDmr3CZYcoCAwjj # import socket import sys import time import smtplib import json import os import threading import SimpleHTTPServer import SocketServer import urllib2 # # Config # cgminer_...
test_integ.py
import os import os.path import shutil import socket import subprocess import sys import tempfile import threading import time import random try: import pytest except ImportError: print >> sys.stderr, "Integ tests require pytests!" sys.exit(1) def pytest_funcarg__servers(request): "Returns a new APIH...
cluster_multiprocessing_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...
powp2pcoin.py
""" POWP2PCoin Usage: powp2pcoin.py serve powp2pcoin.py ping [--node <node>] powp2pcoin.py tx <from> <to> <amount> [--node <node>] powp2pcoin.py balance <name> [--node <node>] Options: -h --help Show this screen. --node=<node> Hostname of node [default: node0] """ import uuid, socketserver, socket,...
lambda_executors.py
import os import re import glob import json import time import logging import threading import subprocess import six from multiprocessing import Process, Queue try: from shlex import quote as cmd_quote except ImportError: from pipes import quote as cmd_quote # for Python 2.7 from localstack import config from ...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import platform import signal import io import os import errno import tempfile import time import selectors import sysconfig import select import shutil import gc import textwrap try: import ctypes except ImportError: ...
serviceProbe.py
#!/usr/bin/env python3 # Author: @m8r0wn # # ServiceProbe takes in list of targets and will probe for HTTP(S) and TCP services. # # serviceProbe.py 10.0.0.0/24 -p 22,21,80,443 # serviceProbe.py nmap_scan.xml # cat hosts.txt | python3 serviceProbe.py import sys import argparse from time import sleep from ipparser impor...
utils.py
# Copyright 2020 - 2021 MONAI Consortium # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in wri...
main.py
from flask import Flask, render_template, redirect, url_for, request import pandas as pd import other import threading app = Flask(__name__) @app.route('/') def index(): return render_template('index.html') @app.route('/file') def file(): return render_template('file.html', data=open("file.csv", "r").read()...
program.py
import socket import client import commands import threading import packets from packet import Packet class Server: def __init__(self, host, port): # open the socket self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # bind our server to a port self.sock.bind(("", 61022)...
notifications.py
# MIT License # # Copyright (c) 2019 Morning Project Samurai (MPS) # # 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, cop...
game_generator.py
import numpy as np import random import uuid import os import time import multiprocessing as mp from os.path import join as pjoin with open("vocabularies/fake_words.txt") as f: FAKE_WORDS = f.read().lower().split("\n") FAKE_WORDS = set(FAKE_WORDS) # entities with open("vocabularies/entities.txt") as f: ALL_E...
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...
test_worker.py
# -*- encoding: 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 ...
member_count.py
""" 获取单个贴吧所有会员 """ import pymysql host = 'localhost' db_name = 'tieba' username = 'root' password = '12345678' def _get_connection(host, username, password, db_name): return pymysql.connect(host=host, user=username, password=password, ...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Han Xiao <artex.xh@gmail.com> <https://hanxiao.github.io> import sys import threading import time import uuid import warnings from collections import namedtuple from functools import wraps import numpy as np import zmq from zmq.utils import jsonapi __all__ = ['__versio...
Multiprocesing.py
from multiprocessing import Process def print_func(continent='Asia', index=0): while True: print('The name of continent is : ', continent, " with index: " + str(index) + "\n") if __name__ == "__main__": # confirms that the code is under main function names = ['America', 'Europe', 'Africa'] proc...
live_translator.py
from PIL import Image, ImageGrab, ImageOps from pyautogui import position as mPos import pytesseract from time import sleep import translators as ts import threading, queue print("Put mouse at first position and press enter.") input() a = mPos() print("Put mouse at secound position and press enter.") input(...
250222_hb4.py
# =============================================================================================================================== # # Name : mavlinkSonyCamWriteVals.py # Desc : Global memory value class for use to write mavlink to sony cam # Auth : AIR-obots Ai-Robots # # =========================================...
extensions.py
# -*- coding:utf-8 -*- from flask_celery import Celery from flask_apscheduler import APScheduler from apscheduler.jobstores.sqlalchemy import SQLAlchemyJobStore from apscheduler.schedulers.background import BackgroundScheduler, BaseScheduler, BlockingScheduler from apscheduler.executors.base import MaxInstancesReachedE...
server.py
import bottle import bottle_session import time from multiprocessing import Process, Event from datetime import datetime from config import config import sqlite3 import logging import os import requests kill_event = Event() open_event = Event() SCRIPT_PATH = os.path.abspath(os.path.dirname(__file__)) log = logging.ge...
scripts.py
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function import os import sys import time import signal import logging import functools import threading import traceback import signal import funct...
servers.py
""" Starting in CherryPy 3.1, cherrypy.server is implemented as an :ref:`Engine Plugin<plugins>`. It's an instance of :class:`cherrypy._cpserver.Server`, which is a subclass of :class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class is designed to control other servers, as well. Multiple servers/p...
data_utils.py
# Lint as python3 # Copyright 2018 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 r...
btop-run.py
#!/usr/bin/env python if __name__ == "__main__": import os import time import socketserver import webbrowser import btop from http.server import SimpleHTTPRequestHandler from multiprocessing import Process def run_http_server(): package_root = os.path.dirname(os.path.abspath(b...
crash-test-server.py
#!/usr/bin/env python3 from http import HTTPStatus from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer import sys import threading import binascii class Handler(BaseHTTPRequestHandler): def commonServe(self): self.send_response(200, "") self.end_headers() sys.stdout.flush(...
detectf.py
import numpy as np import jetson.inference import jetson.utils import argparse import sys import time import threading import math import RPi.GPIO as GPIO from adafruit_servokit import ServoKit import cv2 as cv import face_recognition import os import pickle myKit = ServoKit(channels=16) GPIO.cleanup() GPIO.setmode(GP...
test_upload_url_concurrency.py
###################################################################### # # File: b2sdk/account_info/test_upload_url_concurrency.py # # Copyright 2019 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### imp...
mergeTrainingV2.py
import pandas as pd from django.http import JsonResponse import numpy as np from sklearn import model_selection,preprocessing from keras.preprocessing.image import ImageDataGenerator from datetime import datetime import matplotlib.pyplot as plt from datetime import datetime from keras import optimizers import sys, os,...
bilibili.py
#!/usr/bin/env python3.6 # -*- coding: utf-8 -*- """Bilibili Toolkit 哔哩哔哩工具箱 https://github.com/Hsury/Bilibili-Toolkit""" banner = r""" \\ // \\ // ##################### ________ ___ ___ ___ ________ ___ ___ ___ ## ## |\ ...
Server.py
#Author:Shoaib Omar (C) 2015 #Imports import socket import threading from threading import Thread from multiprocessing import Process import datetime#Needed for logging purposes import os,sys import urllib#Unquote urls import json#Decoding Settings Files import uuid#Generating Temporary file names & Service Thread ID'...
exemplo_3.py
"""Ideia de funções não serializaveis.""" from pickle import dumps from multiprocessing import Process def closure(func): """A função (func) está no escopo da closure.""" def inner(*args): """Os argumentos estão no escopo de inner.""" return print(func(*args)) return inner def add(x, y):...
executors.py
import datetime import multiprocessing import signal import sys import threading import time import warnings from concurrent.futures import ThreadPoolExecutor from concurrent.futures import TimeoutError as FutureTimeout from functools import wraps from logging import Logger from typing import TYPE_CHECKING, Any, Calla...
server.py
import socket import threading from datetime import datetime import queue class Server: """ Класс сервера. Ипользуй метод старт для включения. """ def __init__(self, address=('', 10000)): self.sock = socket.socket() self._address = address self._clients = {} self._is_running = ...
UDPServer.py
import socket from threading import Thread, Lock from time import time from .BenchmarkData import BenchmarkData class UDPServer: def __init__(self, host, port, benchmark_file_path, chunk_size, ack): self.__host = host self.__port = port self.__running = False self.__running_lock ...
test_thread.py
# =========================================================================== # This software is subject to the provisions of the Zope Public License, # Version 2.0 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCL...
test_threading.py
from unittest import TestCase from embit.ec import PrivateKey from embit.liquid.pset import PSET from embit.hashes import tagged_hash from embit.liquid import slip77 import threading mbkey = PrivateKey.from_string("L2U2zGBgimb2vNee3bTw2y936PDJZXq3p7nMXEWuPP5MmpE1nCfv") B64PSET = "cHNldP8BAgQCAAAAAQMEAAAAAAEEAQIBBQEEAf...
__init__.py
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals __all__ = ['ToastNotifier'] # ############################################################################# # ########## Libraries ############# # ################################## # standard library ...
DialogPackageManager.py
''' Created on Oct 6, 2013 (from DialogPluginManager.py) @author: Mark V Systems Limited (c) Copyright 2013 Mark V Systems Limited, All rights reserved. ''' from tkinter import Toplevel, font, messagebox, VERTICAL, HORIZONTAL, N, S, E, W from tkinter.constants import DISABLED, ACTIVE try: from tkinter.ttk import T...
main_simu.py
#!/usr/bin/env python import time import os import random import threading import argparse import matplotlib.pyplot as plt import numpy as np import scipy as sc import cv2 from collections import namedtuple import torch from torch.autograd import Variable from robot import Robot from trainer_simu import Trainer from...
diode_server.py
#!flask/bin/python # Copyright 2019-2020 ETH Zurich and the DaCe authors. All rights reserved. import aenum import dace import dace.serialize import dace.frontend.octave.parse as octave_frontend from dace.codegen import codegen from diode.DaceState import DaceState from dace.transformation.optimizer import SDFGOptimiz...
test_gevent_process.py
import time from gevent import monkey monkey.patch_all() from multiprocessing import Process print(6666) def f(x): print(x) time.sleep(10000) if __name__ == '__main__': [Process(target=f,args=(2,)).start() for i in range(2)]
test_dtr.py
import multiprocessing as mp import numpy as np import pytest import megengine as mge import megengine.functional as F import megengine.module as M import megengine.optimizer as optim import megengine.tensor as tensor from megengine.autodiff import GradManager from megengine.data import DataLoader, RandomSampler, tra...
base.py
"""Base class for nbviewer tests. Derived from IPython.html notebook test case in 2.0 """ #----------------------------------------------------------------------------- # Copyright (C) 2013 The IPython Development Team # # Distributed under the terms of the BSD License. The full license is in # the file COPYING, ...
test_ssl.py
import pytest import threading import socket as stdlib_socket import ssl from contextlib import contextmanager from functools import partial from OpenSSL import SSL import trustme from async_generator import asynccontextmanager import trio from .. import _core from .._highlevel_socket import SocketStream, SocketList...
base.py
# -*- coding: utf-8 -*- ''' napalm-logs base ''' from __future__ import absolute_import # Import std lib import os import re import imp import sys import time import yaml import logging import threading from multiprocessing import Process # Import third party libs # crypto import nacl.utils import nacl.secret import ...
pteeexec_cmd.py
#!/usr/bin/env python3 import argparse import os import subprocess import sys import textwrap import threading ERROR_MODES = [ 'warn', 'warn-nopipe', 'exit', 'exit-nopipe', ] class MockSubprocess: def __init__(self, mp: threading.Thread): self.mp = mp def wait(self): self.mp....
1_rms_bankers.py
from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp from threading import Thread import paramiko import ast import time import os import getpass as gp import data hosts = {} # {hostname: ip} multicast_group = '...
compare_Walltoall_qng_5layers.py
import qiskit import numpy as np import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding import importlib import multiprocessing importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.onequbit) importlib.reload(qtm.nqubit) importlib.reload...
scripts.py
# -*- coding: utf-8 -*- ''' This module contains the function calls to execute command line scripts ''' # Import python libs from __future__ import absolute_import, print_function import os import sys import time import logging import threading import traceback from random import randint # Import salt libs from salt....
EE123TNC.py
# Import functions and libraries import numpy as np import queue as Queue import time import sys from numpy import pi from numpy import sin from numpy import zeros from numpy import r_ from numpy import ones from scipy import signal from scipy import integrate import threading from numpy import mean from numpy import...
api.py
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
mthread.py
# -*- coding:utf-8 -*- from threading import Thread,get_ident,Event from queue import Queue from time import time,sleep from ..common.base import BaseObject ''' 测试线程队列的消耗 ''' rlist = [] def worker(): while True: item = q.get() #print(get_ident(),time() - item.begin) rlist.append(Bas...
core.py
# #!/usr/bin/env python # -*- coding: utf-8 -*- # <HTTPretty - HTTP client mock for Python> # Copyright (C) <2011-2018> Gabriel Falcao <gabriel@nacaolivre.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to d...
valve.py
import numpy as np from scipy.stats import linregress import logging, threading from daq import DAQOut, Trigger from util import now import time import config def reward_scale_to_volume(side, scale): dur = config.reward_dur[side] * scale sc = config.spout_calibration m,i,_,_,_ = linregress(sc['durations'],...
mark_for_deployment.py
#!/usr/bin/env python # Copyright 2015-2016 Yelp 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 ...
__init__.py
# -*- coding: utf-8 -*- import ast import logging import io import os import platform import queue import re import subprocess import sys import textwrap import threading import time import tokenize import traceback import webbrowser from queue import Queue from textwrap import dedent from time import sleep from tkinte...
Httpd.py
#_*_ coding:utf-8 _*_ import multiprocessing import re import socket import time import ProcessingServer.Response import ProcessingServer.Request import ProcessingServer.Yvan class Server(object): def __init__(self, initDic): self.port = initDic["port"] self.application = initDic["applic"] ...
get_access_token_server.py
''' ------------------------------------------------------------------------------ Copyright (c) 2015 Microsoft Corporation 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...
concurrency.py
# -*- coding: utf-8 -*- # # Copyright (C) 2010-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
stratum-miner.py
# Copyright (c) 2019, The Monero Project # # 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 code must retain the above copyright notice, this # list of ...
qt_root.py
import os import pathlib import sys from PyQt5.QtCore import QTimer from PyQt5 import QtCore, QtGui from PyQt5.QtGui import QIcon from PyQt5.QtWidgets import QFileDialog, QMainWindow, QApplication, QWidget, QComboBox, QLineEdit, QRadioButton, QSlider, QCheckBox, QMessageBox import threading import configparser from rl...
batch.py
# The MIT License (MIT) # Copyright (c) 2021 by Brockmann Consult GmbH and contributors # # 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...
__init__.py
import logging import re import requests import time from frozendict import frozendict from threading import Thread from platypush.message.event.http import HttpEvent from platypush.utils import set_thread_name class HttpRequest(object): poll_seconds = 60 timeout = 5 class HttpRequestArguments(object):...
resumable_upload.py
from future import standard_library standard_library.install_aliases() from builtins import range import datetime import queue import threading import time from logging import getLogger import requests import os from .resource import Drive, ResourceBase LOG = getLogger(__name__) class Upload(ResourceBase): re...
dealMenu.py
import configparser from tkinter import messagebox as mBox from tkinter.filedialog import askdirectory import tkinter as tk from tkinter import ttk from urllib.request import urlopen import re import useTor from stem import SocketError import feedBack from tkinter import scrolledtext from time import sleep class dmenu...
server.py
import ujson import hashlib from ModifiedSocketServer import WebSocket, SimpleWebSocketServer from statistics import StatsEvents from Crypto.Random import get_random_bytes from datetime import datetime from time import sleep from threading import Thread connections = {} def Serialize(data): return uj...