source
stringlengths
3
86
python
stringlengths
75
1.04M
rpc_pi_cam_streaming.py
import time from queue import Queue from data_sender import send import argparse from threading import Thread, Event import cv2 import numpy as np from redis import Redis import pickle from baseline_rpc_rgb import make_ucf, make_hmdb, make_infer def streaming(): import picamera import picamera.array while...
continuation.py
import dataclasses import threading import time from .utils import nonce _cont_map = {} _cont_lock = threading.RLock() @dataclasses.dataclass() class Cont: callback: any expiration: float = None def __post_init__(self): """ Set the default expiration. """ self.expiratio...
submitty_grading_scheduler.py
#!/usr/bin/env python3 import os import sys import time import signal import grade_items_logging import grade_item from submitty_utils import glob import multiprocessing from watchdog.observers import Observer from watchdog.events import FileCreatedEvent, FileSystemEventHandler # ====================================...
get data.py
#D:\Python\Python35\python # -*- coding:utf-8 -*- import os,requests,re,time,logging import xml.dom.minidom import json,sys,math,subprocess,ssl,threading from urllib import parse DEBUG=False global BaseRequest max_group_num=2 interface_calling_interval=5 QRImagePath=os.path.join(os.getcwd(),'qrcode.jp...
web-crawler-multithreaded.py
# Time: O(|V| + |E|) # Space: O(|V|) import threading import queue # """ # This is HtmlParser's API interface. # You should not implement it, or speculate about its implementation # """ class HtmlParser(object): def getUrls(self, url): """ :type url: str :rtype List[str] """ pa...
bak_ModulTest.py
# Modul Test # 11.11.2019 # Sahin MERSIN import configparser import os import sys import time import socket import select from threading import Thread import psutil import requests from PySide2.QtUiTools import QUiLoader from PySide2.QtWidgets import QApplication, QPushButton, QLineEdit, QDialog, QDialogButtonBox, \ ...
test__xxsubinterpreters.py
from collections import namedtuple import contextlib import itertools import os import pickle import sys from textwrap import dedent import threading import time import unittest from test import support from test.support import script_helper interpreters = support.import_module('_xxsubinterpreters') ##############...
test_thread.py
# -*- coding: utf-8 -*- """Test CLR bridge threading and GIL handling.""" import threading import time import _thread as thread from .utils import dprint def test_simple_callback_to_python(): """Test a call to managed code that then calls back into Python.""" from Python.Test import ThreadTest dprint(...
multipro6_arr.py
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' 进程间共享数据 通过value\array共享数字和列表数据 ''' from multiprocessing import Process, Value, Array def f(n, a): n.value = 3.1415927 for i in range(len(a)): a[i] = -a[i] if __name__ == '__main__': num = Value('d', 0.0) arr = Array('i', range(10)) print ...
PiCam.py
# built upon: https://github.com/jrosebr1/imutils/blob/master/imutils/video/pivideostream.py from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread # import cv2 # import numpy as np import json class PiCam: def __init__(self, resolution=(640, 480)): # initialize...
laji.py
# from memory_profiler import profile # class aa: # def __init__(self,x): # b=[] # for i in range(30): # b.append([1] * (10**6)) # #@profile() # def __iter__(self): # b=[] # for i in range(3): # b.append([1] * (10**6)) # return iter(...
transport.py
# Copyright 2019 Hanson Robotics 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 agr...
rewind.py
import logging import os import shlex import six import subprocess from threading import Lock, Thread from .connection import get_connection_cursor from .misc import parse_history, parse_lsn from ..async_executor import CriticalTask from ..dcs import Leader logger = logging.getLogger(__name__) REWIND_STATUS = type(...
esp32_load_mqtt.py
import serial import time import msgpack import binascii import json import crcmod from libs.esp32_commands_py3 import ESP32_Message_Generator from libs.esp32_mqtt_setup import ESP32_MQTT_MANAGER from threading import Thread class Serial_Port_Manager(object): def __init__(self): self.packet_recieved = False...
table.py
import threading import Queue def table(args): ''' Simple table for gamblers ''' pool = [] queue = Queue.Queue() player_results = [] players_at_table = args[0] for i in range(players_at_table): t = threading.Thread(target=args[1], args=(args[2], queue)) pool.append(t) ...
demo.py
#!/usr/bin/env python3 # coding=utf-8 import argparse import threading import traceback from time import sleep from predictor import Predictor import bottle import socket import time import torch ''' This file is taken and modified from R-Net by Minsangkim142 https://github.com/minsangkim142/R-net ''' app = bottle.Bo...
autoreload.py
#!/usr/bin/env python3 from pyln.client import Plugin import json import psutil import subprocess import threading import time import os try: # C-lightning v0.7.2 plugin = Plugin(dynamic=False) except: plugin = Plugin() class ChildPlugin(object): def __init__(self, path, plugin): self.path =...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import bitcoinnano from bitcoinnano.bitcoin import TYPE_ADDRESS from bitcoinnano import WalletStorage, Wallet from bitcoinnano_gui.kivy.i18n import _ from bitcoinnano.paymentrequest import InvoiceSt...
test_forward.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...
test.py
#!/usr/bin/env python from time import sleep, time import sys from json import loads from threading import Thread from tty_radio.radio import Radio from tty_radio.stream import mpg_running from tty_radio.api import Server, Client def test_obj(): # noqa r = Radio() i = 0 print('%02d>>> r:%s' % (i, r)) ...
utils.py
"""Utility functions.""" import functools import sys import threading def run_func_capture_locals(func, *args, **kwargs): """ Calls the function *func* with the specified arguments and keyword arguments and snatches its local frame before it actually executes. Taken from https://stackoverflow.com/a/5...
cls-train-cifar10-multi.py
#!/usr/bin/env python3 import os import sys sys.path.append('install/picpac/build/lib.linux-x86_64-%d.%d' % sys.version_info[:2]) os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' import time import threading from tqdm import tqdm import numpy as np import cv2 import tensorflow as tf from tensorflow.contrib import layers import...
test_generator_mt19937.py
import sys import pytest import numpy as np from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_raises, assert_equal, assert_allclose, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings) from numpy.random import Generator, MT199...
test_telnetlib.py
import socket import select import telnetlib import time import contextlib from unittest import TestCase from test import support threading = support.import_module('threading') HOST = support.HOST def server(evt, serv): serv.listen(5) evt.set() try: conn, addr = serv.accept() except socket.ti...
entertainhue.py
#!/usr/bin/python3 import sys try: from http_parser.parser import HttpParser # pylint: disable=no-name-in-module except ImportError: from http_parser.pyparser import HttpParser import argparse import requests import time import json from pathlib import Path from socket import socket, AF_INET, SOCK_DGRAM, IPP...
workers_manager.py
import importlib import threading from functools import partial import logging from apscheduler.schedulers.background import BackgroundScheduler from interruptingcow import timeout from pytz import utc from workers_queue import _WORKERS_QUEUE import logger from pip import __version__ as pip_version if int(pip_versio...
pytorch.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import atexit import logging import time from dataclasses import dataclass import os from pathlib import Path import socket from subprocess import Popen from threading import Thread import time from typing import Any, List, Optional, Union impor...
14_edf_wait_die_Speak.py
# Author Emeka Ugwuanyi Emmanuel from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp from threading import Thread import threading import ast import time import os import psutil import datetime as dt import getp...
packet_sender.py
#!/usr/bin/env python3 # Compatible also with Python2.7 ''' Author Emanuele Gallone Date 08/2020 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 Unl...
rover_offboard.py
#!/usr/bin/env python3 import rospy import math import numpy as np from mavros_msgs.msg import Altitude, ExtendedState, State from mavros_msgs.srv import CommandBool, ParamGet, SetMode from geometry_msgs.msg import PoseStamped, Quaternion from pymavlink import mavutil from std_msgs.msg import Header from threading imp...
test_state.py
""" Tests for the state runner """ import errno import logging import os import queue import shutil import signal import tempfile import textwrap import threading import time import salt.exceptions import salt.utils.event import salt.utils.files import salt.utils.json import salt.utils.platform import salt.utils.stri...
base.py
#!/usr/bin/python # -*- coding: utf-8 -*- # Hive Appier Framework # Copyright (c) 2008-2020 Hive Solutions Lda. # # This file is part of Hive Appier Framework. # # Hive Appier Framework is free software: you can redistribute it and/or modify # it under the terms of the Apache License as published by the Apach...
prepro.py
#! /usr/bin/python # -*- coding: utf-8 -*- import copy import math import random import threading import time import numpy as np import PIL import scipy import scipy.ndimage as ndi import skimage from scipy import linalg from scipy.ndimage.filters import gaussian_filter from scipy.ndimage.interpolation import map_coo...
tests.py
# -*- coding: utf-8 -*- # Unit and doctests for specific database backends. from __future__ import unicode_literals import datetime from decimal import Decimal import threading import unittest from django.conf import settings from django.core.management.color import no_style from django.db import (connection, connect...
event.py
from datetime import datetime from queue import Queue, Empty from threading import Thread from time import sleep from typing import Any, Callable from collections import defaultdict from ..extention import Extention from ..applog import AppLog log = AppLog.get('event') SYS_EVENT_TIMER = "timer" class Event: de...
testrunner.py
# Copyright 2010 Orbitz WorldWide # # 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 writ...
martin_scale.py
#################################################################### # Cyclic grid strategy based on martingale # Copyright © 2021 Jerry Fedorenko aka VM # ver. 0.8rc # See readme.md for detail # Communication with the author and support on # https://discord.com/channels/600652551486177292/601329819371831296 ##########...
tftpServer.py
# -*- coding: utf-8 -*- import sys import struct from socket import * from threading import Thread def download_thread(fileName, clientInfo): s = socket(AF_INET, SOCK_DGRAM) fileNum = 0 fileName = "configXml\\" + str(fileName)[2:-1] # str(fileName) : b'content' try: f = open(fileName,'rb') except: ...
session_server.py
#!/usr/bin/env python # Copyright 1996-2018 Cyberbotics Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
core.py
# -*- coding: utf-8 -*- # # 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, software ...
multicast_client.py
import socket import struct import config import json import threading import random def multicast_handler(client_port: int): # create the datagram socket sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock.bind(('', client_port)) # set a timeout so the socket does not block indefinitely when...
diskover.py
#!/usr/bin/env python3 """ diskover community edition (ce) https://github.com/diskoverdata/diskover-community/ https://diskoverdata.com Copyright 2017-2021 Diskover Data, Inc. "Community" portion of Diskover made available under the Apache 2.0 License found here: https://www.diskoverdata.com/apache-license/ All othe...
test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None imp...
interface.py
# Date: 06/07/2018 # Author: Pure-L0G1C # Description: Interface for the master from os import path from re import match from lib import const from . import ssh, sftp from hashlib import sha256 from time import time, sleep from os import urandom, path from threading import Thread from datetime import datet...
Hover.py
#!/usr/bin/env python import rospy import tf from crazyflie_driver.msg import Hover from std_msgs.msg import Empty from crazyflie_driver.srv import UpdateParams from threading import Thread class Crazyflie: def __init__(self, prefix): self.prefix = prefix worldFrame = rospy.get_param("~worldFrame...
attacker.py
from surrogate import * def pseudo_gaussian_pert_rectangles(x, y): delta = np.zeros([x, y]) x_c, y_c = x // 2 + 1, y // 2 + 1 counter2 = [x_c - 1, y_c - 1] for counter in range(0, max(x_c, y_c)): delta[max(counter2[0], 0):min(counter2[0] + (2 * counter + 1), x), max(0, counter2[...
galleryscreen.py
from kivy.app import App from kivy.uix.screenmanager import Screen from kivy.properties import StringProperty, ListProperty, NumericProperty, ObjectProperty from kivy.properties import BooleanProperty, DictProperty from kivy.clock import Clock import urllib from kivy.network.urlrequest import UrlRequest from kivymd.sna...
anim_test_old.py
from rpi_ws281x import Color, PixelStrip, ws import time from threading import Thread import random # LED strip configuration: LED_COUNT = 2304 # Number of LED pixels. LED_PIN = 18 # GPIO pin connected to the pixels (must support PWM!). LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 8...
test_filters.py
''' Some tests for filters ''' from __future__ import division, print_function, absolute_import import sys import numpy as np from numpy.testing import (assert_equal, assert_allclose, assert_array_equal, assert_almost_equal, suppress_warnings) from pytest import r...
test_client.py
import asyncio import concurrent.futures import copy import datetime import functools import os import re import threading import warnings from base64 import b64decode, b64encode from queue import Empty from unittest.mock import MagicMock, Mock import nbformat import pytest import xmltodict # type: ignore from ipytho...
ib_gateway.py
""" Please install ibapi from Interactive Brokers github page. """ from copy import copy from datetime import datetime from queue import Empty from threading import Thread, Condition from ibapi import comm from ibapi.client import EClient from ibapi.common import MAX_MSG_LEN, NO_VALID_ID, OrderId, TickAttrib, TickerId...
estop.py
# Copyright (c) 2021 Boston Dynamics, Inc. All rights reserved. # # Downloading, reproducing, distributing or otherwise using the SDK Software # is subject to the terms and conditions of the Boston Dynamics Software # Development Kit License (20191101-BDSDK-SL). """Provides a very visible button to click to stop the ...
producer_consumer_model.py
# -*- coding: utf-8 import time import random from multiprocessing import Queue, Process def consumer(name, q): while True: res = q.get() time.sleep(random.randint(1, 3)) print '消费者》》%s 准备开吃%s。' % (name, res) def producer(name, q): for i in range(5): time.sle...
baseuse.py
# -*- coding:utf-8 -*- import time import threading """ 子线程创建的步骤: 1.导入模块: Threading 2. 使用threading.Thread() 创建对象:子线程对象. 3. 指定子线程执行的分支. 4. 启动子线程,线程对象:.start() """ # 定义函数 def sayhello(): print("hello Beautiful girl") # 调用函数,单线程方式: if __name__=="__main__": for i in range(3): # 创建对象(子线程对象) # 指定子...
stress_test.py
import threading from socket import * import sys import os portno = int(input()) serverName = '127.0.0.1' def get_req(portno): clientsocket = socket(AF_INET, SOCK_STREAM) clientsocket.connect((serverName, portno)) file = ['/index.html','/proxy/proxyfile.html','form.html'] req = "GET /form.html HTTP/1.1...
serial_device.py
# Copyright (c) 2009-2021 Arm Limited # SPDX-License-Identifier: Apache-2.0 # # 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 ...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum import Wallet, WalletStorage from electrum.util import UserCancelled, InvalidPassword from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET from elec...
networking.py
""" Defines helper methods useful for setting up ports, launching servers, and handling `ngrok` """ import os import socket import threading from flask import Flask, request, jsonify, abort, send_file, render_template, redirect from flask_cachebuster import CacheBuster from flask_login import LoginManager, login_user,...
flask_ngrok.py
import os import json import time import atexit import shutil import logging import zipfile import platform import tempfile import subprocess from pathlib import Path from threading import Thread import requests from ...exceptions import BentoMLException logger = logging.getLogger(__name__) def _get_command(): ...
passive_operations.py
#!/usr/bin/env python3 #/******************************************************************************* # Copyright (c) 2012 IBM Corp. # 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 # ...
MultiThreadEngine.py
from engine import AbstractEngine from alignment import AbstractAlignment from tools import ConfigUtils, ConfigConsts, FileUtils from tqdm import tqdm from multiprocessing import Process, Manager, cpu_count import logging class MultiThreadEngine(AbstractEngine): def initialize(self, config_utils : ConfigUtil...
spider.py
from multiprocessing import Process from bs4 import BeautifulSoup import requests from tqdm import tqdm import time from datetime import datetime, date import random import config import pymongo import gc from gevent import monkey monkey.patch_socket() import gevent class NeteaseSpider: def __init__(self): ...
qrTest.py
import pyqrcode from Tkinter import * import os import sys import requests import json import time import signal import multiprocessing as mp import requests import ed25519 from kit.controller import Controller from kit.file import read_file from kit.codec import decode, encode from kit.crypto import decrypt, encrypt ...
spider.py
from .request import * import urllib import time import threading class Spider(): """ Spider爬虫类 用于爬取数据 """ def __init__(self,web_link,step=1,**kwargs): self.kwargs = kwargs self.step = step if isinstance(web_link,(list,tuple)): self.web_link = w...
server.py
import socket import threading userdata = {} # To store the username and client-Address SERVER_IP = socket.gethostbyname(socket.gethostname()) PORT = 6969 HEADER = 64 # It is nothing but buffer size server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, ...
test_carbonlookaside_route.py
# Copyright (c) 2015-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the LICENSE # file in the root directory of this source tree. from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals...
email.py
from threading import Thread from flask import current_app, render_template from flask_mail import Message from app import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(to, subject, template, **kw): """ :param to: 收件人地址 :param subject: 邮件主题 ...
test_params.py
import os import threading import time import tempfile import shutil import stat import unittest from common.params import Params, UnknownKeyName, put_nonblocking class TestParams(unittest.TestCase): def setUp(self): self.tmpdir = tempfile.mkdtemp() print("using", self.tmpdir) self.params = Params(self....
conftest.py
import requests_mock import os from click.testing import CliRunner import pytest from wandb.history import History from tests.api_mocks import * import wandb from wandb import wandb_run from wandb.apis import InternalApi import six import json import sys import threading import logging from multiprocessing import Proce...
qbitcookiefeeder.py
import os import time import toml import logging import subprocess from queue import Queue from threading import Thread import qbittorrentapi config = toml.load(os.path.join(os.path.dirname(__file__), "config.toml")) logging.basicConfig( filename=os.path.join(os.path.dirname(__file__), "qbitcookiefeeder.log"), ...
TestThreadingLocal.py
"""Test the ThreadingLocal module.""" import unittest from threading import Thread from DBUtils.PersistentDB import local __version__ = '1.3' class TestThreadingLocal(unittest.TestCase): def test0_GetAttr(self): mydata = local() mydata.number = 42 self.assertEqual(mydata.number, 42) ...
compiler_test.py
# Copyright 2020 Google LLC. 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 applicable law or a...
testAlgorithms.py
import cv2 import math import pandas as pd import numpy as np import time, sys, os, shutil import yaml from multiprocessing import Process, Queue from Queue import Empty import random import imageFeatures as imf import pickle from sklearn import gaussian_process """ # This script collects data if len(sys.argv) < 2: ...
p4runtime.py
# Copyright 2019 Barefoot Networks, 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...
val.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Validate a trained YOLOv5 model accuracy on a custom dataset Usage: $ python path/to/val.py --weights yolov5s.pt --data coco128.yaml --img 640 Usage - formats: $ python path/to/val.py --weights yolov5s.pt # PyTorch ...
wsgi_autoreload.py
import os import time import threading from klaus import make_app # Shared state between poller and application wrapper class _: #: the real WSGI app inner_app = None should_reload = True def poll_for_changes(interval, dir): """ Polls `dir` for changes every `interval` seconds and sets `should_r...
settings.py
import json from pathlib import Path, PurePosixPath from threading import Thread class Settings: def __init__(self): self.settings_path = Path('settings.json') if self.settings_path.exists(): self.settings = json.load(self.settings_path.open()) self.lesson_path = Path(self....
process.py
#!/usr/bin/env python3 # coding: utf-8 import os import threading import queue import time import traceback import datetime from typing import Sequence, Optional, List, Dict, Any, Tuple, Set, Generator, Union #from machaon.action import ActionInvocation from machaon.core.object import Object, ObjectCollection from mac...
FakeEKM.py
#!/usr/bin/env python3 from sqlalchemy import create_engine, text import pymysql as mysql import pymysql.err as Error import time import datetime from datetime import date from datetime import timedelta from datetime import datetime import os import argparse import sys import random import configparser import logging ...
adb_server.py
# Copyright (C) 2013-2014 Sony Mobile Communications AB. # All rights, including trade secret rights, reserved. import os import json import time import errno import socket import traceback import signal import vcsjob import ave.cmd from ave.network.connection import find_free_port from ave.network.process import...
http.py
import urllib.request import urllib.parse import threading import sublime from PyV8 import JSObject, JSArray, JSFunction from SublimeJS.v8 import getContext, convert class Http: def request(self, options, callback=None): def _call(host, port, auth, method, path, data='', headers={}, callback=None, *args): data ...
nng.py
""" Provides a Pythonic interface to cffi nng bindings """ import logging import weakref import threading from ._nng import ffi, lib from .exceptions import check_err, ConnectionRefused from . import options from . import _aio logger = logging.getLogger(__name__) # a mapping of id(sock): sock for use in callbacks...
dask.py
# pylint: disable=too-many-arguments, too-many-locals # pylint: disable=missing-class-docstring, invalid-name # pylint: disable=too-many-lines """Dask extensions for distributed training. See https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple tutorial. Also xgboost/demo/dask for some examples. Th...
task.py
from __future__ import annotations import os import signal import subprocess as sp from enum import Enum, auto from threading import Thread from typing import Callable, List from pyutils import exc from .util import find_executable, kill # Public classes class OutputAction(Enum): """Output actions.""" PRI...
example0.py
#!/usr/bin/env python3 import threading def worker(): print('new worker') for i in range(8): threading.Thread(target = worker).start()
soundDemo.py
import sys from subprocess import Popen, PIPE from threading import Thread from Queue import Queue, Empty from subprocess import call import binascii import time import signal import matplotlib.mlab as mlab import numpy as np import pandas as pd import heapq from scipy import signal import json from requests impo...
vl_device_http.py
"""ViraLink HTTP API device module.""" import threading import logging import queue import time import typing from datetime import datetime, timezone from sdk_utils import verify_checksum import requests from math import ceil FW_CHECKSUM_ATTR = "fw_checksum" FW_CHECKSUM_ALG_ATTR = "fw_checksum_algorithm" FW_SIZE_ATTR...
test_tmuxpair.py
"""Collection of tests for tmuxpair.py""" from distutils.version import LooseVersion from textwrap import dedent from copy import copy from multiprocessing import Process import subprocess import shutil import os import time import signal import filecmp import tmuxpair from click.testing import CliRunner import sshkeys...
lisp-itr.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
example.code.py
from flask import Flask, request, render_template_string, jsonify import datetime import time import threading app = Flask(__name__) running = False # to control loop in thread value = 0 def rpi_function(): global value print('start of thread') while running: # global variable to stop loop ...
recorder.py
import cv2 import numpy as np import pyautogui from tkinter import * from multiprocessing import Process import multiprocessing as mp from time import time from random import randint import pyaudio import wave def update_time_text(): if (state): global timer timer[2] += 1 ...
main.py
import os import socketserver import loader import sys import time import logging import dlauncher from multiprocessing import Process, Pipe class LauncherServer(socketserver.StreamRequestHandler): def __init__(self, *args, **kargs): super(LauncherServer, self).__init__(*args, **kargs) def setup(self):...
draw_map.py
#!/usr/bin/env python import rospy from utils import Turtle from utils import World from utils import draw import math from multiprocessing import Process def node(turtle_name, indx, step, no_turtles, world): x = 0.0 y_start = indx*(world.window_height/no_turtles) y_end = (indx+1)*(world.window_height/no...
Gy.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import io,os,re,ast,six,sys,glob,json,time,timeit,codecs,random,shutil,urllib,urllib2,urllib3,goslate,html5lib,requests,threading,wikipedia,subprocess,googletrans ,pytz from gtts import gTTS from random import...
mykafka.py
""" This library abstracts away all the work required to plumb in the kafka library. """ import atexit import logging import kafka import queue import threading mailbox = queue.Queue() consumer = None producer = None class NotInitializedException(Exception): pass @atexit.register def _at_close(): """ Cle...
comm.py
""" comm.py: This is the F prime communications adapter. This allows the F prime ground tool suite to interact with running F prime deployments that exist on the other end of a "wire" (some communication bus). This is done with the following mechanics: 1. An adapter is instantiated to handle "read" and "write" functi...
bigquery_archiver.py
""" Copyright 2018 zulily, 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, software d...
accumulators.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...
task.py
import atexit import json import os import shutil import signal import sys import threading import time from argparse import ArgumentParser from logging import getLogger from operator import attrgetter from tempfile import mkstemp, mkdtemp from zipfile import ZipFile, ZIP_DEFLATED try: # noinspection PyCompatibili...
asio_chat_client_test.py
import re import os import sys from socket import * from threading import Thread import time # this is a test case write with tiny-test-fw. # to run test cases outside tiny-test-fw, # we need to set environment variable `TEST_FW_PATH`, # then get and insert `TEST_FW_PATH` to sys path before import FW module test_fw_pa...