source
stringlengths
3
86
python
stringlengths
75
1.04M
test_bert_thor.py
# Copyright 2020-2021 Huawei Technologies Co., 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 applicable law or agre...
TesteVelocidade.py
""" ****TESTE DE VELOCIDADE**** Código desenvolvido com a finalidade de verificar a conexão com a internet e realizar uma quantidade de testes de velocidade espaçados por um intervalo. Os valores de "quantidade" e "intervalo" são pré-determinados pelo usuário antes da execução do teste. Além disso, foi elaborada...
role_maker.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional from PyQt5.QtCore i...
recipe-359874.py
import re, time, xmlrpclib from SimpleXMLRPCServer import * import threading class SomeState(object): def __init__(self): self.value = 0 CLASSES = [SomeState] TIMEOUT = 60.0 * 5.0 class Timeout: pass class InvalidId: pass class ObjectManager(object): """ ObjectManager s...
train.py
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 """Train""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import cv2 from datetime import datetime import os.path import sys import time import numpy as np from six.moves import xrange import tensorfl...
buildshard.py
"""Converts MSCOCO data to TFRecord file format with SequenceExample protos. The MSCOCO images are expected to reside in JPEG files located in the following directory structure: train/COCO_train2014_000000000151.jpg train/COCO_train2014_000000000260.jpg ... The MSCOCO annotations JSON files are expected ...
test_aea.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI 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 ...
joint_states_listener.py
#!/usr/bin/env python #spins off a thread to listen for joint_states messages #and provides the same information (or subsets of) as a service import roslib roslib.load_manifest('race_joint_states_listener') import rospy from race_joint_states_listener.srv import * from sensor_msgs.msg import JointState import threadin...
vop_pagnation.py
#!/usr/bin/python3 import sys import os import tempfile import argparse from threading import Thread sys.path.append("../../../") import hive_utils from hive_utils.resources.configini import config as configuration from hive_utils.resources.configini import validate_address # https://developers.hive.io/tutorials-r...
launch.py
#!/usr/bin/python2 """ (C) Copyright 2018-2019 Intel Corporation. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by appli...
bot.py
# -*- coding: utf-8 -*- import YYK import requests from YYK.lib.curve.ttypes import * from datetime import datetime import time,datetime,random,sys,re,os,json,subprocess,codecs,threading,glob cl = YYK.LINE() cl.login(token="EnR3VHxgGLTdlTFSyP28.wj+hgFH9yy5UGkxxf3dYoa.ZWFivXMScYaoGjc+XqzBiJY1wBGxOM1cSFcLQyEBeqI=") cl....
__init__.py
# Adapted from https://github.com/MoshiBin/ssdpy and https://github.com/ZeWaren/python-upnp-ssdp-example import socket import struct import time import threading class SSDPServer(): def __init__(self, fhdhr): self.fhdhr = fhdhr self.ssdp_handling = {} self.methods = [x for x in list(self...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest import unittest.mock from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform i...
config.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: r""" A Python module to maintain unique, run-wide *MRIQC* settings. This module implements the memory structures to keep a consistent, singleton config. Settings are passed across processes via filesystem,...
proFTPD_1.3.3c_exploit.py
import socket import sys import time import subprocess from threading import Thread from termcolor import cprint class Main(): def __init__(self): try: self.lhost = sys.argv[1] self.rhost = sys.argv[2] try: self.rport = int(sys.argv[3]) excep...
testing.py
from lab_2.djangomongo.helper import insert_random_messages, insert_random_users import lab_2.djangomongo.data.supplier as supplier # supplier.users.drop() # supplier.messages.drop() # insert_random_users(1000) import threading import multiprocessing from multiprocessing import Process from threading import Thread...
challenge36.py
#! /usr/bin/python # https://www.cryptopals.com/sets/5/challenges/36 #Implement Secure Remote Password (SRP) from random import randint from hashlib import sha256 import requests import sys N = 0xffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a...
file_processing.py
import os from multiprocessing import Process, Queue from pathlib import Path from rainbow import OPTICAL_FLOW_FILENAME from rainbow.data_analysis import analyze_data from rainbow.optical_flow.optical_flow import compute_optical_flow from rainbow.util import load_nd2_imgs, load_std_imgs from tqdm import tqdm SENTINE...
contextutil.py
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). import logging import os import shutil import sys import tempfile import termios import threading import zipfile from contextlib import contextmanager from queue import Queue from socketse...
myAlgo_2_server.py
""" post_data:lastRequest(the order number of last chunk) lastquality(0-5,0 is the lowest quality) lastChunkSize(bit,kb/1024) lastChunkStartTime(ms from 1970.1.1) lastChunkFinishTime(ms from 1970.1.1) buffer(s) bufferAdjust(buffer time except the chunk played now) RebufferTime(s) bandwidthEst(...
CSZLsuper.py
# -*- coding: utf-8 -*- #import win32api import tushare as ts import threading #from tkinter import * #import hashlib import pandas as pd from pandas import DataFrame import random import time import numpy as np import CSZLsuperGET import CSZLsuperTrain #====定义线程引用==== def Z_CSZL_superGETAllroutine(): CSZLsuper...
dag.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
showMainWindow.py
import os import sys import json import time import utils import useAdd import kuWoApi import showHTML import threading import traceback import displayOn import showAbout import main_class import cloudMusicApi import displayQRCode # from CUi import Ui_Form from ui_file.MainWindowCUI import Ui_MainWindow...
generatorify.py
import queue import threading import collections.abc class generator_from_callback(collections.abc.Generator): """ A generator wrapper for a function that invokes a callback multiple times. Calling `send` on the generator emits a value from one callback, and returns the next. Note this starts a ...
controller.py
#!/home/pi/code/pi_env/bin/python3 # Copyright 2020 Harlen Bains # linted using pylint # formatted using black # pylint: disable=duplicate-code """This script runs on the Raspberry Pi and sends commands to Arduinos. Once a command is sent it then waits a reply and then loops. """ import csv import shutil import subpro...
example_checkpointing_serial.py
""" .. module:: example_checkpointing_serial :synopsis: Example Checkpointing Serial .. moduleauthor:: David Eriksson <dme65@cornell.edu> """ import multiprocessing import os import time import numpy as np from poap.controller import SerialController from pySOT.controller import CheckpointController from pySOT.exp...
tornado_communicator.py
# Copyright 2021 Fedlearn 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 or agreed to in writi...
UDPPingerServer.py
# We will need the following module to generate randomized lost packets import random import socket import threading import time # Create a UDP socket # Notice the use of SOCK_DGRAM for UDP packets serverSocket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) # Assign IP address and port number to socket serverSocket...
main.py
import requests import threading import os import colorama from colorama import * import random import json import base64 import time isIdling = False isIdling2 = False config = {"threads": 10,"proxy_timeout": 6000,"guildId": "", "channelId": "", "channelName": "", "channelType": 0, "Message": "", "webho...
main.py
from multiprocessing import Process, Queue from pyiot.things import run_server from pyiot.app import main if __name__ == '__main__': print("in main", __name__) procs = list() queue = Queue() procs.append(Process(target=run_server, args=(queue, ))) procs.append(Process(target=main, args=(queue, ))) ...
decorators.py
# coding=utf-8 import base64 import copy import random import uuid from flask import request as flask_request # noinspection PyUnresolvedReferences from contextlib import contextmanager import functools import json import os import sys import threading import time import traceback import unittest from functools import...
main.py
#!/usr/bin/python3 import multiprocessing import time import random from Packet import * intro = ''' A, B, C are arranged in clockwise cyclic order SrcID for A = 10, B = 20, C = 30 Packets colors: Red(0), Blue(1), Green(2) ''' p = [] q = [] index_name_map = {0: 'A', 1: 'B', 2: 'C'} id_name_map = {10: 'A', 20: 'B', 3...
zeromq.py
""" Zeromq transport classes """ import errno import hashlib import logging import os import signal import sys import threading from random import randint import salt.auth import salt.crypt import salt.ext.tornado import salt.ext.tornado.concurrent import salt.ext.tornado.gen import salt.ext.tornado.ioloop import salt...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
smoke_test.py
#!/usr/bin/env python """Very sloppy Unix-only manual smoke test for cloudtail. It ensures cloudtail doesn't block stdin (and drops logs instead) and terminates fast enough, even if stuck retrying HTTP 429 errors. """ import contextlib import json import os import shutil import signal import subprocess import sys im...
gateway.py
#!/usr/bin/env python2 # coding: utf-8 # vk4xmpp gateway, v2.27 # © simpleApps, 2013 — 2014. # Program published under MIT license. import gc import httplib import logging import os import re import select import socket import signal import sqlite3 import sys import threading import time from copy import deepcopy co...
abinit_tasks.py
# coding: utf-8 """ Abinit Task classes for Fireworks. """ import inspect import subprocess import logging import time import shutil import json import threading import glob import os import errno import numpy as np import abipy.abio.input_tags as atags from collections import namedtuple, defaultdict from monty.json i...
test_c10d.py
import copy import math import operator import os import random import signal import sys import tempfile import threading import time import traceback import unittest from unittest import mock from contextlib import contextmanager from datetime import timedelta from functools import reduce from itertools import groupby...
test_run_and_rebot.py
import unittest import time import glob import sys import threading import tempfile import signal import logging from os.path import abspath, curdir, dirname, exists, join from os import chdir, getenv from robot import run, run_cli, rebot, rebot_cli from robot.model import SuiteVisitor from robot.running import namesp...
env.py
import argparse import logging import re from landia.registry import load_game_content, GameDef import gym from gym import spaces import logging from landia.runner import get_game_def, get_player_def, UDPHandler, GameUDPServer, LOG_LEVELS from landia.event import InputEvent import threading import sys from landia.play...
rtest.py
#!/usr/bin/python3 """Copyright 2021 Advanced Micro Devices, Inc. Run tests on build""" import re import os import sys import subprocess import shlex import argparse import pathlib import platform from genericpath import exists from fnmatch import fnmatchcase from xml.dom import minidom import multiprocessing import t...
TripAdvisorScrapev3 .py
import csv import multiprocessing import os import re import time import timeit import requests from bs4 import BeautifulSoup, Tag from fake_useragent import UserAgent from selenium import webdriver from unidecode import unidecode # dynamic pathname based on different device, instead of hard coding the p...
chat_runner.py
from mcpi.minecraft import Minecraft from mcpi.minecraft import ChatEvent import time import pycraft import importlib import sys from pycraft import Player import threading mc = pycraft.new_minecraft() def run_in_background(func, mc, player, kwargs): player.unlock() # TODO check if the function accepts the correct...
wsgi.py
""" WSGI config for tncProject project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/2.0/howto/deployment/wsgi/ """ import os import threading import requests import time from whitenoise.django import DjangoWh...
mbase.py
""" mbase module This module contains the base model class from which all of the other models inherit from. """ import abc import sys import os import shutil import threading import warnings import queue as Queue from datetime import datetime from shutil import which from subprocess import Popen, PIPE, STDOUT imp...
bolt.py
"""Base bolt classes.""" from __future__ import absolute_import, print_function, unicode_literals import logging import os import re import signal import sys import threading import time from collections import defaultdict, namedtuple from six import iteritems, itervalues, reraise from .component import Component, T...
1.tcp3.py
from multiprocessing.dummy import threading from socketserver import TCPServer, BaseRequestHandler class MyHandler(BaseRequestHandler): def handle(self): print(f"[来自{self.client_address}的消息:]\n") data = self.request.recv(2048) if data: print(data.decode("utf-8")) self.r...
marshal.py
# Copyright 2019 Atalaya Tech, 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, ...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including witho...
run.py
import os import threading import time import sys, getopt # this script should be executed in parent dir of scripts def client(i,results,loopTimes): print("client %d start" %i) command = "./scripts/run-single.sh -R -t " + str(loopTimes) r = os.popen(command) text = r.read() results[i] = text ...
aria2_download.py
from bot import aria2, download_dict_lock, STOP_DUPLICATE, TORRENT_DIRECT_LIMIT, TAR_UNZIP_LIMIT from bot.helper.mirror_utils.upload_utils.gdriveTools import GoogleDriveHelper from bot.helper.ext_utils.bot_utils import * from bot.helper.mirror_utils.status_utils.aria_download_status import AriaDownloadStatus from bot.h...
integration.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...
DebugMode.py
import os import pickle import threading import time from typing import Type, Collection from .Structures import Node, State, FoundSolution from .FrontierMode import FrontierMode STOP = False class DebugMode: def __init__( self, show_amount_solutions: bool, show_amount_nodes...
ex_workers.py
# # Simple example which uses a pool of workers to carry out some tasks. # # Notice that the results will probably not come out of the output # queue in the same in the same order as the corresponding tasks were # put on the input queue. If it is important to get the results back # in the original order then con...
basic_ops.py
"""An example of how basic operations like broadcast, scatter and all-reduce can be implemented.""" import os import torch import torch.distributed as dist import torch.multiprocessing as mp import common from common import DEVICES, InvalidDistributedOperationError OPERATION = common.BROADCAST def run(rank, size)...
Binance_Detect_Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
simpleclient.py
import sys, threading, time import socket, select import udpbroadcastlistener def appendBytes(data, append, LE=False): if LE: for b in reversed(append): data.append(int(b)) else: for b in append: data.append(int(b)) return data def appendInt(data, num, LE=True): ...
run_package.py
# Copyright 2018 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. """Contains a helper function for deploying and executing a packaged executable on a Target.""" from __future__ import print_function import common import ...
main.py
# Python VK Spotify integration. # Author: Kirill Zhosul (@kirillzhosul) # Importing modules. # Preinstalled libraries. import time import threading import requests import os # VK API. import vk_api import vk_api.utils from vk_api.exceptions import AuthError from vk_api.longpoll import VkLongPoll, VkEventType # Spo...
test_desktop_functions.py
from typing import Optional from pyvda import ( AppView, VirtualDesktop, get_virtual_desktops, get_apps_by_z_order, set_wallpaper_for_all_desktops ) import time import win32gui import threading current_window = AppView.current() current_desktop = VirtualDesktop.current() def test_move_and_go(): ...
local.py
"""Submission job for local jobs.""" # pylint: disable=invalid-name from __future__ import absolute_import import sys import os import subprocess import logging from threading import Thread from . import tracker def exec_cmd(cmd, role, taskid, pass_env): """Execute the command line command.""" if cmd[0].find(...
generate-syn-table.py
#!/usr/bin/env python # # Anas Katib # Dec 14, 2017 # from random import randint import sys from multiprocessing import Process import fileinput import os import time def create_part(filename, n, p, m, num_cols, cols_p): part_file = open(filename, "w") use_weighted_cols = False if (len(cols_p) > 0): ...
test_concurrency.py
import threading import time import unittest from uuid import uuid4 import pytest from limits.limits import RateLimitItemPerSecond from limits.storage import MemoryStorage from limits.strategies import FixedWindowRateLimiter, MovingWindowRateLimiter @pytest.mark.integration class ConcurrencyTests(unittest.TestCase)...
autoclick.py
from pynput.keyboard import Key, Listener from pynput.mouse import Button, Controller from time import sleep from sys import exit from threading import Thread def click_func(): global isCrafting global timeToStop while True: if timeToStop: return if isCrafting: mous...
main.py
"""A basic GUI for cblaster.""" import os import tempfile from threading import Thread, Event import subprocess from queue import Queue, Empty import PySimpleGUI as sg from cblaster import __version__ from cblaster.gui import ( search, makedb, citation, gne, extract, extract_clusters, plo...
test_threading.py
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose import random import re import sys import threading import thread import time import unittest import weakref # A trivial mutable counter. class Counter(object): def __init__(self): se...
learner.py
from typing import Tuple import glob import os import shutil import signal import threading import time from collections import OrderedDict, deque from os.path import join from queue import Empty, Queue, Full from threading import Thread import numpy as np import psutil import torch from torch.nn.utils.rnn import Pack...
views.py
from django.shortcuts import render from django.template import loader from datetime import datetime import requests import cv2 import numpy as np from django.http import StreamingHttpResponse import threading import os import time # Create your views here. PATH = '/home/pi/bestwo/BestTwo/CCTV/templates/resources/ima...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Hello, I am the joke bot & I am alive!" def run(): app.run(host='0.0.0.0', port=8080) def keep_alive(): th = Thread(target=run) th.start()
launch_data_pkt_sim.py
import time def load_config(): fin = open("host.config", "r") host_info = [] while True: try: host_name, host_mnet_pid = fin.readline().split()[0], int(fin.readline()) host_info.append((host_name, host_mnet_pid)) print(host_name, host_mnet_pid) except: ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test_webpack.py
import json import os import time from subprocess import call from threading import Thread import django from django.conf import settings from django.test import RequestFactory, TestCase from django.views.generic.base import TemplateView from django_jinja.builtins import DEFAULT_EXTENSIONS from unittest2 import skipIf...
uwsgiconfig.py
# uWSGI build system uwsgi_version = '2.0.17.1' import os import re import time uwsgi_os = os.uname()[0] uwsgi_os_k = re.split('[-+_]', os.uname()[2])[0] uwsgi_os_v = os.uname()[3] uwsgi_cpu = os.uname()[4] import sys import subprocess from threading import Thread,Lock from optparse import OptionParser try: fro...
biaffine_ner_model.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import os,time,json,threading import random, io import numpy as np from collections import defaultdict #import tensorflow as tf import tensorflow.compat.v1 as tf tf.compat.v1.disable_v2_behavior() import h5py ...
example_binance_us.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_binance_us.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://pypi.o...
webcam_demo_spatiotemporal_det.py
# Copyright (c) OpenMMLab. All rights reserved. """Webcam Spatio-Temporal Action Detection Demo. Some codes are based on https://github.com/facebookresearch/SlowFast """ import argparse import atexit import copy import logging import queue import threading import time from abc import ABCMeta, abstractmethod import c...
Remixatron.py
""" Classes for remixing audio files. (c) 2017 - Dave Rensin - dave@rensin.com This module contains classes for remixing audio files. It started as an attempt to re-create the amazing Infinite Jukebox (http://www.infinitejuke.com) created by Paul Lamere of Echo Nest. The InfiniteJukebox class can do it's processing i...
test_dispatcher.py
import errno import multiprocessing import os import platform import shutil import subprocess import sys import threading import warnings import inspect import pickle import weakref from itertools import chain from io import StringIO import numpy as np from numba import jit, generated_jit, typeof from numba.core impo...
udpopencv.py
''' Custom made UPDVideoCapture like cv2.VideoCapture ''' import threading import cv2 class UdpVideoCapture: def __init__(self, src=0, width=640, height=480): self.src = src self.cap = cv2.VideoCapture(self.src) self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width) self.cap.set(cv2.CAP_PRO...
mock_server.py
import json import logging import queue import traceback from http.server import HTTPServer, BaseHTTPRequestHandler from multiprocessing import Process, Queue from .pact_request_handler import PactRequestHandler _providers = {} log = logging.getLogger(__name__) def getMockServer(config): if config.provider_na...
usage_statistics.py
import atexit import datetime import json import logging import platform import signal import sys import threading from functools import wraps from queue import Queue import jsonschema import requests from great_expectations import __version__ as ge_version from great_expectations.core.usage_statistics.anonymizers.an...
aws-report-builder.py
#!/usr/bin/python import boto3 from prettytable import PrettyTable from flask import Flask, request, send_file, redirect, url_for, jsonify import datetime import pytz import threading import sys app = Flask(__name__) FLASK_PORT = 9001 # Decorator for threading #def threaded(f, daemon=False): # import Queue # # ...
main.py
import os import io import sys import time import datetime import copy import threading import signal import argparse import schedule from flask import Flask, jsonify from flask_restful import Resource, Api, reqparse from flask import send_file import matplotlib.pyplot as plt import numpy as np import in...
instance.py
import json import threading import time from .base import ClientBase class InstanceUtil: def __init__(self, client_base: ClientBase): self.client_base = client_base self.ip = None self.port = None self.serviceName = None self.kwargs = {} self.beat = None s...
app.py
#!/user/bin/env python # Copyright (c) 2017 VisualDL Authors. All Rights Reserve. # # 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 # # Unles...
main.py
import os import sys import RPi.GPIO as GPIO from time import sleep from rover import Rover from utils.keyboard import getch from utils.stream import start_stream, end_stream from utils.tracking import start_manager from multiprocessing import Process import psutil # right motor in1 = 13 in2 = 11 en1 = 15 # left moto...
test.py
import json import os.path as p import random import subprocess import threading import time from random import randrange import pika import pytest from google.protobuf.internal.encoder import _VarintBytes from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster from helpers.test_...
threespace_api.py
#!/usr/bin/env python2.7 from __future__ import print_function """ This module is an API module for ThreeSpace devices. The ThreeSpace API module is a collection of classes, functions, structures, and static variables use exclusivly for ThreeSpace devices. This module can be used with a system runn...
threadpool.py
# Copyright (c) 2005 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of c...
tests.py
from __future__ import unicode_literals from datetime import datetime import threading from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connections, DEFAULT_DB_ALIAS from django.db import DatabaseError from django.db.models.fields import Field, FieldDoesNotExist fro...
test.py
from pytube import YouTube from pytube import Playlist import threading import os.path import socket socket.setdefaulttimeout(30.0) def downThread(video_link): while True: if down(video_link): break else: print('retry') def down(video_link): try: y = YouTube(...
mqtt.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------# # Copyright © 2015-2016 VMware, Inc. All Rights Reserved. # # # # Licensed under the BSD 2-Clause License (the “License...
numba_example_multi_threading.py
#!/usr/bin/env python from __future__ import print_function, division, absolute_import import math import threading from timeit import repeat import numpy as np from numba import jit nthreads = 4 size = 1e6 def func_np(a, b): """ Control function using Numpy. """ return np.exp(2.1 * a + 3.2 * b) @j...
abstractwrapper.py
import abc from datetime import datetime import os.path import threading import zipfile from Quality.AtomicComputation.cp_qoi_system import CpQoiSystem from virtualisation.annotation.observationidgenerator import ObservationIDGenerator from virtualisation.misc.jsonobject import JSONObject from virtualisation.misc.log ...
task_consumer.py
# -*- coding:utf-8 -*- # @Author cc import json import multiprocessing import os import platform import signal import threading from multiprocessing import Process from py_log import get_logger from retrying import retry from leek import default_config, TaskPublisher from leek.custom_gevent import CustomGeventPoolEx...
train_and_eval_runner.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
app.py
# ElectrumSV - lightweight Bitcoin client # Copyright (C) 2019 ElectrumSV developers # # 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 ...
audio.py
from pydub import AudioSegment from pydub.playback import play import time import threading import random class SAudio(): def __init__(self, file): self.ref_file = AudioSegment.from_wav(file) self.p_file = self.ref_file self.SpeedChange(5.0) self.stop = False self.no_change = False self.pause...
test_nntplib.py
import io import socket import datetime import textwrap import unittest import functools import contextlib import os.path from test import support from nntplib import NNTP, GroupInfo import nntplib from unittest.mock import patch try: import ssl except ImportError: ssl = None try: import threading except Im...