source
stringlengths
3
86
python
stringlengths
75
1.04M
ip_header_test.py
import glob import os import utils import numpy as np import multiprocessing num_headers = 1 load_dir = 'E:/Data/h5/' def ipheadertask(filelist): j = 1 for fullname in filelist: print("Loading filenr: {}".format(j)) load_dir, filename = os.path.split(fullname) df = utils.load_h5(load...
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 fnmatch import logging import threading import traceback import contextlib impo...
udp_monitor_chart.py
#!/usr/bin/env python3 # coding: utf-8 ################################################################################ # UDPで受信したIoTセンサ機器の値を棒グラフで表示します。 # (Webブラウザで http://127.0.0.1:8080 にアクセスするとグラフ表示されます) # # Copyright (c) 2021 Wataru KUNINO ##############################...
panda_engine.py
import multiprocessing.connection import os import queue import struct import subprocess import sys import tempfile import threading import time from OpenGL import GL import pman import bpy class ExternalConnection: ptr = None def __init__(self): filedir = os.path.dirname(bpy.data.filepath) if bpy...
hibernate-and-resume.py
#!/usr/bin/env python3 import subprocess import sys import time import datetime from PyQt5 import QtGui, QtWidgets import threading WAKEUP_HOUR=7 WAKEUP_MINUTE=0 def cancelHibernate(): print("cancelHibernate") def runHibernate(): print("runHibernate") tomorrow = datetime.datetime.now() + datetime.timedel...
env_stock_papertrading_erl.py
import datetime import threading import time import alpaca_trade_api as tradeapi import gym import numpy as np import pandas as pd import torch from finrl_meta.data_processors.processor_alpaca import AlpacaProcessor class AlpacaPaperTrading_erl(): def __init__(self, ticker_list, time_interval, a...
dal.py
#!/usr/bin/env python from __future__ import print_function from sim.utils import * from random_box_map import * from navi import * import numpy as np from scipy import ndimage, interpolate from collections import OrderedDict import pdb import glob import os import multiprocessing import errno import re import time ...
final_game.py
import pygame import threading import time import random from class_based_opencv import opencv_module import class_based_opencv import sys SIZE_X = SIZE_Y = 60 SCORE = 0 # VARIABLE : class_based_opencv.sensitivity_gesture -- INT # EFFECT : Change this value to affect the sensitivity of direction identification bas...
test_oddball.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/nedbat/coveragepy/blob/master/NOTICE.txt """Oddball cases for testing coverage.py""" import os.path import re import sys from flaky import flaky import pytest import coverage from coverage import env fr...
traceplayer.py
# -*- coding: utf-8 -*- # Copyright (c) 2013 The pycan developers. All rights reserved. # Project site: https://github.com/questrail/pycan # Use of this source code is governed by a MIT-style license that # can be found in the LICENSE.txt file for the project. """CAN Playback Module Module used to play back a given CA...
test_http_server.py
#! /usr/bin/env python import errno import io import logging import os import random import select import socket import threading import time import unittest import pyslet.http.messages as messages from pyslet.streams import Pipe, io_timedout from pyslet.py2 import range3 import pyslet.http.params as params # rely ...
DyStockTradeMainWindow.py
import datetime import threading from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QMainWindow, QDockWidget, QTabWidget from .Basic.DyStockMarketIndexMonitorWidget import * from .Basic.DyStockMarketStrengthWidget import * from .Basic.StrategyMarket.DyStockTradeStrategiesMarketMonitorWidget import...
demo6.py
#共享全局变量 线程是无序的 容易造成 数据的错误 #为了避免 上锁 import threading VALUE = 0 gLock = threading.Lock() def add_value(): global VALUE gLock.acquire() for x in range(10000000): VALUE +=1 gLock.release() print("value:%d" % VALUE) def main(): for x in range(2): t = threading.Thread(target=add_va...
thread_commucate_varables.py
import threading import time from random import randint url_list = [] def get_url_list(): global url_list print("get_url_list begining") while True: time.sleep(2) for i in range(10): url_list.append("www.studyai.com/" + str(randint(1,100000)) + "/") print("get_url_lis...
cooperative_auth.py
# coding: utf-8 from __future__ import unicode_literals, absolute_import from logging import getLogger from multiprocessing import Manager, Process from os import getpid from boxsdk.auth.cooperatively_managed_oauth2 import CooperativelyManagedOAuth2 from boxsdk.util.log import setup_logging from boxsdk import Client...
database.py
from itertools import permutations try: from Queue import Queue except ImportError: from queue import Queue import re import threading from peewee import * from peewee import Database from peewee import FIELD from peewee import attrdict from peewee import sort_models from .base import BaseTestCase from .base ...
tools.py
import atexit import os import sys import thread import threading import Pyro4 import config # Make Mininets classes import on OS X if sys.platform == "darwin": class DarwinMiniNetHack: pass import select select.poll = DarwinMiniNetHack select.POLLIN =1 select.POLLHUP = 16 class Config:...
create_tfrecord.py
#!/usr/bin/env python3 import argparse import functools import json import logging import multiprocessing import os import random from multiprocessing import Pool from typing import Dict, List, Tuple import cv2 import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split from resea...
example1.py
# ch14/ch01_ex01.py import threading import random import time def update(): global counter current_counter = counter # reading in shared resource time.sleep(random.randint(0, 1)) # simulating heavy calculations counter = current_counter + 1 # updating shared resource counter = 0 threads = [threadi...
http_server.py
from functools import wraps, update_wrapper from datetime import datetime from server.demo_control import DemoControl from server.detector_wrappers import EnvelopeHandler, IQHandler, PowerBinHandler, SparseHandler from threading import Thread from threading import Timer import flask from flask import request import o...
downloader.py
#!/usr/bin/env python import gzip import sys import tarfile import threading import urllib.request import zipfile import lib.download.task as task import lib.independence.fs as fs import lib.ui.color as printer # The greater purpose of (functions in) this file is # to download a list of DownloadTasks class Download...
sdk_worker.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...
client_requests.py
import threading import random import string from src.protocol.multicast.to_message import TotalOrderMessage from src.core.multicast.to_reliable_multicast import TotalOrderedReliableMulticast from src.core.group_view.group_view import GroupView from src.core.multicast.co_reliable_multicast import CausalOrderedReliable...
test_node.py
import pytest from pytest_bdd import given, scenario, then, when, parsers import os import subprocess import threading import time import grpc import csi_pb2 as pb from common.apiclient import ApiClient from common.csi import CsiHandle from common.deployer import Deployer from openapi.model.create_pool_body import C...
utils.py
import math import random import os.path as osp import multiprocessing from timeit import default_timer as timer import numpy as np import numpy.linalg as LA import matplotlib.pyplot as plt import os import shutil class benchmark(object): def __init__(self, msg, enable=True, fmt="%0.3g"): self.msg = msg ...
__init__.py
""" Enable ptvsd debugger to attach to HA. Attach ptvsd debugger by default to port 5678. """ from asyncio import Event import logging from threading import Thread import ptvsd import voluptuous as vol from homeassistant.const import CONF_HOST, CONF_PORT import homeassistant.helpers.config_validation as cv from hom...
basic04.py
""" 使用**多进程**完成文件夹的copy案例 主进程统计完成的进度,使用进程间的通信queue,子进程完成后放入queue中,主进程去拿 """ import os import multiprocessing import time def copy_file(src, file_name, dest, queue): # 打开一个源文件, 读取文件 src_file = open(src + "/" + file_name, "rb") # 打开一个目标文件,写入文件 dest_file = open(dest + "/" + file_name, "wb") f...
jdp.py
import threading import socket import json class Server: def __init__(self, port=11000, hostname="0.0.0.0"): self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.sock.bind((hostname, port)) self.thread = None self.callbacks = [] def start(self): self.thread...
variable_scope_test.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...
__init__.py
# -*- coding: utf-8 -*- # # ----------------------------------------------------------------------------------- # Copyright (c) Microsoft Open Technologies (Shanghai) Co. Ltd. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this softw...
Wall.py
import time import random import configparser import queue import threading import twitter import neopixel as np import LightControl as lc import LED class Wall: def __init__(self): self.init_time = int(time.time()) self.queued_words = queue.Queue() self.running = True self.input...
client-server-tests.py
#!/usr/bin/env python3 from __future__ import unicode_literals from builtins import bytes, dict, list, int, float, str import errno import sys import json import os import threading import time import unittest sys.path.append('..') from reflectrpc.client import RpcClient from reflectrpc.client import RpcError from ...
streamer.py
import base64 import time import threading from threading import Timer import cv2 import numpy as np import requests import json class RepeatedTimer(object): def __init__(self, interval, function, *args, **kwargs): self._timer = None self.interval = interval self.function = function ...
gnupg.py
""" A wrapper for the 'gpg' command:: Portions of this module are derived from A.M. Kuchling's well-designed GPG.py, using Richard Jones' updated version 1.3, which can be found in the pycrypto CVS repository on Sourceforge: http://pycrypto.cvs.sourceforge.net/viewvc/pycrypto/gpg/GPG.py This module is *not* forward-...
test_llcorehttp_peer.py
#!/usr/bin/env python """\ @file test_llsdmessage_peer.py @author Nat Goodspeed @date 2008-10-09 @brief This script asynchronously runs the executable (with args) specified on the command line, returning its result code. While that executable is running, we provide dummy local services for use by C...
environment.py
# import threading # from wsgiref import simple_server # # from selenium import webdriver # # from my_application import model # # from my_application import web_app # def before_all(context): # # context.server = simple_server.WSGIServer(('', 8000)) # # context.server.set_app(web_app.main(environment='test'))...
xmlstream.py
""" sleekxmpp.xmlstream.xmlstream ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides the module for creating and interacting with generic XML streams, along with the necessary eventing infrastructure. Part of SleekXMPP: The Sleek XMPP Library :copyright: (c) 2011 Nathanael C. Fritz :...
test__fileio.py
# Licensed to the .NET Foundation under one or more agreements. # The .NET Foundation licenses this file to you under the Apache 2.0 License. # See the LICENSE file in the project root for more information. ''' Tests for CPython's _fileio module. ''' import os import sys import time import threading import unittest f...
AI.py
""" Adhering (Sort of) to the insustry standards set bt OpenAI. Base Code: https://github.com/Sentdex/Carla-RL """ # Import Carla Egg import glob import os import sys try: sys.path.append(glob.glob('../WindowsNoEditor/PythonAPI/carla/dist/carla-*%d.%d-%s.egg' % ( sys.version_info.major, sys.version_info....
scanner.py
# -*- coding: utf-8 -*- """ Created v1 on Sun Mar 11 09:30:49 2018 Created v2 on Tue Jul 31 13:15:22 2018 Created v3 on 20181030 @author: bransonngai """ # import argparse import talib as ta import BATrader as ba from BATrader.final.product import Stock from BATrader.final.data_handler import MemoryDict from BATrader...
server.py
from logger import LOG from keypad import readFromKeyboard from time import sleep from RPLCD.RPLCD.i2c import CharLCD from multiprocessing import Process import datetime import RPi.GPIO as GPIO import threading import pyrebase import json import time FIFO_FILE = "nfc_fifo.tmp" AUDIT_FILE = "arrays.json" NUMBER_OF_PI...
me.py
import time import sys from multiprocessing import Process, Value, Lock mfac = 100./500. def func(val, lock, pid): cfac = 10 for i in range(50): time.sleep(0.1) if pid == 0: tmp = val.value * mfac if tmp >= cfac: sys.stderr.write("processed %s %i%%\n"%(sys.argv[1],cfac)) cfac += 10 with lock: ...
TelloEdu.py
#coding=utf-8 import socket import threading import time import netifaces import netaddr import pyttsx3 class TelloEdu(object): def __init__(self, manager, ip): self.manager = manager self.ip = ip self.sn = "" self.name = "" self.battery = 0 self.command = "" ...
data.py
import multiprocessing import os import re import signal from math import ceil from os.path import join import numpy as np import torch from numpy.random import choice from torchtext.data import Field, TabularDataset from paragraphvec.utils import DATA_DIR def load_dataset(file_name): """Loads contents from a f...
skeletonMultiTesterAppiumReal.py
#################################################################### # Skeleton for Appium tests on Sauce Labs RDC #################################################################### ################################################################### # Imports that are good to use ###################################...
url_requests_tools4.25.py
''' 作者:柴志勇 ''' import requests from bs4 import BeautifulSoup import csv import selenium import selenium.webdriver import urllib import time import re import random import sys import datetime import threading from random import choice from util.file_manager import fileManager professional_url_path = 'util/professiona...
__init__.py
#!/usr/bin/python3 # @todo logging # @todo extra options for url like , verify=False etc. # @todo enable https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl as option? # @todo option for interval day/6 hour/etc # @todo on change detected, config for calling some API # @todo fetch title into json # https://di...
async_dqn.py
#!/usr/bin/env python import os os.environ["KERAS_BACKEND"] = "tensorflow" from skimage.transform import resize from skimage.color import rgb2gray from atari_environment import AtariEnvironment from custom_environment import CustomEnvironment import threading import tensorflow as tf import sys import random import num...
exposition.py
from __future__ import unicode_literals import base64 from contextlib import closing import os import socket import sys import threading from wsgiref.simple_server import make_server, WSGIServer, WSGIRequestHandler from .openmetrics import exposition as openmetrics from .registry import REGISTRY from .utils import fl...
server.py
# don't modify this imports. import socket from threading import Thread from client_handler import ClientHandler class Server(object): """ The server class implements a server socket that can handle multiple client connections. It is really important to handle any exceptions that may occur because other cl...
server4.py
import socket from threading import Thread sock = socket.socket() sock.bind(('127.0.0.1', 53331)) sock.listen(10) users = [] def adder(): while True: global users users.append(sock.accept()[0]) print("Пользователь подключился, стало:", len(users)) def users_counter(): ...
game.py
import time import turtle import threading from random import choice # region blocks blocks = [turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), turtle.Turtle(), 0, 0] HP = [3, 3, 3, ...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum_grlc.storage import WalletStorage, StorageReadWriteError from electrum_grlc.wallet_db import Wallet...
LDRAProjectSetup_GUI.py
from tkinter import Label, Button, Entry, Radiobutton import tkinter as tk from tkinter import messagebox, filedialog, StringVar, SUNKEN, W, X, BOTTOM from os import path import threading, sys import os from tkinter.filedialog import askopenfilename import LDRAProjectSetup class GUI_COntroller: ''' This class...
RAZE.py
import requests import threading import socket import time import random import sys global target global server_block global end_ end_ = False #method to stop threads def load_pix(): from colorama import init init() from colorama import Fore, Back, Style print(Fore.GREEN ...
networking.py
import platform import queue import re import subprocess import threading import psutil def scan_network(base_ip): def worker_func(pingArgs, pending, done): try: while True: # Get the next address to ping. address = pending.get_nowait() ping = ...
common.py
"""Test the helper method for writing tests.""" from __future__ import annotations import asyncio from collections import OrderedDict from collections.abc import Awaitable, Callable, Collection from contextlib import contextmanager from datetime import datetime, timedelta import functools as ft from io import StringIO...
archive_migration.py
#!/usr/bin/env python2.7 #! -*- encoding: utf-8 -*- import simplejson as json import threading from sqlobject import SQLObject, connectionForURI from sqlobject.sqlbuilder import Insert, Select, Delete from octopus.dispatcher.model.node import FolderNode, TaskNode from octopus.dispatcher.model.task import Task, Tas...
printing.py
import datetime import os import subprocess import sys import tempfile import threading import uuid import config def run(username, source): with open('template.tex') as f: template = f.read() template = template.replace('%USER%', username).replace('%DATE%', str(datetime.datetime.now())) with te...
server_dmm.py
import os import json import time import traceback from flask import Flask, request, Response, send_from_directory from elasticsearch import Elasticsearch from slipstream_api import Api import boto import boto.s3.connection import requests from datetime import datetime from threading import Thread import lib_access a...
douban.py
import re from multiprocessing import Process, Queue from threading import Lock, Thread import numpy as np import requests from bs4 import BeautifulSoup # 全局线程锁 threadLock = Lock() class Movie: def __init__(self, name, stars, votes, rating, areas, year, types, time, url): """ ###...
showvcodelineedit.py
import threading import time from typing import Union from PyQt5 import QtCore from PyQt5.QtCore import QPoint, QSize, QPropertyAnimation, QRect, pyqtSignal, pyqtSlot, QTimer from PyQt5.QtGui import QIcon, QPixmap from PyQt5.QtWidgets import QLineEdit, QLabel, QGraphicsEffect, QGraphicsOpacityEffect class ShowVCodeL...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import os import sys import copy import errno import signal import hashlib import logging import weakref import threading from random import randint # Import Salt Libs...
dctool.py
import Client import Exploits import requests import traceback import time from consolemenu import ConsoleMenu from consolemenu.items import SubmenuItem, FunctionItem from threading import Thread def about(): print('''Discord Tool v0.1.3 Alpha version, expect spectacular bugs Coded by Raffy E \tThanks to Discord f...
_flaskhelpers.py
""" This file contains the main functions used to implement a flask/gevent server hosting a flexx application. The chain of initialisation is the following: # Import from flexx import flx_flask # Define one or multiple classes class Example1(flx.Widget): ... # Register the class to the server (you can define mor...
manager.py
#!/usr/bin/env python3 import os import time import sys import fcntl import errno import signal import shutil import subprocess import datetime import textwrap from typing import Dict, List from selfdrive.swaglog import cloudlog, add_logentries_handler from common.basedir import BASEDIR, PARAMS from common.hardware i...
kb_meta_decoder_py2Server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
Selfbot.Kris.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests cl = LINETCR.LINE() #cl.login(qr=True) cl.login(token='') #kris cl.loginResult() print "===[Login Success]===" ki = kk = kc = cl...
instrument.py
import subprocess, threading from subprocess import Popen, PIPE; from threading import Timer class Command(object): def __init__(self, cmd): self.cmd = cmd self.process = None self.out = [] def run(self, timeout): def target(): print 'Thread started' ...
test_class_sample.py
from __future__ import print_function import sys if sys.version_info < (3,0,0): from thread import get_ident else: from threading import get_ident import threading import time class WaitClass: def __init__(self, time): self.time = time def __call__(self): ident = get_id...
multi_p.py
from multiprocessing import Process, Manager import os def f(d, l): d[os.getpid()] = os.getpid() l.append(os.getpid()) print(l) if __name__ == '__main__': with Manager() as manager: d = manager.dict() # 声明一个字典,这个字典是用manger声明的,不是用dict()声明的 # manger.dict()是用专门的语法生产一个可在多进程之间进行传递和共享的...
xk_adb.py
# -*- coding: utf-8 -*- # @Time : 2018/5/21 9:47 # @Author : xiaoke # @Email : 976249817@qq.com # @File : xk_adb.py import threading import tkinter from tkinter import * from tkinter import messagebox, ttk from adb.app_adb_time import collect_time from adb.app_adb_monkey import collect_monkey from...
cooljugator.py
import requests import threading import time import traceback import re import queue from cmg.event import Event from study_tool.russian.types import Aspect from study_tool.russian.types import Case from study_tool.russian.types import Gender from study_tool.russian.types import Person from study_tool.russian.types imp...
server.py
''' Copyright (C) 2016 Marco Agner This file is part of Flask-QRcode. Flask-QRcode is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ...
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...
backend.py
# # Copyright (c) 2021, NVIDIA 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 ...
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...
issue_send_extrinsic_docker_workaround.py
#!/usr/bin/env python3 """ @summary: how to send a signed transaction @version: v03 (6/March/2020) @since: 6/March/2020 @author: https://github.com/drandreaskrueger @see: https://github.com/drandreaskrueger/chainhammer-substrate for updates """ import time, sys from threading import Thread from queue import Qu...
unsafe_bank.py
import datetime import random import time from threading import Thread, RLock from typing import List class Account: def __init__(self, balance=0): self.balance = balance def main(): accounts = create_accounts() total = sum(a.balance for a in accounts) validate_bank(accounts, total) pri...
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...
tmp_track2.py
import sys sys.path.insert(0, './yolov5') from yolov5.utils.datasets import LoadImages, LoadStreams from yolov5.utils.general import check_img_size, non_max_suppression, scale_coords from yolov5.utils.torch_utils import select_device, time_synchronized from deep_sort_pytorch.utils.parser import get_config from deep_sor...
tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import time import unittest try: from urllib.request import urlopen except ImportError: # Python 2 from urllib2 import urlopen import zlib from datetime import datetime, timedelta...
room.py
import socket import threading import pickle import utils import game.cards as cards from game.main_client import Game class Room: def __init__(self, socket, name, max_users): self.socket = socket self.members = {} self.name = name self.threads = [] self.max = max_users ...
kafkaplus.py
def _async_call(fn): """ 内部异步调用 :param fn: :return: """ import threading def wrapper(*args, **kwargs): threading.Thread(target=fn, args=args, kwargs=kwargs).start() return wrapper def getProducer(bootstrap_servers, username=None, password=None...
tickerRequestProducer.py
#!/usr/bin/python import threading import time import traceback import confluent_kafka import ccxt import json import datetime import logging import os import click import uuid import signal import etcd3 import concurrent.futures import os import collections import simpleProducer import simpleConsumer import heartbea...
_e3dc_rscp_web.py
#!/usr/bin/env python # Python class to connect to an E3/DC system. # # Copyright 2017 Francesco Santini <francesco.santini@gmail.com> # Licensed under a MIT license. See LICENSE for details import datetime import hashlib import struct import threading # TODO: move to threading to make python3 easier import time imp...
cassettes.py
import base64 import re import sys import threading from queue import Queue from typing import Any, Dict, Generator, Iterator, List, Optional, cast import attr import click import requests from requests.cookies import RequestsCookieJar from requests.structures import CaseInsensitiveDict from .. import constants from ...
testStitchModule.py
from __future__ import division, print_function import os, sys import ROOT from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import PostProcessor from PhysicsTools.NanoAODTools.postprocessing.framework.datamodel import Collection, Object from PhysicsTools.NanoAODTools.postprocessing.framework.event...
StreamFiledescriptors_test.py
import os import subprocess import threading import errno import unittest from pysam import AlignmentFile DATADIR = os.path.abspath(os.path.join( os.path.dirname(__file__), "pysam_data")) def alignmentfile_writer_thread(infile, outfile): def _writer_thread(infile, outfile): """read from infile ...
watcher.py
import logging import os.path import threading try: from watchdog.events import FileSystemEventHandler from watchdog.observers import Observer from watchdog.observers.polling import PollingObserver can_watch = True except ImportError: Observer = None FileSystemEventHandler = object PollingO...
overlay.py
__author1__ = 'David Northcote' __author2__ = 'Lewis McLaughlin' __organisation__ = 'The University of Strathclyde' __date__ = '12th May 2021' __version_name__ = '<a href="https://www.google.com/search?q=ben+donich" target="_blank" rel="noopener noreferrer">Ben Donich</a>' __version_number__ = '0.3.1' __channels__ = 'D...
roh.py
import json, random, threading, time class Roh: def __init__(self,data,interval=60,store=True): self.data_path = data with open(data,'r') as f: self.data = json.load(f) self.previous = None if store: self.interval = 60 self.stor_thread = threading...
__init__.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import difflib import gc import os import re import sys import hashlib import heapq import lz4.frame import math import operator import tempfile import threading import x...
actor_worker.py
import os import random import signal import time from collections import OrderedDict from queue import Empty, Full import numpy as np import psutil import torch from gym.spaces import Discrete, Tuple from torch.multiprocessing import Process as TorchProcess from sample_factory.algorithms.appo.appo_utils import TaskT...
meta-watchdog.py
#!/usr/bin/env python3 import os import sys import json import time import socket import requests import slackweb import pytz from datetime import datetime from redis import Redis from flask import Flask, jsonify from dotenv import load_dotenv from multiprocessing import Process __date__ = "10 January 2020" __version...
main.py
import sys import os, re, os.path import time import threading import serial import signal sys.path.append('/home/root/ArduCAM_USB_Camera_Shield/RaspberryPi/Python/Streaming_demo') import ArducamSDK from periphery import GPIO import globals import ardu_camera import image_processing import rpi_serial import logging ...
AgentTask.py
#!/usr/bin/python3 # -*- coding: UTF-8 -*- '''BlendNet AgentTask Description: Task used by Agent to control jobs ''' import os import time import signal import threading # To run stderr reading thread from subprocess import TimeoutExpired from .TaskBase import TaskConfig, TaskBase class AgentTaskConfig(TaskConfig):...
gui.py
from tkinter import * from pynput import mouse from PIL import ImageGrab, ImageTk from mss import mss from PIL import Image as Img import cv2 import numpy import threading import cvSCR as scr from sys import exit # GUI # state 2 => # State 1: # Button to capture screen + zoom # Button to hide border # Button to exi...
music_player.py
''' Kivy music player from Automator ================================ github: https://github.com/Davide255/Automator module from core.graphics MIT License Copyright (c) 2022 Davide Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentat...
helpers.py
""" :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers """ import base64 import builtins import errno import fnmatch import functools import inspe...