source
stringlengths
3
86
python
stringlengths
75
1.04M
plex-tvst-scrobbler.py
#!/usr/bin/env python import os import sys import platform import logging import time import threading import ConfigParser from optparse import OptionParser from plex_tvst_scrobbler.tvst import Tvst from plex_tvst_scrobbler.plex_monitor import monitor_log from plex_tvst_scrobbler.pre_check import PLSSanity def platfo...
server.py
# server import socket import threading HEADER = 64 PORT = 5053 SERVER = socket.gethostbyname(socket.gethostname()) ADDR = (SERVER, PORT) SERVER = "192.168.254.101" FORMAT = 'utf-8' DISCONNECT_MESSAGE = "!DISCONNECT" client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect( "192.168.254.101") serv...
asyncio.py
import asyncio import threading import warnings from concurrent.futures import CancelledError from functools import partial import outcome from .base import AsyncEngine, ThreadWorker from .exc import AlreadyQuit, SQLAlchemyAioDeprecationWarning class Request: def __init__(self, func): self.func = func ...
smart_thread.py
"""Module smart_thread. =========== SmartThread =========== The SmartThread class provides messaging, wait/resume, and sync functions for threads in a multithreaded application. The functions have deadlock detection and will also detect when a thread becomes not alive. :Example: create a SmartThread for threads name...
baseline.py
import h5py import os import pandas as pd import tempfile import numpy as np import random import json import time import networkx as nx import sys # Add to sys.path from baseline_common import compute_metrics from baseline_cdt import run_CDT, run_RCC from bl_gob import run_Gob sys.path.append(os.path.abspath("./no...
test_issue_605.py
import collections import logging import os import threading import time import unittest import pytest from integration_tests.env_variable_names import ( SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN, SLACK_SDK_TEST_RTM_TEST_CHANNEL_ID, ) from integration_tests.helpers import is_not_specified from slack_sdk.rtm import...
node_provider.py
import random import copy import threading from collections import defaultdict import logging import boto3 import botocore from botocore.config import Config from ray.autoscaler.node_provider import NodeProvider from ray.autoscaler.aws.config import bootstrap_aws from ray.autoscaler.tags import TAG_RAY_CLUSTER_NAME, ...
canas.py
#!/usr/bin/env python # # This is actually a quickly implemented testing tool, it is not intended for real use # import threading, struct, time from itertools import count import pycanbus class CanAerospaceEsc: DATA_TYPE = 2 CAN_ID = 200 def __init__(self, iface, self_node_id=None, redundancy_channel_id=...
FD_circle.py
import cv2 from tkinter import Tk from tkinter.filedialog import askopenfilename import numpy as np import imutils import threading def main(): cap = cv2.VideoCapture(vid_path) ret, previous_frame1 = cap.read() previous_frame = cv2.cvtColor(previous_frame1, cv2.COLOR_BGR2GRAY) hsv = np...
MainPanel.py
# -*- coding: utf-8 -*- """ Created on Mon Jul 9 20:41:03 2018 @author: 康文洋 kangwenyangde@163.com、陈祚松、夏萍萍、艾美珍、陈兰兰、张梦丽、易传佳 """ from threading import Timer from BasePacket import * from SensorPacket import * from InformPacket import * from DataProtocol import * from SocketClient import * from MessageControlCenter im...
ttvrecorder.py
import argparse import logging import os import subprocess import threading import time from collections import deque from dataclasses import dataclass from datetime import datetime from enum import Enum import requests from streamlink import Streamlink logging.basicConfig( level=logging.INFO, format="%(ascti...
thread_safe_queue.py
import time from queue import Queue from threading import Lock, Thread class LockedQueue(Queue): def __init__(self, *args, **kwargs): self._lock = Lock() self.queue = super().__init__() super(LockedQueue, self).__init__(*args, **kwargs) def size(self): with self._lock: ...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread from zipfile im...
__init__.py
import io import os import pathlib import socket import threading import time from abc import ABC, abstractmethod from contextlib import contextmanager from datetime import datetime from multiprocessing import Process from queue import Queue from typing import Optional, Union, Dict, Tuple, IO from platypush.config im...
runner.py
# Copyright (c) 2021 - present, Timur Shenkao # 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 appl...
criteo_2node_4gpu.py
import hugectr from mpi4py import MPI import threading import sys def model_test(json_file): solver = hugectr.CreateSolver(max_eval_batches = 100, batchsize_eval = 16384, batchsize = 16384, vvgpu = [[0,1,2,3],[4,5,6,7]], ...
main.py
# flask is a python web framework. it allows us to send and receive user requests # with a minimal number of lines of non-web3py code. flask is beyond the scope of # this tutorial so the flask code won't be commented. that way we can focus on # how we're working with our smart contract from flask import Flask, request,...
auth.py
from workflow import PasswordNotFound import json import logging import requests # from urllib import parse # this is a Py3 function from urllib import quote_plus from urlparse import urlparse, parse_qs from mstodo import config from mstodo.util import relaunch_alfred, workflow log = logging.getLogger('mstodo') def ...
collect_dataset.py
#!python3 ''' ############################## ### Receive Video stream ##### ### from Android client ####### ### Use yolo to do detect #### ## (return a message to the mobile device) ## ############################## ''' from ctypes import * import math import random import os import socket import time import cv2 impor...
rosbag_cli_recording_2_generate_output.py
#!/usr/bin/env python import roslib import rospy import smach import smach_ros from geometry_msgs.msg import Point from geometry_msgs.msg import Point32 from geometry_msgs.msg import PointStamped from geometry_msgs.msg import Pose from geometry_msgs.msg import PoseStamped from geometry_msgs.msg import Quate...
Barrier.py
from random import randrange from threading import Barrier, Thread from time import ctime, sleep num_mhs = 3 b = Barrier(num_mhs) mhs = ['Ahmad', 'Alwi', 'Abdul'] # barrier = barrier digunakan untuk memblock semua thread,kemudian melepas semua untuk execute secara bersamaan def runner(): name = mhs.pop() s...
Buses.py
# Classes for handling the communication """ The classes can be tested by following commands: wrt = SimpleWriteFileDevice() red = SimpleReadFileDevice() for i in range(1000): message = 'Hello I am No. ', i wrt.write_string(message) print red.read_str...
streaming.py
""" This module implements the main functionality of vidstream. Author: Florian Dedov from NeuralNine YouTube: https://www.youtube.com/c/NeuralNine """ __author__ = "Florian Dedov, NeuralNine" __email__ = "mail@neuralnine.com" __status__ = "planning" import cv2 import pyautogui import numpy as np import socket impo...
search.py
from multiprocessing import Process, Manager from datetime import datetime from bs4 import BeautifulSoup import requests import json import re SITE_URL = 'https://old.reddit.com/' REQUEST_AGENT = 'Mozilla/5.0 Chrome/47.0.2526.106 Safari/537.36' def createSoup(url): return BeautifulSoup(requests.get(url...
mqtt_server.py
import socket import threading import json from .compat import b from .mqtt import MQTT from .const import ( LOGGER, SHELLY_TYPES ) from .utils import exception_log class MQTT_connection: def __init__(self, mqtt, connection, client_address): self._mqtt_server = mqtt self._connection = c...
food_string_matching.py
from fuzzywuzzy import fuzz from fuzzywuzzy import process import Levenshtein import operator import time import threading from itertools import combinations from multiprocessing import Process import cPickle as pickle import os import subprocess foo = subprocess.Popen(['grep','-c','processor','/proc/cpu...
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json import pkgutil from threading import Thread import time import csv import decimal from decimal import Decimal as PyDecimal # Qt 5.12 also exports Decimal from collections import defaultdict from .bitcoin import COIN from .i1...
build_pretraining_dataset.py
# coding=utf-8 # Copyright 2020 The Google Research 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 applicab...
record_thread.py
import queue import os import time import wave from datetime import datetime from datetime import timedelta from threading import Thread import pyaudio from pydub import AudioSegment from pydub.playback import play class Recorder: _recording = False _frames = queue.Queue() _p = '' _stream = '' _o...
A3C_discrete_action.py
""" Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning. The Cartpole example. View more on my tutorial page: https://morvanzhou.github.io/tutorials/ Using: tensorflow 1.8.0 gym 0.10.5 """ import multiprocessing import threading import numpy as np import gym import os import...
perfmp.py
# perfmp.py # # A performance test with processes import time import multiprocessing def count(n): while n > 0: n -= 1 start = time.time() count(10000000) count(10000000) end = time.time() print("Sequential", end-start) start = time.time() p1 = multiprocessing.Process(target=count,args=(10000000,)) p2 =...
uart2usb_loopback.py
# -*- coding:utf-8 -*- import serial import serial.tools.list_ports import struct import time import sys import random import threading import datetime ############################################################################### #文件设置 ###################################################################...
main.py
# -*- coding: utf-8 -*- """Создание сырых netCDF файлов хромато-масс спектров. Модуль для моделирования хромато-масс спектров на основе таких параметров пика как время удерживания, отношения сигнал шум, параметров распределения задающего этот пик и масс спектра для соединения пика. Модуль позволяет провести симуляцию...
raspi_v1.py
import tkinter as tk from PIL import Image, ImageTk import threading import re import serial import time import datetime from google.protobuf.timestamp_pb2 import Timestamp import RPi.GPIO as GPIO #import grpc #import read_event_pb2 #import read_event_pb2_grpc #import goal_pb2 #import goal_pb2_grpc #import book_pb2 #i...
car_helpers.py
import os import threading import json import requests from common.params import Params from common.basedir import BASEDIR from selfdrive.version import comma_remote, tested_branch from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars from selfdrive.car.vin import get_vin, VIN_UNKNOWN from ...
start_azureml.py
#!/usr/bin/env python import os import sys import copy import uuid import json import time import socket import argparse import itertools import threading import subprocess from azureml.core import Workspace, Experiment, Environment from azureml.core.compute import AmlCompute, ComputeTarget from azureml.train.estimat...
updating-server-manual-inputs-multithreading-v0.3.py
#!/usr/bin/env python ''' Pymodbus Server With Updating Thread -------------------------------------------------------------------------- This is an example of having a background thread updating the context while the server is operating. This can also be done with a python thread:: from threading import Thread ...
threadDev.py
#!/usr/local/bin/python3 #-*- encoding: utf-8 -*- import threading class ThreadDev: _instance = None _job = {} # 프로세스 관리용 딕셔너리 # 인스턴스 1회 생성 def __new__(cls): if not cls._instance: cls._instance = object.__new__(cls) return cls._instance # 프로세스 실행 def run(cls, name,...
test_connection.py
# Copyright 2009-2012 10gen, 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 writing,...
xystage.py
import logging from threading import Thread, Event import time import yaml from zaber.serial import * from collections import OrderedDict from functools import wraps from irrad_control import xy_stage_config, xy_stage_config_yaml def movement_tracker(movement_func): """ Decorator function which is used keep t...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
utils.py
import valve from valve.source.a2s import ServerQuerier from valve.source.messages import InfoRequest, LongField, ByteField, Message, StringField, InfoResponse from .rcon import RCON, RCONTimeoutError import subprocess import os, re import time, threading import logging logger = logging.getLogger(__name__) ARK_APPID ...
bbox_regression.py
""" This file has functions about generating bounding box regression targets """ from ..pycocotools.mask import encode import numpy as np from utils.logger import logger from .bbox_transform import bbox_overlaps, bbox_transform from utils.config import config import math import cv2 import PIL.Image as Image import th...
utils.py
from ding.utils import remove_file from queue import Queue from typing import Union, Tuple from threading import Thread import time from functools import partial import threading from typing import Any from ding.utils.autolog import LoggedValue, LoggedModel from ding.utils import LockContext, LockContextType def gen...
pbrtBlend.py
#!BPY # -*- coding: utf-8 -*- # coding=utf-8 """Registration info for Blender menus: Name: 'pbrt v2.0 alpha Exporter' Blender: 248 Group: 'Render' Tooltip: 'Export/Render to pbrt v2.0 scene format (.pbrt)' """ __author__ = "radiance, zuegs, ideasman42, luxblender, dougal2, mmp" __version__ = "0.6" __url__ = [ "http:/...
3_philosophers.py
from __future__ import print_function from threading import Semaphore, Lock, Thread from collections import deque import random from time import sleep from timeit import Timer import itertools import sys import logging #P = int(input('Total of Philosophers:')) #M = int(input('Max Meals:')) #tested works in cmdline P ...
mcDODE.py
import os import numpy as np import pandas as pd import hashlib import time import shutil from scipy.sparse import coo_matrix, csr_matrix import pickle import multiprocessing as mp import MNMAPI class MCDODE(): def __init__(self, nb, config): self.config = config self.nb = nb self.num_assign_interval =...
harness.py
#!/usr/bin/env python ############################################################################## # Copyright 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. ################################...
views.py
"""Defines a number of routes/views for the flask app.""" from functools import wraps import io import os import sys import shutil from tempfile import TemporaryDirectory, NamedTemporaryFile import time from typing import Callable, List, Tuple import multiprocessing as mp import zipfile from flask import json, jsonif...
ps5.py
# 6.0001/6.00 Problem Set 5 - RSS Feed Filter # Name: # Collaborators: # Time: import feedparser import string import time import threading from project_util import translate_html from mtTkinter import * from datetime import datetime import pytz # ---------------------------------------------------------------------...
test_bz2.py
from test import support from test.support import TESTFN, bigmemtest, _4G import unittest from io import BytesIO import os import pickle import random import subprocess import sys try: import threading except ImportError: threading = None # Skip tests if the bz2 module doesn't exist. bz2 = support.import_mod...
test_dag_serialization.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...
live.py
# -*- coding: utf-8 -*- """ @date: 2020/11/9 上午11:07 @file: live.py @author: zj @description: """ import cv2 import time from multiprocessing import Process, Queue import subprocess as sp class Live(object): frame = None def __init__(self, enable, way, url, size=(1280, 720), fps=25): self.enable =...
windows.py
import collections import collections.abc import contextlib import ctypes import ctypes.wintypes import io import json import os import re import socket import socketserver import threading import typing import pydivert import pydivert.consts REDIRECT_API_HOST = "127.0.0.1" REDIRECT_API_PORT = 8085 ################...
mk_chembonds.py
# IO options for loading pathway data. # Zilin Song, 20 AUG 2021 # import iomisc, numpy, multiprocessing, dist_compute def extract_conf(mda_universe, mda_universe_label, nrep=50, ): '''Extract all bonds (chemical/hydrogen) in one RPM coordinate of nrep replicas.. ''' rep_distlabel = [] # Label...
Application1_SecuredRoom.py
import datetime import threading import time import cv2 import timed_face_recognition import numpy as np def timer(): time_limit = 20 # 120 seconds while time_limit >= 0: m, s = divmod(time_limit, 60) h, m = divmod(m, 60) time_left = str(h).zfill(2) + ":" + str(m).zfill(2) ...
example_stream_buffer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_stream_buffer.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api # Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api # PyPI: https://pyp...
core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2020 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-...
multithreading.py
import threading, time print('Start of Program') def take_a_nap(n): time.sleep(n) print('Wake up!') threadobj = threading.Thread(target=take_a_nap, args=[5]) threadobj.start() print('End of Program')
cmd_line.py
import traceback import sys import time import textwrap from pubsub import pub from fixate.ui_cmdline.kbhit import KBHit from queue import Queue from fixate.core.exceptions import UserInputError from fixate.core.common import ExcThread from fixate.config import RESOURCES import fixate.config wrapper = textwrap.TextWra...
wsdump.py
#!/home/jbee/PycharmProjects/SER401_Trynkit/venv/bin/python import argparse import code import sys import threading import time import ssl import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.st...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a bubcoind node can load multiple wallet files """ from decimal import D...
branchandbound4.py
import time import multiprocessing as mp import numpy as np import sys from queue import PriorityQueue from assignment import * sys.setrecursionlimit(10000) class TreeNode: # This is the node for tree serch def __init__(self, nb_unassigned_buildings, assigned_locations, assigned_buildings, location_status, bu...
programs.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """Running programs utilities.""" from __future__ import print_function # Standard library imports from ast import literal_eval from getpass import getu...
run-tests.py
#!/usr/bin/env python3 # # 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 "L...
red_test.py
#!/usr/bin/env python import logging from redbot.resource import HttpResource import redbot.speak as rs import thor import threading from tornado import gen from tornado.options import parse_command_line from tornado.testing import AsyncHTTPTestCase from tornado.web import RequestHandler, Application, asynchronous imp...
frontend_test.py
#!/usr/bin/env python """Unittest for grr http server.""" import hashlib import os import socket import threading import ipaddr import portpicker import requests from google.protobuf import json_format from grr.lib import flags from grr.lib import utils from grr.lib.rdfvalues import file_finder as rdf_file_finder ...
async_consumer.py
# -*- coding: utf-8 -*- # pylint: disable=C0111,C0103,R0205 # Asynchronous MQ consumer, from pika import functools import logging import time import pika from pika.exchange_type import ExchangeType import threading from queue import Queue LOG_FORMAT = ('%(levelname) -10s %(asctime)s %(name) -30s %(funcName) ' ...
utils.py
import time import os import shutil import threading import subprocess import eosfactory.core.errors as errors def wslMapLinuxWindows(path, back_slash=True): if not path or path.find("/mnt/") != 0: return path path = path[5].upper() + ":" + path[6:] if back_slash: path = path.replace("/", ...
__main__.py
import subprocess import sys import threading FILES = { "ca-langs.py": "wikidict/lang/ca/langs.py", "de-abk.py": "wikidict/lang/de/abk.py", "de-langs.py": "wikidict/lang/de/langs.py", "en-form-of.py": "wikidict/lang/en/form_of.py", "el-langs.py": "wikidict/lang/el/langs.py", "en-labels.py": "wi...
test_parallel.py
from __future__ import absolute_import, unicode_literals import json import os import subprocess import sys import threading import pytest from flaky import flaky from tox._pytestplugin import RunResult def test_parallel(cmd, initproj): initproj( "pkg123-0.7", filedefs={ "tox.ini": ...
chronos.py
from __future__ import absolute_import from future import standard_library standard_library.install_aliases() import logging from toil.batchSystems.abstractBatchSystem import ( AbstractBatchSystem, BatchSystemSupport, BatchSystemLocalSupport) import chronos import time import uuid import os import sys from threadin...
skywalker.py
''' Here below is a list of tools in `skywalker`. ''' from __future__ import print_function import warnings warnings.filterwarnings("ignore", message="numpy.dtype size changed") warnings.filterwarnings("ignore", message="numpy.ufunc size changed") import os, sys, traceback from tqdm import tqdm from functools import w...
MultiDownload.py
import shapefile from coord2rowcol import Coord2RowCol import asynMapLoader import multiprocessing import os import time def work(records): for record in records: minx = record[1] maxx = record[2] miny = record[3] maxy = record[4] ml = Coord2RowCol(level=1...
vChatServer2.py
#coding:utf-8 from socket import * import threading,time import pymysql from dbConfigs import vChatConfigs import sys reload(sys) sys.setdefaultencoding('utf-8') sendPort = 12001; receivePort = 12002; checkPort = 12003; #set room key key = "runningseagull"; def sendThread(): #content, userName, key, pwd prin...
corscheck.py
import gevent.monkey gevent.monkey.patch_all() import requests, json, os, inspect, tldextract from future.utils import iteritems try: from urllib.parse import urlparse except Exception as e: from urlparse import urlparse import urllib3 urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning) from...
node.py
import threading from time import sleep from logzero import logger from twisted.internet import reactor, task from neo.Network.NodeLeader import NodeLeader from neo.Core.Blockchain import Blockchain from neo.Implementations.Blockchains.LevelDB.LevelDBBlockchain import LevelDBBlockchain from neo.Settings import settin...
joystick_fsm.py
#!/usr/bin/env python import copy import math import threading import rospy import rostopic import smach import smach_ros import PyKDL as kdl import message_filters as mf import tf_conversions as tfc from nav_msgs.msg import Odometry from std_msgs.msg import Bool, Duration, Float32, String from geometry_msgs.msg imp...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
Urllib3Using.py
# Copyright 2019, Kay Hayen, mailto:kay.hayen@gmail.com # # Python test originally created or extracted from other peoples work. The # parts from me are licensed as below. It is at least Free Software where # it's copied from other people. In these cases, that will normally be # indicated. # # L...
demo.py
# coding=utf-8 # Copyright 2019 StrTrek Team 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 ...
test_streams.py
"""Tests for streams.py.""" import gc import os import queue import pickle import socket import sys import threading import unittest from unittest import mock from test.support import socket_helper try: import ssl except ImportError: ssl = None import asyncio from test.test_asyncio import utils as test_utils ...
main.py
from tkinter import * from time import * from PIL import ImageTk, Image import os, random, threading root = Tk() root.resizable(width=False, height=False) root.title('Whack-A-Mole') score = 0 n_whacked = 0 d_whacked = 0 game_time = 20 current_path = os.path.dirname(os.path.abspath(__file__)) #L...
test_content.py
from __future__ import print_function import os import re import sys import json import time import argparse import threading import subprocess import traceback from time import sleep import datetime from distutils.version import LooseVersion import pytz from google.cloud import storage from google.api_core.exception...
rdd.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...
cloud.py
""" Object Store plugin for Cloud storage. """ import logging import multiprocessing import os import os.path import shutil import subprocess import threading import time from datetime import datetime from galaxy.exceptions import ( ObjectInvalid, ObjectNotFound, ) from galaxy.util import ( directory_hash...
runtests.py
#!/usr/bin/env python import os import re import sys import glob import subprocess from ctypes import c_int from multiprocessing import Process, Lock, Value, BoundedSemaphore, cpu_count #--------------------------------------------------------------------- # Extract scenarios from the specified test def runTest(test...
runner.py
import asyncio import concurrent.futures import contextlib import threading import types from typing import cast, Any, Optional, Tuple, Type, TYPE_CHECKING import click.testing from typing_extensions import Literal from kopf import cli from kopf.reactor import registries from kopf.structs import configuration _ExcTy...
visualizer.py
# Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this so...
Hiwin_RT605_Socket_v3_20190628113225.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd_v3 as TCP import HiwinRA605_socket_Taskcmd_v3 as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.s...
RND_adapter.py
# Copyright (c) TUT Tampere University of Technology 2015-2018. # This software has been developed in Procem-project funded by Business Finland. # This code is licensed under the MIT license. # See the LICENSE.txt in the project root for the license terms. # # Main author(s): Ville Heikkila, Otto Hylli, Pekka Itavuo, #...
fetchvc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # author: observer # email: jingchaohu@gmail.com # blog: http://obmem.com import urllib import re import sqlite3 import time import os,sys import config from threading import Thread from Queue import Queue from download import httpfetch path = os.path.dirname(os.path.rea...
test_multivariate.py
import multiprocessing import time import pytest import unified_map as umap # Common preliminaries def f_num(x, y, z): return x**2 + y**2 + z**2 args_numerical = [(x, x+1, x+2) for x in list(range(10))] expected_results_numerical = [f_num(*args) for args in args_numerical] def f_str(s1, s2): return s1+s...
lock_objects_02.py
import threading from tqdm import tqdm from time import sleep lock = threading.Lock() resource: list = [] def target_function(): current_thread: threading.Thread = threading.current_thread() thread_name: str = current_thread.name print(f'\n{thread_name} -> is_alive: {current_thread.is_alive()}') if lock.lo...
_channel_test.py
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
downloader.py
#-*- coding=utf-8 -*- import requests import threading import os import random import math def randip(): return str(random.randint(0, 255)) + "."\ + str(random.randint(0, 255)) + "."\ + str(random.randint(0, 255)) + "."\ + str(random.randint(0, 255)) class Downlo...
test_linsolve.py
import sys import threading import numpy as np from numpy import array, finfo, arange, eye, all, unique, ones, dot import numpy.random as random from numpy.testing import ( assert_array_almost_equal, assert_almost_equal, assert_equal, assert_array_equal, assert_, assert_allclose, assert_warns, ...
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, Iterator from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ...
pan_tilt_tracking.py
from multiprocessing import Manager from multiprocessing import Process from imutils.video import VideoStream from core.objcenter import ObjCenter from core.pid import PID import pantilthat as pth import argparse import signal import time import sys import cv2 # define the range for the motors # -85 to 85 for safety r...