source
stringlengths
3
86
python
stringlengths
75
1.04M
test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import os import signal import sys import threading import time import unittest import ray.local_scheduler as local_scheduler import ray.plasma as plasma import pyarrow as pa USE_VALGRIND =...
gossiping.py
import Queue __author__ = "Thomas Spycher, Philipp Spinnler" __copyright__ = "Copyright 2013, Zerodine GmbH (zerodine.com) " __credits__ = ["Thomas Spycher", "Philipp Spinnler"] __license__ = "Apache-2.0" __maintainer__ = "Thomas Spycher" __email__ = "me@tspycher.com" __status__ = "Development" import logging import ...
main.py
from OSC import OSCServer, OSCMessage, ThreadingOSCServer, ForkingOSCServer, OSCClient import kivy #kivy.require('1.9.0') #import os #kivy_path = r'C:\Users\ogoshen1\Downloads\Kivy-1.9.0-py2.7-win32-x86' #os.environ['GST_PLUGIN_PATH'] = kivy_path + r"\gstreamer\lib\gstreamer-1.0" #os.environ['GST_REGISTRY'] = kivy_pa...
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...
mutex.py
# What the threads_and_data example shows is called a race condition, we don't know the output. # To synchronise access to data we can use a mutex, using it will enable us to synchronise acces # to a resource/a region of code. from threading import Thread, Lock import time mutex = Lock() nums = [] def run(n): #...
listener.py
from __future__ import print_function import psutil import time import platform import os import sys import csv import threading import logging from colorlog import ColoredFormatter, getLogger from reporter.influxdbhandler import influx_writer from reporter.flaskapi import start_server,PerfData,stop_server ...
app.py
import json from threading import Thread from queue import Queue from migration.json_decoder import get_workload, get_migration from api.listener import Listener from persistence.workload import WorkloadPickler from persistence.migration import MigrationPickler from flask import Flask from flask import request from...
answer_bot.py
""" Takes the screenshot and tries to guess the answer. Each option is red and searched in parallel. """ from multiprocessing import Process, Manager from modules.imgtotext import * import numpy as np from modules.gsearch import * from threading import Thread import modules.emulator as em from operator import itemge...
blecontroller.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jan 10 09:13:24 2018 @author: takata@innovotion.co.jp @author: harada@keigan.co.jp """ from pykeigan import controller as base import struct, time,threading, atexit from bluepy import btle from pykeigan.utils import * class BLEController(base.Controlle...
BLW.py
#Decompiled by MR.BLackWhite import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool from requests.exceptions import ConnectionError from mechanize import Browser reload(sys) sys.setdefaultencoding('utf8') br = mechanize.Bro...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum from electrum.bitcoin import TYPE_ADDRESS from electrum import WalletStorage, Wallet from electrum_gui.kivy.i18n import _ from electrum.contacts import Contacts from electrum.payment...
new_face_detect.py
import cv2 import platform from PIL import Image import face_recognition from edgetpu.detection.engine import DetectionEngine from queue import Queue from multiprocessing import Process import multiprocessing import time from time import sleep import math from sklearn import neighbors import os import os.path import pi...
server.py
#!flask/bin/python import asyncio import colorsys import importlib import inspect import json import os.path import sys import threading import time import psutil import multiprocessing import traceback from timeit import default_timer as timer import logging import mido import signal from functools import wraps impor...
_server.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...
resolver.py
"""Contains code related to the module resolver.""" # standard import logging from threading import Thread import os import requests import time import asyncio # local from resolve.enums import Module, MessageType, SystemStatus from conf.config import get_nodes from communication.zeromq import rate_limiter from metri...
utils.py
import azure.batch.models as batchmodels import azure.storage.blob as azureblob from azure.storage.blob.models import ContainerPermissions import azext.batch as batch import datetime import time import os from enum import Enum import pytz import logger import threading utc = pytz.utc """ Utility module that holds the...
test_context.py
# -*- coding: utf-8 -*- from pmdarima.arima.auto import StepwiseContext, auto_arima from pmdarima.arima._context import ContextStore, ContextType from pmdarima.arima import _context as context_lib from pmdarima.datasets import load_lynx, load_wineind from unittest import mock import threading import collections impor...
test_pickle.py
from machin.parallel.pickle import dumps, loads from machin.parallel.process import Process import torch as t from multiprocessing import Pipe, get_context from test.util_platforms import linux_only def subproc_test_dumps_copy_tensor(pipe): pipe.send(dumps(t.zeros([10]), copy_tensor=True)) def test_dumps_copy_t...
detection_utils.py
from collections import deque import cv2 from threading import Thread import numpy as np import time import torch import torchvision import os import logging import requests #code partly adapted from https://github.com/mikel-brostrom/Yolov5_DeepSort_Pytorch def on_segment(p, q, r): # check if point r is on segment pq...
Table.py
import numpy as np import pandas as pd from hdfs import InsecureClient import threading class Table: def __init__(self, schema, n_rows, name, storage="row", filename=None): self.name = name self.n_cols = len(schema) self.storage = storage self.schema = schema self.col_name...
thread.py
# Copyright 2021 Katteli Inc. # TestFlows.com Open-Source Software Testing Framework (http://testflows.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/lice...
servers.py
""" Starting in CherryPy 3.1, cherrypy.server is implemented as an :ref:`Engine Plugin<plugins>`. It's an instance of :class:`cherrypy._cpserver.Server`, which is a subclass of :class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class is designed to control other servers, as well. Multiple servers/p...
processor_v2_abl_audio.py
import datetime import lmdb import math import matplotlib.pyplot as plt import numpy as np import os import pickle import pyarrow import python_speech_features as ps import threading import time import torch import torch.optim as optim import torch.nn as nn import torch.nn.functional as F from librosa.feature import m...
ui1(current).py
from PyQt5 import QtGui,QtWidgets,QtCore from PyQt5.QtWidgets import QApplication,QRadioButton,QPushButton,QListWidget,QDial,QSpinBox,QLCDNumber,QMessageBox,QLabel from PyQt5.QtGui import QPixmap import sys import matplotlib.pyplot as plt from matplotlib.figure import Figure import numpy as np from matplotlib.ba...
multiprocess_iterator.py
from __future__ import division import collections import datetime import multiprocessing from multiprocessing import sharedctypes import signal import sys import threading import warnings import numpy import six from chainer.dataset import iterator from chainer.iterators.order_samplers import ShuffleOrderSampler _...
automated.py
#!/usr/bin/env python3 # Copyright (c) 2017 Intel 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 ...
auto_reload_worker.py
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available. Copyright (C) 2017-2020 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in co...
multip.py
import multiprocessing from multiprocessing import Process, Pipe, Queue import time def standalone_headless(pq, cq, plock): plock.acquire() print("Lata") plock.release() time.sleep(0.1) msg = pq.get() print(msg) if msg == 'hello': cq.put('gottem1') cq.put('gottem2') ...
lkDrEngine.py
''' Project: Negociant Copyright (c) 2017 Xilin Jia <https://github.com/XilinJia> This software is released under the MIT license https://opensource.org/licenses/MIT ''' # encoding: UTF-8 ''' 本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。 使用DR_setting.json来配置需要收集的合约,以及主力合约代码。 ''' import json import csv import os import cop...
irc.py
# coding=utf8 """ irc.py - An Utility IRC Bot Copyright 2008, Sean B. Palmer, inamidst.com Copyright 2012, Edward Powell, http://embolalia.net Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> Licensed under the Eiffel Forum License 2. Willie: http://willie.dftba.net/ When working on core IRC protocol related ...
utils.py
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. from __future__ import annotations import csv import itertools import logging import math import threading from collections import defaultdict from dataclasses import Field, field as dataclass_field, fields as dataclass_fields from typing import ...
deletionwatcher.py
import json import requests import time # noinspection PyPackageRequirements import websocket # noinspection PyPackageRequirements from bs4 import BeautifulSoup from threading import Thread from urlparse import urlparse import metasmoke from globalvars import GlobalVars import datahandling # noinspection PyClassHasNo...
crvdata.py
__author__ = 'ian.collins' import kivy kivy.require('1.9.0') from kivy.uix.boxlayout import BoxLayout from kivy.uix.button import Button from kivy.uix.progressbar import ProgressBar #from kivy.uix.label import Label from kivy.uix.popup import Popup #from kivy.uix.bubble import Bubble #from kivy.logger import...
__init__.py
# -*- coding: UTF-8 -*- from __future__ import absolute_import # Operates on sound fragments consisting of signed integer samples 8, 16 # or 32 bits wide, stored in Python strings. import audioop import os import time from contextlib import contextmanager from ctypes import CFUNCTYPE, c_char_p, c_int, cdll from threa...
video2chars.py
# -*- coding:utf-8 -*- import numpy as np import pickle import os import invoke from threading import Thread # 用于生成字符画的像素,越往后视觉上越明显。。这是我自己按感觉排的,你可以随意调整。写函数里效率太低,所以只好放全局了 pixels = " .,-'`:!1+*abcdefghijklmnopqrstuvwxyz<>()\/{}[]?234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ%&@#$" def video2imgs(video_name, size, seconds): ...
runner.py
#!/usr/bin/env python2 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
main.py
from discord.ext import commands import importlib import json import os from threading import Thread from time import sleep # check if config file exists if not os.path.isfile('config.json'): print("Could not find config.json. Read about creating it here: https://mninc.github.io/ludus/") input("Press enter to ...
tree_musica.py
#Como eu não conseguia resolver os bugs, decidi criar 2 arquivos, esse arquivo abre e toca o lofi e tem o bug do lofi tocar infinitamente indepedente do tempo :/ from time import sleep import PySimpleGUI as sg from audioplayer import AudioPlayer from PySimpleGUI.PySimpleGUI import Tree from threading import Thread d...
stationary_display.py
import Tkinter import plot_manager_D3S import threading import time from multiprocessing import Process # spectra, waterfall plot_jobs = [None, None] global mgrD3S mgrD3S = plot_manager_D3S.Manager_D3S(plot = False) top = Tkinter.Tk() global jobd3s jobd3s = None def start_D3S(): global mgrD3S mgrD3S.run() de...
__init__.py
#coding=utf-8 import sys if __name__.endswith('qgb.N'):from qgb import py else: from pathlib import Path gsqp=Path(__file__).absolute().parent.parent.parent.absolute().__str__() if gsqp not in sys.path:sys.path.append(gsqp)#py3 works from qgb import py # import py #'py': <module 'py' from '..\\py.py'>, RPC_BASE_R...
platform.py
import os import logging import time import signal import threading import socket import atexit try: from ConfigParser import RawConfigParser, NoOptionError except ImportError: from configparser import RawConfigParser, NoOptionError from . import version as agent_version from .common.object_names import call...
cancel.py
#!/usr/bin/env python from urllib2 import quote as urllib2_quote, Request as urllib2_Request, urlopen as urllib2_urlopen, URLError as urllib2_URLError, HTTPError as urllib2_HTTPError from threading import Thread, Lock, current_thread, Timer, local as threading_local from time import sleep print "Request start" req = ...
scan.py
import quo import collections import datetime import shodan import shodan.helpers as helpers import socket import threading import time from shodan.cli.helpers import get_api_key, async_spinner from shodan.cli.settings import COLORIZE_FIELDS @quo.group() def scan(): """Scan an IP/ netblock using Shodan.""" p...
test_dataloader.py
import math import sys import errno import os import ctypes import torch import gc import time import signal import unittest import itertools import warnings from torch import multiprocessing as mp from torch.utils.data import _utils, Dataset, IterableDataset, TensorDataset, DataLoader, ConcatDataset, ChainDataset from...
market_price_posting.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. -- ...
cli.py
import logging import os import threading import webbrowser import typer import uvicorn from uvicorn.config import LOGGING_CONFIG from fps.config import Config from fps.logging import get_logger_config from fps.plugins import load_configurations from .config import FPSConfig app = typer.Typer() @app.command() def...
ch05_respeaker.py
import logging import time from threading import Thread, Event from respeaker import Microphone from respeaker.bing_speech_api import BingSpeechAPI # get a key from https://www.microsoft.com/cognitive-services/en-us/speech-api BING_KEY = '<--bing speech api-->' def task(quit_event): ...
launch_servers.py
from multiprocessing import Process import time import argparse import socket import os from utils import check_ports_avail ap = argparse.ArgumentParser() ap.add_argument("-n", "--number-servers", required=True, help="number of servers to spawn", type=int) ap.add_argument("-p", "--ports-start", required=True, help="th...
keep_alive.py
# file name is keep_alive.py from flask import Flask from threading import Thread import logging # ロガーの取得 werkzeug_logger = logging.getLogger("werkzeug") # レベルの変更 werkzeug_logger.setLevel(logging.ERROR) app = Flask('') @app.route('/') def main(): return "Your bot is alive!" def run(): app.run(host="0.0.0.0", p...
inmem_server.py
from object_database.server import Server from object_database.database_connection import DatabaseConnection from object_database.messages import ClientToServer, ServerToClient, getHeartbeatInterval from object_database.persistence import InMemoryPersistence import time import queue import logging import threading imp...
cvimage.py
from __future__ import annotations from dataclasses import dataclass from typing import overload from numbers import Real import builtins import sys import os import io import math import warnings import contextlib from pathlib import Path import cv2 import numpy as np def isPath(f): return isi...
clientes.py
# -*- coding: utf-8 -*- # @Author: Manuel Rodriguez <valle> # @Date: 10-May-2017 # @Email: valle.mrv@gmail.com # @Last modified by: valle # @Last modified time: 17-Mar-2018 # @License: Apache license vesion 2.0 from kivy.uix.anchorlayout import AnchorLayout from kivy.storage.jsonstore import JsonStore from kivy.p...
diff-filterer.py
#!/usr/bin/python3 # # Copyright (C) 2018 The Android Open Source Project # # 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 ...
views.py
from django.shortcuts import render, get_object_or_404, redirect from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from recommender.forms import LoginForm from recommender.models import Item from django.views import generic from django.views.generic import Re...
pjit_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, ...
server.py
import shutil import threading from base64 import b64encode from copy import copy from http.server import BaseHTTPRequestHandler, HTTPServer from io import BytesIO from pathlib import Path from urllib.parse import parse_qs, unquote, urlparse from .settings import PKG_DIR from .utils import create_jinja_env, echo def...
EncrypC.py
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys import hashlib import tkinter as tk from tkinter import filedialog from tkinter import messagebox from tkinter import * from Cryptodome.Cipher import AES import threading from pathlib import Path class EncryptionTool: def __init__( self, ...
worldgen.py
from __future__ import print_function import mcpi from mcpi import minecraft from mcpi.vec3 import Vec3 from threading import Thread import time import numpy as np import queue import threading from connection import Connection import random import os # Run this code in the terminal to improve performance # !!!!!!!!...
plotter.py
import subprocess import threading import datetime import os import shlex from replotting import replotting class plot_process_monitor(object): proc = None start_time = None temp_drive = "" temp_drive_two = "" destination_drive = "" log_file_name = "" is_alive = True phase = 0 file_...
cache_ventilator.py
#!/usr/bin/python import time import zmq import sys import optparse # import fileinput # Was using as fast low memory line by line parser from lxml import etree from multiprocessing import Process AGENTS = ["MSIE", "Chrome", "Firefox", "Safari", "Opera"] # Fast iterative XML parsing function useful for parsing huge...
local.py
#!/usr/bin/env python # Copyright (c) 2013 clowwindy # # 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 use, copy, modify, me...
data_poller.py
# Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fut...
SensapexPressureControl.py
from __future__ import print_function from threading import Thread from time import sleep from acq4.drivers.sensapex import UMP from acq4.util import Qt from .PressureControl import PressureControl, PressureControlWidget from ..util.debug import logExc class SensapexPressureControl(PressureControl): """Pressure...
serial_test.py
from serial import Serial import threading import signal import sys serial = Serial("/dev/ttyACM0", 115200, timeout=1.0) f_send = open("file_tx.txt", "r") f_recv = open("file_rx.txt", "w") do_exit = False def loop_write(): for line in f_send.readlines(): print(line[:-1]) serial.write(line.encod...
game.py
import os import random from game.card_list import card_list, all_bids, pretty_card_str from collections import defaultdict from flask_socketio import emit from game.card_sorting import sort_card_list from game.card_validity import is_card_valid, winning_card_index import threading class Game: def __init__(self):...
__init__.py
"""A package for creating Extract-Transform-Load (ETL) programs in Python. The package contains a number of classes for filling fact tables and dimensions (including snowflaked and slowly changing dimensions), classes for extracting data from different sources, classes for defining 'steps' in an ETL flow, ...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import logging import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool, Pool from pathlib import Path from threading import Thread ...
dbapi.py
# pysqlite2/test/dbapi.py: tests for DB-API compliance # # Copyright (C) 2004-2010 Gerhard Häring <gh@ghaering.de> # # This file is part of pysqlite. # # This software is provided 'as-is', without any express or implied # warranty. In no event will the authors be held liable for any damages # arising from the use of t...
api.py
""" For example: >> future = get('/', host='127.0.0.1', port=5000) >> response = future.result() This will also try to resolve DNS, so this should work: >> future = get('/', host='www.google.com', port=80) >> response = future.result() """ import asyncio import ipaddress import socket from threading im...
devtools_browser.py
# Copyright 2019 WebPageTest LLC. # Copyright 2017 Google Inc. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Base class support for browsers that speak the dev tools protocol""" import glob import gzip import io import logging import os import re import shut...
specification_drawer.py
""" A specification drawer is for visualizing combinatorial specification object """ import json import os import tempfile import threading import time import uuid import webbrowser from copy import copy from typing import TYPE_CHECKING, ClassVar, Dict, Iterable, List, Tuple, cast import requests from logzero import l...
igmpproxyTest.py
# Copyright 2017-present Open Networking Foundation # # 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 ag...
tests.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...
server.py
from dataclasses import dataclass from threading import Thread import unicodedata as ud import json import math import time from random import randint import eventlet from flask_socketio import SocketIO from flask import Flask, send_from_directory, render_template from ip import ip_address, port # Init app async_mo...
tuhay kaba.py
import subprocess from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC import time from appium import webdriver import itertools from xlrd import open_workbook from future.utils import iteritems from...
masterAction.py
''' Action take by agent ''' import sys,os import validators import re, random from furl import * from urllib.parse import urlparse import time, signal from multiprocessing import Process import stomp import re from daemonize import Daemonize from os.path import basename from os.path import basename current_dir = os....
timing.py
# # -*- coding: utf-8 -*- # from multiprocessing import Process # from scrapy import cmdline # import time # import logging # # # 配置参数即可, 爬虫名称,运行频率 # confs = [ # { # "spider_name": "awp914", # "frequency": 2, # }, # ] # # # def start_spider(spider_name, frequency): # args = ["scrapy", "crawl...
miner_cli.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Miner client ''' import sys import psutil import binascii, json, socket, struct import threading, time, urlparse, random, platform from multiprocessing import Process, Queue, Manager, cpu_count, Event #from threading import Timer try: from cryptonite_hash import cpu_h...
server.py
import socket from threading import Thread import sys import signal MESSAGE_SIZE = 1024 server_sock = None separator_token = "<SEP>" # we will use this to separate the client name & message client_sockets = None def sigterm_handler(_signum, _frame) -> None: sys.exit(1) def clean_up(): global server_sock ...
main.py
from threading import Thread, Lock import logging import webview from time import sleep from server import run_server server_lock = Lock() logger = logging.getLogger(__name__) def url_ok(url, port): # Use httplib on Python 2 try: from http.client import HTTPConnection except ImportError: ...
common.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_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import unittest import unittest.mock from weakref import proxy import contextlib import functools ...
client.py
import cv2 import sys from PyQt5 import uic import PyQt5.QtCore from PyQt5.QtGui import * from PyQt5.QtWidgets import * import gtts import playsound import gaze_tracking import time import threading import NewGallery import pandas as pd import dlib import serial import SendMessage # 아두이노 try: ard = serial.Serial('...
Efficiency.py
import argparse import glob import json import os import time from multiprocessing import Manager, Process from pynvml.smi import nvidia_smi from logger import add_file_handler_to_logger, logger add_file_handler_to_logger(name="main", dir_path="logs/", level="DEBUG") manager = Manager() gpu_list = man...
evaluate_agent.py
''' @name: evaluate_agent.py @brief: Evaluates an agent according to a test set. @author: Ronja Gueldenring @version: 3.5 @date: 2019/04/05 ''' import os home = os.path.expanduser("~") import rospy import rospkg from multiprocessing import Process from scripts.run_scripts.run_ppo...
datavisualizer.py
import asyncio import datetime import random from websocket_server import WebsocketServer import threading import queue import time dataQueue = queue.Queue() def new_client(newClient, server): print("New Client connected") while True: try: if not dataQueue.empty(): server.s...
_train_megaface.py
from __future__ import print_function from absl import app from absl import flags as absl_flags import tensorflow as tf import benchmark_cnn import cnn_util import flags from cnn_util import log_fn from preprocessing import BaseImagePreprocessor from datasets import Dataset import numpy as np import cv2 from queue im...
agent.py
#!/usr/bin/env python # # AzureMonitoringLinuxAgent Extension # # Copyright 2019 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/L...
TestRC.py
#!/usr/bin/env python """ Test script to test sending RC input to shotManager (Used for testing shotManager in SITL) Also emulates the button server in stm32 running on Artoolink This takes user input to change rc values (use the arrow keys) Only meant for debugging purposes, so it's not production code """ #Imports ...
session_test.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...
conftest.py
from concurrent import futures import threading import pytest import grpc from prometheus_client import exposition, registry from py_grpc_prometheus.prometheus_client_interceptor import PromClientInterceptor from py_grpc_prometheus.prometheus_server_interceptor import PromServerInterceptor from tests.integration.hell...
app_utils.py
# From http://www.pyimagesearch.com/2015/12/21/increasing-webcam-fps-with-python-and-opencv/ import struct import six import collections import cv2 import datetime import subprocess as sp import json import numpy import time from threading import Thread from matplotlib import colors class FPS: def __init__(self): ...
log_util_test.py
# Copyright 2014 PerfKitBenchmarker 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 appli...
picarCommandHandler.py
#!/usr/bin/python3 # File name : picarCommandHandler.py # Description : handles commands for PiCar import time import traceback import requests import json import threading from piServices.piUtils import timePrint import picar import picarDrive import picarHead import picarConst # constants for http status strings...
firehose.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # (c) B.Kerler 2018-2019 import binascii import platform import time import json from struct import unpack from binascii import hexlify from Library.utils import * from Library.gpt import gpt from Library.sparse import QCSparse try: from Library.Modules.init import modul...
meterpreter.py
#!/usr/bin/python import binascii import code import os import platform import random import re import select import socket import struct import subprocess import sys import threading import time import traceback try: import ctypes except ImportError: has_windll = False else: has_windll = hasattr(ctypes, '...
benchmark.py
""" Copyright (c) 2014, Samsung Electronics Co.,Ltd. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and...
add_server.py
import socket import sys import lib.ProtocolUtils as protocolUtils import threading as thread def message_handler(conn, addr): data = protocolUtils.MessageHandler(conn.recv(1024)).message_loads() print("New operation in queue ", data[0], " ", data[2]) try: result = str(float(data[0]) + float(data...
shellutils.py
from __future__ import annotations from contextlib import contextmanager from pathlib import Path import os from typing import List import subprocess import sys from multiprocessing import Process @contextmanager def working_directory(path: Path) -> None: prev_dir = os.getcwd() os.chdir(str(path)) try: ...