source
stringlengths
3
86
python
stringlengths
75
1.04M
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ILI9341 lib: # Copyright (c) 2014 Adafruit Industries # Author: Tony DiCola # # 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 restrict...
fn_api_runner.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...
run_install.py
#!/usr/bin/env python3 import http.server import os from os.path import abspath, dirname, join import pathlib import shutil import sys import subprocess import threading import tempfile import zipfile def create_artifact_path(path, group_id, artifact_id, version, classifier): components = group_id.split(".") + [...
__init__.py
#from joblib import Parallel, delayed import numpy as np from thesdk import * import multiprocessing from functools import reduce from f2_signal_gen import * from f2_signal_gen import * from f2_channel import * from f2_rx import * from f2_adc import * from segmented_dac import * from f2_dsp import * from f2_util_classe...
tools.py
# standard library imports import math import os import socket import struct import time from pathlib import Path from threading import Lock, Thread # third-party imports import cv2 import numpy as np # local imports from tmrl.config.config_constants import LIDAR_BLACK_THRESHOLD class TM2020OpenPlanetClient: de...
core_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...
serve.py
# -*- coding: utf-8 -*- from __future__ import print_function import abc import argparse import json import logging import os import platform import signal import socket import subprocess import sys import threading import time import traceback from six.moves import urllib import uuid from collections import defaultd...
utils.py
import logging import threading import functools import coloredlogs from qtpy.QtCore import QtInfoMsg, QtWarningMsg, QtCriticalMsg def qt_message_handler(mode, context, message): logger = logging.getLogger("QT Logger") """Qt errors handler""" if mode == QtInfoMsg: mode = 20 elif mode == QtWarn...
tests.py
import threading import time from unittest import mock from multiple_database.routers import TestRouter from django.core.exceptions import FieldError from django.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from django.test import ( Transact...
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #TODO # yellow - normal connection # red - if possible presence of malware or blacklisted IP addr # if warning, notification via pynotify # + scapy module for sniffing ? #TODO asap # check traceroute backup and replot them when reseting map (new loop feature) # check threa...
job.py
import time from threading import Thread, get_ident, enumerate from .local_db import user_exist, delete_user, get_user, update_user, db_create_user from .utils import create_db_process def run_job(user): workThread = Thread(target=create_db_process, args=(user,)) workThread.start() def get_result(user): ...
AudioToVideo.py
#!/usr/bin/env python import ffmpy import multiprocessing from tkinter.filedialog import askopenfilename, asksaveasfile from tkinter import Text from tkinter import * import os class App(): def __init__(self, master): # Init stuff frame = Frame(master) master.minsize(width=400...
plugins.py
import os import pickle import hashlib import io import json import zipfile import shutil import tempfile import threading import configparser import logging import sys import semver import time from datetime import datetime import multiprocessing import cherrypy from colorama import Fore from docopt import docopt fro...
__main__.py
#!/usr/bin/env python3 """ This module contains the entry point for the CLI script and the PyPI console script """ import argparse import yaml import logging from multiprocessing import Process, Queue from scrubdash.asyncio_server.asyncio_server import AsyncioServer from scrubdash.dash_server.dash_server import star...
rcpy_bare_minimum_thread.py
#!/usr/bin/env python3 # import python libraries import time import threading # import rcpy library # This automatically initizalizes the robotics cape import rcpy import rcpy.mpu9250 as mpu9250 # function to run on a thread def thread_function(imu, name): # make sure the thread will terminate while rcpy.ge...
mucstability.py
""" This file is part of SleekBot. http://github.com/hgrecco/SleekBot See the README file for more information. """ import logging import threading from sleekxmpp.xmlstream.handler.callback import Callback from sleekxmpp.xmlstream.matcher.xmlmask import MatchXMLMask from sleekbot.plugbot import BotPlugin MA...
thread_pool.py
# Copyright: 2011 Brian Harring <ferringb@gmail.com> # License: GPL2/BSD 3 clause import threading import Queue from snakeoil import compatibility from snakeoil.demandload import demandload demandload( 'snakeoil.process:get_proc_count', ) def reclaim_threads(threads): for x in threads: try: ...
no_notebook.py
from .vpython import GlowWidget, baseObj, vector, canvas, _browsertype from ._notebook_helpers import _in_spyder, _undo_vpython_import_in_spyder from http.server import BaseHTTPRequestHandler, HTTPServer import os import platform import sys import threading import json import webbrowser as _webbrowser import asyncio f...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Ferretcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt 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...
_stream_thread.py
""" Kafka consumer poll thread """ import logging import threading from enum import Enum from confluent_kafka import KafkaError from ._stream_task import StreamTask class StreamThread: """ Stream thread states are the possible states that a stream thread can be in. A thread must only be in one st...
gmail_api.py
from flask import session, jsonify import google.oauth2.credentials from googleapiclient.discovery import build from googleapiclient.errors import HttpError # from oauth2client.clientsecrets import InvalidClientSecretsError import google_auth_oauthlib.flow from bs4 import BeautifulSoup from email.mime.multipart ...
comms.py
''' Serial communications support for Hackflight GCS Copyright (C) Simon D. Levy 2021 MIT License ''' from serial import Serial from threading import Thread BAUD = 115200 class Comms: def __init__(self, gcs): self.gcs = gcs portname = gcs.portsvar.get() baud = BAUD self.p...
clientserver.py
# -*- coding: UTF-8 -*- """Module that implements a different threading model between a Java Virtual Machine a Python interpreter. In this model, Java and Python can exchange resquests and responses in the same thread. For example, if a request is started in a Java UI thread and the Python code calls some Java code, t...
test_search.py
import threading import time import pytest import random import numpy as np from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks prefix = "search_collection" d...
mappfinder.py
###mappfinder #Copyright 2005-2008 J. David Gladstone Institutes, San Francisco California #Author Nathan Salomonis - nsalomonis@gmail.com #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 Softwar...
analysis_submission.py
##################################################################### # # # /analysis_submission.py # # # # Copyright 2013, Monash University ...
eval_multipro.py
# System libs import os import argparse from distutils.version import LooseVersion from multiprocessing import Queue, Process # Numerical libs import numpy as np import math import torch import torch.nn as nn from scipy.io import loadmat # Our libs from config import cfg from dataset import ValDataset from models impor...
serve_tei.py
import http.server as server import threading import shutil import socketserver from pathlib import Path import os import platform import sys def start_tei_server(tei_repo_dir, main_dir, httpd, PORT): tei_repo_dir = Path(tei_repo_dir).as_posix() main_dir = Path(main_dir).as_posix() try: shutil.cop...
common_utils.py
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
test_docxmlrpc.py
from xmlrpc.server import DocXMLRPCServer import http.client import sys from test import support threading = support.import_module('threading') import time import socket import unittest PORT = None def make_request_and_skipIf(condition, reason): # If we skip the test, we have to make a request because # the s...
connection.py
""" bjson/connection.py Asynchronous Bidirectional JSON-RPC protocol implementation over TCP/IP Copyright (c) 2010 David Martinez Marti All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ...
log_server.py
""" Log Server ========== """ import logging import threading import attr import msgpack import pytest import zmq from pytestskipmarkers.utils import platform from pytestskipmarkers.utils import ports from saltfactories.utils import time log = logging.getLogger(__name__) @attr.s(kw_only=True, slots=True, hash=True...
berry.py
# -*- coding: utf-8 -*- import os, sys import collections import itertools import queue import threading import time import pyberryimu.client from ..core import config, exc, logging, utils log = logging.logger(__package__) from . import remote # # This controller is trying to have the robot get as clo...
subdomain_brute.py
from termcolor import colored from requests.packages.urllib3.exceptions import InsecureRequestWarning import os, os.path, requests, argparse, threading, time from tqdm import tqdm class Error(Exception): pass def verify(wordlist, domain, threads, output, hide_words): if os.path.exists(wordlist): tqdm....
distributor.py
""" Classes for multiprocess job running. """ import os import logging import multiprocess as mp from tqdm import tqdm class _DummyBar: def __init__(self, *args, **kwargs): _ = args, kwargs self.n = 0 self.total = None def set_description(self, *args, **kwargs): pass def ...
script_api.py
from __future__ import print_function import os import json import base64 from multiprocessing import Process import hashlib import webbrowser import warnings from .GanjaScene import GanjaScene from .color import Color CEFAVAILABLE = False try: from .cefwindow import * CEFAVAILABLE = True except: warnin...
WebFuzzer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This material is part of "The Fuzzing Book". # Web site: https://www.fuzzingbook.org/html/WebFuzzer.html # Last change: 2020-10-13 15:12:24+02:00 # #!/ # Copyright (c) 2018-2020 CISPA, Saarland University, authors, and contributors # # Permission is hereby granted, free...
revocation_notifier.py
#!/usr/bin/env python ''' DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclu...
saltmod.py
""" Control the Salt command interface ================================== This state is intended for use from the Salt Master. It provides access to sending commands down to minions as well as access to executing master-side modules. These state functions wrap Salt's :ref:`Python API <python-api>`. .. versionadde...
server_code.py
import socket from threading import Thread SERVER_HOST = "0.0.0.0" SERVER_PORT = 5002 separator_token = "<SEP>" client_sockets = set() s = socket.socket() s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((SERVER_HOST, SERVER_PORT)) s.listen(5) print(f"[*] Listening as {SERVER_HOST}:{SERVER_P...
fields.py
import re from pathlib import Path from threading import Thread from lxml.html.clean import Cleaner from lxml.etree import ParserError from django.conf import settings from django.core.files.storage import FileSystemStorage from django.db import models from django.db.models.signals import post_delete from .widgets i...
smtclient.py
# Copyright 2017,2020 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agr...
Spec.py
# -*- coding: utf-8 -*- import glob import io import sys import os from collections import defaultdict, OrderedDict from datetime import datetime from . import biblio from . import boilerplate from . import caniuse from . import dfns from . import mdnspeclinks from . import conditional from . import config from . im...
dataloader_webcam_my.py
import os import torch from torch.autograd import Variable import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image, ImageDraw from SPPE.src.utils.img import load_image, cropBox, im_to_torch from opt import opt from yolo.preprocess import prep_image, prep_frame, inp_to_image fro...
test_server_async.py
#!/usr/bin/env python3 import unittest import pytest from unittest.mock import patch, Mock, MagicMock from pymodbus.device import ModbusDeviceIdentification from pymodbus.server.asynchronous import ModbusTcpProtocol, ModbusUdpProtocol from pymodbus.server.asynchronous import ModbusServerFactory from pymodbus.server.asy...
scheduler.py
""":mod:`news.scheduler` --- Scheduler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides a scheduler class that will run news cover celery tasks. """ import time import threading import schedule as pusher from contextlib import contextmanager from celery import Task, states from .cover import Cover from .mapping import...
test_req_rep.py
import unittest from multiprocessing import Process from nanoservice import Responder from nanoservice import Requester from nanoservice import encoder from nanoservice import Authenticator class BaseTestCase(unittest.TestCase): def setUp(self): self.addr = 'ipc:///tmp/test-reqprep.sock' def tearDo...
WrappedRocGraphsWindow.py
import pickle import threading from PyQt5.QtCore import QTimer, QEventLoop from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import ( QWidget, QToolTip, QPushButton, QApplication, QMessageBox, ) from .RocGraphsWindow import RocGraphsWindow from ..utils import remove_if_exists from ..WaitingSpinnerWi...
_cancel_many_calls_test.py
# Copyright 2016 gRPC 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 writing...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil import cereal.messaging as messaging from cereal import log from common.dict_helpers import strip_d...
main.py
#!/usr/bin/env python3 """Provide the main point of entry.""" import argparse import contextlib import datetime import enum import math import pathlib import re import threading from typing import Any, Callable, Optional, Sequence, Tuple import cv2 import numpy as np import mediti_collector.announce _VALID_IDENTIFI...
gps_pub.py
#!/usr/bin/env python import serial import types import re import rospy import time import threading from datetime import datetime from shipcon.msg import gps_position from shipcon.msg import gps_local_position from shipcon.msg import gps_navinfo from shipcon.msg import gps_time #Constants--------------------------...
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...
autohdmap_lane_start_all.py
# -*- coding: utf-8 -*- from base.log import * import os from multiprocessing import Process import redis_pool def gen_id(): r = redis_pool.get('dornaemon') return r.incr('deploy_id') def do(deploy_id): log_path = 'html/deploy_logs/%d.txt' % deploy_id print '%s' % (log_path) cmd = "ansible-playbook -i /home/op...
test_serve.py
import time from multiprocessing import Process from unittest import TestCase from unittest.mock import Mock import requests from openbrokerapi import api from openbrokerapi.catalog import ServicePlan from openbrokerapi.service_broker import Service, ProvisionedServiceSpec, ServiceBroker, DeprovisionDetails, \ De...
scripts_runner.py
from pyto import Python, PyOutputHelper, ConsoleViewController, EditorViewController, __Class__ from time import sleep from console import run_script from rubicon.objc import ObjCClass, objc_method, NSObject import threading import traceback import stopit import sys import os import ctypes import gc import __pyto_ui_ga...
AMPI.py
#!/usr/bin/python3 """ Main AMPI code """ from __future__ import unicode_literals from cfg import * import json import sys, atexit, signal from socketIO_client import SocketIO from modules.ampi_backend import * from time import time, sleep from threading import Thread from subprocess import run from modules.rotaryenc...
tinychain.py
#!/usr/bin/env python3 """ ⛼ tinychain putting the rough in "rough consensus" Some terminology: - Chain: an ordered list of Blocks, each of which refers to the last and cryptographically preserves a history of Transactions. - Transaction (or tx or txn): a list of inputs (i.e. past outputs being spent) ...
threading.py
import threading import datetime from queue import Queue from random import randint import re import sys import traceback import inspect from datetime import timedelta import logging from appdaemon import utils as utils from appdaemon.appdaemon import AppDaemon class Threading: def __init__(self, ad: AppDaemon, ...
server.py
import time from flask import Flask from flask import Response import RPi.GPIO as GPIO GPIO.cleanup() GPIO.setmode(GPIO.BCM) switchPin = 3 GPIO.setup(switchPin, GPIO.OUT) GPIO.output(switchPin, GPIO.LOW) from threading import Thread app = Flask(__name__) switching = False password="op" def high(): global swi...
interactive.py
import asyncio import logging import os import tempfile import textwrap import uuid from functools import partial from multiprocessing import Process from typing import Any, Callable, Dict, List, Optional, Text, Tuple, Union, Set import numpy as np from aiohttp import ClientError from colorclass import Color from rasa...
manager.py
#!/usr/bin/env python3 import datetime import os import signal import subprocess import sys import traceback from multiprocessing import Process import cereal.messaging as messaging import selfdrive.crash as crash from common.basedir import BASEDIR from common.params import Params, ParamKeyType from common.text_window...
SynTestFrame.py
# for python3.4 import ctypes import queue import random import sys import threading import time from multiprocessing import Process, Queue, \ sharedctypes, Lock, Event import os_2 from PyQt4 import QtGui, QtCore ''' Synchronization Main Window ''' class MainWindow_Syn(QtGui.QMainWindow): ...
advanced-reboot.py
# # ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";...
main.py
import os from Subprocess import convert_video_720 from Subprocess import convert_video_480 import threading import queue import time def main(): q1 = queue.Queue() q2 = queue.Queue() inputPath = "/Users/leeseunghee/Documents/EC500/class_practice/Exercise2/videos" files = os.listdir(inputPath) for file in f...
fake_backend.py
import asyncio import gzip import json import socket import sys import threading from collections import OrderedDict, defaultdict from contextlib import contextmanager from queue import Queue from google.protobuf import json_format from sanic import Sanic, response from signalfx.generated_protocol_buffers import signa...
judgeManager.py
from Judger_Core.config import * from JudgerResult import * from Judger_Core.Compiler.Compiler import compiler from Judger_Core.classic_judger import ClassicJudger from Judger_Data import ProblemConfig, Group, Detail import multiprocessing import subprocess import os.path class JudgeManager: def judge(self, ...
subprocess_env_manager.py
import logging from typing import Dict, NamedTuple, List, Any, Optional, Callable, Set import cloudpickle from mlagents.envs.environment import UnityEnvironment from mlagents.envs.exception import UnityCommunicationException, UnityTimeOutException from multiprocessing import Process, Pipe, Queue from multiprocessing.c...
client_test.py
# Copyright 2020 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 applicable ...
factories.py
# -*- coding: utf-8 -*- import collections import logging import logging.config import sys import threading import selenium.webdriver from selenium.webdriver.support.wait import WebDriverWait from . import exceptions from . import scrapers from .infrastructure import producing from roomlistwatcher.common import auto...
test_dataloader.py
import math import sys import errno import os import ctypes import faulthandler import torch import gc import time import signal import unittest import itertools import warnings import tempfile from torch import multiprocessing as mp from torch.utils.data import ( ChainDataset, ConcatDataset, DataLoader, ...
file_system_cache_test.py
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
test_manager.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...
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...
mariadbManager.py
from contextlib import closing import asyncio import logging import subprocess import json import importlib from contextlib import closing import argparse import multiprocessing from io import StringIO import traceback import sys import time from datetime import datetime import os import pymysql import boto3 import a...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Fujicoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test fujicoind shutdown.""" from test_framework.test_framework import FujicoinTestFramework from test...
proxy_scraper_checker.py
# -*- coding: utf-8 -*- from ipaddress import IPv4Address from threading import Thread from time import sleep from typing import Union from maxminddb import open_database from requests import get class ProxyScraperChecker(object): def __init__( self, anonymous_only: bool = False, geolocat...
gps_sync_updated.py
import pickle as pickle import socket from multiprocessing import Process, Queue, Value, Manager from ctypes import c_char_p import time import util_gps # TCP_IP = '127.0.0.1' TCP_IP = '0.0.0.0' # s = 0 # MAX_WORKERS = 0 # global_var_vals = None # # # FLAGS = tf.app.flags.FLAGS # # # # tf.app.flags.DEFINE_string('trai...
reference_test.py
import unittest import collections import time import redis import threading import phonon.connections import phonon.reference class ReferenceTest(unittest.TestCase): def setUp(self): self.client = redis.StrictRedis(host='localhost') self.client.flushall() self.conn = phonon.connections....
utils.py
# Copyright 2012-present MongoDB, 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 wri...
main_panel.py
import sys import easygui import os import threading from Panel import GUI_Panel, all_airPort, NetCheck_panel from config import ROOT_DATABASE, TITLE home_list = ['[1]查看机场生态', '[2]获取订阅链接', '[3]检查网络状态', '[4]检查版本更新', '[5]退出', ] def INIT_USER_AGENT(): """ 将伪装请求头文件写入系统缓存,不执行该初始化步骤 fake-useragent库将发生致命错误 :re...
FuzzingInTheLarge.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # This material is part of "The Fuzzing Book". # Web site: https://www.fuzzingbook.org/html/FuzzingInTheLarge.html # Last change: 2019-05-21 19:58:03+02:00 # #!/ # Copyright (c) 2018-2020 CISPA, Saarland University, authors, and contributors # # Permission is hereby grant...
test_search_20.py
import multiprocessing import numbers import pytest from time import sleep from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.util_pymilvus import...
eventlogging_test.py
# noinspection PyUnresolvedReferences # # The noinspection comment above is to tell PyCharm that the import below # is important, and cannot be deleted during import optimizations, # even if it's not referenced within the code. import testcontext # This must be the first import. import io import json import threading...
twisted_test.py
# Author: Ovidiu Predescu # Date: July 2011 # # 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 ...
reid_track_single_raspi.py
# -*- coding: utf-8 -*- # from __future__ import print_function, division import matplotlib.patches as patches import matplotlib.pyplot as plt import argparse import torch import torch.nn as nn import torch.optim as optim from torch.optim import lr_scheduler from torch.autograd import Variable import torch.backends.cu...
game.py
# Copyright (c) 2011, Adam Parrish <adam@decontextualize.com> # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" A...
test_web.py
import json import requests import threading import time import random import numpy as np """ 多线程测试接口的并发效率 """ data = { 'times': 1000, # 并发数 'url': 'http://localhost:1234/predict?sentence=感冒鼻子干有什么方法能快速解决' } def get_predict(): global RIGHT_NUM global ERROR_NUM try: result = requests.get(...
mixins.py
from __future__ import ( unicode_literals, print_function, absolute_import, division, ) nstr = str str = type('') import inspect import weakref from functools import wraps, partial from threading import Event from collections import deque from time import time try: from statistics import median...
dbipc.py
#!/usr/bin/python # Death by infinite paper cuts! # This program is designed to suss out a performance issue with GFS2. # Thus I can have a benchmark to work against. # Hypotheis: # Creating lots and lots of small files on gfs2 causes it massive indigestion # because of the distributed lock manager import os, sys, da...
heart_rate.py
#!/usr/bin/env python ## code by Alexandre Barachant ## modified by Pierre Karashchuk import numpy as np import matplotlib.pyplot as plt from scipy.signal import butter, filtfilt from time import time, sleep from pylsl import StreamInlet, resolve_byprop import seaborn as sns from threading import Thread from scipy impo...
send_text.py
#!/usr/bin/env python3 import __init__ import argparse import uuid import requests import signal from threading import Thread, Event from time import sleep from lib import get_components def work(event: Event, delay: float): print("Request thread started") while not event.is_set(): try: ...
download_without_tf.py
"""Utilities for file download and caching.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import csv import logging import logging.handlers import multiprocessing.pool import os import shutil import sys import tempfile import traceback from typing impor...
info.py
import os import imp import sys import time import threading import subprocess import socket print "Starting INFO script" # usb or sd card user_dir = os.getenv("USER_DIR", "/usbdrive") patch_dir = os.getenv("PATCH_DIR", "/usbdrive/Patches") fw_dir = os.getenv("FW_DIR", "/root") print "loading og module" # imports cu...
test_speaker.py
#!/usr/bin/env python import unittest import logging import os from multiprocessing import Process, Queue import random import sys import time sys.path.insert(0, os.path.abspath('..')) from context import Context from speaker import Speaker class SpeakerTests(unittest.TestCase): def test_stop(self): ...
main.py
#!/usr/bin/env python3 # coding: utf-8 import os import threading from getpass import getpass import extensions from network_tools import down_file, get_soup, login from submit_record import SubmitRecord __author__ = 'isac322' def get_solved_problems(sp): problems = set() """ 2021-03-02 아래 DOM 읽어오는...
pre_commit_linter.py
# coding: utf-8 # # Copyright 2014 The Oppia 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 requi...
diskcache_manager.py
from . import BaseLongCallbackManager _pending_value = "__$pending__" class DiskcacheLongCallbackManager(BaseLongCallbackManager): def __init__(self, cache, cache_by=None, expire=None): """ Long callback manager that runs callback logic in a subprocess and stores results on disk using dis...
test_go_feature_server.py
import socket import threading from contextlib import closing from typing import List import grpc import pytest from feast import FeatureService, ValueType from feast.embedded_go.online_features_service import EmbeddedOnlineFeatureServer from feast.feast_object import FeastObject from feast.protos.feast.serving.Servi...
trading_alert.py
import time import tkinter as tk from threading import Thread from tkinter import font import matplotlib.pyplot as plt from requests import ReadTimeout from trading_alert.base.main_window import MainWindow from trading_alert.binance_plot import PricePlot, mpf from datetime import datetime from trading_alert.trade.ac...