source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
import argparse from datetime import datetime, timedelta from pathlib import Path import cv2 import numpy as np import depthai import time from tools import * from imutils.video import FPS import queue import threading parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", hel...
sdca_ops_test.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...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class, IPv6 and TLS # environment import ftplib import asyncore import asynchat import socket import StringIO import errno import os try: import ssl except ImportError: ssl = None from unittest import TestCase from test import t...
test_threaded_import.py
import _imp as imp import os import importlib import sys import time import shutil import unittest from test.support import verbose, import_module, run_unittest, TESTFN, reap_threads, forget, unlink, rmtree, start_threads threading = import_module('threading') def task(N, done, done_tasks, errors): try: i...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development team # 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 ...
sonar_v3_dev_daemon.py
# -*- coding: utf-8 -*- # Copyright 2017-2020 CERN # # 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...
example.py
import math import threading import time import matplotlib.pyplot as plt from PyYDLidar.PyYDLidar import LaserScan, YDLidarX4 def draw(): global is_plot while is_plot: plt.figure(1) plt.cla() plt.ylim(-2, 2) plt.xlim(-2, 2) plt.scatter(x, y, c='r', s=1) plt.p...
update_checker.py
import json import subprocess import threading from os import path from tempfile import gettempdir from tkinter import * from tkinter import ttk import requests from base_window import BaseWindow from files import __location__ from user_settings import UserSettings from windows_style_button import WindowsButton cla...
main.py
import packages import telebot from telebot import types import json import subprocess import threading import requests from remain_up import remain_up remain_up() bot = telebot.TeleBot("SET TOKEN") def run_php(): subprocess.call('php -S 0.0.0.0:5000', shell=True) def run_ngrok(): subprocess.call('./ngrok htt...
RobotCommandHandle.py
# Copyright 2021 Open Source Robotics Foundation, 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...
dag_processing.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...
ocs_end_of_night.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # + # import(s) # - from OcsGenericEntity import * import threading import os # + # function: ocs_end_of_night() # - def ocs_end_of_night(entity_name='', entity_object=None): # check input(s) if (not isinstance(entity_name, str) or entity_name == '') or (not en...
reporters.py
"""Basic result reporters.""" import csv import json import pickle import signal from collections import defaultdict from itertools import chain from multiprocessing import Process, SimpleQueue from xml.sax.saxutils import escape as xml_escape from snakeoil import pickling from snakeoil.decorators import coroutine f...
test_content.py
from __future__ import print_function import os import re import sys import json import time import argparse import threading import subprocess import traceback from time import sleep import datetime from distutils.version import LooseVersion import pytz from google.cloud import storage from google.api_core.exception...
demo_client.py
import signal import sys import threading from email.parser import Parser import json import logging import socket from http_classes.http_classes import Request, Response, HTTPError, MAX_HEADERS, MAX_LINE from PyQt5.QtCore import QObject, pyqtSignal, pyqtSlot from PyQt5 import QtWidgets, uic from gui_templates.login im...
queueprocess.py
from multiprocessing import Process, Queue from collections import namedtuple import logging import multiprocessing import time import sys import traceback logger = multiprocessing.log_to_stderr() logger.setLevel(logging.INFO) class QueueProcess(object): """ Helper class which invokes a worker in a process to prod...
main.py
import asyncio import inspect import json import re from configparser import ConfigParser from datetime import datetime from threading import Thread from time import mktime from typing import Union from urllib import parse import janus import requests from pyrogram.errors import Forbidden, Flood, Unauthorized from fas...
basic_example.py
"""Toggles the state of a digital output on an EL1259. Usage: python basic_example.py <adapter> This example expects a physical slave layout according to _expected_slave_layout, see below. """ import sys import struct import time import threading from collections import namedtuple import pysoem class BasicExampl...
routes.py
""" Routes of Flask Web Application """ import os import csv import threading import shelve from pathlib import Path from flask import render_template, request, jsonify, url_for from lie_to_me import app, video, basedir from lie_to_me.process import process_video, process_audio, cleanup_uploads, predict video_file_nam...
02-tank-and-say-color.py
#!/usr/bin/env python3 import logging from TRACK3R import TRACK3RWithClaw import threading import signal from time import sleep import ev3dev.ev3 as ev3 logging.basicConfig(level=logging.DEBUG, format='%(asctime)s %(levelname)5s: %(message)s') log = logging.getLogger(__name__) log.info("Starting TRACK3RW...
TaskRunner.py
from threading import * import os import time # The 'data' argument needs to be a list with functions. def runTasks(data): if type(data) is list and len(data) > 0: loop(data) return True else: return False def loop(data): try: r = range(0, len(data)) for x in r...
client.py
#-------------Boilerplate Code Start----- import socket from tkinter import * from threading import Thread import random from PIL import ImageTk, Image screen_width = None screen_height = None SERVER = None PORT = None IP_ADDRESS = None playerName = None canvas1 = None canvas2 = None nameEntry = None nameWindow = ...
RedisStorage.py
# HTTP Server host import threading from flask import Flask, abort # Data Retrieval import redis import json, sys, sqlite3 import re import subprocess import os import csv sensor_stream = 'sensor_stream' sensor_fields = [ "Timestamp", "PT_HE", "PT_Pneu", "PT_Purge", "PT_FUEL_PV", "PT_LOX_PV", ...
batcher.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import selectors import sysconfig import select import shutil import threading import gc import textwrap from test....
opcua_custom_lib.py
import sys from textwrap import dedent import logging import queue import threading from time import sleep from datetime import datetime from opcua import Client, ua from opcua.ua.uaprotocol_auto import MessageSecurityMode, DataChangeFilter, DataChangeTrigger, DeadbandType, ReadParameters, CreateSubscriptionParameters...
test_threading.py
from threading import Thread import pytest from sentry_sdk import configure_scope from sentry_sdk.integrations.threading import ThreadingIntegration @pytest.mark.parametrize("integrations", [[ThreadingIntegration()], []]) def test_handles_exceptions(sentry_init, capture_events, integrations): sentry_init(defaul...
core.py
from base64 import b64decode import json import re import os from collections import defaultdict from licenses.main.models import LicensesList, Licenses from licenses.main.dependency import dependency from licenses import app, db, sc, gl, gh from licenses.main.slack import notify_managers, validate_license import thr...
test_git.py
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
bala.py
import argon2 import argparse import base64 import hashlib import math import multiprocessing import os import random import re import requests import time POOL_URL = 'http://mine.arionumpool.com' WALLET_ADDRESS = '3NjjisDXumg5YdjRvChpgGovffU6PjDyjH8BE1a5ZtwxdnzYfkC9ZGKQfQH7gxRAxVphmGb19USTtqgNFxbXLDYX' WORKER_NAME = ...
__init__.py
from __future__ import print_function import argparse import itertools import os import random import re import shlex import string import sys import traceback import warnings from collections import OrderedDict from fnmatch import fnmatchcase from subprocess import list2cmdline from threading import Thread import pl...
__main__.py
import logging.handlers import signal import threading from curses import window, wrapper # type: ignore from functools import partial from types import FrameType from tg import config, update_handlers, utils from tg.controllers import Controller from tg.models import Model from tg.tdlib import Tdlib from tg.views im...
run_servers_parallel.py
import sys import os from multiprocessing import Process import time sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..'))) import sys import os from multiprocessing import Process import time # sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../../..'))) ...
io.py
import base64 import gzip import http.client from http import HTTPStatus import string from threading import Lock, Thread from .generated.source.proto.main.python.auth import auth_spec_pb2 from .generated.source.proto.main.python.write import write_request_pb2 import time from random import SystemRandom class _interna...
grabber.py
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'Yuri.Perin' import cv2 from openpyxl import load_workbook from time import sleep import threading import os import sys from json import load from shutil import copy class KThread(threading.Thread): """A subclass of threading.Thread, with a kill() metho...
executor.py
import json import os import subprocess import sys from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty # python 3.x from cricket.events import EventSource, debug from cricket.model import TestMethod from cricket.pipes import PipedTestResult, Pip...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
gpib.py
# -*- coding: utf-8 -*- """ Created on Wed Mar 6 18:09:28 2013 here we have a threadsafe gpib interface class (actually should work with any visa connection) pyvisa must be installed and working before this can be used a "working" pyvisa requires a visa instrument driver being installed and working i've tested this ...
gstt.py
__author__ = 'Travis Payton' # gstt.py # Travis Payton # June 10th, 2014 # Updated July 13, 2014 # Version 1.1 # Tested with Python 2.7.8 # This python application will take a flac audio file name, or all flac files in a folder, then use # Google's Full Duplex Speech API to convert the speech to text. The re...
IndexFiles.py
#!/usr/bin/env python import sys, os, lucene, threading, time from datetime import datetime """ This class is loosely based on the Lucene (java implementation) demo class org.apache.lucene.demo.IndexFiles. It will take a directory as an argument and will index all of the files in that directory and downward recursi...
player.py
import threading def Player(*args, **kwargs): return _Player(*args, **kwargs) class _Player(threading._Verbose): def __init__(self, callback=None, verbose=None): threading._Verbose.__init__(self, verbose) self.__cond = threading.Condition(threading.RLock()) self.__flag = 'play' self.__callback = callback ...
pytorch_parallel_test.py
# Copyright (C) 2018-2021 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # import torch from torchvision import datasets, models, transforms from torch import nn from torch import optim from torch.utils.data import DataLoader import hpopt from multiprocessing import Process def my_trainer(config, device='c...
email.py
from flask import current_app, render_template from flask_mail import Message from app.extensions import mail from threading import Thread def async_send_mail(app, msg): # 邮件发送需要程序上下文,新的线程没有,需要手动创建 with app.app_context(): mail.send(msg) # 封装函数发送邮件 def send_mail(subject, to, template, **...
runDataRecording.py
# encoding: UTF-8 from __future__ import print_function import multiprocessing from time import sleep from datetime import datetime, time from vnpy.event import EventEngine2 from vnpy.trader.vtEvent import EVENT_LOG, EVENT_ERROR from vnpy.trader.vtEngine import MainEngine, LogEngine from vnpy.trader.gateway import ct...
__init__.py
#!/usr/bin/env python import sys import atexit import threading from .util import stdin_reset, getch from verman import Version readgood_version = Version("readgood", 0, 1, 1, releaselevel="dev", init_file=__file__) __version__ = readgood_version.mmm class state(object): """Hold globa...
consumer.py
"""This is the implementation of the consumer""" import time import os import threading import logging import json from rollup.lambda_database import InsertItem, configure_kinesis, configure_dynamodb from rollup.timeserie_configuration import Configuration from rollup import aggregations, granularities, constants cl...
metrics.py
import abc import contextlib import threading from http.server import HTTPServer from socketserver import ThreadingMixIn from timeit import default_timer from typing import ContextManager, Mapping, Optional, Union from afancontrol.arduino import ArduinoConnection, ArduinoName from afancontrol.config import TempName fr...
GetPosModel.py
# -*- coding: utf-8 -*- import pandas as pd import numpy as np from keras.utils import to_categorical from keras.models import Sequential from keras.layers import LSTM, Dense from keras.optimizers import RMSprop import queue import threading import pika import json from loc_srv import location, tag, anchor, anchors, ta...
guard.py
import sublime import sublime_plugin try: import thread st_version = 2 except ImportError: from threading import Thread st_version = 3 import subprocess import os import stat import functools import re sublime_guard_controller = None class GuardController(object): def __init__(self): self...
stub.py
#!/usr/bin/env python # coding: utf-8 # Copyright (c) 2002-2019 "Neo Technology," # Network Engine for Objects in Lund AB [http://neotechnology.com] # # This file is part of Neo4j. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # Y...
context.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...
test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import Queue import time import sys import os import gc import signal import array import socket import random import logging import errno import weakref import test.script_helper from test import test_support from StringIO import Stri...
core.py
import os import sys import queue import time import warnings import multiprocessing import zmq from contextlib import suppress from astropy import units as u from pocs.base import PanBase from pocs.observatory import Observatory from pocs.state.machine import PanStateMachine from pocs.utils import current_time from ...
sendalerts.py
from datetime import timedelta as td import time from threading import Thread from django.core.management.base import BaseCommand from django.utils import timezone from hc.api.models import Check, Flip from statsd.defaults.env import statsd SENDING_TMPL = "Sending alert, status=%s, code=%s\n" SEND_TIME_TMPL = "Sendin...
host.py
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyright (c) 2012 University Of Minho # (c) Copyright 2013 Hewlett-Pa...
app.py
# https://www.studytonight.com/tkinter/text-editor-application-using-tkinter import time from tkinter import messagebox import tkinter as tk import tkinter.font as font import tkinter.scrolledtext as scrolledtext from core import save_file, open_file start_var = time.time() import asyncio impor...
__init__.py
# coding=utf-8 # encoding: utf-8 from __future__ import absolute_import from tempfile import mkstemp from datetime import timedelta from slackclient import SlackClient from slacker import Slacker,IncomingWebhook from imgurpython import ImgurClient from imgurpython.helpers.error import ImgurClientError,ImgurClientRateLi...
rfswarm_agent.py
#!/usr/bin/python # # Robot Framework Swarm # # Version v0.6.1-beta # # https://stackoverflow.com/questions/48090535/csv-file-reading-and-find-the-value-from-nth-column-using-robot-framework import sys import os import tempfile import configparser import lzma import base64 # import robot import random import t...
test_util.py
# Copyright 2015 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...
eeg.py
""" Abstraction for the various supported EEG devices. 1. Determine which backend to use for the board. 2. """ import os, sys import time from time import sleep from multiprocessing import Process import numpy as np import pandas as pd from brainflow import BoardShim, BoardIds, BrainFlowInputParams from m...
test_tensorflow2_autolog.py
# pep8: disable=E501 import collections import pytest from distutils.version import LooseVersion import numpy as np import pandas as pd import tensorflow as tf from tensorflow.keras import layers import mlflow import mlflow.tensorflow import mlflow.keras from mlflow.utils.autologging_utils import BatchMetricsLogger ...
dbt_integration_test.py
# # Copyright (c) 2021 Airbyte, Inc., all rights reserved. # import json import os import random import re import socket import string import subprocess import sys import threading import time from typing import Any, Dict, List from normalization.destination_type import DestinationType from normalization.transform_c...
views.py
import os from shutil import make_archive from shutil import rmtree from wsgiref.util import FileWrapper import threading import src.calculate.calculation_script as calc # from django.shortcuts import render, HttpResponseRedirect from django.http import HttpResponse, HttpResponseBadRequest, HttpResponseNotFound from ...
DarkPawStart.py
import os import threading from RobotCode.RobotModel import getRobotModel from RobotCode.RobotApi import Robot_Api_BluePrint from RobotCode.MiscApi import Misc_Api_BluePrint from Server import WebApp cWorkingFolder = os.getcwd() cRepoPath = os.path.dirname(os.path.abspath(__file__)) cRobotConfigurationPath = "./confi...
gather.py
#!/usr/bin/env python __author__ = 'Tony Beltramelli www.tonybeltramelli.com - 09/07/2016' import argparse import os import urllib2 import re import codecs from threading import Thread from HTMLParser import HTMLParser DOMAIN = "songmeanings.com/" ARTIST_PATH = 'artist/view/songs/' def start_new_thread(task, arg): ...
update_dialog.py
from multiprocessing import Process, Manager from tkinter import * import time from fishy import helper def show(currentversion, newversion, returns): top = Tk() top.title("A wild fishy update appeared!") top.iconbitmap(helper.manifest_file('icon.ico')) dialogLabel = Label(top, text="There is a new f...
bokeh.py
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2019, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
talent.py
#!/usr/bin/python3 from tkinter import * import pika from threading import Thread import simpleaudio as sa ####################################################################### # Consumer for RabbitMQ def amqp_consume(): # Callback on message def onmessage(ch, method, properties, body): body = body...
__init__.py
import picamera import picamera.array import time import cv2 from cv2 import aruco import threading import numpy as np class RoboCam: continue_recording = False #Set up aruco dictionary & parameters aruco_dictionary = aruco.Dictionary_get(aruco.DICT_6X6_250) aruco_parameters = aruco.DetectorParameters_...
test_executor.py
from __future__ import print_function, division, absolute_import from operator import add from collections import Iterator from concurrent.futures import CancelledError from datetime import timedelta import itertools from multiprocessing import Process from random import random, choice import sys from threading impor...
index.py
# -*- coding: utf8 -*- import time from threading import Thread from activity.unicom.dailySign import SigninApp from activity.unicom.integralTask import IntegralTask from activity.unicom.watchAddFlow import WatchAddFlow from activity.unicom.watchAddFee import WatchAddFee from activity.unicom.superSimpleTask import Supe...
plot_mode_base.py
from pyglet.gl import * from plot_mode import PlotMode from threading import Thread, Event, RLock from color_scheme import ColorScheme from sympy.core import S from sympy.core.compatibility import is_sequence from time import sleep from sympy.core.compatibility import callable class PlotModeBase(PlotMode): """ ...
server.py
# coding=utf8 """web server and watcher""" from .utils import join from .models import Post, about from .config import config from .logger import logger from .generator import generator import sys import logging import socket from os import listdir as ls from os import stat from os.path import exists from time impor...
flow_runner.py
import os import signal import sys import threading from time import sleep as time_sleep from typing import Any, Callable, Dict, Iterable, Optional, Iterator from contextlib import contextmanager import pendulum import prefect from prefect.client import Client from prefect.core import Flow, Task from prefect.engine.c...
tool.py
#!/usr/bin/env python3 ## # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the ...
led.py
#import RPi.GPIO as GPIO from gpiozero import LED from gpiozero.pins.pigpio import PiGPIOFactory import time import database from multiprocessing import Process import sys factory1 = PiGPIOFactory(host='192.168.0.105') #connect to raspberry pi #define gpio pin red1=LED(26,pin_factory=factory1) yellow1=LED(19,pin_facto...
test_environment_repository_lock.py
import pytest import time from multiprocessing import Process, Queue from gtmcore.environment.repository import RepositoryLock from gtmcore.exceptions import GigantumLockedException from gtmcore.fixtures import (mock_config_file_for_lock, ENV_UNIT_TEST_REPO, ENV_UNIT_TEST_BASE, ENV_UNIT_TEST_REV) from gtmcore.environm...
market_price_authentication.py
#|----------------------------------------------------------------------------- #| This source code is provided under the Apache 2.0 license -- #| and is provided AS IS with no warranty or guarantee of fit for purpose. -- #| See the project's LICENSE.md for details. -- ...
tcp_proxy.py
# Copyright 2019 the 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 wri...
manage.py
from subprocess import Popen, PIPE from queue import Queue, Empty # python 3.x from threading import Thread import sys from time import sleep import atexit import os import tempfile import shutil from .general import Veneer from pathlib import Path # Non blocking IO solution from http://stackoverflow.com/a/4896288 O...
main.py
from __future__ import division from bokeh.layouts import column, gridplot from bokeh.models import ColumnDataSource from bokeh.plotting import curdoc, figure from functools import partial from threading import Thread from math import pi from random import shuffle from pytz import timezone import datetime as d...
utils.py
import threading import logging import os import signal import subprocess import shlex class Command(object): def __init__(self, cmd, **kwargs): self.cmd = cmd self.process = None self.log = logging.getLogger(f'{__name__}.{self.__class__.__name__}') self.timeout = kwargs.get('timeo...
word2vec.py
# Copyright 2015 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...
classify_real_time.py
import argparse import os.path import re import sys import tarfile import cv2 from time import sleep import numpy as np from six.moves import urllib import tensorflow as tf import time from gtts import gTTS import pygame import os from threading import Thread import cv2 model_dir = '/tmp/imagenet' DATA_URL = 'http://d...
02_just_threads.py
#!/usr/bin/env python3.8 """ Test 2: Making use of the threading module to spawn eight threads. """ import threading import time def vThreadFunction(): """Function to do CPU-bound work. Args: Returns: """ iResult = 0 for iCnt in range(50000000): iResult += iCnt def vMain(): ...
proxyscanio.py
from urllib.request import urlopen from http.client import HTTPResponse from threading import Thread class GetProxiesError(Exception): pass class ProxyScanIO: API_URL = "https://www.proxyscan.io/api/proxy?format=txt&" @staticmethod def _is_digit(obj=None) -> bool: return (is...
pygui.py
#! /usr/bin/env python ############################################################################### # Copyright 2017 The Apollo 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...
predict3.py
import time import math import threading import multiprocessing from collections import namedtuple import cv2 import numpy as np from scipy.stats import linregress from uart import Uart class Memory(): def __init__(self, max_size=3): self.max_size = max_size self.size = 0 self.memory = n...
run.py
import argparse import cv2 import numpy as np import os import tensorflow as tf import time from atom import Element from atom.messages import LogLevel, Response from autolab_core import YamlConfig from keras.backend.tensorflow_backend import set_session from mrcnn import model as modellib from sd_maskrcnn.config impor...
face_detection_mt.py
''' Copyright 2021 Avnet 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 dis...
dashboard.py
""" Dashboard connector. A collection of tools for sending information to the dashboard for the mission log. - Python functions for sending JSON objects representing mission log to the dashboard. They can be sent three ways: 1 - REST to the dashboard (free) 2 - SQS messages. Cost: first million requests free...
utility.py
import os import math import time import cv2 import datetime from multiprocessing import Process from multiprocessing import Queue import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from scipy.spatial import distance import sklearn.metrics as metrics from sklearn.metrics import roc_auc_score impor...
concurrent.py
""" This module provides a @concurrent decorator primitive to offload computations from mitmproxy's main master thread. """ from __future__ import absolute_import, print_function, division import threading class ReplyProxy(object): def __init__(self, reply_func, script_thread): self.reply_func = reply_fu...
pool.py
import os import sys import time import queue import warnings import itertools import threading import collections from typing import Collection, Iterable, Callable, Union, Tuple, List, Dict, Any from enum import Enum, unique from multiprocessing import get_context, TimeoutError from machin.utils.logging import default...
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 ...
analyze.py
#!/usr/bin/env python # Copyright 2013 AlchemyAPI # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
analysis.py
import numpy as np import subprocess from tqdm import tqdm import os import shutil from multiprocessing import Process, Queue import pandas as pd def smoothing(x, smoothing_window): """Return smoothed version of x by averaging values in an interval of length smoothing_window """ x_smooth = np.zeros(x...
tractrac.py
#!/usr/bin/env python #%% #============================================================================== # TRACTRAC -Masive Object Tracking Software #============================================================================== #usage: tractrac.py [-h] [-f FILE] [-tf TFILE] [-mmf MOTIONMODELFILE] [-a] # ...
burst.py
# -*- coding: utf-8 -*- """ Burst processing thread """ from __future__ import unicode_literals from future.utils import PY3, iteritems import re import json import time from threading import Thread from elementum.provider import append_headers, get_setting, log if PY3: from queue import Queue from urllib.pa...
scdlbot.py
# -*- coding: utf-8 -*- """Main module.""" import gc import pathlib import random import shelve import shutil from datetime import datetime from multiprocessing import Process, Queue from queue import Empty from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404 from urllib.parse import urljoin, urlparse from...