source
stringlengths
3
86
python
stringlengths
75
1.04M
main.py
from __future__ import print_function import argparse import os import torch import torch.multiprocessing from models import my_optim from env.envs import create_atari_env from models.model import ActorCritic from test import test from train import train class ErrorHandler(object): """A class that listens for ex...
loadgen.py
import threading import requests import time import config import random ## Add Load Function def AddLoad(): # Generate X number of extra requests try: for i in range(config.load_test_user_bump): x = threading.Thread( target=make_request, args=(i,)) x.start() except: ...
server.py
import socket import os import threading buffersize = 2048 def worker (conn): while True: try: data = conn.recv(buffersize) except: break msg = data.decode("utf-8") cmd = msg.split() print (cmd) r, w = os.pipe() pid = os.fork() ...
apimodules.py
import urllib.parse import urllib.request, urllib.error import secrets import hashlib, hmac, base64 from mimetypes import guess_all_extensions from datetime import datetime from copy import deepcopy import re import os, sys, time import io from collections import OrderedDict import threading from PySide2.QtWebEngineW...
comparator.py
# # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
jobsSample.py
''' /* * Copyright 2010-2018 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 "...
putterTransferPage.py
import threading #import multiprocessing from tkinter import * from tkinter.ttk import Treeview import putterTransfer class TransferPage(Frame): def __init__(self, parent, controller): Frame.__init__(self, parent) self.name= 'TransferPage' self.controller = controller self.serverLis...
test_setup.py
"""Test component/platform setup.""" # pylint: disable=protected-access import asyncio import logging import os import threading import pytest import voluptuous as vol from homeassistant import config_entries, setup import homeassistant.config as config_util from homeassistant.const import EVENT_COMPONENT_LOADED, EVE...
run.py
import argparse import sys import threading import meter import msgbroker import pv_gen import pv parser = argparse.ArgumentParser() # Broker arguments parser.add_argument( "-b", "--broker", help="Chooses the msg broker. If not set, the simulator " "uses rabbitmq", default="rabbitmq") parser.add_argument( ...
GIMBAL_2_robot_picam_test_NCS2_mobilenet.py
import cv2 import time import numpy import random from multiprocessing import Process from multiprocessing import Queue from picamera.array import PiRGBArray from picamera import PiCamera from adafruit_servokit import ServoKit kit = ServoKit(channels=8) #hacked from: #https://software.intel.com/articles/OpenVINO-Inst...
dashboard.py
import sys import time import threading import random import math import pygeoip from Scripts import graphiti as og from Scripts import standard as std from Scripts import console shell = console.console.Console() mutex = threading.Lock() queue = list() nodes = dict() edges = dict() job_id = None t = 0 valu...
client.py
#!/usr/bin/python __author__ = 'deevarvar' import sys import socket import threading import os import select import errno import json import thread #copied from http://code.activestate.com/recipes/408859/ def recv_basic(the_socket): total_data=[] while True: data = the_socket.recv(8192) print ...
run.py
import logging from chessbot.ChessBot import ChessBot from bot.Bot import SlackBot, Bot, threaded, allMessageEvents from bot.config import SLACK_TOKEN from bot.redis import redis from slackclient import SlackClient from crypto.CryptoTrader import CryptoTrader from crypto.CryptoBot import CryptoBot from arbitrage.Arbit...
email.py
# -*- coding: utf-8 -*- """User blueprint email helper module.""" # Standard library modules from multiprocessing import get_context # Third-party modules from flask import current_app from flask_mail import Message # Application specific modules from fmchallengewebapp.extensions import mail def send_email(app, re...
old.py
# source: https://github.com/joshuamorton/Machine-Learning/blob/master/P3/analysis.py # source: https://github.com/iRapha/CS4641/blob/master/P3/analysis.py # source: https://github.com/baiyishr/baiyishr.github.io/blob/master/MLprojects/unsupervisedlearning/tools.py import argparse # import multiprocessing as mp from ...
test_executors.py
import os import multiprocessing import sys import threading import tempfile import time import pytest import prefect from prefect.utilities.configuration import set_temporary_config from prefect.utilities.executors import ( run_with_thread_timeout, run_with_multiprocess_timeout, tail_recursive, Recur...
unerrored.py
import threading import time def run_threaded(func, *args): try: threading.Thread(target=func, args=args).start() except: time.sleep(5) def run_old(func, *args): try: func(args) except: pass
multi3.py
""" Use multiprocess shared memory objects to communicate. Passed objects are shared, but globals are not on Windows. Last test here reflects common use case: distributing work. """ import os from multiprocessing import Process, Value, Array procs = 3 count = 0 # per-process globals, not shared def s...
Watcher.py
import os import psutil import datetime import time from multiprocessing import Process import multiprocessing ##TODO完善watcher class Watcher(object): def __init__(self, pid): self.__watchermsg = multiprocessing.Manager().dict() self.__WatchPid = pid self.__watchermsg['MaxRam'] = 0 ...
newevent.py
#--------------------------------------------------------------------------- # Name: newevent.py # Purpose: Easy generation of new events classes and binder objects. # # Author: Miki Tebeka <miki.tebeka@gmail.com> # # Created: 18-Sept-2006 # Copyright: (c) 2006-2018 by Total Control Software # Lic...
GUI.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'test3.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. import time import sys f...
Run.py
import sys import subprocess import threading try: from Queue import Queue, Empty except: from queue import Queue, Empty class Run: def __init__(self): return def _read_output(self, pipe, q): while True: try: c = pipe.read(1) q.put(c) ...
acs_client.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
jobStoreTest.py
# Copyright (C) 2015-2016 Regents of the University of California # # 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...
channel_handler.py
# ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies 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 Redistrib...
Metrics.py
import queue import threading import requests import json import pkg_resources from werkzeug import Request from readme_metrics import MetricsApiConfig, ResponseInfoWrapper from readme_metrics.PayloadBuilder import PayloadBuilder class Metrics: """ This is the internal central controller classinvoked by the...
main.py
import pika import logging import json import threading from requests import Request, Session from requests.exceptions import ConnectionError, Timeout, TooManyRedirects import json import os from time import time, sleep import cryptocompare import datetime global data_cache data_cache = {"data": {}} global btc_histor...
client.py
import asyncio import curses import logging import logging.config from threading import Thread from typing import Iterable, List, Tuple, cast from scrabble.game import BoardWord, BoardWords, GameState, WordDirection from scrabble.game.api import (Event, GameInitEvent, GameStartEvent, PlayerAddLettersEvent, PlayerMoveE...
core.py
# -*- coding: utf-8 -*- # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software ...
pytorch.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. from __future__ import annotations import logging import warnings from threading import Thread from typing import Any, List, Union, cast import colorama import torch import torch.nn as nn from nni.experiment import Experiment, RunMode from nn...
messages.py
import os import sys import threading import shutil import csv import sqlite3 import copy from pathlib import Path from bs4 import BeautifulSoup import utils.files as utils # XXX (ricardoapl) Fix this non-pythonic mess! CONVERSATIONS_TEMPLATE_FILENAME = os.path.join(os.path.dirname(__file__), r'..\templates\templat...
__init__.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Implements context management so that nested/scoped contexts and threaded contexts work properly and as expected. """ from __future__ import absolute_import import collections import functools import logging import os import platform import socket import stat import s...
bounds_solver.py
from random import shuffle,random import click import json from multiprocessing import Process, Manager import time from math import sqrt from minimax_solver import setup, new_calc_maxmin_minmax, calc_maxmin_minmax, calc_old_maxmin_minmax, spruik_solver import gmpy2 indsplus = None N = None method = None def v(s): g...
scheduler_job.py
# -*- coding: utf-8 -*- # # 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 #...
exported-sql-viewer.py
#!/usr/bin/env python2 # SPDX-License-Identifier: GPL-2.0 # exported-sql-viewer.py: view data from sql database # Copyright (c) 2014-2018, Intel Corporation. # To use this script you will need to have exported data using either the # export-to-sqlite.py or the export-to-postgresql.py script. Refer to those # scripts ...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
spectrogram.py
import json from threading import Thread, RLock import flask from flask import send_from_directory import pyaudio import numpy as np import scipy as sp from scipy.integrate import simps from bokeh.embed import components from bokeh.models import ColumnDataSource, Slider from bokeh.plotting import figure from bokeh.r...
face.py
import _thread as thread import ast import io import json import os import sqlite3 import sys import time import warnings from multiprocessing import Process sys.path.insert(0, os.path.join(os.path.dirname(os.path.realpath(__file__)), ".")) from shared import SharedOptions if SharedOptions.PROFILE == "win...
enterprise_backup_restore_test.py
import re, copy, json, subprocess from random import randrange, randint from threading import Thread from couchbase_helper.cluster import Cluster from membase.helper.rebalance_helper import RebalanceHelper from couchbase_helper.documentgenerator import BlobGenerator, DocumentGenerator from ent_backup_restore.enterpris...
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...
hikvision.py
""" pyhik.hikvision ~~~~~~~~~~~~~~~~~~~~ Provides api for Hikvision events Copyright (c) 2016-2021 John Mihalic <https://github.com/mezz64> Licensed under the MIT license. Based on the following api documentation: System: http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION%20ISAPI_2.0-IPMD%20Servi...
pinet_screens_startup.py
#!/usr/bin/env python3 import os import time import requests import socket import netifaces import hashlib from threading import Thread server_address = "server" # Default LTSP IP address maps to server script_root = "/home/shared/screens/scripts/" file_hash = "" ran_script_path = "" def background_thread(): ...
cnn_eval.py
import time import os import os.path as path from os.path import join as pj import json from pprint import pprint from pprint import pformat from multiprocessing import Process, Queue from concurrent.futures import ProcessPoolExecutor import tensorflow as tf import var_config as cf import dataPreProcess as preProcess...
test_utils.py
# Copyright (c) 2010-2012 OpenStack, 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 to ...
sfwebui.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------- # Name: sfwebui # Purpose: User interface class for use with a web browser # # Author: Steve Micallef <steve@binarypool.com> # # Created: 30/09/2012 # Copyright: (c) Steve Micallef 2012 # License: ...
race.py
import threading import time # create a mutable object that is shared among threads class Shared: val = 1 def func(): y = Shared.val time.sleep(0.00001) y += 1 Shared.val = y threads = [] for i in range(99): thread = threading.Thread(target=func) threads.append(thread) thread.start...
pyi_lib_requests.py
# ----------------------------------------------------------------------------- # Copyright (c) 2014-2022, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.tx...
thread_function.py
# @Time : 2021/03/23 # @Author : Naunter # @Page : https://github.com/Naunter # @Page : https://github.com/Naunter/bdocn_client_en from threading import Thread from time_template import time_template def thread_it(func, *args): time_template() print("thread_function.py >>> def thread_it(func, *args)...
oremoremo.py
#!/usr/bin/env pythonw3 # Author: Armit # Create Time: 2020/02/08 import os import sys import time import logging from configparser import ConfigParser from threading import Thread, RLock, Event import tkinter as tk import tkinter.ttk as ttk import tkinter.font as tkfont import tkinter.messagebox as tkms...
test.py
import unittest import json import fields from store import Store from time import sleep TEST_PORT = 10101 def cases(cases_list): def deco(func): def wrapper(self): for case in cases_list: func(self, case) return wrapper return deco class TestFields(unittest.Tes...
PrefetchingIter.py
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by Yuwen Xiong # -------------------------------------------------------- # Based on: # MX-RCNN # Copyright (c) 2016 by Cont...
rospynode.py
import websocket import json import time import threading import logging class Client: '''This class creates a ROS client that connects to ROS network via rosbridge''' def __init__(self,traceable=True, handler=logging.NullHandler(), host='localhost', port=9090): # Initializations self...
test_ufuncs.py
import functools import itertools import re import sys import warnings import threading import operator import numpy as np import unittest from numba import typeof, njit from numba.core import types, typing, utils from numba.core.compiler import compile_isolated, Flags, DEFAULT_FLAGS from numba.np.numpy_support impor...
server.py
import socket from threading import Thread import time import json class Node: def __init__(self, A_addr, B_addr): self.a_sock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.b_sock=socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.a_sock.bind(A_addr) self.b_sock...
test_lightningd.py
from concurrent import futures from decimal import Decimal import copy import json import logging import queue import os import random import re import shutil import socket import sqlite3 import stat import string import subprocess import sys import tempfile import threading import time import unittest import utils f...
cache_decompression_test.py
# Copyright 2017 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable la...
chat.py
#!/usr/bin/env python3 import threading import time class Connections(): def __init__(self): self.connections = [] self.timer = 0 def __iter__(self): return self.connections def __add__(self, new_connection): # assert type(other, Connection), "Can only add Connection t...
spongebot.py
import os import time import threading __version__ = '0.1.0' class SpongeBot: """ Who lives in a pineapple under the sea? SpongeBot spends his days soaking up files that are unlucky enough to end up in the folder specified in 'path'. Each time he encounters a new file, he calls the callback functio...
spy.py
import os from socket import socket, AF_INET, SOCK_STREAM from threading import Thread import logging from .proto import spy_pb2 from .command import * import subprocess from queue import Queue from uuid import uuid4 import sys if not sys.version >= "3.8": logging.error("微信版本过低,请使用Python3.8.x或更高版本") exit() ...
__init__.py
# We import importlib *ASAP* in order to test #15386 import importlib import importlib.util from importlib._bootstrap_external import _get_sourcefile import builtins import marshal import os import platform import py_compile import random import stat import sys import threading import time import unittest import unitte...
KUKU_chat_client.py
# coding: utf-8 # In[ ]: import threading import socket s= socket.socket(socket.AF_INET,socket.SOCK_STREAM) ip="192.168.43.185" port=1234 s.connect((ip,port)) print("\n\t\t\t\t\tWELCOME\n") print("connected successfully...") def csend(): while True: data=input("\n\t\t\t\t\t\t<<<: ") data=data.en...
main_app.py
from tkinter import * from tkinter import messagebox import time import threading from splinter import Browser import re from urllib.request import urlopen import sys # for debug purpose # path for chromedriver executable_path = {'executable_path':'/usr/local/bin/chromedriver'} HEADLESS = True # HEADLESS = False cl...
preview.py
import numpy as np import pygame.time from threading import Thread from utils import * class Preview: def __init__(self, rect, timeline): self.rect = rect self.run = False self.fps = 1 self.timeline = timeline self.current_frame_index = 0 self.frame_rect = pygame.R...
client_mq.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from queue import Queue, Empty from threading import Thread from nanomsg import Socket, PAIR, SUB, SUB_SUBSCRIBE, AF_SP from source.data.tick_event import TickEvent, TickType from source.order.order_status_event import OrderStatusEvent from source.order.fill_event import Fi...
main.py
from threading import Thread import uvicorn from fastapi import FastAPI from endpoint import API_ROUTER from price import load_predefined_coins, main_current_price, main_history_data if __name__ == "__main__": load_predefined_coins() main_price_current_thread = Thread(target=main_current_price) main_price_...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal from bitcoin import COIN from i18n import _ from util import PrintError, ThreadJob from util import format_satoshis # See https://en.wikipedia.org/w...
wrenhandler.py
# # Copyright 2018 PyWren Team # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
syngen_matlab.py
import sys sys.path.append('../nvm') from nvm import NVM from activator import tanh_activator from learning_rules import rehebbian from syngen_nvm import * from syngen import Network, Environment from syngen import get_cpu, get_gpus, interrupt_engine import numpy as np from random import random, sample, choice from...
soc_net_bench.py
#! /usr/bin/env python # # =============================================================== # Description: Benchmark to emulate TAO workload. # # Created: 2014-04-17 10:47:00 # # Author: Ayush Dubey, dubey@cs.cornell.edu # # Copyright (C) 2013-2014, Cornell University, see the LICENSE # ...
qdm.py
from utils import * from db import * import sqlite3 as lite import threading import requests import logging import rfc6266 import shutil import time import sys import os from file import * from utils import * from widgets import * import urllib.parse as parse from multiprocessing import Pool from PyQt5.QtWidgets i...
tello.py
import threading from threading import Thread import socket import time import netifaces import netaddr from netaddr import IPNetwork from collections import defaultdict import binascii from datetime import datetime import itertools class Tello(object): """ A wrapper class to interact with Tello. Communica...
gui.py
# -*- coding: utf-8 -*- import tkinter as tk import tkinter.font as tkFont from tkinter import ttk from tkinter import font from puttier.configurator import * import threading import puttier.definitions as appconfig from puttier.vstermtheme import VsTermTheme class App: def __init__(self): self.root = t...
package.py
import html, json, os, re, socket, sublime, sublime_plugin, threading, time from collections import defaultdict from .src import bencode from typing import Any, Dict, Tuple ns = 'clojure-sublimed' def settings(): return sublime.load_settings("Clojure Sublimed.sublime-settings") def format_time_taken(time_taken):...
autoSubmitter.py
from __future__ import print_function import configparser as ConfigParser import argparse import shelve import sys import os import subprocess import threading import shutil import time import re from helpers import * shelve_name = "dump.shelve" # contains all the measurement objects history_file = "history.log" clock...
test_distributed.py
HELP="""All related to distributed compute and atomic read/write Thread Safe Process Safe Lock Mechanism """ import os, sys, socket, platform, time, gc,logging, random ############################################################################################### from utilmy.utilmy import log, log2 def h...
process_daily_monthly_spend.py
#!/bin/env python # -*- coding: utf-8 -*- import time from multiprocessing import Process import pandas as pd from lib.budget import AccountBudget from lib.cur_cost_usage import CostUsageReportSpend from lib.cur_projected_spend import CostUsageReportProjected from lib.metric_exporter import OutputConfigParser from l...
diagnostic.py
#!/usr/bin/env python # # Azure Linux extension # # Linux Azure Diagnostic Extension (Current version is specified in manifest.xml) # Copyright (c) Microsoft Corporation All rights reserved. # MIT License # Permission is hereby granted, free of charge, to any person obtaining a copy of # this software and associated do...
multi_client.py
from fl_client import FederatedClient import datasource import multiprocessing import threading def start_client(): print("start client") c = FederatedClient("127.0.0.1", 5000, datasource.Mnist) if __name__ == '__main__': jobs = [] for i in range(5): # threading.Thread(target=start_client).st...
StackTraceLoop.py
# Copyright 2015 Ufora 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 i...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_ddl.py
import unittest from copy import copy import gc import ibis import pandas as pd from posixpath import join as pjoin import pytest from ibis.expr.tests.mocks import MockConnection from ibis.compat import mock import ibis.common as com import ibis.expr.types as ir import ibis.util as util from ibis.tests.util import ...
wsdump.py
#!/opt/tdd/flask-microservices-users/tdd3/bin/python3.7 import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encod...
server.py
import logging import os import select import socket import subprocess import threading try: from queue import Queue except ImportError: # Python 2.7 from Queue import Queue import paramiko from mockssh import sftp __all__ = [ "Server", ] SERVER_KEY_PATH = os.path.join(os.path.dirname(__file__), "se...
__init__.py
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs from __future__ import absolute_import, print_function import os import re import sys import copy import time import stat import errno import signal import shutil import pprint import atexit import socket import logging import...
__init__.py
from threading import Thread from flask import Flask, render_template, redirect from tornado.ioloop import IOLoop from bokeh.embed import server_document from bokeh.server.server import Server from bokeh.themes import Theme from bokeh.settings import settings import homepage.albedo._albedo.dashlayout as dashlayout ...
atrace_agent.py
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import print_function import optparse import platform import re import sys import threading import zlib import six import py_utils from dev...
double.py
import time from threading import Thread def countdown(n): while n > 0: n -= 1 COUNT = 10_000_000 if __name__ == "__main__": times = [] for _ in range(3): start_time = time.time() t1 = Thread(target=countdown, args=(COUNT // 2,)) t2 = Thread(target=countdown, args=(COUN...
tesis5.py
from multiprocessing import Process, Queue import mysql.connector import cv2 import numpy as np from datetime import datetime def run_camara(direccion, arreglo_jugadores, cola, indice_proceso_actual): cap = cv2.VideoCapture(direccion) jugador_actual = None continuar1 = True if cap.isOpened(): while True: ...
SDN_mininet_older.py
#!/usr/bin/python """ Documentation: Pending . . . """ import sys, os, threading, time, math, random; # Suppress .pyc generation sys.dont_write_bytecode = True; # Base Directory BASE_DIR = os.path.dirname(os.path.realpath(__file__)); # Add BASE_DIR to PYTHONPATH sys.path.append(BASE_DIR); # Make Directories Save...
common.py
#!/usr/bin/env python3 import numpy as np from threading import Thread from multiprocessing import Process, Queue def spawn_opencv_key_window(queue: Queue): """ Spawn an opencv window just to receive keyboard events. Internally imports cv2 to prevent enforcing unnecessary dependency. """ def spin...
spanprocessor.py
# Copyright The OpenTelemetry 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 ...
generate_breakpad_symbols.py
#!/usr/bin/env python # Copyright (c) 2013 GitHub, Inc. # Copyright (c) 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Convert pdb to sym for given directories""" from __future__ import print_function import errn...
test_flask.py
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 import json from threading import Thread from time import sleep from dazl import LOG, Network, SimplePartyClient from dazl.ledger import CreateCommand from dazl.protocols.events...
test_strategy.py
import threading import time import unittest from request_limiter import LimitedIntervalStrategy class NowMocker(object): def __init__(self): self.seconds = 0 def __call__(self): return self.seconds class TestLimitedIntervalStrategy(unittest.TestCase): def setUp(self): self.now...
Wifi_main.py
# -*- coding: utf-8 -*- # Wifi_Main.py import os import re import getpass import threading import subprocess from Cli import * class RunError(Exception): pass # 执行命令行指令函数 def cmd(cmd): res = subprocess.Popen( cmd, shell = True, stdin = subprocess.PIPE, stdout = sub...
views.py
"""Defines a number of routes/views for the flask app.""" from functools import wraps import io import os import sys import shutil from tempfile import TemporaryDirectory, NamedTemporaryFile import time from typing import Callable, List, Tuple import multiprocessing as mp import zipfile from flask import json, jsonif...
asyncorereactor.py
# Copyright 2013-2015 DataStax, 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 writi...
main.py
import sys import threading from queue import Queue from crawler import Crawler from links.domain import get_domain_name from utils.file_operations import file_to_set repository_name = str(sys.argv[1]) home = str(sys.argv[2]) count = int(sys.argv[3]) domain_name = get_domain_name(home) queue_file = repository_name + ...
plugin_manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/windows/plugin_manager.py # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright...