source
stringlengths
3
86
python
stringlengths
75
1.04M
progressmanager.py
import threading import time from libs.popup import SilentUIHandle from libs.progressbar import ProgressBar class Progress(ProgressBar): def __init__(self, message="Checking for new items", silent=False): super().__init__(title="School", message=message, silent=silent) self.messages = [message] ...
distributed_run.py
from multiprocessing.connection import Listener import os import subprocess import socket import tempfile from contextlib import closing import argparse import uuid import getpass import atexit import pathlib import asyncio import glob from datetime import date HARD_CODED_AFFILIATIONS = { "192.168.1.11": ["192.168...
test_capture.py
import contextlib import io import os import pickle import subprocess import sys import textwrap from io import StringIO from io import UnsupportedOperation from typing import List from typing import TextIO import pytest from _pytest import capture from _pytest.capture import CaptureManager from _pytest.main import Ex...
manipulation_example.py
""" Example of a manipulation task. The robot skills are run using the Behavior Tree policy representation. """ # Copyright (c) 2022, ABB # All rights reserved. # # Redistribution and use in source and binary forms, with # or without modification, are permitted provided that # the following conditions are met: # # ...
main.py
# Copyright 2016 Google Inc. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
text2face_gui.py
import os import csv import json import numpy as np import tensorflow as tf from scipy.io import wavfile from python_speech_features import mfcc import eventlet import socketio import threading import PySimpleGUI as sg from google.cloud import texttospeech import base64 from pyngrok import ngrok import requests impo...
testFlask.py
from flask import Flask,Response, request, jsonify import requests import time import json from threading import Thread def sendFuckMessage(): for i in range(100): d = { "message": "caonimabi" } r = requests.post("http://0.0.0.0:101/testpost", data = json.dumps(d)) ...
LAMDA_GEE_Template.py
""" Copyright 2021 Ian Housman, RedCastle Resources 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 applica...
MakeMyGate.py
# -*- coding: utf-8 -*- """ @authors: tomasz marchlewski (marchlewski.tomasz@gmail.com, marchlewski@slcj.uw.edu.pl) roman szenborn (romanszenborn@gmail.com) @version: beta 2.0 --Quick guide-- 1. General info 2. MakeMyGate requirements 3. Installing python and modules a. Anaconda distribution b. Mi...
test_etcd3.py
""" Tests for `etcd3ref` module. ---------------------------------- """ import base64 import contextlib import json import os import signal import string import subprocess import tempfile import threading import time import grpc import mock import pytest import six from hypothesis import given, settings from hypothe...
hmdb_extract_flow.py
# ============================================================================ # 计算光流并输出保存为.npy文件 # ============================================================================ # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from date...
repeating_timer.py
import time from threading import Event, Thread import traceback import logging logger = logging.getLogger(__name__) class Repeating_Timer(object): """Repeat `function` every `interval` seconds.""" def __init__(self, interval): self.interval = float(interval) self.event = Event() s...
wsdump.py
#!/home/lot/Desktop/docker-manager/DockerManager/venv/bin/python import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): ...
background_http_server.py
# Copyright (c) 2017-2022 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. # SPDX-License-Identifier: Apache-2.0 from http.server import HTTPServer from threading import Thread class TestHTTPServer: """ Runner for an HTTP server in a background thread. """ def __init__(se...
irc.py
from __future__ import unicode_literals, division, absolute_import, with_statement from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring from future.moves.urllib.parse import quote import os import re import threading import logging from xml.etree.ElementT...
requests_qitech.py
import multiprocessing from tqdm import tqdm import datetime import requests import random class Requester: def __init__(self, name): self.url = 'http://postal-code.sandbox.certifier.qitech.app/' \ 'postal_code/{}' self.sess = requests.Session() self.name = name de...
test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import os import signal import sys import threading import time import unittest import ray.local_scheduler as local_scheduler import ray.plasma as plasma import pyarrow as pa USE_VALGRIND =...
subprocess.py
# coding: utf-8 from __future__ import absolute_import, print_function, division, \ unicode_literals __author__ = 'Matteo Giantomass' __copyright__ = "Copyright 2014, The Materials Virtual Lab" __version__ = '0.1' __maintainer__ = 'Matteo Giantomassi' __email__ = 'gmatteo@gmail.com' __date__ = '10/26/14' class C...
tab6_cloud.py
import wx import shell_util as exec_cmd import misc_dialogs as misc import info_dialogs as info import json import images as img # from wx.lib.pubsub import setuparg1 # from wx.lib.pubsub import pub as Publisher from pubsub import pub as Publisher import threading from threading import Thread aws_log = None aws_region_...
Department_master.py
from src.dependencies.imports import * class Department_master(LabelFrame): def __init__(self,master,db,flag): super(Department_master,self).__init__(master) labelfont=('times',16,'bold') self.canvas = Canvas(self,bg="#bdc3c7") self.frame = LabelFrame(self.canvas) ...
train.py
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 """Train""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import cv2 from datetime import datetime import os.path import sys import time import numpy as np from six.moves import xrange import tensorfl...
dataset.py
# Copyright 2020 - 2021 MONAI Consortium # 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...
flask_embed.py
from flask import Flask, render_template from bokeh.embed import server_document from bokeh.layouts import column from bokeh.models import ColumnDataSource, Slider from bokeh.plotting import figure from bokeh.server.server import Server from bokeh.themes import Theme from tornado.ioloop import IOLoop from bokeh.sampl...
lambda_executors.py
import base64 import contextlib import dataclasses import glob import json import logging import os import re import shlex import subprocess import sys import tempfile import threading import time import traceback import uuid from multiprocessing import Process, Queue from typing import Any, Callable, Dict, List, Optio...
e2e.py
""" This is an end to end release test automation script used to kick off periodic release tests, running on Anyscale. The tool leverages app configs and compute templates. Calling this script will run a single release test. Example: python e2e.py --test-config ~/ray/release/xgboost_tests/xgboost_tests.yaml --test-...
test_stack.py
# -*- encoding: utf-8 -*- import os import threading import time import timeit import typing import uuid import pytest import six from ddtrace.internal import nogevent from ddtrace.profiling import collector from ddtrace.profiling import event as event_mod from ddtrace.profiling import profiler from ddtrace.profiling...
web_server.py
import re import socket import multiprocessing from dynamic.my_web import application class MyServer(object): """服务器""" def handler_client(self, client_socket): """5.处理客户端请求""" print('接收到客户端的的数据') request_data = client_socket.recv(1024).decode('utf-8') print(request_data) ...
test_context.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...
log_utils.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import os import sys import json import logging import logging.handlers import time import threading import re from datetime import datetime from enum import Enum, unique from logging import StreamHandler from queue import Queue from .rest_uti...
task_queue.py
""" Task queue in yt """ #----------------------------------------------------------------------------- # Copyright (c) 2013, yt Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #--------------------------...
chat.py
import socket import threading class ChatServer: def __init__(self, host, port): self.host = host self.port = port self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.sock.bind((self.host, self.port)) self.sock.listen(5) self.clients = [] self....
StreamingQueryDNADatabase_exitQueue.py
#! /usr/bin/env python import khmer import marisa_trie as mt import numpy as np import os import sys # The following is for ease of development (so I don't need to keep re-installing the tool) try: from CMash import MinHash as MH except ImportError: try: import MinHash as MH except ImportError: sys.path.insert(0...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
views.py
from __future__ import absolute_import, unicode_literals import base64 import json import time import threading import datetime import threading import traceback import io import sys from django.shortcuts import render from django.http import JsonResponse, HttpResponse, StreamingHttpResponse from django.core.files.ima...
main.py
#!/usr/bin/env python # Copyright (c) 2019 Jeppe Pihl # All Rights Reserved # # Distributed under the "BSD License". See the accompanying LICENSE file. import threading import clapper import light def main(): my_light = light.Light() stopped = threading.Event() clapper_thread = threading.Thread( ...
indicator.py
""" The base class for all loading bars and indicators supported by clanimate. @author: Jakub Wlodek """ # python imports. threading for creating animation thread # sys for writing, time for waiting import threading import sys import time class Indicator: """ Base class extended by all supported animated in...
test_threadworker.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for L{twisted._threads._threadworker}. """ import gc import weakref from threading import ThreadError, local from twisted.trial.unittest import SynchronousTestCase from .. import AlreadyQuit, LockWorker, ThreadWorker class FakeQueue...
cnn_util.py
# coding=utf-8 # Copyright 2018 The Google Research 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 applicab...
jobs.py
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import errno import subprocess from abc import abstractmethod from threading import BoundedSemaphore, Event, Thread from pex.compatibility import A...
recursiveFractalSearch5.py
import math import numpy as np import random import timeit from threading import Thread import seaborn as sns import pandas as pd import functools dist_ar = [] # 거리표(global) cities_count = 0 # 도시 수(global) dots_list = [] # 도시 리스트(global) # Hyper Parameter limits = 60 * 10/60 # 제한시간 Fractal_size = 4 # 재귀 수 # Visua...
callbacks_test.py
# Copyright 2016 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...
httpd.py
import http.server import time import os import pyroute2 import socketserver import threading from functools import partial from pathlib import Path class ThreadingHTTPServer(socketserver.ThreadingMixIn, http.server.HTTPServer): pass class HTTPServer: def __init__(self, path, remote_ip): self.path = p...
executor.py
#!/usr/bin/env python # hook for virtualenv # switch to the virtualenv where the executor belongs, # replace all the path for modules from __future__ import absolute_import from __future__ import print_function import sys import os.path P = 'site-packages' apath = os.path.abspath(__file__) if P in apath: virltual...
mv_interface.py
""" Module for defining bell-and-whistles movement features """ import time import fcntl import logging import numbers import signal from contextlib import contextmanager from pathlib import Path from threading import Thread, Event from types import SimpleNamespace, MethodType from weakref import WeakSet import pylab ...
__init__.py
# Copyright 2011 James McCauley # # This file is part of POX. # # POX is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # POX is distri...
gethash.py
import subprocess, threading, os def SnatchHash(): while not os.listdir("/tmp/SSH"): # Checking if the directory is still empty or not pass os.system("cat /tmp/SSH/* > /home/robert/hashes.txt") # Snatching the hash if not os.path.isdir("/tmp/SSH"): # sometime the system doesn't have any default /tmp/...
jobs.py
# _*_ coding: utf-8 _*_ import json import uuid from datetime import datetime from multiprocessing import Process import redis __author__ = 'Arun KR (@kra3)' class SimpleJobQueue(object): SCHEDULED, IN_PROGRESS, DONE, FAILED = ( 'SCHEDULED', 'IN_PROGRESS', 'DONE', 'FAILED') TIMESTAMP, PAYLOAD, STATU...
rec2_particles.py
""" Script for reconstructing particles RELION compatible from full reconstructed tomograms Modification for re-reconstructing the synaptic particles Input: - STAR file with next columns: '_rlnMicrographName': tomogram that will be used for reconstruction '_rlnImageName': ...
port_scanner.py
# imports import socket, threading, time from tkinter import * # === Scan Vars === ip_s = 1 ip_f = 1024 log = [] ports = [] target = 'localhost' # === Scanning Functions === def scan_port(target, port): try: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(4) c = s.conne...
multiluks.py
from subprocess32 import call import threading import os import time import luks class MultiLuks(object): """ Given a username to mount as, a directory which contains containers, and the directory in which to mount containers, allows management of multiple luks operations which are coming...
Crawler.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import urllib2 import urlparse from bs4 import BeautifulSoup import re import os import threading import Queue import time import chardet def valid_filename(s): import string valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits) s = ''.join(c for c...
distopia_data.py
from data_types import Data from distopia.app.agent import VoronoiAgent from utils import hierarchical_sort import numpy as np import pickle as pkl import csv from tqdm import tqdm from multiprocessing import Pool, Manager from threading import Thread from environments.distopia_environment import DistopiaEnvironment im...
stats.py
# from __future__ import absolute_import import json import platform import subprocess import threading import time from typing import Dict, List, Optional, Union import psutil import wandb from wandb import util from wandb.vendor.pynvml import pynvml from . import tpu from ..interface.interface_queue import Interfa...
views.py
from flask import request from flask_cors import CORS, cross_origin from datetime import datetime, timezone from functools import wraps import threading, json, time from googletrans import Translator from AuthModule.azuread import authProvider from SearchModule import app from SearchModule.TextSearchModule import load...
server.py
#!/usr/bin/env python """ Dummy server used for unit testing. """ from __future__ import print_function import errno import logging import os import random import string import sys import threading import socket import warnings from datetime import datetime from urllib3.exceptions import HTTPWarning from tornado.pl...
stage.py
import inspect import sys import time import traceback from collections import namedtuple from queue import Queue from threading import Lock, Thread import stopit from pypeln import utils as pypeln_utils from . import utils class Stage: def __init__( self, f, workers, maxsize, ...
results.py
from toolset.utils.output_helper import log from toolset.test_types import test_types import os import subprocess import uuid import time import json import requests import threading import re import math import csv import traceback from datetime import datetime import pymongo # Cross-platform colored text from color...
concurrency.py
from threading import Thread from geo_cache_client.cache_client import Cache def count(n, name): cache = Cache(name="example") response = cache.get("acc") while n > 0: if not response.ok: response = cache.get("acc") if response.ok: #print("{name}.get: {item}".format...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_scale_cube.py
# scale.py import os import threading import unittest from sql30 import db DB_NAME = './cube.db' class Config(db.Model): TABLE = 'cube' PKEY = 'num' DB_SCHEMA = { 'db_name': DB_NAME, 'tables': [ { 'name': TABLE, 'fields': { ...
subprocess_env_manager.py
from multiprocessing import Process, Pipe, connection, get_context, Array from collections import namedtuple import enum import logging import platform import time import math import copy import traceback import threading import numpy as np import torch import ctypes import pickle import cloudpickle from functools impo...
map_dataset_op_test.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...
train.py
import sys import os import threading import torch from torch.autograd import Variable import torch.utils.data from lr_scheduler import * import numpy from AverageMeter import * from loss_function import * import datasets import balancedsampler import networks from my_args import args def train(): torch.manua...
bpytop.py
#!/usr/bin/env python3 # pylint: disable=not-callable, no-member # indent = tab # tab-size = 4 # Copyright 2020 Aristocratos (jakob@qvantnet.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 a copy of the...
attach_server.py
# Python Tools for Visual Studio # Copyright(c) Microsoft Corporation # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the License); you may not use # this file except in compliance with the License. You may obtain a copy of the # License at http://www.apache.org/licenses/LICENSE-2.0 # # THIS ...
robot_adapter.py
import sys import os import logging import time import threading from opcua import Client from opcua import ua import code # To load the adapter module. sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), "..")) from adapter.mtconnect_adapter import Adapter from adapter.data_item import DataIt...
minesweeper.py
""" NSI-Minesweeper Python Minesweeper game using Tkinter. This game is the final project for the NSI curriculum of 2020-2021. Made by: Maxime Djmb, Ian McFarland !!! To install the necessary modules use: pip install -r REQUIREMENTS.txt """ import threading import tkinter as tk import tkinter.ttk as ttk from random i...
_base.py
# Builtins import datetime as dt import time from pathlib import Path import yaml import traceback import threading from typing import Any, Callable, Dict, List, Tuple, Union from os.path import exists # External libraries import pandas as pd from rich.status import Status # Submodule imports from harvest.utils impor...
cross_device_ops_test.py
# Copyright 2018 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...
start.py
import socket import time import threading import socks5_1 import logging BUFSIZE = 1024 port = 9090 Change_dict = { 'User-Agent': 'Mozilla/5.0' } def change(data, sslflag=0): # 修改http请求中的内容 if sslflag == 0 and len(Change_dict) > 0: for block, content in Change_dict.items(): index1 = da...
CntlrWebMain.py
''' Created on Oct 3, 2010 Use this module to start Arelle in web server mode @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from arelle.webserver.bottle import Bottle, request, response, static_file from arelle.Cntlr import LogFormatter import os, io, sys, time, ...
server.py
import socket import threading import time PORT = 8084 HOST = socket.gethostname() #create a socket class Server: server=socket.socket(socket.AF_INET,socket.SOCK_STREAM) connections=[] channel_list={} default_channel='IRCDEF' msg='' ports=[] msgserv=[] default_message="Here are the list of commands\n/join cha...
application.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import json import logging import subprocess import tempfile import textwrap import threading from pathlib import Path from ty...
test_legacymultiproc_nondaemon.py
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Testing module for functions and classes from multiproc.py """ from __future__ import (print_function, division, unicode_literals, absolute_import) from bu...
views.py
import json import time from threading import Thread from asgiref.sync import async_to_sync from channels.generic.websocket import WebsocketConsumer from django.http.request import QueryDict from Lib.log import logger from Lib.xcache import Xcache from WebSocket.Handle.console import Console from WebSocket.Handle.hea...
unit_test.py
# import tensorflow as tf # import matplotlib.pyplot as plt # from tensorflow.examples.tutorials.mnist import input_data # import numpy as np # import os # import tf_basics as tfb # from tkinter import filedialog # from tkinter import * # from classes import tkinter_app from classes import datalogger, dataset, neurons,...
parallel_darknet.py
#!python2 ''' ############################## ### Receive Video stream ##### ### from Android client ####### ### Use yolo to do detect #### ## (return a message to the mobile device) ## ############################## ''' from ctypes import * import math import random import os import socket import time import cv2 impor...
repo_manager.py
# =============================================================================== # Copyright 2013 Jake Ross # # 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...
parallel.py
# Author: Nathan Trouvain at 24/02/2022 <nathan.trouvain@inria.fr> # Licence: MIT License # Copyright: Xavier Hinaut (2018) <xavier.hinaut@inria.fr> import os import tempfile import uuid from functools import partial from multiprocessing import Manager, Process from typing import Tuple import joblib import numpy as np...
test_dist_graph_store.py
import os os.environ['OMP_NUM_THREADS'] = '1' import dgl import sys import numpy as np import time import socket from scipy import sparse as spsp from numpy.testing import assert_array_equal from multiprocessing import Process, Manager, Condition, Value import multiprocessing as mp from dgl.graph_index import create_gr...
old_main.py
from time import sleep import threading from gpiozero import RotaryEncoder, AngularServo # use custom pin-factory to fix servo jitter, make sure pigpio deamon is running: 'sudo pigpiod' from gpiozero.pins.pigpio import PiGPIOFactory pigpio_factory = PiGPIOFactory() ENCODER = RotaryEncoder(17, 18, max_steps=0) SERVO ...
Connection.py
import websocket from . import PacketHandler as packet import re import threading as thread import ssl import json def on_msg(shard): while shard.ws.connected: data = shard.ws.recv() if data != None or len(data) > 0: json_data = json.loads(data) packet.PacketHandler(shard, json_data.get("op"), j...
uploader.py
#!/usr/bin/env python import os import re import time import stat import json import random import ctypes import inspect import requests import traceback import threading import subprocess from collections import Counter from selfdrive.swaglog import cloudlog from selfdrive.loggerd.config import ROOT from common.para...
main.py
class NoNewData(Exception): pass def readline(handle): offset = handle.tell() handle.seek(0, 2) length = handle.tell() if length == offset: raise NoNewData handle.seek(offset, 0) return handle.readline() import time def tail_file(handle, interval, write_func): whi...
progress.py
from __future__ import absolute_import, division, print_function import sys import threading import time from timeit import default_timer from ..callbacks import Callback from ..utils import ignoring def format_time(t): """Format seconds into a human readable form. >>> format_time(10.4) '10.4s' >>>...
cached_data_writer.py
#!/usr/bin/env python3 import asyncio import json import logging import ssl import sys import threading import websockets from os.path import dirname, realpath sys.path.append(dirname(dirname(dirname(realpath(__file__))))) from logger.writers.writer import Writer # noqa: E402 from logger.utils.das_record import DASR...
__main__.py
from honeygrove import log from honeygrove.config import Config from honeygrove.core.HoneyAdapter import BrokerWatcher from honeygrove.core.ServiceController import ServiceController from honeygrove.services.SSHService import load_database, save_database import os import threading import atexit def shutdown(): l...
mock_lsl_stream.py
# Authors: Teon Brooks <teon.brooks@gmail.com> # # License: BSD (3-clause) import time from multiprocessing import Process from mne.utils import _check_pylsl_installed from mne.io import constants class MockLSLStream(object): """Mock LSL Stream. Parameters ---------- host : str The LSL ident...
router.py
"""Router - handle message router (base class) Router to manage responses. """ from abc import abstractmethod import logging import threading from typing import Dict, Optional from typing import TYPE_CHECKING import uuid from .message_future import MessageFuture from ..lib import tracelog if TYPE_CHECKING: fr...
upnp.py
import logging import threading from queue import Queue try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: def __init__(self): self.queue = Queue() def run(): try: self.upnp = miniupnpc.UPnP() self.up...
multi_threading.py
import os import time import sys import threading import numpy as np from wkr_serving.client import WKRClient def build_input(url): # download image # crop image return [] # list face def process_data(client, data): faces = build_input(data) for i, face in enumerate(faces): client.encod...
test_client_reconnect.py
from concurrent import futures import contextlib import os import threading import sys from ray.util.client.common import CLIENT_SERVER_MAX_THREADS, GRPC_OPTIONS import grpc import time import random import pytest from typing import Any, Callable, Optional from unittest.mock import patch import ray.core.generated.ray...
spaces_finder.py
#!/usr/bin/env python # "Spaces finder" is a tool to quickly enumerate DigitalOcean Spaces to look for loot. # It's similar to a subdomain bruteforcer but is made specifically to DigitalOcean # Spaces and also has some extra features that allow you to grep for # delicous files as well as download interesting files if ...
gui.py
import math import os.path import logging import threading from six.moves import tkinter as tk from six.moves import tkinter_ttk as ttk from six.moves import tkinter_tkfiledialog as tkfiledialog from loopyupload import LoopyTusUploader from tuspy import requests_options, TusError def bytes2human(n, format='%(value)...
test_tracing_context.py
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import unittest try: from unittest import mock except ImportError: import mock from azure.core.tracing.context import tracing_context from azure.core.tracing im...
main3.py
#!/usr/bin/python """ @AUTHOR : KRYPTON-BYTE @DATE : TUE OCT 13, 2020 " Wahai Orang-orang Yg Beriman Mengapakah Kamu Mengatakan Sesuatu Yg Tidak Kamu Kerjakan? Amat Besar Kebencian Di Sisi Allah Bahwa Kamu Mengatakan Apa-apa Yang Tidak Kmau Kerjakan." (QS asg-shaff: 2-3) """ import difflib from openwa.helper impo...
utilization_sampler.py
""" ``rls-util-sampler`` script for collecting GPU (and CPU) utilization using ``nvidia-smi`` every 0.5 second over the course of training. """ from rlscope.profiler.rlscope_logging import logger import signal import time import subprocess import argparse import textwrap import psutil import platform import threading i...
consumer.py
import logging import os import signal import sys import threading import time from multiprocessing import Event as ProcessEvent from multiprocessing import Process try: import gevent from gevent import Greenlet from gevent.event import Event as GreenEvent except ImportError: Greenlet = GreenEvent = N...
control_with_role.py
#!/usr/bin/env python3 # coding: UTF-8 # Copyright 2021 Roots # # 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 applic...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Version 3.2.3 is currently recommended when SSL is enabled, since this version worked the best with SSL in internal testing....