source
stringlengths
3
86
python
stringlengths
75
1.04M
test.py
#! /usr/bin/env python # -*- coding: utf-8 -*- from __future__ import division, print_function, absolute_import import threading import queue import math from timeit import time import warnings import cv2 import numpy as np from PIL import Image from yolo import YOLO from deep_sort import preprocessing from deep_sort ...
updater.py
import itertools, threading, time, sys, subprocess, json, os, traceback import tools, colorama, hashlib from colorama import Fore, Style import shutil from shutil import copyfile colorama.init() arg = sys.argv[1] def sha256sum(filename): h = hashlib.sha256() b = bytearray(128*1024) mv = memo...
threads.py
"""Module Docstring""" import os from threading import Thread from time import sleep import click import isort import psutil import snoop from pydub import AudioSegment from pydub.playback import play from pynput.keyboard import Key, KeyCode, Listener from snoop import pp from tqdm import tqdm def type_watch(source,...
eventEngine.py
# encoding: UTF-8 # 系统模块 from queue import Queue, Empty from threading import Thread from time import sleep from collections import defaultdict # 第三方模块 from qtpy.QtCore import QTimer # 自己开发的模块 from vnpy.event.eventType import * ######################################################################## class EventEngi...
spinner.py
# Copyright (c) 2021, Serum Studio # Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.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 restr...
backend.py
"""Interface for job launching backend. Run/Job and Task are container classes encapsulating functionality. User creates them through make_run/make_job/make_task methods """ # Job launcher Python API: https://docs.google.com/document/d/1yTkb4IPJXOUaEWksQPCH7q0sjqHgBf3f70cWzfoFboc/edit # AWS job launcher (concepts): h...
job.py
# Copyright 2017 Spotify AB # # 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, softw...
qfluxcap.py
# qfluxcap.py Copyright (c) 2021 Masami Yamakawa # SPDX-License-Identifier: MIT # from time import process_time from time import sleep from qiskit import IBMQ, QuantumCircuit, execute, BasicAer from qiskit.providers import JobStatus from qiskit.providers.ibmq import least_busy import argparse from multiproce...
main.py
#!/usr/bin/env python __author__ = "Justin M. Sloan" __copyright__ = "Public Domain" __credits__ = [] __license__ = "Unlicense.org" __version__ = "0.55" __maintainer__ = "Justin M. Sloan" __email__ = "python@justinsloan.com" __status__ = "Development" # Prototype, Development, or Production from tkinter import * from...
app.py
import threading from flask import Response, Flask import cv2 import time import atexit app = Flask(__name__) global video_capture video_capture = None global video_frame video_frame = None global thread_lock thread_lock = threading.Lock() # camera parameters width = 224 height = 224 fps = 21 capture_width = 3280 ...
watcher_app_main.py
""" Main module for the application """ import sys import webbrowser import ctypes import threading import setuptools from app import win_registry_management, colors_def as colors, constants_def as constants, bitbucket_rest_interaction from app.exception_definitions import reg_key_cannot_be_read_error from ap...
colour.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ File: colour.py Author: Ian Ross Williams Last change 2014/08/28 Example usage of the oceanoptics python library to measure the visible colour of light. The user interface uses GTK3+ idle threads as this was necessary for the live display t...
switch_controller.py
#/usr/bin/python3 import time import serial import threading import serial.tools.list_ports BUTTON_NONE = 0x00 BUTTON_Y = 0x01 BUTTON_B = 0x02 BUTTON_A = 0x04 BUTTON_X = 0x08 BUTTON_L = 0x10 BUTTON_R = 0x20 BUTTON_ZL = 0x40 BUTTON_ZR =...
py_collector.py
from datetime import datetime, timezone, timedelta from threading import Thread, Event import signal import os class Scheduler(Thread): ''' Controls scheduling for py_curator Based havily on Timer implementation here https://github.com/python/cpython/blob/3.9/Lib/threading.py ''' initial_run =...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
motorTest.py
import Motor import threading import time def print_speed_loop(trip_meter): while True: print "%f %f" % (trip_meter.get_right_speed(), trip_meter.get_left_speed()) time.sleep(0.1) trip_meter = Motor.TripMeter() motor = Motor.Motor(trip_meter) print_speed_thread = threading.Thread(targ...
myfork2.py
import time from multiprocessing import Process def f(name): print('hello', name) time.sleep(15) print('我是子进程') if __name__ == '__main__': p = Process(target=f, args=('bob',)) p.start() p.join() print('我是父进程')
server.py
from socket import * import threading import random import pickle import queue from PyQt5.QtCore import QThread, QTimer class Server(QThread): def __init__(self, host, port, clientField, debugField): super(Server, self).__init__(parent = None) self.connections = [] self.messageQueue = queue...
client.py
from Proxy import Proxy from threading import Thread server_address = ("127.0.0.1", 10087) class Client: def __init__(self, name, download_rate): self.proxy = Proxy(upload_rate=0, download_rate=download_rate) self.name = name print("%s(%d) create" % (name, download_rate)) ...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from collections import OrderedDict import os import pickle import random import re import subprocess import sys import textwrap import threading import time import unitt...
lock.py
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
run.py
#! /usr/bin/env python3 # # Copyright (C) 2017-2021 Open Information Security Foundation # # 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 ...
Bee.py
import pythoncom import pyHook from os import path from time import sleep from threading import Thread import urllib, urllib2 import smtplib import datetime import win32com.client import win32event, win32api, winerror from _winreg import * import shutil import sys ironm = win32event.CreateMutex(None, 1, 'NOSIGN') if w...
tests.py
from __future__ import unicode_literals from datetime import datetime import threading from django.core.exceptions import ObjectDoesNotExist, MultipleObjectsReturned from django.db import connections, DEFAULT_DB_ALIAS from django.db import DatabaseError from django.db.models.fields import Field, FieldDoesNotExist fro...
tpu_estimator.py
# Copyright 2017 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...
detection.py
# coding: utf-8 # Copyright (c) HP-NTU Digital Manufacturing Corporate Lab, Nanyang Technological University, Singapore. # # This source code is licensed under the Apache-2.0 license found in the # LICENSE file in the root directory of this source tree. import csv import io import subprocess import numpy as...
run_nvmf.py
#!/usr/bin/env python3 import os import re import sys import argparse import json import zipfile import threading import subprocess import itertools import configparser import time import uuid from collections import OrderedDict import paramiko import pandas as pd import rpc import rpc.client from common import * ...
extractor.py
#!/usr/bin/env python # vim: set ts=4 sw=4 tw=0 et pm=: import iq import demod import time import cut_and_downmix import detector import getopt import sys import re import threading import multiprocessing import signal import iridium import os out_queue = multiprocessing.JoinableQueue() queue_len = 0 queue_len_max = ...
utils.py
from __future__ import annotations import asyncio import contextvars import functools import importlib import inspect import json import logging import multiprocessing import os import pkgutil import re import socket import sys import tempfile import threading import warnings import weakref import xml.etree.ElementTre...
__init__.py
"""Initialises Modis.""" import logging import sys from modis import datatools logger = logging.getLogger(__name__) logger.setLevel("INFO") formatter = logging.Formatter( "{asctime} {levelname:8} {name} - {message}", style="{") printhandler = logging.StreamHandler(sys.stdout) printhandler.setFormatter(formatter...
threading_1.py
import time import threading import datetime import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') # 锁 l = threading.Lock() def hello(): global l if l.acquire(False): logging.info("hello, world") time.slee...
frontend_test.py
#!/usr/bin/env python """Unittest for grr http server.""" import hashlib import logging import os import socket import threading import ipaddr import portpicker import requests from google.protobuf import json_format from grr import config from grr_response_client import comms from grr_response_client.client_actio...
bots.py
#!/usr/bin/env python # -⁻- coding: UTF-8 -*- import json, threading, sys, time import res.util as util from res.IrcBot import IrcBot from res.banchonet import BanchoNet from res.OsunpServer import OsunpServer from res.LastFMNP import NpLastFM _launch_vars = {} for prev, item, next in util.neighborhood( sys.argv ): ...
verifyaddon.py
''' Security and validation for add-ons verifyaddon uses the file of an add-on to make sure it follows some rules before letting it loose on Idea users. During verification, the add-on file is imported into a seperate thread, effectively sandboxing it. This library is mainly used by !load of the setup command package ...
tests.py
from __future__ import unicode_literals import os import signal import sys import threading import time from unittest import skipIf, skipUnless from django.db import ( DatabaseError, Error, IntegrityError, OperationalError, connection, transaction, ) from django.test import ( TransactionTestCase, skipIfDB...
camera_pi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import io import threading import picamera global flag flag=1 class Camera(object): global flag thread = None frame = None last_access = 0 def initialize(self): if Camera.thread is None: ...
cpu_reporter_test.py
import time import unittest import random import threading import sys import traceback import stackimpact from stackimpact.runtime import runtime_info class CPUReporterTestCase(unittest.TestCase): def test_record_profile(self): if runtime_info.OS_WIN: return stackimpact._agent = No...
dqnbot_server.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import copy from pprint import pprint from queue import PriorityQueue from threading import Thread from convlab.modules.nlu.multiwoz.mlst.nlu import MlstNLU from flask import Flask, request, jsonify from convlab import slot_dict, act...
helpers.py
""" :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 """ import base64 import builtins import errno import fnmatch import functools import inspe...
main.py
#!/usr/bin/env python3 import os # NOTE This is a hack to avoid pecular file locking issues for the # externally linked chunk files on the NRAO's `lustre` filesystem. os.environ['HDF5_USE_FILE_LOCKING'] = 'FALSE' import time import shutil import inspect import warnings import itertools import multiprocessing from pat...
main.py
import sys import time import threading import logging import psycopg2 from psycopg2 import pool from psycopg2 import extras import config from processing import process_page, robots from db import queries def get_page_to_process(connection, sleep_time, max_sleeps): """ :param connection: Database connection...
server.py
import select import socketserver import threading from queue import Queue class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer): pass class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): """A threaded tcp request handler """ def handle(self): """ The ha...
crypto_depth_data_fetch.py
import asyncio import time import traceback from datetime import datetime from binance.client import Client from binance import ThreadedDepthCacheManager from binance import ThreadedWebsocketManager from binance import AsyncClient, BinanceSocketManager from multiprocessing import ProcessError, Queue, Process class bi...
test_config.py
# -*- coding: utf-8 -*- ''' Test fixtures for the napalm-logs profiles. ''' from __future__ import absolute_import # Import python std lib import os import json import time import socket import logging from multiprocessing import Process # Import third party lib import zmq import pytest # Import napalm-logs pkgs imp...
arvfile.py
import functools import os import zlib import bz2 import config import hashlib import threading import Queue import copy import errno import re import logging import collections import uuid from .errors import KeepWriteError, AssertionError, ArgumentError from .keep import KeepLocator from ._normalize_stream import no...
test_webdriver.py
# -*- coding: utf-8 -*- """ Created on 2021/3/18 7:05 下午 --------- @summary: --------- @author: Boris @email: boris_liu@foxmail.com """ from feapder.utils.webdriver import WebDriverPool, WebDriver import threading def test_webdirver_pool(): webdriver_pool = WebDriverPool( pool_size=2, load_images=False, ...
efuzzer.py
#imports first import time import threading import urllib3 import certifi from queue import Queue import argparse #define argparse argument for threads parser = argparse.ArgumentParser(description='Etsy attack tool') parser.add_argument("-t", "threadsN", type=int, help='number for thread c...
main.py
import renderer,lvl_loader mul=input("multiplayer?(y/n)") online=False if mul=="y": import network online=True def controler(): target = None inp="" while True: inp = input().split(" ") command = inp[0] arg1=inp[1] if command == "move": if arg1 == "up": ...
exercise24_hash_server.py
""" --- Exercise statement: N°24 - Hash Realizar un programa cliente-servidor en Python que permita calcular las funciones hash de un archivo pasado por opciones de línea de comandos. El servidor deberá atender en un puerto TCP determinado pasado por argumento -p. El servidor recibirá conexiones desde clientes remo...
joystickviewer.py
import pygame from Tkinter import * import threading import joysticks class JoyEntry(Frame): def __init__(self, left, right, master=None): Frame.__init__(self, master) self.right = Label(self, text=right) self.right.pack(side=RIGHT) self.left = Label(self, text=left) self....
mail.py
# -*- coding: utf-8 -*- import email.mime.text import logging import smtplib from Queue import Empty from multiprocessing import JoinableQueue from multiprocessing import Process from pushmanager.core.settings import Settings class MailQueue(object): message_queue = None worker_process = None smtp = None...
upload_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2014 Kitware 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 cop...
connections.py
from __future__ import absolute_import import socket import Queue import threading import logging import binascii import sys from abc import ABCMeta, abstractmethod import functools import time try: import can _import_can_err = None except Exception, e: _import_can_err = e try: impor...
handlers.py
import logging import time from threading import Thread class StreamHandlerWithBuffer(logging.StreamHandler): def __init__(self, stream=None, buffer_time: float = 0.2, buffer_lines: int = 50): super().__init__(stream) assert buffer_time >= 0 or buffer_lines >= 0, "At least one kind of buffer must ...
test_api.py
#!/usr/bin/python ############################################################################## # Copyright 2016-2017 Rigetti Computing # # 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 ...
bbmp_subprocess.py
''' Copyright (c) 2020 Attila Szarvas <attila.szarvas@gmail.com> All rights reserved. Use of this source code is governed by the 3-Clause BSD License that can be found in the LICENSE file. ''' import logging import signal import subprocess import sys import threading from typing import List, Union logger = logging.g...
graphic_debugger.py
import threading import cv2 import numpy as np from utils import mttkinter from utils.misc import color_filter, kill_thread from screen import Screen from item import ItemFinder from config import Config import tkinter as tk from template_finder import TemplateFinder from PIL import ImageTk, Image import re class G...
_runner.py
# Copyright 2015-2016, Google Inc. # All rights reserved. # # 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 # notice, this list of conditions and ...
start_proc.py
import multiprocessing def sum_and_product(a, b): s, p = a + b, a * b print(f'{a}+{b}={s}, {a}*{b}={p}') p = multiprocessing.Process( target=sum_and_product, name='SumProdProc', args=(7, 9) ) p.start() """ $ python start_proc.py 7+9=16, 7*9=63 """
core.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import rospy, cv2, time from rospy import Subscriber, ServiceProxy from gs_flight import CallbackEvent from std_msgs.msg import UInt8, Int8MultiArray from threading import Thread from kiberdrom_interfaces.srv import GoToLand from kiberdrom_interfaces.srv import P...
tutorial_kml.py
""" mss.tutorials.tutorial_kml ~~~~~~~~~~~~~~~~~~~~~~~~~~ This python script generates an automatic demonstration of how to overlay kml flles on top of the map in topview. kml(key hole markup language) is an XML based file format for demonstrating geographical context. This will demonstrate how to ...
TCPclient.py
import socket from colorama import Fore, init, Back; from threading import * import random init() colors = [Fore.BLUE, Fore.CYAN, Fore.GREEN, Fore.LIGHTBLACK_EX, Fore.LIGHTBLUE_EX, Fore.LIGHTCYAN_EX, Fore.LIGHTGREEN_EX, Fore.LIGHTMAGENTA_EX, Fore.LIGHTRED_EX, Fore.LIGHTWHITE_EX, Fore.LIGHTY...
test_bootstrap_link_via_app_data.py
from __future__ import absolute_import, unicode_literals import contextlib import os import subprocess import sys from stat import S_IWGRP, S_IWOTH, S_IWUSR from threading import Thread import pytest from virtualenv.discovery import cached_py_info from virtualenv.discovery.py_info import PythonInfo from virtualenv.i...
dirstructure.py
from __future__ import print_function from __future__ import absolute_import ################################################################################ # RelMon: a tool for automatic Release Comparison # https://twiki.cern.ch/twiki/bin/view/CMSPublic/RelMon # # # ...
main.py
# Asset Monitoring Dashboard 1.0 # Cisco Meraki IoT + Cisco Industrial Asset Vision # MIT License, flopach / Cisco Systems 2021 import iav_to_influx import meraki_to_influx import config import time from threading import Thread if __name__ == "__main__": print("Starting py_connector") time.sleep(60) #wait for...
moduleinspect.py
"""Basic introspection of modules.""" from typing import List, Optional, Union from types import ModuleType from multiprocessing import Process, Queue import importlib import inspect import os import pkgutil import queue import sys class ModuleProperties: def __init__(self, name: str, ...
engine.py
# encoding: UTF-8 ''' 账号相关数据记录 1. 监听 EVENT_ACCOUNT事件,数据 => mongodb Account.account_info 和 daily_info 2. 监听 EVENT_ORDER 事件,数据 => mongodb Account.today_orders 3. 监听 EVENT_TRADE 事件,数据 => mongodb Account.today_trades 4. 监听 EVENT_POSITION事件,数据 => mongodb Account.today_position 5. 监听股票接口的 EVENT_HISTORY_TRADE 事件, 数据 => his...
server.py
import socket import select import threading from rhba_utils import BotUtils, Events, QuestHandle, SellRepair, WindowCapture, Follower import pydirectinput import time import os import ctypes from cryptography.fernet import Fernet from fuzzywuzzy import process from custom_input import CustomInput # Change directory t...
predict_all.py
import os import queue import threading import cv2 import gc from model_name_encoder import decode_params from tools.stats import mean_bands os.environ['CUDA_VISIBLE_DEVICES'] = "0" from skimage.external import tifffile from tensorflow.python.client import device_lib from tools.mul_img_utils import stretch_8bit ...
mthello.py
import threading def hello(): print('Hello World!') if __name__ == '__main__': for i in range(3): # 生成工作线程 t = threading.Thread(target=hello) # 启动工作线程 t.start() # 调用target()
info_s.py
import requests, urllib, socket, random, time, re, threading, sys, json, os, xtelnet import bs4 from bs4 import BeautifulSoup from bane.payloads import * if sys.version_info < (3, 0): from scapy.config import conf conf.ipv6_enabled = False from scapy.all import * else: from kamene.config import conf ...
manticore.py
import os import sys import time import types import logging import binascii import tempfile import functools from multiprocessing import Manager, Pool from multiprocessing import Process from threading import Timer from elftools.elf.elffile import ELFFile from elftools.elf.sections import SymbolTableSection from ....
Transport_Cleaning.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import cv2 import copy import time import math import import_path import Camera import apriltag import threading import numpy as np from LABConfig import * import PickAction as Pick import kinematics as kinematics import HiwonderSDK.Misc as Misc import HiwonderS...
dnschef.py
#!/usr/bin/env python # # DNSChef is a highly configurable DNS Proxy for Penetration Testers # and Malware Analysts. Please visit http://thesprawl.org/projects/dnschef/ # for the latest version and documentation. Please forward all issues and # concerns to iphelix [at] thesprawl.org. DNSCHEF_VERSION = "0.3" # Copy...
histogram.py
# coding: utf-8 ### # @file histogram.py # @author Sébastien Rouault <sebastien.rouault@alumni.epfl.ch> # # @section LICENSE # # Copyright © 2020-2021 École Polytechnique Fédérale de Lausanne (EPFL). # See LICENSE file. # # @section DESCRIPTION # # Plot the histogram of per-worker norm/variance estimations...
common_utils.py
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
bot_core.py
from asyncio import tasks from modules import writer, status, logger, watchdog from modules import services from platform import node from modules.services import server from modules.services import Message, Attachment from modules.scanner import scann from modules.response import response from threading import Thread ...
video_stream.py
import time from pathlib import Path from queue import Queue from threading import Thread import cv2 class VideoStream: """ VideoStream. Uses OpenCV to open a video file and read frames. Allows for reading one frame at a time, or starting a thread to buffer frames. """ _EOF = {'data': ...
base_camera.py
import time import threading try: from greenlet import getcurrent as get_ident except ImportError: try: from thread import get_ident except ImportError: from _thread import get_ident class CameraEvent(object): """An Event-like class that signals all active clients when a new frame is ...
DyStockTableWidget.py
import threading import os import struct import requests from bs4 import BeautifulSoup import re try: from PyQt5.QtWebKitWidgets import QWebView as DyWebView except ImportError: from PyQt5.QtWebEngineWidgets import QWebEngineView as DyWebView from PyQt5.QtCore import QUrl from PyQt5.QtWidgets import QApplicat...
registry.py
import logging import math import sys import threading from spectator.clock import SystemClock from spectator.counter import Counter, NoopCounter from spectator.distsummary import DistributionSummary, NoopDistributionSummary from spectator.gauge import Gauge, NoopGauge from spectator.http import HttpClient from specta...
GroupManager.py
import threading, datetime, time, ast import udpserver, tcpfilesocket, udpbroadcaster, messages from constants import * groupManager = None startup = True class GroupManager(): def __init__(self, config): self.groupName = config["group"] self.memberCount = 0 self.groupMasterName = config["...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ...
client.py
import socket import json import config from threading import Thread import time class Client: def __init__(self): self.socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) self.listenerThread = Thread(target=self.listen) self.workerThread = Thread(target=self.process) self.queue = [] self.mapReady = F...
subdomains.py
import re import requests from webpt import find from urllib.parse import urlparse import threading import urllib.request import time requests.packages.urllib3.disable_warnings() # noqa class SubDomains: def __init__(self, url): self.url = url self.domains = [] self.all_links = [] ...
test_server.py
import asyncio import json import os import time import urllib.parse import uuid import sys from http import HTTPStatus from multiprocessing import Process, Manager from multiprocessing.managers import DictProxy from pathlib import Path from typing import List, Text, Type, Generator, NoReturn, Dict, Optional from unitt...
app.py
from threading import Thread, Timer from time import sleep import RPi.GPIO as GPIO # Todo list storage global todoList todoList = [ { "name": "Go to school", "completed": True, } ] def set_interval(func, sec): def func_wrapper(): set_interval(func, sec) func() t = Timer(sec, func_wrapper) t....
__init__.py
import logging import sys import threading import time from ping3 import ping class Pyng: def __init__(self, logfile, hosts, delay): self.__logger = logging.getLogger("pyng") self.__logger.setLevel(logging.INFO) log_format = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(me...
devserver.py
from __future__ import absolute_import, print_function, unicode_literals import atexit import logging import multiprocessing import os import platform import subprocess import sys from threading import Thread from django.contrib.staticfiles.management.commands.runserver import Command as RunserverCommand from django....
local.py
from __future__ import absolute_import import os import sys import subprocess import shutil import io import threading import errno try: import pty except ImportError: pty = None from .tempdir import create_temporary_dir from .files import FileOperations from . import results from .io import IoHandler, Chann...
framereader.py
import os import sys import json import struct import tempfile import threading import xml.etree.ElementTree as ET import numpy as np if sys.version_info >= (3,0): import queue import pickle from io import BytesIO as StringIO else: import Queue as queue import cPickle as pickle from cStringIO import StringI...
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...
process.py
""" Functions for daemonizing and otherwise modifying running processes """ import contextlib import copy import errno import functools import io import json import logging import multiprocessing import multiprocessing.util import os import queue import signal import socket import subprocess import sys import threadi...
slp_backend.py
""" Copyright (c) 2019 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.0 (the "License"). You may obtain a copy of the License at https://developer.cisco.com/docs/licenses All use of the material herein must be in accordance wi...
task_manager.py
__copyright__ = "Copyright 2017-2018, http://radical.rutgers.edu" __author__ = "Vivek Balasubramanian <vivek.balasubramaniana@rutgers.edu>" __license__ = "MIT" import radical.utils as ru from radical.entk.exceptions import * import threading from multiprocessing import Process, Event import Queue import time import js...
gdal2tiles.py
# -*- coding: utf-8 -*- # ****************************************************************************** # $Id$ # # Project: Google Summer of Code 2007, 2008 (http://code.google.com/soc/) # Support: BRGM (http://www.brgm.fr) # Purpose: Convert a raster into TMS (Tile Map Service) tiles in a directory. # ...
publisher.py
import errno import hashlib import os import posixpath import select import shutil import subprocess import tempfile import threading from contextlib import contextmanager from werkzeug import urls from lektor._compat import (iteritems, iterkeys, range_type, string_types, text_type, queue, StringIO) from lektor.e...
mock_steam.py
import websocket import json import traceback from threading import Thread, Condition from base64 import b64encode class MockSteam: def __init__(self, base_uri, username, password, trace=False): uri = "ws://%s/3/Steam.websocket" % base_uri if username is not None: userAndPass = b64enco...
s00_prep_data.py
import bz2 import gzip import os import shutil import glob from multiprocessing import Process, Queue from tqdm.auto import tqdm from kgdata.config import WIKIDATA_DIR """This is the module that split and prepare the raw data downloaded from Wikidata to make it easier to process with Spark """ def save2file(outfil...
mod_serial.py
#!/usr/bin/env python # # mod_serial.py # send a serial file with RTS/CTS and DSR/DTR handshaking # # Neil Gershenfeld # (c) Massachusetts Institute of Technology 2014 # # This work may be reproduced, modified, distributed, # performed, and displayed for any purpose, but must # acknowledge the fab modules project. C...