source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
pio_bridge.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import os
from glob import glob
from ..libraries import paths
from ..libraries.file import File
from ..libraries.tools imp... |
main.py | import os
import time
import sys
import cv2 as cv
import numpy as np
import face_recognition
import multiprocessing
import gpiozero
def updateframe(rtsp_url,lock):
print('connecting to video ...')
# set rtsp protocol path
cap = cv.VideoCapture(rtsp_url)
print('connected')
while cap.isOpened():
... |
grass_azure_executor.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import collections
import json
import os
import secrets
import shutil
import string
import threading
import time
from copy import deepcopy
from multiprocessing.pool import ThreadPool
import yaml
from maro.cli.grass.executors.grass_executor imp... |
helper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import threading
import asyncio
import websockets
from aiohttp import web
class MockInsServer():
def __init__(self, port):
self.loop = asyncio.new_event_loop()
self.port = port
self.thread = threading.Thread(target=self._run)
... |
avalon.pyw | import logging
import threading
import time
import client_board_state
import client
import main_board_class as board
def main():
#logging.basicConfig(filename='AVALON.log', level=logging.INFO)
logging.basicConfig(format='%(levelname)s:%(message)s',
level=logging.DEBUG)
logging.in... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
backuper_gui.py | import logging
import pathlib
import threading
import tkinter as tk
import tkinter.ttk as ttk
from tkinter.filedialog import (askopenfilename, askopenfilenames,
askdirectory)
from .backuper import Backuper
class SourceFrame(tk.Frame):
def __init__(self, master):
super().__... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_dash.util import bfh, bh2u, UserCancelled, UserFacingException
from electrum_dash.bip32 import BIP32Node
from electrum_dash import constants
from elect... |
iters.py | from __future__ import division
import math
import multiprocessing
import itertools
import time
from decimal import *
from django.forms.models import model_to_dict
from core.models import Factor,Radiators,Horizontal,Vertical,Fins
class Iters(object):
counter=0
basic={}
core={}
tapping={}
lv={}
hv={}
cca={}
coo... |
test_operator_gpu.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
test_qt_notifications.py | import threading
import warnings
from concurrent.futures import Future
from unittest.mock import patch
import dask.array as da
import pytest
from qtpy.QtCore import Qt, QThread
from qtpy.QtWidgets import QPushButton
from napari._qt.dialogs.qt_notification import NapariQtNotification
from napari._tests.utils import DE... |
training.py | from __future__ import print_function
from __future__ import absolute_import
import warnings
import copy
import time
import numpy as np
import multiprocessing
import threading
import six
try:
import queue
except ImportError:
import Queue as queue
from .topology import Container
from .. import backend as K
f... |
input_http_unittest.py | #!/usr/bin/env python3
#
# Copyright 2017 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittests for input HTTP plugin."""
import http.client
import logging
import os
import queue
import shutil
import tempfile
im... |
exercise8.py | #!/usr/bin/env python
# Optional bonus question
# --use a queue to get the output data back from the child processes in question #7.
# Print this output data to the screen in the main process.
# amount of time executing with processes and queues : 0:00:07.893882
from datetime import datetime
from multiprocessing impor... |
shallow_backup.py | import os
import git
import sys
import json
import click
import shutil
import inquirer
from glob import glob
import subprocess as sp
from pprint import pprint
import multiprocessing as mp
from os.path import expanduser
from constants import Constants
from colorama import Fore, Style
from shutil import copy, copyfile, c... |
pyscanner2.py | import socket
import time
import threading
import sys
from Queue import Queue
socket.setdefaulttimeout(0.25)
print_lock = threading.Lock()
if len(sys.argv)!=3:
print('usage: pyscanner.py IP_ADDRESS \'[port1, port2, ...]\'')
exit(0)
target = sys.argv[1]
ports = eval(sys.argv[2])
t_IP = socket.gethostbyname(ta... |
plutus.py | # Plutus Bitcoin Brute Forcer
# Made by Isaac Delly
# https://github.com/Isaacdelly/Plutus
import os
import pickle
import hashlib
import binascii
import multiprocessing
from ellipticcurve.privateKey import PrivateKey
DATABASE = r'database/MAR_23_2019/'
def generate_private_key():
"""
Generate a random 32-byte hex... |
saveData.py | import threading
from api_phidget_n_MQTT.src.lib_global_python import createLoggerFile
from api_phidget_n_MQTT.src.lib_global_python import loggerHandler
from api_phidget_n_MQTT.src.lib_global_python import repeatedTimer
class saveData:
def __init__(self):
self.last_t1=0
pass
def initFile(sel... |
server_supportonly.py | import socket
import select
import threading
import pydirectinput
import time
import subprocess
import os
from win32api import GetSystemMetrics
from windowcapture import WindowCapture
import ctypes
from cryptography.fernet import Fernet
from vision import Vision
from hsvfilter import grab_object_preset, HsvFilter
impor... |
weather.py | ################################################################################
# weather.py
#-------------------------------------------------------------------------------
# Weather app based on openweathermap.org.
#
# By Malcolm Stagg
#
# Copyright (c) 2021 SODIUM-24, LLC
#
# Permission is hereby granted, free of... |
terminal.py | import json
import os
import platform
import socket
import struct
import multiprocessing
import subprocess
class Terminal(object):
def __init__(self):
self.ip_port = ("127.0.0.1", 8090)
self.back_log = 5
self.buf_size = 1024
self.tcp_client = socket.socket(socket.AF_I... |
overexposure_creator.py | # generate overexposure samples from clear images
# author: @LucasX
import argparse
import os
import random
from multiprocessing import Queue, Process
import cv2
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('-orig_dir', type=str,
default='C:/Users/LucasX/Desktop/ShelfE... |
tube.py | # -*- coding: utf-8 -*-
import logging
import re
import string
import subprocess
import sys
import threading
import time
from .. import atexit
from .. import term
from ..context import context
from ..log import Logger
from ..timeout import Timeout
from ..util import fiddling
from ..util import misc
from ..util import ... |
GhosDoser.py | import argparse, socket, sys, time
from threading import Thread
from art import *
tprint("GhosDoser")
print("Type GhosDoser.py -h for help\n")
my_parser = argparse.ArgumentParser()
my_parser.add_argument('-u', metavar='Target', type=str, help='Target IP or URL')
my_parser.add_argument('-p', metavar='Port', type=int,... |
test_fx.py | import builtins
import contextlib
import copy
import functools
import inspect
import math
import numbers
import operator
import os
import pickle
import sys
import torch
import traceback
import warnings
import unittest
from math import sqrt
from pathlib import Path
from torch.multiprocessing import Process
from torch.te... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module.
Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through
3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use
... |
player.py | import os
import tkinter
from tkinter import Canvas,PhotoImage
from PIL import Image, ImageTk
# import tkinter.filedialog
import time
import random
import threading
import pygame
import ctypes
#高像素
#创建窗口,root可替换成自己定义的窗口
root =tkinter.Tk()
#调用api设置成由应用程序缩放
ctypes.windll.shcore.SetProcessDpiAwarenes... |
SinaL2.py | # -*- coding: utf-8 -*-
from . import util
from .Sina.Sina import Sina
from datetime import datetime
from .connection import *
import time
import websockets
import json
import asyncio
import threading
import re
import traceback
class NotLoginError(Exception):
def __init__(self):
super().__init__()
class... |
launch_heterogeneous_mig.py | #! /usr/bin/env python3
# Copyright (c) 2021, NVIDIA CORPORATION. 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
#
# ... |
test_instrumented_session.py | # Copyright (C) 2018 SignalFx. All rights reserved.
import threading
import requests
import pytest
from opentracing.mocktracer import MockTracer
from opentracing.ext import tags as ext_tags
from requests.sessions import Session
from flask import Flask, request
from werkzeug.serving import make_server
from signalfx_tr... |
JobLoggerPingThread.py | # encoding=utf-8
from __future__ import unicode_literals
import time
import threading
import datetime
class JobLoggerPingThread(object):
"""
Not part of public API
Helper class to house a thread that regularly calls JobModelAbstraction.update_model()
"""
def __init__(self, joblog):
self... |
script_wrapper_static.py | def convert_env_value_to_string(envDict):
for key, value in envDict.items():
envDict[str(key)] = str(envDict.pop(key))
def parse_output(output):
# by convention, the last output is the result of the operation
last_output = None
outputs = {}
pattern = re.compile('EXPECTED_OUTPUT_(\w+)=(.*)'... |
lab2-2-get-path-trace-with-flowAnalysisId.py | """
Script name: lab2-2-get-path-trace-with-flowAnalysisId.py
This script prints outA DNAC path trace information between the source and destination host(network device).
"""
from dnac import *
import threading,time # Need it for delay - sleep() function
def check_status(arg,arg1):
"""
Non-blocking wait funct... |
account.py | #!/usr/bin/python3
import json
import threading
from getpass import getpass
from pathlib import Path
from typing import Any, Dict, Iterator, List, Optional, Tuple, Union
import eth_account
import eth_keys
from hexbytes import HexBytes
from brownie._config import CONFIG, _get_data_folder
from brownie._singleton impor... |
conftest.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import curses
import logging
import threading
from functools import partial
import pytest
from vcr import VCR
from six.moves.urllib.parse import urlparse, parse_qs
from rtv.oauth import OAuthHelper, OAuthHandler, OAuthHTTPServer
from rtv.conte... |
xxe.py | import socket
import sys
import argparse
import requests
import threading
import time
import hashlib
import os
import modules.sendrequest as req
import utils.logger as logger
import utils.logs as logs
from utils.db import Database_update
dbupdate = Database_update()
# Dummy response
data = b'''\
HTTP/1.1 200 OK\r\n\... |
email.py | from flask_mail import Message
from flask import current_app, render_template
from threading import Thread
from . import mail
def send_mail(to,subject,template,**kwargs):
app = current_app._get_current_object()
msg = Message(current_app.config['FLASKY_MAIL_PREFIX'] + subject,
sender=app.conf... |
test_config.py | import asyncio
import copy
import pytest
import random
import yaml
from mint.util.config import create_default_mint_config, initial_config_file, load_config, save_config
from mint.util.path import mkdir
from multiprocessing import Pool
from pathlib import Path
from threading import Thread
from time import sleep
from t... |
control_robo.py | import RPi.GPIO as GPIO
import time
import read_RPM
import threading
import setup_robo
import sys
import multiprocessing
from Gyro_new import Gyro
#from mpu6050 import mpu6050
class Control_robo:
def __init__(self, encoder_1, encoder_2, SAMPLE_TIME, motor_1, motor_2):
self.encoder_1 = encoder_1 ## LEFT... |
data_loader_base.py | # Copyright 2019 Uber Technologies, Inc. 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... |
login.py | import os, sys, time, re, io
import threading
import json, xml.dom.minidom
import copy, pickle, random
import traceback, logging
import requests
from pyqrcode import QRCode
from .. import config, utils
from ..returnvalues import ReturnValue
from ..storage.templates import wrap_user_dict
from .contact impo... |
managers.py | #
# Module providing manager classes for dealing
# with shared objects
#
# multiprocessing/managers.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
__all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ]
#
# Imports
#
import sys
import threading
import signal
imp... |
lambda_executors.py | import os
import re
import json
import time
import logging
import threading
import subprocess
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
# for Python 2.7
from pipes import quote as cmd_quote
from localstack import config
from localstack.utils.aws... |
ppo_wm.py | # -*- coding: utf-8 -*-
import os
import numpy as np
import logging
import pickle
import torch
import torch.nn as nn
from torch import optim
from torch import multiprocessing as mp
from rlmodule import MultiDiscretePolicy, Value, Memory, Transition, UserAction2
from estimator import RewardEstimator
from utils import... |
chess.py | from math import inf
import pygame_menu
import queue
import sys
import threading
import time
from board import *
from timer import Timer
# Initialize Pygame
pygame.init()
# Fonts
FONT = pygame.font.Font(pygame_menu.font.FONT_OPEN_SANS_BOLD, 18)
BIG_FONT = pygame.font.Font(pygame_menu.font.FONT_OPEN_SANS_BOLD, 26)
# ... |
main.py | from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route, Mount, WebSocketRoute
from starlette.websockets import WebSocket
from starlette.staticfiles import StaticFiles
from starlette.middleware import Middleware
from starlette.middleware.cors import ... |
blivedm_lar_logger.py | import asyncio
import os,time
import signal,sys
import xml.sax.saxutils as xmlutil
from concurrent.futures import CancelledError
import multiprocessing
import blivedm.blivedm as blivedm
import utils
class BLiveLARlogger(blivedm.BLiveClient):
def __init__(self, room_id, uid=0, heartbeat_interval=30, ssl=True, loop... |
control.py | ####################################################################################
# BLACKMAMBA BY: LOSEYS (https://github.com/loseys)
#
# QT GUI INTERFACE BY: WANDERSON M.PIMENTA (https://github.com/Wanderson-Magalhaes)
# ORIGINAL QT GUI: https://github.com/Wanderson-Magalhaes/Simple_PySide_Base
####################... |
downloadclient.py | # Copyright 2018 CERN for the benefit of the ATLAS collaboration.
#
# 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 appl... |
actor.py | #!/usr/bin/env python3
# MIT License
#
# Copyright (c) 2020 FABRIC Testbed
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to ... |
learner.py | # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to us... |
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... |
main.py | from concurrent import futures
import time
import threading
import grpc
import pb2_grpc
import pb2
RAISE_ERROR_DELAY_TIME_SENONDS = 1
SEND_REQUEST_AGAIN_DELAY_TIME_SENONDS = 2
HANDLE_REQUEST_DELAY_TIME_SECONDS = 4
class OrderDispatcherServicer(pb2_grpc.TestServiceServicer):
def testFunc(self, request, context)... |
app.py | # -*- coding: utf-8-*-
from Imgood.linepy import *
from Imgood.linepy import (LINE, Channel, OEPoll, OpType)
from Imgood.akad import *
from Imgood.linepy.style import *
from Imgood.linepy.login import *
from justgood import imjustgood
from time import sleep
from gtts import gTTS
from datetime import datetime
from bs4 i... |
utils.py | ########
# Copyright (c) 2018-2020 GigaSpaces Technologies Ltd. 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
#
# U... |
nonblock.py | import sys
import time
from subprocess import PIPE, Popen
from threading import Thread
from queue import Queue, Empty
ON_POSIX = 'posix' in sys.builtin_module_names
def enqueue_output(out, queue):
for line in iter(out.readline, b''):
queue.put(line)
print("EOF")
out.close()
command = 'adb shell... |
kernel.py | from queue import Queue
from threading import Thread
from ipykernel.kernelbase import Kernel
import subprocess
import tempfile
import os
import os.path as path
class RealTimeSubprocess(subprocess.Popen):
"""
A subprocess that allows to read its stdout and stderr in real time
"""
def __init__(self, c... |
process_worker.py | # coding=utf-8
import multiprocessing
import serial
import socket
import os
import fuckargs
# 没声音就输出1
# 有声音就输出0
# 串口通讯
# 频率的决定者以硬件的串口通讯频率决定
def get_serial_info( whether, sum_list ):
os.system( "echo %d >>pid_repo" % os.getpid() ) # store the pid
i = 0
while True:
res_read = ser.readline()[0]
... |
custom.py | # pylint: disable=too-many-lines
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------... |
email.py | from threading import Thread
from flask import current_app, render_template
from flask_mail import Message
from app import mail
from app.common.file import put_to_file
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, html_body):
... |
archiver.py | import argparse
import dateutil.tz
import errno
import io
import json
import logging
import os
import pstats
import random
import re
import shutil
import socket
import stat
import subprocess
import sys
import tempfile
import time
import unittest
from binascii import unhexlify, b2a_base64
from configparser import Config... |
stream_detect.py | import threading
import SocketServer
import cv2
import numpy as np
import math
import socket
import time
# distance data measured by ultrasonic sensor
sensor_data = " "
class NeuralNetwork(object):
def __init__(self):
self.model = cv2.ANN_MLP()
def create(self):
layer_size = np.int32([38400,... |
watch.py | import time
import threading
class HostWatcher(object):
def __init__(self, host_scanner, reconnection_callback):
self._scanner = host_scanner
self._reconnection_callback = reconnection_callback
self._hosts = set()
self._hosts_lock = threading.Lock()
self._interval = 45 ... |
irc.py | import io
import logging
import os
import re
import threading
import time
from datetime import datetime, timedelta
from urllib.parse import quote
from uuid import uuid4
from xml.etree.ElementTree import parse
from flexget.config_schema import one_or_more, register_config_key
from flexget.entry import Entry
from flexge... |
handRecog2Mqtt.py | import cv2
import mediapipe as mp
import math
import os
import queue
import time
import threading
import paho.mqtt.client as mqtt
from flask import Flask, render_template, Response
app = Flask(__name__)
def vector_2d_angle(v1,v2):
'''
求解二维向量的角度
'''
v1_x=v1[0]
v1_y=v1[1]
v2_x=v2[0]
v2_y... |
test_motor_change_stream.py | # Copyright 2017-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... |
basic.py | #!/usr/bin/env python
# -- Content-Encoding: UTF-8 --
"""
COHORTE Monitor: Monitor included in the F/M/N process
:author: Thomas Calmant
:license: Apache Software License 2.0
:version: 1.1.0
..
Copyright 2014 isandlaTech
Licensed under the Apache License, Version 2.0 (the "License");
you may not use thi... |
notebookapp.py | # coding: utf-8
"""A tornado based Jupyter notebook server."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
import notebook
import binascii
import datetime
import errno
import gettext
import importlib
impor... |
buffer_vid.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jun 18 15:09:09 2020
@author: Nikki
extremely slow
attempted buffer as implemented here: https://www.pyimagesearch.com/2017/02/06/faster-video-file-fps-with-cv2-videocapture-and-opencv/
"""
import numpy as np
import tensorflow as tf
import time
import cv2
from core.yolov4 i... |
test_sockets.py | import os, multiprocessing, subprocess
from runner import BrowserCore, path_from_root
from tools.shared import *
def clean_pids(pids):
import signal, errno
def pid_exists(pid):
try:
# NOTE: may just kill the process in Windows
os.kill(pid, 0)
except OSError, e:
return e.errno == errno.EPE... |
deploy_handler.py | __author__ = 'magus0219'
import logging
from config import DEBUG as _DEBUG, GITHUB as _GITHUB_CFG
from .common_handler import CommonHandler
from core.deploy_manager import dmc
from core.payload import PayLoad
import threading
import json
import hmac
from utils.mongo_handler import mongodb_client
logger_server = loggi... |
diffusion_profiles.py | import os
import pickle
import multiprocessing
import networkx as nx
import math
import time
import copy
import scipy
import numpy as np
WEIGHT = 'weight'
class DiffusionProfiles():
def __init__(self, alpha, max_iter, tol, weights, num_cores, save_load_file_path):
self.alpha = alpha
self.max_iter = max_iter
sel... |
plugin.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
####################
import base64
import logging
import json
import ssl
import os.path
import hashlib
import time
import threading
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from urlparse import urlparse, parse_qs
import urllib2
import indigo
REALM ... |
walking_simulation.py | #!/usr/bin/env python3
import pybullet as p
import numpy
import rospy
import time
import threading
import pybullet_data
from sensor_msgs.msg import JointState
from sensor_msgs.msg import Imu
import matplotlib.pyplot as plt
from quadruped_ctrl.srv import QuadrupedCmd, QuadrupedCmdResponse
from quadruped_ctrl.msg import... |
webserver.py | # Copyright (c) 2016, Tim Wentzlau
# Licensed under MIT
""" Simple web server for the Kervi application """
import os
import time
try:
from SimpleHTTPServer import SimpleHTTPRequestHandler
except:
from http.server import SimpleHTTPRequestHandler
try:
from BaseHTTPServer import HTTPServer
except:
from... |
faceid_online_multithreading.py |
import cv2
import threading
import numpy as np
from imutils.video import FPS
import sys
sys.path.append('../')
from facevi.facedetector import FaceDetector
from facevi_api.faceviAPI import UDC_API
from facevi_utils import helpers
# 设置gpu_memory_fraction
import tensorflow as tf
import keras.backend.tensorflow_backen... |
vis_uncertainty.py | import glob
import logging
import multiprocessing
import os
import time
import matplotlib.cm
import numpy as np
import tensorflow as tf
from PIL import Image
from lib_yolo import yolov3
def colorize(img, vmin=None, vmax=None, cmap='plasma'):
# normalize
vmin = tf.reduce_min(img) if vmin is None else vmin
... |
adball.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Aug 16 20:18:29 2018
@author: shane
"""
import os, sys
import subprocess, threading
import shlex
#Command execution function `cmd()`
def cmd(cmds, _cwd='', selfdebug=True):
if _cwd == '':
_cwd = os.getcwd()
try:
if selfdebug:
... |
web_ping.py | """
This module defines the Website Monitoring web_ping modular input.
"""
import os
import sys
path_to_mod_input_lib = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'modular_input.zip')
sys.path.insert(0, path_to_mod_input_lib)
from modular_input import Field, ModularInput, URLField, DurationField, Intege... |
tests.py | import threading
from datetime import datetime, timedelta
from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist
from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections
from django.db.models.manager import BaseManager
from django.db.models.query import EmptyQuerySet, QuerySet
from dj... |
spider.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import random
import threading
import time
from bs4 import BeautifulSoup
import requests
from util import *
from util.browserconfig import HEADERS
class Spider(object):
def __init__(self, review_site, db, table):
self.db = db
self.table ... |
test_driver.py | from copy import deepcopy
from threading import Thread
from unittest.mock import Mock
import pytest
from time import sleep
from numpy import isclose
from opentrons.trackers import pose_tracker
from tests.opentrons.conftest import fuzzy_assert
from opentrons.config.robot_configs import DEFAULT_GANTRY_STEPS_PER_MM
from... |
MeshAlgoFaceAreaTest.py | ##########################################################################
#
# Copyright (c) 2009, Image Engine Design 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:
#
# * Redistribu... |
real_time_pos_hand.py | from os import read
import queue
from codetiming import Timer
import asyncio
import matplotlib.pyplot as plt
import numpy as np
import sys
import random
from itertools import count
import time
from matplotlib.animation import FuncAnimation
from numpy.core.numeric import True_
import matplotlib
import queue
import async... |
stage_manager.py | # ===============================================================================
# Copyright 2011 Jake Ross
#
# 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/licens... |
_index.py | import asyncio
import os
import re
import shutil
import tempfile
from abc import abstractmethod
from collections import namedtuple
from queue import Empty, Queue
from threading import Thread
from secedgar.client import NetworkClient
from secedgar.core._base import AbstractFiling
from secedgar.exceptions import EDGARQu... |
brute_forcing_form_auth.py | #!/usr/bin/env python
__author__ = "bt3"
"""
Now we are going to learn how to brute force a web server.
Most web system have brute-force protection these days, such as
captcha, math equations or a login token that has to be submitted
with request.
In this script we will brute force Joomla, whih lack account lockou... |
application_runners.py | from __future__ import print_function
import sys
import os
import uuid
import shlex
import threading
import subprocess
import logging
import inspect
import runpy
import future.utils as utils
import flask
import requests
from dash.testing.errors import (
NoAppFoundError,
TestingTimeoutError,
ServerCloseEr... |
chess_client.py | import socket
from threading import Thread
class NoPlayerActive(Exception):
pass
"""
class: Connection - used for connecting user to server and join online games
"""
class Connection:
def __init__(self):
self.client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.server = "localhos... |
poets.py | #!/usr/bin/env python3
from __future__ import annotations
import json
import os
import re
import sys
import threading
from queue import Queue
from typing import Iterable, cast, TypedDict
import click
import marko
import marko.inline
import toml
from loguru import logger
LOGGING_LEVELS = [99, 50, 40, 30, 25, 20, 10, 5... |
mosaicml_logger.py | # Copyright 2021 MosaicML. All Rights Reserved.
from __future__ import annotations
import logging
import os
import sys
import uuid
import warnings
from queue import Queue
from threading import Thread
from typing import Dict, List, Optional
import requests
from composer.core.logging import LogLevel, TLogData
from co... |
test_concurrent_query.py | import os
import sys
import threading
from redisgraph import Graph, Node, Edge
from base import FlowTestsBase
GRAPH_ID = "G" # Graph identifier.
CLIENT_COUNT = 16 # Number of concurrent connections.
graphs = None # One graph object per client.
assertions = ... |
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... |
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_pre_dataloader.py | # -*- coding: utf-8 -*-
# MegEngine is Licensed under the Apache License, Version 2.0 (the "License")
#
# Copyright (c) 2014-2021 Megvii Inc. All rights reserved.
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT ARRANTI... |
servers.py | # 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 required by applicable ... |
serial_io.py | from __future__ import division
import json
import time
import serial as _serial
import platform
import sys
if sys.version_info >= (3, 0):
import queue
else:
import Queue as queue
from threading import Event, Thread
from serial.tools.list_ports import comports
from . import IOHandler
try:
JSONDecodeEr... |
main.py | #!/usr/bin/python
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
import time
import atexit
import threading
import random
import RPi.GPIO as gpio
rdy = 4 #grey RB7
bit0 = 17 #purple RB4
bit1 = 18 #blue RB3
#bit2 = 27 #white RB5
ack = 22 #green RB8
gpio.setmode(gpio.BCM)
gpio... |
commands.py | from functools import partial
from concurrent.futures import ThreadPoolExecutor
import traceback
import threading
import time
InitFunctions = []
stopped = False
ThreadPool = ThreadPoolExecutor(max_workers=64)
def delay_pyle_command(timer, fun):
def timed_cmd():
time.sleep(timer)
fun()
Thread... |
manager.py | from threading import Thread
from datetime import datetime
import time
import os
import cv2
from settings import INCHES_TO_CENIMETERS, Reading
PPEAK_EXPIRATION_SECONDS = 3.0
SAMPLE_RATE_WINDOW = 5.0
READING_RELEVANCE = max([PPEAK_EXPIRATION_SECONDS, SAMPLE_RATE_WINDOW])
class Manager():
def __init__(self):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.