source
stringlengths
3
86
python
stringlengths
75
1.04M
test_jwt_token_manager.py
# pylint: disable=missing-docstring,protected-access,abstract-class-instantiated import time import threading from typing import Optional import jwt import pytest from ibm_cloud_sdk_core import JWTTokenManager, DetailedResponse class JWTTokenManagerMockImpl(JWTTokenManager): def __init__(self, url: Optional[str] ...
command.py
import multiprocessing import random import subprocess import sys import os import threading import time import glob as _glob import shutil import pathlib from functools import wraps from typing import Union import pkg_resources import idseq_dag.util.log as log from idseq_dag.util.trace_lock import TraceLock import ids...
HIDPS.pyw
import fcntl, easygui, logging, time, urllib, urllib2, sys, simplejson, ttk, multiprocessing, Queue, os, netifaces from Tkinter import * from threading import * from PIL import Image, ImageTk from netfilter import * logging.getLogger("scapy.runtime").setLevel(logging.ERROR) from scapy.all import * inc_txt_str = " " ou...
data_util.py
''' this file is modified from keras implemention of data process multi-threading, see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py ''' import time import numpy as np import threading import multiprocessing try: import queue except ImportError: import Queue as queue cl...
api_tester_old.py
from __future__ import print_function # Python 2 standard library imports import argparse import json import logging import os import shutil import sys import threading import uuid # Oasis Api import from oasislmf.api_client.client import OasisAPIClient ''' Test utility for running a model analysis using the Oasis A...
models.py
from django.db import models import multiprocessing from .send_command import ProcessSendCommand from django.conf import settings class PelletStoveCmd(): def __init__(self): self.send_commands = False self.fan1_speed = 5 self.fan2_speed = 5 self.flame_power = 3 self.mode = T...
server.py
import socket import threading import time def logicka(request): print("request",request) superUser = 0 places = [] if request=='1'or '0': if request == '1': superUser=1 concerts = ["Imagine Dragons", "Tarkov", "KINO", "Kazah-Han", "Coiner"] if superUser=...
__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 shutil import subprocess import stat import sys import threading import ti...
jobs.py
"""Sopel's Job Scheduler: internal tool for job management. .. important:: As of Sopel 5.3, this is an internal tool used by Sopel to manage internal jobs and should not be used by plugin authors. Its usage and documentation is for Sopel core development and advanced developers. It is subject to rapid...
envs_runner_cen_condi.py
import numpy as np import torch import IPython from multiprocessing import Process, Pipe from IPython.core.debugger import set_trace def worker(child, env): """ Worker function which interacts with the environment over remote """ try: while True: # wait cmd sent by parent ...
01_demo.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading from time import sleep, ctime def sing(): for i in range(3): print("正在唱歌...%d" % i) sleep(1) def dance(): for i in range(3): print("正在跳舞...%d" % i) sleep(1) if __name__ == '__main__': print('---开始---:%s' % ...
cluster.py
import asyncio import shutil import tempfile import threading import warnings from asyncio import AbstractEventLoop from collections import Counter from pathlib import Path from typing import List, Optional, Union from cluster_fixture import ssl_helper from cluster_fixture.base import DEFAULT_KAFKA_VERSION, KafkaVersi...
_v5_proc_voice2wav.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # COPYRIGHT (C) 2014-2020 Mitsuo KONDOU. # This software is released under the MIT License. # https://github.com/konsan1101 # Thank you for keeping the rules. import sys import os import time import datetime import codecs import glob import queue impo...
docker_image_manager.py
from collections import namedtuple import threading import time import traceback import logging import docker import codalab.worker.docker_utils as docker_utils from codalab.worker.fsm import DependencyStage from codalab.worker.state_committer import JsonStateCommitter from codalab.worker.worker_thread import ThreadD...
utils.py
import logging import os import random import re import shutil import sqlite3 import string import subprocess import threading import time from btcproxy import BitcoinRpcProxy from bitcoin.rpc import RawProxy as BitcoinProxy from decimal import Decimal from ephemeral_port_reserve import reserve from lightning import L...
download_mbta_gtfsrt.py
"""Script to download MBTA vehicle positions every 5 seconds during 1 minute """ import os import time import threading from datetime import datetime import traceback import requests from common import Settings, s3, utils __author__ = "Alex Ganin" def download_feed(dirName, url, *args): """Downloads a real-time...
diskover_socket_server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """diskover - Elasticsearch file system crawler diskover is a file system crawler that index's your file metadata into Elasticsearch. See README.md or https://github.com/shirosaidev/diskover for more information. Copyright (C) Chris Park 2017-2018 diskover is released unde...
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...
test_core.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 #...
screen.py
from .streamtools import Stream from .image import Image from .rainbow import color, msg from .guiviewer import GuiViewer from os import system from time import sleep, process_time from sys import argv from threading import Thread MAT_WIDTH = 64 MAT_HEIGHT = 16 class Screen: """ Screen is the Image manager ...
tcp.py
import socketserver import logging import threading import dns.message import encrypted_dns.inbound_handler from . import server class StreamHandler(socketserver.StreamRequestHandler): inbound_handler = None def setup(self): super().setup() self.logger = logging.getLogger("encrypted_dns.i...
pl6_ex21.py
#-*- coding : utf-8 -*- from multiprocessing import Process, Array, Semaphore import random, time MAX_SIZE = 1 buffer = Array("i", MAX_SIZE) empty = Semaphore(MAX_SIZE) #Inicialmente, MAX_SIZE posicoes livres full = Semaphore(0) #Inicialmente, 0 posicoes ocupadas def produtor(): while True: nextProduced = r...
precompute_alignments.py
import argparse from functools import partial import json import logging import os import threading from multiprocessing import cpu_count from shutil import copyfile import tempfile import time import pickle import openfold.data.mmcif_parsing as mmcif_parsing from openfold.data.data_pipeline import AlignmentRunner fro...
__init__.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # imports. from dev0s.classes.defaults.objects import * from dev0s.classes.defaults.defaults import defaults from dev0s.classes.defaults.exceptions import Exceptions from dev0s.classes.response import response as _response_ from dev0s.classes.requests import requests as _...
statistics.py
#!/usr/bin/env python import time import os import sys import socket import ast import threading from utils import * socket_file = '/var/run/statistics_socket' # Make sure the socket does not already exist try: os.unlink(socket_file) except OSError: if os.path.exists(socket_file): raise class Statis...
test_ssl.py
# Test the support for SSL and sockets import sys import unittest from test import support import socket import select import time import datetime import gc import os import errno import pprint import urllib.request import threading import traceback import asyncore import weakref import platform import functools try: ...
CrayTag.pyw
class ver: sion="2.1" # Version number of program. # ver.sion """ ############################## CrayTag. ############################## Coded by: Dalton Overlin ########################################################## Last Code Revision Date: May. 26th, 2020 #################################...
lisp-rtr.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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...
test_events.py
"""Tests for events.py.""" import collections.abc import concurrent.futures import functools import io import os import platform import re import signal import socket try: import ssl except ImportError: ssl = None import subprocess import sys import threading import time import errno import unittest from unitt...
tornado_handler.py
from __future__ import print_function from ResponseProvider import Payload from ResponseProvider import ResponseProvider from ResponseProvider import ResponseProviderMixin from threading import Timer import os import threading import tornado.ioloop import tornado.web import logging class MainHandler(tornado.web.Req...
generate_data.py
import asyncio import logging import os import random import time import threading from multiprocessing import Pool from multiprocessing import Process from activity.constants import ACTIVITY, HEART_RATE, RESPIRATION_RATE, USER_ID from activity.models import DeviceModel from activity.utils import generate_csv_file, ...
installwizard.py
from functools import partial import threading from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.utils import platform from kivy...
RunMutants.py
#coding:utf-8 import sys,os import logging from DeviceHelper import get_available_devices from Device import Device from App.app import App from ConfigReader import ConfigReader import threading,time class RunMutants(object): # this is a single instance class _instance_lock = threading.Lock() # How long we...
padding_fifo_queue_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
run-clang-format.py
#!/usr/bin/env python import argparse import json import multiprocessing import os import re import subprocess import sys import threading from pathlib import Path import queue as queue def get_format_invocation(f, clang_format_binary): """Gets a command line for clang-tidy.""" start = [clang_format_binary, ...
server.py
""" MIT License Copyright (c) 2021 CarlFandino 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, pu...
ScanThread.py
from threading import Thread from typing import Callable, Any import boardController from chess import SquareSet class ScanThread: def __init__(self, callback: Callable[[SquareSet], Any]): self._callback = callback self._thread = Thread(name="ScanThread", target=self._scan_loop) self._shou...
_multiprocessing.py
from __future__ import annotations import os import multiprocessing import sys from ._imports import multiprocessing_connection def run_in_process( target, name=None, args=(), kwargs=None, allow_detach=False, timeout=None ): """Run provided target in a multiprocessing.Process. This function does not re...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
client.py
#coding=utf8 import time, sys, Queue import MySQLdb from MySQLdb import cursors from multiprocessing.managers import BaseManager from multiprocessing.sharedctypes import RawArray from multiprocessing import Process, freeze_support, Array reload(sys) sys.setdefaultencoding('utf8') def work(server_addr): # 数据库连接 ...
UserInterface.py
import os import math import time from threading import Thread, Timer from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * # Main widget from widgets.ControlPanel import ControlPanel # Dialog with combo from dialogs.ComboDialog import ComboDialog # Replay from ..log.Replay import Replay...
actor.py
# _*_ encoding:utf-8 _*_ """ read package data test """ __author__ = "aaron.qiu" from queue import Queue from threading import Thread, Event # Sentinel used for shutdown class ActorExit(Exception): pass class Actor: def __init__(self): self._mailbox = Queue() def send(self, msg): ''' ...
ub_process.py
import subprocess import traceback from multiprocessing import Process from uniback.tools.data_trackers import ProgressTracker, DataTracker from time import sleep from threading import Thread, Lock import os # process object with the ability to deal with subprocesses and parse # their output as necessary class UBProc...
server.py
from __future__ import print_function from __future__ import absolute_import from __future__ import division import threading try: from SimpleXMLRPCServer import SimpleXMLRPCServer except ImportError: from xmlrpc.server import SimpleXMLRPCServer # socket.setdefaulttimeout(10) __all__ = ['Server'] class ...
detecta.py
from scapy.all import * import platform import subprocess from threading import Thread BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[94m', '\033[91m', '\33[97m', '\33[93m', '\033[1;35m', '\033[1;32m', '\033[0m' """ @args: <ip> Convierte una lista de enteros a un string para presentación """ def...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import multiprocessing import os import socket import shutil import s...
test_metric.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import urllib import urllib.request import json import requests from requests.exceptions import SSLError import rdflib from rdflib import Graph, plugin from rdflib.serializer import Serializer import argparse import termcolor from string import Template import ite...
git.py
#!/usr/bin/env python """ git.py - Github Post-Receive Hooks Module """ import http.server from threading import Thread from io import StringIO import json import os import re import time import atexit import signal from tools import generate_report, PortReuseTCPServer, truncate import urllib.parse import web from mod...
bot.py
""" ## Programm structure bot.py handles all the messages users send to bot. Then it uses `AnswerGenerator` to get the reply to user's command. This file contains message handlers. ## Executing the bot To execute, you need to provide bot's `API_TOKEN` using environment variable. In Linux: ``` export API_TOKEN=x...
test_binary_filesystem.py
""" test CRUD ops put, list_dir, get, delete """ from os import environ, remove from pytest import fixture, raises import docker import tempfile from time import sleep from multiprocessing import Process from .brain import connect, r from .brain.binary.data import put, get, list_dir, delete from .brain.queries import...
http1_tests.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...
Extração MagMax COVID - STARLAB.py
from opentrons.types import Point import json import os import math import threading from time import sleep metadata = { 'protocolName': 'USO_v6_station_b_M300_Pool_magmax', 'author': 'Nick <ndiehl@opentrons.com', 'apiLevel': '2.3' } NUM_SAMPLES = 96 # start with 8 samples, slowly increase to 48, then 94 ...
main.py
import struct import socket from PIL import ImageGrab from cv2 import cv2 import numpy as np import threading import keyboard import mouse bufsize = 1024 host = ('0.0.0.0', 80) soc = socket.socket(socket.AF_INET, socket.SOCK_STREAM) soc.bind(host) soc.listen(1) # 压缩比 1-100 数值越小,压缩比越高,图片质量损失越严重 IMQUALITY = 50 lock = ...
subprocess.py
# coding: utf-8 """ Calling shell processes. """ import shlex import threading import traceback from subprocess import Popen, PIPE from .string import is_string __author__ = 'Matteo Giantomass' __copyright__ = "Copyright 2014, The Materials Virtual Lab" __version__ = '0.1' __maintainer__ = 'Matteo Giantomassi' __em...
devtools.py
# pyright: reportGeneralTypeIssues=false from asyncio import get_event_loop from websockets import serve from http.server import BaseHTTPRequestHandler, HTTPServer from requests import get from threading import Thread from sys import argv print("Jacdac DevTools (Python)") internet = "--internet" in argv HOST = '0.0.0...
device.py
# -*- coding: utf-8 -*- import os import sys import json import time import logging import threading import logging.config import numpy as np from datetime import datetime from collections import defaultdict from .io import discover_hosts, io_from_host, Ws from .containers import name2mod from anytree import AnyNode...
deletionwatcher.py
# coding=utf-8 import json import os.path import requests import time import threading # noinspection PyPackageRequirements import websocket # noinspection PyPackageRequirements from bs4 import BeautifulSoup from urllib.parse import urlparse import chatcommunicate import metasmoke from globalvars import GlobalVars impo...
processo_1.py
@app.route('/start_task') def start_task(): def do_work(value): # do something that takes a long time import time time.sleep(value) thread = Thread(target=do_work, kwargs={'value': request.args.get('value', 20)) thread.start() return 'started' @app.route('/start_task') def s...
UDPclient.py
''' UDPclient.py Author: Colleen Kimball Date: November 2, 2014 Description: This program connects to a server using UDP and pings the server 10 times, collecting RTT information and recording it. ''' from socket import* import time import threading #this function sends a ping message to the server and records the R...
app.py
import os import sys import time import logging import datetime import threading try: import Queue as queue except ImportError: # Python 3+ import queue from ...vendor.Qt import QtWidgets, QtCore, QtGui from ... import api, io from .. import lib from ...vendor import qtawesome as awesome log = logging.ge...
pigear.py
""" =============================================== vidgear library source-code is deployed under the Apache 2.0 License: Copyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with th...
augment_trajectories.py
import os import sys sys.path.append(os.path.join(os.environ['ALFWORLD_ROOT'])) sys.path.append(os.path.join(os.environ['ALFWORLD_ROOT'], 'gen')) import json import glob import os import constants import cv2 import shutil import numpy as np import argparse import threading import time import copy import random from ut...
ch4_voltage_source.py
from functools import partial from pubsub import pub from threading import Thread from time import sleep import wx from wx.lib.agw.floatspin import FloatSpin from spacq.gui.tool.box import load_csv, save_csv, Dialog, MessageDialog from spacq.interface.units import Quantity """ Configuration for a ch4VoltageSource. ""...
port_scanner.py
import requests import socket import threading requests.packages.urllib3.disable_warnings() # noqa class ScanPort: def __init__(self, target, start_port=None, end_port=None): self.target = target self.from_port = start_port self.to_port = end_port self.ports = [] ...
mail-measure.py
# coding: utf-8 import sys import smtplib import socket import time from email.MIMEText import MIMEText from PyQt4 import QtGui, uic, QtCore from multiprocessing import Process """ sendmail examples: https://docs.python.org/2/library/email-examples.html """ class form(QtGui.QMainWindow): def __init__(self): ...
common.py
import os import re import subprocess import threading import time from contextlib import contextmanager from pathlib import Path import docker import requests from tests.helpers import fake_backend from tests.helpers.util import ( get_docker_client, get_host_ip, pull_from_reader_in_background, retry, ...
utils.py
import binascii import logging import os import re import sqlite3 import subprocess import threading import time from bitcoin.rpc import RawProxy as BitcoinProxy BITCOIND_CONFIG = { "rpcuser": "rpcuser", "rpcpassword": "rpcpass", "rpcport": 57776, } LIGHTNINGD_CONFIG = { "bitcoind-poll": "1s", ...
iterativeCF.py
import numpy as np import pandas as pd import tensorflow as tf import time, sys, datetime, copy, math, os from threading import Thread from multiprocessing import Process import logging os.environ["TF_CPP_MIN_LOG_LEVEL"] = '3' log = logging.getLogger('root') class cf_similarity(object): def __init__(self, mat1, m...
utils.py
from bitcoin.rpc import RawProxy as BitcoinProxy from btcproxy import BitcoinRpcProxy from collections import OrderedDict from decimal import Decimal from ephemeral_port_reserve import reserve from lightning import LightningRpc import json import logging import lzma import os import random import re import shutil impo...
doom_gym.py
import copy import os import random import re import time from os.path import join from threading import Thread import cv2 import gym import numpy as np from filelock import FileLock, Timeout from gym.utils import seeding from vizdoom.vizdoom import ScreenResolution, DoomGame, Mode, AutomapMode from sample_factory.al...
server.py
#!/usr/bin/python3 import socket import threading import time import os import subprocess from hash_identify import * import re import attack_list import local_network_attack import json import os import signal import shodan from termcolor import colored import pyfiglet #configure: API_KEY = "" #shodan api key executa...
interactive.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko 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 Foundat...
test_ffi.py
import sys, py from pypy.module.pypyjit.test_pypy_c.test_00_model import BaseTestPyPyC class Test__ffi(BaseTestPyPyC): def test__ffi_call(self): from rpython.rlib.test.test_clibffi import get_libm_name def main(libm_name): try: from _rawffi.alt import CDLL, types ...
Ports.py
import pygame from PIL import Image import time import MotherBoard.util as util from threading import Thread buffer = Image.new("RGB",(16,16),"black") running = True ports = {0:0, 1:0, 2:0, 3:0, 4:0, 5:0, 6:0, 7:0, 8:0, 9:0, 10:0, 11:0, 12:0, 13:0, 14:0, 15:0} def screen(): global buffer global running py...
thread.py
import cv2 import threading import queue class ThreadingClass: def __init__(self, name): self.cap = cv2.VideoCapture(name) self.q = queue.Queue() t = threading.Thread(target = self._reader) t.daemon = True t.start() def _reader(self): while True: re...
thread_num.py
#encoding:utf-8 ''' @author: look @copyright: 1999-2020 Alibaba.com. All rights reserved. @license: Apache Software License 2.0 @contact: 390125133@qq.com ''' import csv import os import re import sys import threading import time import traceback BaseDir=os.path.dirname(__file__) sys.path.append(os.path....
web.py
from inspect import currentframe from flask import Flask, render_template, Response #!/usr/bin/env python3 import re import cv2 import depthai as dai import numpy as np from multiprocessing.pool import ThreadPool import threading from queue import Queue from collections import deque import time import base64 from fla...
endpoints.py
import os import sys import json from flask import request, Blueprint, Response from flask_cors import cross_origin from concurrent.futures import ThreadPoolExecutor from multiprocessing import Process from dhcp_monitor.command_scripts.stream_handler import StreamHandler from dhcp_monitor.data_manipulation.dump_message...
ipgrab.py
# By Luiz Viana import argparse from http.server import HTTPServer, BaseHTTPRequestHandler import time import os import requests from threading import Thread import platform parser = argparse.ArgumentParser(description="IP grabber NGROK") parser.add_argument('-u', '--redirect-url', type=str, required=True, h...
screen_interface.py
import threading from rich import print as pr import sys import socket import enum import os class TypeMessage(enum.Enum): PRINT="[print]" INPUT="[input]" BASE ="[basic]" CLOSE="[close]" class Screen: def __init__(self, prt: int) -> None: self.port = prt self.accept_input = False ...
asyncio_util.py
# Copyright (c) 2017-2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 """ This module contains utilities to help work with ``asyncio``. """ from asyncio import ( AbstractEventLoop, AbstractEventLoopPolicy, CancelledError, Future, ...
TransaqReplayServer.py
# -*- coding: utf-8 -*- """ File: TransaqReplayServer.py Author: Daniil Dolbilov Created: 18-Oct-2020 """ import logging import threading import time from multiprocessing.connection import Listener class TransaqReplayServer: def __init__(self, xdf_file, host='localhost', port=7070, authkey=b'sec...
runner.py
import argparse import datetime import colors import docker import json import multiprocessing import numpy import os import psutil import requests import sys import threading import time from ann_benchmarks.datasets import get_dataset, DATASETS from ann_benchmarks.algorithms.definitions import (Definition, ...
mpv.py
# -*- coding: utf-8 -*- # vim: ts=4 sw=4 et # # Python MPV library module # Copyright (C) 2017-2020 Sebastian Götte <code@jaseg.net> # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free Software Foundation, either...
dynamodb_logstore.py
# # Copyright (2021) The Delta Lake Project 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 ag...
_debugger_case_multiprocessing.py
import multiprocessing import sys def run(name): print("argument: ", name) # break 1 here if __name__ == '__main__': if sys.version_info[0] >= 3 and sys.platform != 'win32': multiprocessing.set_start_method('fork') p = multiprocessing.Process(target=run, args=("argument to run method",)) p....
pydoc.py
#!/usr/bin/env python # -*- coding: Latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import Thread from zipfile im...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
test_threaded_import.py
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
startup_controller.py
#!/usr/bin/env python import sys import traceback from threading import Thread, active_count from time import sleep, time from subprocess import call from p3lib.conduit import Conduit from ogsolar.libs.ogsolar_controller import OGSolarController from ogsolar.libs.epsolar_tracer import EPSolarTracerInterface from ogs...
main.py
"""\ Main wxGlade module: defines wxGladeFrame which contains the buttons to add widgets and initializes all the stuff (tree, frame_property, etc.) @copyright: 2002-2007 Alberto Griggio @copyright: 2011-2016 Carsten Grohmann @copyright: 2016-2021 Dietmar Schwertberger @license: MIT (see LICENSE.txt) - THIS PROGRAM COM...
lstm_tester.py
from __future__ import print_function from keras.utils.data_utils import get_file import io import numpy as np from keras.models import load_model import pickle import heapq import cv2 from threading import Thread letter_list = ['e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', 'e', ...
ssh.py
'''ssh client use with, or finally close See https://daanlenaerts.com/blog/2016/07/01/python-and-ssh-paramiko-shell/ https://stackoverflow.com/questions/39606573/unable-to-kill-python-script ''' import threading import paramiko class Ssh: '''communicate with miner through ssh''' shell = None client = None ...
synchronization.py
#coding:utf-8 from p2ptest.proto import grpc_pb2 from p2ptest.proto import grpc_pb2_grpc import p2ptest.block as block from p2ptest.enum.enum import * import threading import time import re _compiNum = re.compile("^\d+$") #判斷全數字用 _compiW = re.compile("^\w{64}") class Synchronization(grpc_pb2.SynchronizationServicer)...
object_detector.py
# -*- coding: utf-8 -*- # Copyright © 2017 Apple Inc. All rights reserved. # # Use of this source code is governed by a BSD-3-clause license that can # be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause """ Class definition and utilities for the object detection toolkit. """ from __futu...
UseModuleMenu.py
import threading import time from prompt_toolkit.completion import Completion from empire.client.src.EmpireCliState import state from empire.client.src.menus.UseMenu import UseMenu from empire.client.src.utils import print_util from empire.client.src.utils.autocomplete_util import filtered_search_list, position_util ...
check.py
from random import randint from PIL import Image from threading import Thread import tensorflow as tf import numpy as np import time import cv2 import voicetest pHand = [] def camcheck(): # Connect to camera camera = cv2.VideoCapture(0) # Take picture time.sleep(0.2) return_value, image = camera....
rosdistro.py
import copy import os import sys import tarfile import tempfile import threading import urllib try: from urllib.request import urlopen from urllib.error import HTTPError except ImportError: from urllib2 import urlopen from urllib2 import HTTPError from .common import info from .common import warning fr...
test_distributed_sampling.py
import dgl import unittest import os from dgl.data import CitationGraphDataset from dgl.distributed import sample_neighbors from dgl.distributed import partition_graph, load_partition, load_partition_book import sys import multiprocessing as mp import numpy as np import backend as F import time from utils import get_lo...