source
stringlengths
3
86
python
stringlengths
75
1.04M
cma-evolve.py
#!/usr/bin/env python3 import gym import torch import numpy as np import multiprocessing as mp import os import pickle import sys import time import logging import cma import argparse from torchmodel import StandardFCNet def _makedir(name): if not os.path.exists(name): os.makedirs(name) def get_logger():...
utils.py
import inspect import logging import os import shlex import subprocess import threading import time from contextlib import contextmanager from functools import wraps import parsl from parsl.version import VERSION logger = logging.getLogger(__name__) def get_version(): version = parsl.__version__ work_tree =...
doc_isolation.py
import json from threading import Thread from basetestcase import ClusterSetup from couchbase_helper.documentgenerator import doc_generator from sdk_client3 import SDKClient import com.couchbase.test.transactions.SimpleTransaction as Transaction from reactor.util.function import Tuples from sdk_exceptions import SDK...
monitor.py
# Copyright (C) 2016 Nippon Telegraph and Telephone 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/LICENSE-2.0 # # Unless required by appli...
online_websocket.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Investing.com API - Market and historical data downloader # https://github.com/crapher/pyinvesting.git # # Copyright 2020 Diego Degese # # Licensed under the Apache License, Version 2.0 (the 'License'); # you may not use this file except in compliance with the License. ...
manageProxy.py
# coding=utf-8 import requests from multiprocessing import Process from apscheduler.schedulers.blocking import BlockingScheduler from crawlProxy.crawlProxy import getProxy from tools.config import MONGO_TABLE_ALL, MONGO_TABLE_VERIFY from tools.ext import db from tools.tools import verifyProxy class Proxymanager(obje...
dnn.py
import os import sys import math import networkx as nx import numpy as np from itertools import product from multiprocessing import Process, sharedctypes #parallelism = 8 parallelism = os.cpu_count() - 1 class DnnInferenceEngine(object): def __init__(self, graph): self.g = graph def run(self, tin): ...
manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import vim import os import sys import json import time import operator import itertools import threading import multiprocessing from functools import partial from functools import wraps from .instance import LfInstance from .cli import LfCli from .utils import * from .fuz...
wikisourcetext.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ This bot applies to wikisource sites to upload text. Text is uploaded to pages in Page ns, for a specified Index. Text to be stored, if the page is not-existing, is preloaded from the file used to create the Index page, making the upload feature independent from the forma...
tello.py
# coding=utf-8 import logging import socket import time import threading import cv2 from threading import Thread from djitellopy.decorators import accepts class Tello: """Python wrapper to interact with the Ryze Tello drone using the official Tello api. Tello API documentation: https://dl-cdn.ryzerobotics...
controller_manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Software License Agreement (BSD License) # # Copyright (c) 2010, Antons Rebguns, Cody Jorgensen, Cara Slutter # 2010-2011, Antons Rebguns # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are perm...
Dash_launch.py
import os import ccxt import time import datetime import dash from dash.dependencies import Input, Output, Event import dash_core_components as dcc import dash_html_components as html import plotly.graph_objs as go import threading import dataset import sqlite3 from sqlalchemy import create_engine import pandas as pd i...
api.py
#coding=utf-8 import web from threading import Thread from config import * from squid import Squid_PURGE, SERVER_LIST_HOST from json import dumps from Queue import Queue import re class default: def GET(self): return Return('Error', 1001) def POST(self): return Return('Error', 1002) class cache: def GET(self)...
server.py
#!/usr/bin/python3 import json import threading import socket from loguru import logger from protocol import Message, MessageType class Client: def __init__(self, username: str, room_id: str, socket: socket.socket, lock): self.username = username self.room_id = room_id self.socket = soc...
conftest.py
import logging import os import random import time import tempfile import threading from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime from itertools import chain from math import floor from shutil import copyfile from functools import partial from botocore.exceptions import ClientE...
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json import pkgutil from threading import Thread import time import csv import decimal from decimal import Decimal as PyDecimal # Qt 5.12 also exports Decimal from collections import defaultdict from .bitcoin import COIN from .i1...
audio.py
from riem.debug import Debug, DebugChannel from riem.library import ArrayList from threading import Thread from playsound import playsound class SoundLoader: def play(sound: str) -> None: # Debug Debug.print("Playing sound %s" % sound, DebugChannel.AUDIO) # Thread Logic def execute(sound: str, _) -> None: ...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') from test.support.script_helper import assert_python_ok import contextlib import itertools imp...
ddos.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ PyDDoS. A Simple DDoS Tool. What is DDoS ? Distributed Denial of Service (DDoS) is an attempt to make an online service unavailable by ovearwhelming it with traffic from multiple sources. They target a wide variety of important resources from banks to news websites, and p...
auth.py
import base64 as _base64 import hashlib as _hashlib import keyring as _keyring import os as _os import re as _re import requests as _requests import webbrowser as _webbrowser from multiprocessing import Process as _Process, Queue as _Queue try: # Python 3.5+ from http import HTTPStatus as _StatusCodes except Imp...
runner.py
#!/usr/bin/env python ''' Simple test runner See settings.py file for options&params. Edit as needed. These tests can be run in parallel using nose, for example nosetests --processes=4 -v -s tests/runner.py will use 4 processes. To install nose do something like |pip install nose| or |sudo apt-get install python...
test.py
#!/usr/bin/env python3 # vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4 import libtorrent as lt import unittest import time import datetime import os import shutil import binascii import subprocess as sub import sys import pickle import threading import tempfile import socket import select import logging import...
smbrelayx.py
#!/usr/bin/env python # Copyright (c) 2013-2016 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # SMB Relay Module # # Author: # Alberto Solino (@agsolino) # # Description: # ...
kivy_ui.py
import json import re import time from copy import copy from datetime import datetime from functools import partial import subprocess from subprocess import Popen, PIPE from threading import Thread from collections import namedtuple from kivy.logger import Logger import io import os import atexit import yaml from PIL i...
consumers.py
import asyncio import os import threading from asgiref.sync import sync_to_async, async_to_sync from channels.layers import get_channel_layer from EOSS.aws.utils import get_boto3_client from EOSS.data.design_helpers import add_design from auth_API.helpers import get_user_information from daphne_context.models import U...
processor.py
# System libs import os import argparse import copy import queue import threading import sys import warnings import traceback from distutils.version import LooseVersion # Numerical libs import numpy as np import torch import torch.nn as nn from scipy.io import loadmat import csv # Our libs from dataset import TestDatas...
PikachuScan.py
#!/usr/bin/python3 import os import IPy import sys import time import nmap import regex import socket import struct import ctypes import requests import threading from termcolor import cprint from collections import OrderedDict #################################################################################### # ...
analysis.py
import re import json import threading import time from nba_api.stats.library.http import NBAStatsHTTP from nba_api.stats.library.parameters import * from datetime import datetime from tools.library.file_handler import load_file, save_file, get_file_path from tools.stats.library.mapping import endpoint_list, paramet...
run_end_to_end_test.py
#!/usr/bin/env python3 # # end to end tests of fetch-ledger # # This is achieved by using available fetch APIs to spin up a network locally # and test it can handle certain conditions (such as single or multiple # node failure) import sys import os import argparse import yaml import io import random import datetime i...
routes.py
from flask import render_template, redirect, url_for, flash, request from app import app, db, mail from app.forms import SignupForm, LoginForm, ForgetForm, PasswordChangeForm, PasswordResetForm, CourseForm, ModuleForm, TestQuestionForm, TestAnswerForm from flask_login import current_user, login_user, logout_user, login...
shuttle_client.py
#!/usr/bin/python # -*- coding: utf-8 -*- mqtt_host = 'mqtt.home' import paho.mqtt.client as paho import platform import sys import os #import urllib2 import time #from subprocess import call import struct import socket import threading from shuttlexpress import ShuttleXpress try: mqtt = paho.Client() mqtt...
mycontroller.py
#!/usr/bin/env python2 import argparse import grpc import os import sys import time from time import sleep import signal import json from threading import Thread # Import P4Runtime lib from parent utils dir # Probably there's a better way of doing this. sys.path.append( os.path.join(os.path.dirname(os.path.abspath...
publishers.py
import time,math,threading import rospy from sensor_msgs.msg import Image, CameraInfo, JointState, Range, LaserScan, PointCloud2, PointField from nav_msgs.msg import Odometry from geometry_msgs.msg import PointStamped, Point import numpy as np from .laser_pub import laser_messages_info from .sonar_pub import sonar_mes...
test_basic.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from concurrent.futures import ThreadPoolExecutor import glob import io import json import logging from multiprocessing import Process import os import random import re import...
test_icdar2015_ms.py
# -*- coding:utf-8 -*- from __future__ import absolute_import from __future__ import print_function from __future__ import division import os import sys import tensorflow as tf import cv2 import numpy as np import math from tqdm import tqdm import argparse from multiprocessing import Queue, Process sys.path.append("....
flask_app.py
from flask import Flask, render_template, request, url_for, flash, redirect from flask_cors import CORS import multiprocessing, secrets import Vyxal app = Flask(__name__) CORS(app) import os, sys, shutil THIS_FOLDER = os.path.dirname(os.path.abspath(__file__)) + "/.." sys.path.insert(1, THIS_FOLDER) shu...
client_handler.py
import socket import sqlite3 import sys import aes_crypt import rsa_encrypt import hashlib import base64 import settings import threading import sqlite3 import shamir_updater import time import shamir_client #set number for communication with webservers from file comms_number = 0 with open(settings.assetsdir + "comms...
zk_stress.py
#!/usr/bin/env python import json import numpy import zmq import os import logging import sys import time from kazoo.client import KazooClient from sys import path from threading import Thread path.append("hydra/src/main/python") from hydra.lib import util from hydra.lib.hdaemon import HDaemonRepSrv l = util.createl...
motion_controller.py
# Controller class for the Keybot robot # Gnu License # Erik Strahl. Modified by Fares Abawi import math import time import pypot.robot import sys from threading import Thread import numpy as np from numpy import linalg as la from pypot.robot import from_json from ikpy import plot_utils from ikpy.chain import Chain...
helpers.py
# -*- coding: utf-8 -*- """ :copyright: Copyright 2013-2017 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. tests.support.helpers ~~~~~~~~~~~~~~~~~~~~~ Test support helpers """ # pylint: disable=repr-flag-used-in-string,wrong-import-order ...
多线程之RLOCK.py
import threading class Rlock_Data(): rlock = threading.RLock()#递归锁 def __init__(self): self.data = 0 def execute(self,n): with Rlock_Data.rlock:#自动开关 self.data += n def add(self):#加 1 操作 with Rlock_Data.rlock:#自动开关 self.execute(1) ...
s3op.py
from __future__ import print_function import json import time import math import sys import os import traceback from hashlib import sha1 from tempfile import NamedTemporaryFile from multiprocessing import Process, Queue from itertools import starmap, chain, islice from boto3.s3.transfer import TransferConfig try: ...
IOS_update_threating_w_stack.py
""" Category: Python Config Script Author: nouse4it <github@schlueter-online.net> IOS_update_threating_w_stack.py Illustrate the following conecepts: - Upload of IOS Software of given IOS-based Switch and reboot -- Including 2960x-Stacks or 9300L-Stacks - Process handling happend parallel by threating - Including MD5-...
plot_uwb.py
import logging import sys import threading import time import uavcan import numpy as np import pyqtgraph as pg from pyqtgraph.Qt import QtCore, QtGui from ..network.UavcanNode import UavcanNode from ..viewers.LivePlotter2D import LivePlotter2D def argparser(parser=None): parser = parser or argparse.ArgumentPars...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
06-many_threads.py
import time import threading def myfunc1(name): print(f"myfunc1 started with {name}") time.sleep(10) print("myfunc1 ended") def myfunc2(name): print(f"myfunc2 started with {name}") time.sleep(10) print("myfunc2 ended") def myfunc3(name): print(f"myfunc3 started with {name}") time.sle...
http_server.py
# Copyright (c) 2020 PaddlePaddle 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 app...
tests.py
#! /usr/bin/env python3 # # Copyright (C) 2018 Garmin Ltd. # # SPDX-License-Identifier: GPL-2.0-only # import unittest import threading import sqlite3 import hashlib import urllib.request import json from . import create_server class TestHashEquivalenceServer(unittest.TestCase): def setUp(self): # Start a...
BattleShipPyClient.py
import socket import threading import json import time import math class Client: client_name = "" client_token = "" server = "" port = 0 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_address = (server, port) x = 0 y = 0 health = 0 flag = 0 ShipList = [] action_list = {"actions" : []} ...
database.py
import re from datetime import datetime, timedelta from threading import Thread import requests from pymongo import MongoClient class ApiCache: def __init__(self, max_lifetime=300): # Url - Time of request pairs self.requests = {} # Url - Content of response pairs self.responses ...
jobs.py
# coding=utf8 from __future__ import unicode_literals, absolute_import import copy import datetime import sys import threading import time if sys.version_info.major >= 3: unicode = str basestring = str py3 = True else: py3 = False try: import Queue except ImportError: import queue as Queue ...
kubernetes_orchestrator.py
# # Copyright (c) 2017 Intel 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/LICENSE-2.0 # # Unless required by applicable law or agreed to...
inb4404.py
#!/usr/bin/python3 import urllib.request, urllib.error, urllib.parse, argparse, logging import os, re, time import http.client import fileinput from multiprocessing import Process log = logging.getLogger('inb4404') workpath = os.path.dirname(os.path.realpath(__file__)) args = None def main(): global args par...
threading_test.py
import time import threading def caculate_time(func): def wrapper_func(*args, **kwargs): start = time.perf_counter() func(*args, **kwargs) finish = time.perf_counter() print(finish - start) return func.__name__ return wrapper_func @caculate_time def test(sec=0...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import os import re import copy import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
EDL.py
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import re from base64 import b64decode from multiprocessing import Process from gevent.pywsgi import WSGIServer from tempfile import NamedTemporaryFile from flask import Flask, Response, request from netaddr import IPAd...
series_scheduler.py
from multiprocessing import Process import sys from pathlib import Path sys.path.append(Path(__file__).resolve()) if __name__ == '__main__' and __package__ is None: __package__ = 'kurosc' from main import run # def run(set:str = 'global_sync', # config_file:str = 'model_config.json'): if __name__=='...
dx_authorization.py
#!/usr/bin/env python # Corey Brune - Oct 2016 # Creates an authorization object # requirements # pip install docopt delphixpy # The below doc follows the POSIX compliant standards and allows us to use # this doc to also define our arguments for the script. """List, create or remove authorizations for a Virtualization...
search.py
"""Python wrapper for easily making calls to Pipl's Search API. Pipl's Search API allows you to query with the information you have about a person (his name, address, email, phone, username and more) and in response get all the data available on him on the web. The classes contained in this module are: - SearchAPIRe...
dx_users.py
#!/usr/bin/env python # Adam Bowen - Aug 2017 #Description: # This script will allow you to easily manage users in Delphix # This script currently only supports Native authentication # #Requirements #pip install docopt delphixpy.v1_8_0 #The below doc follows the POSIX compliant standards and allows us to use #this doc...
scraper.py
#third party imports import traceback from tqdm import tqdm #progress bar from github #std imports import os import threading import json import re import time #local imports from . import helpers class Ufc_Data_Scraper: #Constants DEFAULT_DIRECTORY ="UFC_Data_Scraper" SAVE_FIGHT_DIR = "fight_history" ...
simulation.py
import os import time from multiprocessing import Process from typing import Tuple from collections import OrderedDict import flwr as fl import numpy as np from flwr.server.strategy import FedAvg import torch import dataset import json from torchrppg.models import get_model from torchrppg.optim import get_optimizer fr...
d3dshot.py
import threading import collections import gc import os import time from d3dshot.display import Display from d3dshot.capture_output import CaptureOutput, CaptureOutputs from weakref import WeakValueDictionary class Singleton(type): _instances = {} #def __call__(cls, *args, **kwargs): #if cls not in...
test_transport.py
# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under ...
microphone.py
# microphone.py (pi-topPULSE) # Copyright (C) 2017 CEED ltd. # from ptcommon.logger import PTLogger from binascii import hexlify from binascii import unhexlify from tempfile import mkstemp from os import close from os import path from os import remove from os import rename from os import stat import serial import sig...
scanner.py
#!/usr/bin/env python3 import argparse import os import readline import socket import struct import sys import threading import time from ctypes import * from netaddr import IPNetwork, IPAddress readline.get_history_length() # throw this away because we import readline for prompt stuff parser = argparse.ArgumentPars...
test_request_body.py
import io import threading from wsgiref import simple_server import requests import falcon from falcon import request_helpers import falcon.testing as testing SIZE_1_KB = 1024 class TestRequestBody(testing.TestBase): def before(self): self.resource = testing.TestResource() self.api.add_route('...
TH_IB2.py
from threading import Thread from time import sleep import requests from core.data.command import Command from core.device.manager import DeviceManager from core.task.abstract import BaseTask class MeasureAll(BaseTask): def __init__(self, config): self.__dict__.update(config) required = ['sleep...
text_scraper.py
from bs4 import BeautifulSoup import threading from tqdm import tqdm import requests class Text_Scraper: def __init__(self): self.var = 0 self.quotes_set = set() def scrape(self): self.var += 1 URL = (f"https://www.brainyquote.com/topics/daily-quotes_{str(self.var)}") ...
test_search.py
import pdb import struct from random import sample import pytest import threading import datetime import logging from time import sleep from multiprocessing import Process import numpy import sklearn.preprocessing from milvus import IndexType, MetricType from utils import * dim = 128 collection_id = "test_search" add...
unzip.py
import optparse, zipfile from threading import Thread def extrackFile(zFile, password): try: zFile.extractall(pwd=password) print("[+] Found password" + password + '\n') except: pass def main(): usage = ''' Zip Passeord cracker v0.1 created by c0d3r email: F0c3 u ######...
gmail_scanner.py
############################################################################### # Name : gmail_scanner.py # # Author : Abel Gancsos # # Version : v. 1.0.0.0 # ...
kmeans.py
#!/usr/bin/env python import os, random, threading, sys import socket dataDir="/mnt/sda" file_size = 250*1024*1024 dimension = 20 fot = -200 rng = 200 hostname = socket.gethostname() def _create(file_prefix, file_number, file_size): os.chdir(dataDir) for k in range(file_number): outFile = file_prefix ...
standalone.py
"""Standalone Authenticator.""" import argparse import collections import logging import socket import sys import threading import OpenSSL import six import zope.interface from acme import challenges from acme import standalone as acme_standalone from certbot import cli from certbot import errors from certbot import...
main.py
from builtins import Exception from scrapers.financial_web_scraper import Finviz_scraper from scrapers.deep_scraping import make_request from tripleizer import Tripleizer from fuseki_wrapper import FusekiSparqlWrapper from threading import Thread import datetime import time import os import json import subprocess impor...
core.py
########################################################## # pytorch-kaldi v.0.1 # Mirco Ravanelli, Titouan Parcollet # Mila, University of Montreal # October 2018 ########################################################## import sys import configparser import os from utils import is_sequential_dict, model_init, optim...
train_pg.py
import numpy as np import tensorflow as tf import gym import logz import scipy.signal import os import time import inspect from multiprocessing import Process #============================================================================================# # Utilities #====================================================...
canvas.py
from pyplex import * from ctypes import * import numpy as np from sys import stderr from threading import Thread from typing import List, Optional from enum import Enum from time import time class GLError(Exception): pass class VideoMode: def __init__(self, mode: glfw.VideoMode): self._resolution ...
scraper.py
#!/usr/bin/python # pastebin scraper v2 # written by unix-ninja import argparse import BeautifulSoup import requests import time import Queue import threading import sys import datetime import random import os ############################################################ # Configs max_seen = 50 num_workers = 1 pastes...
multiplanet.py
import os import multiprocessing as mp import sys import subprocess as sub import argparse import h5py import numpy as np from bigplanet.bp_get import GetVplanetHelp from bigplanet.bp_process import GatherData,DictToBP # -------------------------------------------------------------------- def GetSNames(in...
ThreadPoolMixIn.py
# From <http://code.activestate.com/recipes/574454-thread-pool-mixin-class-for-use-with-socketservert/> # By Michael Palmer, 2008-07-20 # PSF license # This class creates a Queue where incoming requests are stored. A # number of threads, defined by 'numThreads' then get requests off of # this queue and handle them. Th...
app.py
import os import random from flask import Flask, flash, session, request, redirect, render_template, send_file from werkzeug.utils import secure_filename from ftssim import gpx, wander from threading import Thread app = Flask(__name__) app.secret_key = os.urandom(24) app.config['MAX_CONTENT_LENGTH'] = 16 * 1024 * 1024...
local.py
import cairosvg import pygame import pypboy import settings import requests import game import threading import io import numpy as np import urllib # def load_svg(filename, width, height): # drawing = cairosvg.svg2png(url = filename) # byte_io = io.BytesIO(drawing) # image = pygame.image.load(byte_io).conv...
GenInt.py
from .Polynomial import * from .Sbox import * from .Term import * from .Vector import * from multiprocessing import Process, Lock from threading import Thread #from pudb import set_trace; set_trace() class GenInt(object): def __init__(self, values, inputLength, outputLength ): self.probability_bit = 0 ...
app.py
import httplib2 import os import os.path import sys import SocketServer from SimpleHTTPServer import SimpleHTTPRequestHandler from multiprocessing import Process from apiclient.discovery import build from oauth2client.client import flow_from_clientsecrets from oauth2client.file import Storage from oauth2client.tools i...
radical-pilot-limits.py
#!/usr/bin/env python3 import os import time import socket import threading as mt import multiprocessing as mp threads = list() procs = list() files = list() sockets = list() t_max = 4 * 1024 p_max = 1 * 1024 f_max = 1 * 1024 s_max = 1 * 1024 def _work(): time.sleep(30) base = '/tmp/rp_limi...
main.py
# Copyright (c) 2020 Intel Corporation. # # 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, publish, ...
bloom.py
import helpers.common as common from multiprocessing import Process import math from index import * from token_index import weightFun as tokenWeightFun from token_index import genKeys as tokenGenKeys from ident_index import weightFun as identWeightFun from ident_index import genKeys as identGenKeys def runAssignment(...
mtcnn.py
#!/usr/bin/env python3 """ MTCNN Face detection plugin """ from __future__ import absolute_import, division, print_function import os from six import string_types, iteritems import cv2 import numpy as np from lib.multithreading import MultiThread from ._base import Detector, logger # Must import tensorflow insid...
batch_env_factory.py
# coding=utf-8 # Copyright 2018 The Tensor2Tensor 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...
message_receiver.py
import html import logging import queue import threading import time from .incoming_message import IncomingMessage from .utils import CONF_START, LongpollMessage logger = logging.getLogger('vkapi.receiver') class MessageReceiver: def __init__(self, api, get_dialogs_interval=-1, message_class=IncomingMessage): ...
main.py
from api import CLongPoll, threading from loader import load, os from utils import * bots = [{ 'token': config.token, 'type': 'page', 'version': '5.90' },{ 'token': config.group_token, 'type': 'group', 'version': '5.90' }] cmds.update(load(cmds)) if __name__ == '__main__': LP = CLongPoll(bots, cmds) for u...
test_c10d_common.py
# flake8: noqa import copy import os import random import sys import tempfile import threading import time import traceback import unittest from datetime import timedelta from itertools import product from sys import platform import torch import torch.distributed as c10d if not c10d.is_available(): print("c10d no...
performance_tests_support.py
import camera_emulator import time from threading import Thread import traceback import json CONFIG_LOCATION = "config.json" def get_web_server_location(config_location=CONFIG_LOCATION): with open(config_location, "rb") as camera_info_file: json_data = json.load(camera_info_file) if "web_server_...
export_data.py
from ..file_utils import common_filepaths from ..conf_utils import conf from ..serve.server_jeeves import ServerJeeves from ..serve.encoder import FGJSONEncoder #from flask.json import dump from json import dump import argparse import numpy as np import os import time from multiprocessing import Pool, Process import ...
augment_trajectories_third_party_camera_frames210.py
import os import sys sys.path.append(os.path.join(os.environ['ALFRED_ROOT'])) sys.path.append(os.path.join(os.environ['ALFRED_ROOT'], 'gen')) import json import glob import os import constants import cv2 import shutil import numpy as np import argparse import threading import time import copy import random from gen.ut...
human_agent.py
#!/usr/bin/env python # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides a human agent to control the ego vehicle via keyboard """ import time from threading import Thread import cv2 import numpy as np try: import pygame ...
multiprocessing_basics.py
""" 「マルチプロセス」の節で登場するサンプルコード `multiprocessing` モジュールを用いて新しいプロセスを生成する """ from multiprocessing import Process import os def work(identifier): print(f'こんにちは、私はプロセス {identifier}, pid: {os.getpid()} です') def main(): processes = [ Process(target=work, args=(number,)) for number in range(5) ] ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
httpd.py
#!/usr/bin/env python """ Copyright (c) 2014-2020 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from __future__ import print_function import datetime import glob import gzip import hashlib import io import json import mimetypes import os import re import...