source
stringlengths
3
86
python
stringlengths
75
1.04M
__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Han Xiao <[email protected]> <https://hanxiao.github.io> import sys import threading import time import uuid import warnings from collections import namedtuple from functools import wraps import numpy as np import zmq from zmq.utils import jsonapi __all__ = ['__versio...
fast_solve.py
import argparse import os import subprocess import threading from common.parse import parse_problem def get_dest_file(problem, destination): dest_dir = os.path.abspath(destination) os.makedirs(dest_dir, exist_ok=True) problem_code = problem.name[0].lower() num = 0 while os.path.isfile(os.path.joi...
editor_test.py
""" Copyright (c) Contributors to the Open 3D Engine Project. For complete copyright and license terms please see the LICENSE at the root of this distribution. SPDX-License-Identifier: Apache-2.0 OR MIT Test-writing utilities that simplify creating O3DE in-Editor tests in Python. Test writers should subclass a test ...
android_helper.py
import os import sys import json import time import codecs import lyrebird import threading import subprocess from . import config from lyrebird import context from lyrebird.log import get_logger """ Android Debug Bridge command helper Basic ADB command for device_service and API """ logger = get_logger() here = os...
test_unit.py
import pytest from rundoc import BadInterpreter, BadEnv, RundocException, CodeFailed import rundoc.block as rb import rundoc.commander as rc import rundoc.parsers as rp import rundoc.__main__ as rm from pygments import highlight from pygments.formatters import Terminal256Formatter from pygments.lexers import get_lexe...
debug_display_server.py
#!/usr/bin/env python # # Cloudlet Infrastructure for Mobile Computing # # Author: Zhuo Chen <[email protected]> # # Copyright (C) 2011-2013 Carnegie Mellon University # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may ...
servidor.py
import socket import threading import socketserver def tratarCliente(clientsocket, adress): while True: msg_cliente = clientsocket.recv(1024).decode("utf-8") # para transformar em string -> usar o decode for i in range(0,len(lista_sockets)): if(adress != lista_adresses[i]): # ...
main.py
""" Ngrok Web Manager Github: @thisiskeanyvy Instgram: @thisiskeanyvy Twitter: @thisiskeanyvy """ import os, socket, threading from time import * from set import * from webserver import * from pyngrok import ngrok, conf #background jobs webserver_start = threading.Thread(target=webserver_start, name="Ngrok Web Manage...
bitcoin_event.py
#!/usr/bin/python import sqlite3 import os from threading import Lock db_filename = 'bitcoin_events.db' db_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), db_filename) # connect db db_lock = Lock() conn = sqlite3.connect(db_filename) # create tables c = conn.cursor() c.execute('''create table if...
blockly_tool.py
#!/usr/bin/env python3 # Software License Agreement (BSD License) # # Copyright (c) 2019, UFACTORY, Inc. # All rights reserved. # # Author: Vinman <[email protected]> <[email protected]> try: import xml.etree.cElementTree as ET except ImportError: import xml.etree.ElementTree as ET import re import sys imp...
data_creation_game4.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Mon Sep 7 11:00:24 2020 @author: djoghurt """ import cv2 import numpy as np import dlib from math import hypot import pyautogui import random import subprocess import json import threading import time import os receiveBuffer = "" receiveStatus = 0 DATA =...
_simple_stubs.py
# Copyright 2020 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...
1.1_rms_bankers_Speak.py
# Author Emeka Ugwuanyi Emmanuel from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp from threading import Thread import threading import ast import time import os import psutil import datetime as dt import getp...
compositor.py
""" The compositor module combines the different output files of the simulation. As the simulation module outputs different files for background and foreground and because the intensity of the blender rendered images are not constant, the compositor is required to fix the intensity issue and add the star background. "...
process.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import, with_statement import copy import os import sys import time import errno import types import signal import logging import threading import contextlib import subprocess import multiprocessing import multiprocessing.util # Import salt...
test_kernelmanager.py
"""Tests for the KernelManager""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import asyncio import json import os pjoin = os.path.join import signal from subprocess import PIPE import sys import time import threading import multiprocessing as mp import pytest...
make.py
import os import glob import time import shutil import bpy import json import stat from bpy.props import * import subprocess import threading import webbrowser import arm.utils import arm.write_data as write_data import arm.make_logic as make_logic import arm.make_renderpath as make_renderpath import arm.make_world as ...
test.py
import time import os import threading import random from contextlib import contextmanager import pytest from helpers.cluster import ClickHouseCluster from helpers.network import PartitionManager from helpers.test_tools import TSV from helpers.client import CommandRequest cluster = ClickHouseCluster(__file__) node...
Salas.py
import os import sys from random import shuffle, choice from threading import Thread, Timer from PyQt5.QtCore import pyqtSignal, QObject from PyQt5.QtGui import QPixmap, QIcon, QStandardItem, QStandardItemModel, QCloseEvent from PyQt5.QtWidgets import QPushButton, QWidget, QVBoxLayout, QListWidget, QLabel, QApplicatio...
publisher.py
import errno import hashlib import os import posixpath import select import shutil import subprocess import tempfile import threading from contextlib import contextmanager from ftplib import Error as FTPError from werkzeug import urls from lektor._compat import (iteritems, iterkeys, range_type, string_types, text...
speedtest.py
# Taken from https://github.com/sivel/speedtest-cli import csv import datetime import errno import math import os import platform import re import signal import socket import sys import threading import timeit import xml.parsers.expat from insomniac import utils try: import gzip GZIP_BASE = gzip.GzipFile ex...
hash.py
#!/usr/bin/env python """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ try: from crypt import crypt except ImportError: from thirdparty.fcrypt.fcrypt import crypt _multiprocessing = None try: import multiprocessing # problems on...
mocktraffic.py
#!/usr/bin/env python # Copyright (c) 2020-2021 VMware, Inc. All Rights Reserved. # SPDX-License-Identifier: BSD-2 License # The full license information can be found in LICENSE.txt # in the root directory of this project. import logging import os import queue import threading import time from lydian.apps.base impor...
mdns_example_test.py
import re import os import socket import time import struct import dpkt import dpkt.dns from threading import Thread, Event from tiny_test_fw import DUT import ttfw_idf # g_run_server = True # g_done = False stop_mdns_server = Event() esp_answered = Event() def get_dns_query_for_esp(esp_host): dns = dpkt.dns.DN...
tf_util.py
""" Taken from https://github.com/openai/baselines """ import collections import copy import functools import multiprocessing import os import joblib import numpy as np import tensorflow as tf # pylint: ignore-module def switch(condition, then_expression, else_expression): """Switches between two operations dep...
conan_worker.py
from queue import Queue from threading import Thread # this allows to use forward declarations to avoid circular imports from typing import TYPE_CHECKING, List from PyQt5 import QtCore from conans.model.ref import ConanFileReference from conan_app_launcher.base import Logger from conan_app_launcher.components.conan ...
lambda_executors.py
import os import re import glob import json import time import logging import threading import subprocess import six from multiprocessing import Process, Queue try: from shlex import quote as cmd_quote except ImportError: from pipes import quote as cmd_quote # for Python 2.7 from localstack import config from ...
backend.py
#!/usr/bin/python3 import json, hug, random, time, threading, operator with open("questions.json") as f: questions = json.load(f) sessions = {} for question in questions: questionIDs = list(questions.keys()) #sessions["test"] = {"questionsCount": 0, "questionsRemaining": 0, "players":{"Mork":{"timeOut": 0, "s...
progress.py
from __future__ import division, absolute_import import sys import threading import time from timeit import default_timer def format_time(t): """Format seconds into a human readable form. >>> format_time(10.4) '10.4s' >>> format_time(1000.4) '16min 40.4s' """ m, s = divmod(t, 60) h, ...
test_client_fetch.py
from threading import Thread, Lock from typing import Any, Callable, List from unittest.mock import patch from pykusto import PyKustoClient, Query # noinspection PyProtectedMember from pykusto._src.client_base import Database # noinspection PyProtectedMember from pykusto._src.expressions import _StringColumn, _NumberC...
test_httplib.py
import errno from http import client import io import itertools import os import array import re import socket import threading import unittest TestCase = unittest.TestCase from test import support here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' CERT_localhost = os.path.join(here, 'keycert.p...
microphone.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # Import modules from io import BytesIO from core.logger import Log from threading import Thread from wave import open as wave_open # pip3 install wave from pyaudio import paInt16, PyAudio # pip3 install pyaudio from core.messages import services as Messages """ Author : Lim...
Main_Tweak_Test-copy.py
import Call_UTI from send_multiple_setpoints import * from read_Temp_value import * import numpy as np import pandas as pd import os import sys from threading import Thread from ctypes import * import time from pyqtgraph.Qt import QtCore, QtGui import pyqtgraph as pg import numpy as np import math from thermocouples_re...
test_local_catalog.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...
p2p_stress.py
import testUtils import p2p_test_peers import random import time import copy import threading from core_symbol import CORE_SYMBOL class StressNetwork: speeds=[1,5,10,30,60,100,500] sec=10 maxthreads=100 trList=[] def maxIndex(self): return len(self.speeds) def randAcctName(self): ...
ThreadPool.py
#!/usr/bin/env python # -*- coding:utf-8 -*- #!/usr/bin/env python # -*- coding:utf-8 -*- import queue import threading import contextlib import time StopEvent = object() class ThreadPool(object): def __init__(self, max_num): self.q = queue.Queue()#存放任务的队列 self.max_num = max_num#最大线程并发数 ...
thread_delegating_executor.py
# Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ...
pinchsensor_3_20180213.py
from PyQt5 import QtCore, QtGui, QtWidgets import pyqtgraph as pg import time import datetime import serial import numpy as np import threading import os import configparser default_time = 5 # 3 <= default_time <= 20 default_ymin = 2.0 default_ymax = 3.5 default_port = 'COM3' default_b...
block.py
import time import threading import warnings from contextlib import contextmanager import remoteobj import reip from reip.stores import Producer from reip.util import text, Meta ''' ''' __all__ = ['Block'] class _BlockSinkView: '''This is so that we can select a subview of a block's sinks. This is similar ...
__init__.py
import multiprocessing import pytest import tempfile from gym_remote.client import RemoteEnv from gym_remote.server import RemoteEnvWrapper @pytest.fixture(scope='function') def tempdir(): with tempfile.TemporaryDirectory() as dir: yield dir @pytest.fixture(scope='function') def process_wrapper(): w...
resource_sharer.py
# # We use a background thread for sharing fds on Unix, and for sharing sockets on # Windows. # # A client which wants to pickle a resource registers it with the resource # sharer and gets an identifier in return. The unpickling process will connect # to the resource sharer, sends the identifier and its pid, and...
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...
kw_train.py
import gfootball.env as football_env import time, os import numpy as np import torch import torch.multiprocessing as mp # from actor import * from learner import * from evaluator import evaluator ################################################################################ def save_args(arg_dict): os.makedirs(a...
TTSAlertsAndChat_StreamlabsSystem.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Text-To-Speech for Alerts and Chat Messages 1.1.4 Fixed bug adding unicode characters to banned words list Added setting for ban messages Added ability to ban users for a time 1.1.3 Fixed bug where banned words showed on overlay 1.1.2 Support ...
main.py
""" mlperf inference benchmarking tool """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import array import collections import json import logging import os import sys import threading import time from queue import Queue import mlperf_l...
arvfile.py
# Copyright (C) The Arvados Authors. All rights reserved. # # SPDX-License-Identifier: Apache-2.0 from __future__ import absolute_import from __future__ import division from future import standard_library from future.utils import listitems, listvalues standard_library.install_aliases() from builtins import range from ...
connection.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
example2.py
# importing the multiprocessing module import multiprocessing import time import os def worker1(): # printing process id time.sleep(5) print("ID of process running worker1: {}".format(os.getpid())) def worker2(): # printing process id print("ID of process running worker2: {}".format(os.ge...
server.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division import threading try: from SimpleXMLRPCServer import SimpleXMLRPCServer except ImportError: from xmlrpc.server import SimpleXMLRPCServer __all__ = ['Server'] class Server(SimpleXMLRPCServer): "...
test_msvccompiler.py
"""Tests for distutils._msvccompiler.""" import sys import unittest import os import threading from distutils.errors import DistutilsPlatformError from distutils.tests import support from test.support import run_unittest SKIP_MESSAGE = (None if sys.platform == "win32" else "These tests are only for w...
tcp_sender.py
# Copyright 2020 Unity Technologies # # 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...
test_mysql_client.py
# Copyright 2020 The FedLearner 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...
progSound.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from pygame import mixer import threading, random, socket play = 0 file = 0 sock = socket.socket() sock.bind(('', 6000)) sock.listen(1) conn, addr = sock.accept() #sock.settimeout(.01) def soundPlayer(arg3, soundPlayer_stop): global file global play while 1...
pb_gateway.py
# 恒投交易客户端 文件接口 # 1. 支持csv/dbf文件的读写 # 2. 采用tdx作为行情数据源 # 华富资产 李来佳 28888502 import os import sys import copy import csv import dbf import traceback import pandas as pd from typing import Any, Dict, List from datetime import datetime, timedelta from time import sleep from functools import lru_cache from collections import...
scriptinfo.py
import os import sys from tempfile import mkstemp import attr import collections import logging import json from furl import furl from pathlib2 import Path from threading import Thread, Event from .util import get_command_output from ....backend_api import Session from ....debugging import get_logger from .detectors ...
actuator.py
# MIT License # # Copyright (c) 2021 Mobotx # # 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, merge, publi...
connection.py
import time import re from threading import Lock, Thread from src.utility.exceptions import OperationError class Connection: def __init__(self, terminal=None): self._terminal = terminal self._reader_running = False self._auto_read_enabled = True self._auto_reader_lock = Lock() ...
create_s2_account_vdi_host.py
#!/usr/bin/env python #coding:utf-8 ''' Created on 2019-03-05 @author: yunify ''' import qingcloud.iaas import threading import time from optparse import OptionParser import sys import os import qingcloud.iaas.constants as const import common.common as Common def get_s2server_ip(conn,user_id,s2_servers_id): prin...
moduleinspect.py
"""Basic introspection of modules.""" from typing import List, Optional, Union from types import ModuleType from multiprocessing import Process, Queue import importlib import inspect import os import pkgutil import queue import sys class ModuleProperties: def __init__( self, name: str, fi...
Binance_Detect_Moonings.py
""" Horacio Oscar Fanelli - Pantersxx3 Version: 6.2 Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and shou...
memwatcher.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Profile mem usage envelope of IPython commands and report interactively""" from __future__ import division # 1/2 == 0.5, as in Py3 from __future__ import absolute_import # avoid hiding global modules with locals from __future__ import print_function # force use of pri...
server.py
import threading from pyee import EventEmitter from pythonosc import dispatcher, osc_server from tomomibot.const import OSC_ADDRESS, OSC_PORT class Server: def __init__(self, ctx, **kwargs): self.ctx = ctx self.is_running = False # Provide an interface for event subscribers sel...
scheduler.py
# !/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2018/3/31 21:53 # @Author : Yunhao Cao # @File : scheduler.py import time import threading import queue as Queue __author__ = 'Yunhao Cao' __all__ = [ 'Scheduler', ] def work_func(func, args, kwargs, queue, token): args = args or [] kwargs ...
joystick_creator.py
import sys import os import argparse import json import time import math from donkeycar.utils import * from donkeycar.parts.controller import JoystickCreatorController try: from prettytable import PrettyTable except: print("need: pip install PrettyTable") class CreateJoystick(object): def __init__(self)...
test_celery.py
import threading import pytest pytest.importorskip("celery") from sentry_sdk import Hub, configure_scope from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk.tracing import SpanContext from celery import Celery, VERSION from celery.bin import worker @pytest.fixture def connect_signal(reque...
debug_ext.py
import json import os import re import shlex import subprocess import sys import threading import time from threading import Thread from idf_py_actions.errors import FatalError from idf_py_actions.tools import ensure_build_directory PYTHON = sys.executable def action_extensions(base_actions, project_path): OPEN...
foreman.py
# vim:ts=4:sts=4:sw=4:expandtab import copy import datetime import dateutil.parser import glob import json import logging import math from multiprocessing import Process import os import random import shutil import subprocess import sys import tempfile import traceback from threading import Thread import time import u...
Simulation.py
# Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
ncm2_pyclang_proc.py
# -*- coding: utf-8 -*- from ncm2 import Ncm2Source, getLogger, Popen import subprocess import re from os.path import dirname from os import path, scandir import vim import json import shlex import time import threading import queue import traceback from distutils.spawn import find_executable import sys sys.path.inse...
test_contextvars.py
import pytest import random import time from sentry_sdk.utils import _is_threading_local_monkey_patched @pytest.mark.forked def test_thread_local_is_patched(maybe_monkeypatched_threading): if maybe_monkeypatched_threading is None: assert not _is_threading_local_monkey_patched() else: assert ...
weixin.py
#!/usr/bin/env python # coding: utf-8 import qrcode import urllib import urllib2 import cookielib import requests import xml.dom.minidom import json import time import re import sys import os import subprocess import random import multiprocessing import platform import logging import httplib import datetime from colle...
ism_test.py
#!/usr/bin/env python ''' Copyright (c) 2016, Allgeyer Tobias, Aumann Florian, Borella Jocelyn, Hutmacher Robin, Karrenbauer Oliver, Marek Felix, Meissner Pascal, Trautmann Jeremias, Wittenbeck Valerij All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted...
generatorclient.py
import socket from threading import Thread import datetime import pickle import hashlib import youtubequeue musicTypes = None sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) last_upload_times = None isRequestingScripts = False # Connect the socket to the port where the server is listening server_address = (...
bt.py
#!/usr/bin/python import bluetooth, os, time, sys, threading # The in directory for new pcap files PCAP_DIR = "/tmp/pcaps" GPSPATH = '/tmp/gpsfifo' SERVICE_NAME = "EyeOfTechnology" LOGFILE = "/var/log/iot.log" is_running = True def _curr_time(): return time.strftime("%Y-%m-%d %H:%M:%S") def _format_log(logstr...
combined.py
from flask import Flask, request, render_template,jsonify from flask_restful import Resource, Api import mysql.connector import json import requests import base64 import os import zipfile import re import shutil import requests import time import threading from json import loads from kafka import KafkaConsumer ''' S...
base_camera.py
""" This was originally pilfered from https://github.com/adeept/Adeept_RaspTank/blob/a6c45e8cc7df620ad8977845eda2b839647d5a83/server/base_camera.py Which looks like it was in turn pilfered from https://blog.miguelgrinberg.com/post/flask-video-streaming-revisited "Great artists steal". Thank you, @adeept and @miguel...
segment.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import json import logging import math import os from os.path import exists, join, split import threading import time import numpy as np import shutil import sys from PIL import Image import torch from torch import nn import torch.backends.cudnn as cudnn...
testserver.py
import socket import asyncio import threading import time from json import dumps from aiohttp import web class Response(web.Response): def __init__(self, *, json=None, **kwargs): if json is not None: text = dumps(json) content_type = "application/json" kwargs.update(te...
helpers.py
"""Supporting functions for polydata and grid objects.""" import collections.abc import enum import logging import signal import sys import warnings from threading import Thread import threading import traceback import numpy as np import scooby import vtk import vtk.util.numpy_support as nps import pyvista from .fil...
Cthulu.py
# @author Stefano Sesia all rights reserved # Cthulu command and control center # Requires sudo apt-get install mingw-w64 # Library Imports from CommunicationTunnelServer import * from TrivialFunctions import * from WebServer import * import constants # Constants PORT = 8000 #Functions def setKey(passphrase): c...
app.py
import importlib import sys import threading from pathlib import Path from flask import Flask, request app = Flask(__name__) SCRIPTS_PATH = 'scripts' mod = None def run_script_thread(script_name, script_arguments): global mod print("Running script {} with arguments {}".format(script_name, script_arguments)...
03_tcp_server.py
""" Quick spool TCP server, using built in socket module """ import socket import threading bind_ip = '0.0.0.0' bind_port = 9999 # Create client socket, using IPv4 and TCP socket type server = socket.socket(family=socket.AF_INET, type=socket.SOCK_STREAM) server.bind((bind_ip, bind_port)) serv...
conn.py
# -*-coding:utf-8-*- # Copyright (c) 2020 DJI. # # 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 in the file LICENSE.txt or at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') # -------------------------------------------------------- # handlers # -------------------------------------------------------- @app.route('/') def home(): return "Proctor bot is live!" # =====================================================...
test_dataloader.py
import math import sys import errno import os import ctypes import faulthandler import torch import gc import time import signal import unittest import itertools import warnings import tempfile from torch import multiprocessing as mp from torch.utils.data import _utils, Dataset, IterableDataset, TensorDataset, DataLoad...
article_flush.py
import sys import json import time import urllib3 import hashlib import requests import random from redis import StrictRedis from lxml import etree from selenium import webdriver from selenium.webdriver.chrome.options import Options from threading import Thread from multiprocessing import Process urllib3.disable_wa...
test_collection.py
""" Legalese -------- Copyright (c) 2016 Genome Research Ltd. Author: Colin Nolan <[email protected]> This file is part of HGI's common Python library This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Fou...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
deferred.py
 import os import time import threading def run(delaySeconds:float, func, *args, **kwargs): assert isinstance(delaySeconds, (int,float)) assert callable(func) def _threadFunc(): time.sleep(delaySeconds) func(*args, **kwargs) # t = threading.Thread(target=_threadFunc) t.start() # ...
core.py
# -*- coding: utf-8 -*- u"""SecureTea. Project: ╔═╗┌─┐┌─┐┬ ┬┬─┐┌─┐╔╦╗┌─┐┌─┐ ╚═╗├┤ │ │ │├┬┘├┤ ║ ├┤ ├─┤ ╚═╝└─┘└─┘└─┘┴└─└─┘ ╩ └─┘┴ ┴ Version: 1.1 Module: SecureTea """ # To share mouse gestures import struct import sys import time import threading from securetea import configurations from securet...
server-tad-pi-v3.py
#!/usr/bin/python from Adafruit_PWM_Servo_Driver import PWM import socket from multiprocessing import Process, Manager import time import sys import RPi.GPIO as GPIO import os ''' !!!THIS IS FOR LOCALHOST TESTING!!! Writen by Gunnar Bjorkman to control a robot via raspberrypi Current design: * Use...
tasks.py
import json, threading import apscheduler from apscheduler.schedulers.background import BackgroundScheduler from apscheduler.triggers.interval import IntervalTrigger as trigger from apscheduler import events from time import sleep from components.logger import Logger from datetime import datetime class Tasks: de...
server_inference.py
import argparse import torch import numpy as np import sys import os import dlib import PIL import threading import flask import queue import io sys.path.append(".") sys.path.append("..") from configs import data_configs, paths_config from utils.model_utils import setup_model from utils.alignment import align_face, ...
oracletest.py
import tensorflow as tf from utils.nn import linearND, linear from mol_graph import atom_fdim as adim, bond_fdim as bdim, max_nb, smiles2graph, smiles2graph_test, bond_types from models import * import math, sys, random from optparse import OptionParser import threading from multiprocessing import Queue import rdkit fr...
simulation_2.py
''' Created on Oct 12, 2016 @author: mwittie ''' import network_2 import link_2 import threading from time import sleep ##configuration parameters router_queue_size = 0 # 0 means unlimited simulation_time = 4 # give the network sufficient time to transfer all packets before quitting if __name__ == '_...
test_util_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...
WikiExtractor.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ============================================================================= # Version: 3.0 (July 22, 2020) # Author: Giuseppe Attardi ([email protected]), University of Pisa # # Contributors: # Antonio Fuschetto ([email protected]) # Leonardo Souza (lsouza@amte...
helper.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Created on Fri Dec 22 11:53:52 2017 @author: GustavZ """ import datetime import cv2 import threading import time import tensorflow as tf import sys PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 if PY2: import Queue elif PY3: import queue as Qu...
main.py
# Copyright 2017 Mycroft AI 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 writin...
transfer.py
from Ipv6_stun.server import Service import socket from threading import Thread import json import time from datetime import datetime class Transfer: def __init__(self,address=('127.0.0.1',9080)): self.user_info ={} #self.user_info={'000000':{'passward':'sdlab123','service':None,'heart_ad...