source
stringlengths
3
86
python
stringlengths
75
1.04M
TCppServerTestManager.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import threading from thrift.Thrift import TProcessor from thrift.server.TCppServer import TCppServer class TCppServerTestManager(object): """ A context manager ...
wizard.py
import logging import math import os import sys from functools import partial from io import StringIO from multiprocessing import Event as MpEvent from multiprocessing import Process as MpProcess from multiprocessing import Queue as MpQueue from multiprocessing import freeze_support as mp_freeze_support, set_start_meth...
utils.py
import azure.batch.models as batchmodels import azure.storage.blob as azureblob from azure.storage.blob.models import ContainerPermissions from azure.keyvault import KeyVaultClient import azext.batch as batch import datetime import time import os from enum import Enum import pytz import logger import threading utc = p...
batch_processor.py
import click import json import requests from queue import Queue, Empty from threading import Thread, Event from seldon_core.seldon_client import SeldonClient import numpy as np import logging import uuid import time CHOICES_GATEWAY_TYPE = ["ambassador", "istio", "seldon"] CHOICES_TRANSPORT = ["rest", "grpc"] CHOICES_...
tasks.py
"""Classes to easily implement Qt-friendly computational tasks running in external threads or processes, with a simple API.""" import time import traceback import inspect import logging from queue import Queue as tQueue from queue import Empty from threading import Thread from multiprocessing import Process, Queue as ...
main.py
import sys import time import threading import collections from statistics import mean, stdev from formant.sdk.agent.v1 import Client as FormantClient import cv2 from jetbot import Robot, INA219 MAX_CHARGING_VOLTAGE = 12.6 MIN_CHARGING_VOLTAGE = 11.0 MAX_DISCHARGING_VOLTAGE = 12.1 MIN_DISCHARGING_VOLTAGE = 10.0 DEF...
bot.py
import threading import traceback from .objects import * from .useful import notafunction as nf from .useful import * from .exceptions import * from .inline import CallbackQuery class Bot: def __init__(self, bot_key: str): self.key = bot_key self.offset = 0 # Bot Information self....
__init__.py
""" A library of various helpers functions and classes """ import inspect import sys import socket import logging import threading import time import random from rpyc.lib.compat import maxint # noqa: F401 class MissingModule(object): __slots__ = ["__name"] def __init__(self, name): self.__name = nam...
test_multiprocessing.py
import asyncio import copy import os import platform import sys import threading import time import pytest import loguru from loguru import logger @pytest.fixture def fork_context(monkeypatch): import multiprocessing context = multiprocessing.get_context("fork") monkeypatch.setattr(loguru._handler, "mu...
__init__.py
from generate_interactive_bom import GenerateInteractiveBomPlugin import pcbnew import wx import wx.aui import threading import time import sys def check_for_bom_button(): # From Miles McCoo's blog # https://kicad.mmccoo.com/2017/03/05/adding-your-own-command-buttons-to-the-pcbnew-gui/ def find_pcbnew_wind...
__init__.py
from urlparse import urlparse from wsgiref.simple_server import make_server import multiprocessing from selenium import webdriver from selenium.webdriver.support import ui from pecan.deploy import deploy from draughtcraft.tests import TestApp class TestSeleniumApp(TestApp): HOST_BASE = "http://localhost:8521" ...
Tranmission_TestThread.py
#!/usr/bin/env python # -- Import PyQt wrappers -- from PyQt5.QtWidgets import QMainWindow, QApplication from PyQt5.QtCore import pyqtSlot, QThread, pyqtSignal from PyQt5 import uic from PyQt5.QtGui import QPixmap # -- import classic package -- from functools import wraps from datetime import datetime imp...
hilo_proyecto_2_3.py
#Script que mediante hilos lee los valores del acelerometro ADXL345 #Lee los valores de la sonda de temperatura DS18B20 #Saca el promedio de los valores definidos y los publica por serial #!/bin/python3 import threading import serial import time import smbus import sys import base64 #Valores globales valor_N = [] ser ...
miner.py
#!/usr/bin/python # # Copyright 2011 Jeff Garzik # # This program 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. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY;...
population.py
# # Copyright (c) 2019. Asutosh Nayak (nayak.asutosh@ymail.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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # from utils import * impor...
scheduler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Background processes made simple --------------------------------- """ USAGE = """ ## Example For an...
test_dgx.py
import multiprocessing as mp import os import subprocess import dask.array as da from dask_cuda import LocalCUDACluster from distributed import Client import numpy import pytest from time import sleep from dask_cuda.utils import get_gpu_count from dask_cuda.initialize import initialize from distributed.metrics impor...
batch_iterators.py
from __future__ import print_function import numpy as np def get_batch_iterator(): """ Standard batch iterator """ def batch_iterator(batch_size, k_samples, shuffle, fill_last_batch=True): return BatchIterator(batch_size=batch_size, k_samples=k_samples, shuffle=shuffle, fill_last_batch=fill_...
module3.py
#------------------------------------------------------------------------------- # Name: module1 # Purpose: # # Author: Rajesh # # Created: 24-12-2019 # Copyright: (c) Rajesh 2019 # Licence: <your licence> #------------------------------------------------------------------------------- #!/usr/bin/...
AgentRun.py
import os import sys import gym import torch import numpy as np from AgentZoo import Recorder from AgentZoo import BufferArray, initial_exploration """ 2019-07-01 Zen4Jia1Hao2, GitHub: YonV1943 DL_RL_Zoo RL 2019-11-11 Issay-0.0 [Essay Consciousness] 2020-02-02 Issay-0.1 Deep Learning Techniques (spectral norm, Dense...
controller.py
import re from copy import copy from datetime import datetime from logging import getLogger from threading import Thread, Event, RLock from time import time from attr import attrib, attrs from typing import Sequence, Optional, Mapping, Callable, Any, Union, List from ..backend_interface.util import get_or_create_proj...
runtests.py
#!/usr/bin/python2.7 # # Copyright 2015 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # ...
multiprocessing_global_1,py.py
#!/usr/bin/env python3 import multiprocessing import time import random import os mylist = [ ] def hello(n): time.sleep(random.randint(1,3)) mylist.append(os.getpid()) print("[{0}] Hello!".format(n)) processes = [ ] for i in range(10): t = multiprocessing.Process(target=hello, args=(i,)) process...
simple_http_server.py
''' Simple HTTP Server Copyright 2018 Jacques Gasselin 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 Unles...
session_manager.py
# This work is based on original code developed and copyrighted by TNO 2020. # Subsequent contributions are licensed to you by the developers of such code and are # made available to the Project under one or several contributor license agreements. # # This work is licensed to you under the Apache License, Versi...
test_lock.py
"""Test the clients `lock` interface.""" from datetime import timedelta from tempfile import NamedTemporaryFile from threading import Thread from time import sleep import pytest # type: ignore from throttle_client import ( Client, Peer, PeerWithHeartbeat, Timeout, get_local_peer, lock, s...
train.py
from __future__ import print_function import numpy as np from tqdm import tqdm import multiprocessing as mp from absl import app from absl import flags import tensorflow as tf from env import Environment from game import CFRRL_Game from model import Network from config import get_config FLAGS = flags.FLAGS flags.DEF...
ccpp.py
import os import sys import time import ftfy import ujson import gcld3 import uuid import shutil import argparse import hashlib import tarfile import psycopg2 import requests import numpy as np import pandas as pd from tqdm.auto import tqdm from random import randint from datetime import datetime from sqlalchemy import...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from electrum_sum.bitcoin import TYPE_ADDRESS from electrum_sum.storage import WalletStorage from electrum_sum.wallet import Wallet, InternalAddressCorruption from electrum_sum.paymen...
server.py
""" This file takes part of the server side of the peer to peer network This file deals with uploading of the song for other peers """ from server_client.constants import * SEPARATOR = "<SEPARATOR>" import os import tqdm class Server: def __init__(self, msg): try: print("Setting up se...
wandblogger.py
import fnmatch import multiprocessing import numbers import os import shutil import wandb from ray import tune from ray.tune.utils import flatten_dict def find(pattern, path): result = [] for root, dirs, files in os.walk(path): for name in files: if fnmatch.fnmatch(name, pattern): ...
starAlignGui.py
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.boxlayout import BoxLayout from kivy.uix.floatlayout import FloatLayout from kivy.config import Config from kivy.factory import Factory from kivy.graphics.texture import Texture from kivy.graphics import Color,Rectangle from kivy.uix.popu...
imagefolder.py
# Copyright (c) Facebook, Inc. and its affiliates. import os import re import http.server import threading import torch import torch.utils.data.backward_compatibility import torchvision.datasets as datasets import torchvision.datasets.folder import torchvision.transforms as transforms from PIL import Image from torch....
io.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
04_globalvariable.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import time g_num = 0 def work1(num): global g_num for i in range(num): g_num += 1 # print("----in work1, g_num is %d---" % g_num) def work2(num): global g_num for i in range(num): g_num += 1 # print("-...
shell.py
# Copyright 2019 Barefoot Networks, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
docker_starter.py
import os import multiprocessing def docker_init(): os.system('gnome-terminal -x bash -c "docker/run.sh -v ~/jetson-inference:/jetson-inference -r ./packages_download_run_model.sh"') def autolabeling_init(): os.system('python3 auto_labeling.py') p1 = multiprocessing.Process(targe...
Unity.py
from gi.overrides import override from gi.importer import modules import threading import sys Unity = modules['Unity']._introspection_module from gi.repository import GLib __all__ = [] class ScopeSearchBase(Unity.ScopeSearchBase): def __init__(self): Unity.ScopeSearchBase.__init__(self) def do_run...
pyQtSignal.py
import threading import time from PyQt5.QtGui import QTextCursor from PyQt5.QtWidgets import QMainWindow from musicMain import Ui_MainWindow # 加载我们的布局 import mySerial """ 信号类: 管理全局所有各种各样的信号 """ class MainWindowSignal(QMainWindow,Ui_MainWindow): @staticmethod def drawSignals(self): if self.drawCheckBt...
Diematic3Panel.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading,queue import logging, logging.config import DDModbus import time,datetime,pytz from enum import IntEnum #Target Temp min/max for hotwater TEMP_MIN_ECS=10 TEMP_MAX_ECS=80 #Target Temp min/max for hotwater TEMP_MIN_INT=5 TEMP_MAX_INT=30 #definition for s...
pushdown.py
import random import logging import itertools import os import subprocess from collections import defaultdict import edgelist_pb2 # protobuf import networkx as nx class PushDown: class StackDistance: def __init__(self, calls, returns): self.calls = calls self.returns = returns ...
embeddings.py
import sparknlp.internal as _internal from pyspark.ml.param import Params from pyspark import keyword_only import sys import threading import time import sparknlp.pretrained as _pretrained # DONT REMOVE THIS IMPORT from sparknlp.annotator import WordEmbeddingsModel #### class Embeddings: def __init__(self, emb...
http_console_server.py
"""Implements a simple HTTP-based console for applications.""" import BaseHTTPServer import logging import gc import os import socket # For gethostname import sys import threading import time import urllib from chirp.common import timestamp DEFAULT_HOST = "localhost" DEFAULT_PORT = 9000 class _RequestHandler(Base...
bridge.py
#!/usr/bin/env python3 # type: ignore import carla # pylint: disable=import-error import time import math import atexit import numpy as np import threading import cereal.messaging as messaging import argparse from common.params import Params from common.realtime import Ratekeeper, DT_DMON from lib.can import can_functi...
supervisor.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...
applications_test.py
import pytest import random import six import numpy as np import keras_applications from keras.applications import densenet from keras.applications import inception_resnet_v2 from keras.applications import inception_v3 from keras.applications import mobilenet try: from keras.applications import mobilenet_v2 except...
reader.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
farming.py
from .custom_driver import client, use_browser from .settings import settings import time from .utils import log, check_for_lines from .village import open_building, open_city, open_village from .util_game import close_modal import schedule from threading import Thread from random import randint def start_farming_thr...
process.py
__author__ = "Radical.Utils Development Team" __copyright__ = "Copyright 2016, RADICAL@Rutgers" __license__ = "MIT" import os import sys import time import signal import socket import threading as mt import multiprocessing as mp import setproctitle as spt from .logger import Logger from .threads impo...
http.py
""" This module provides WSGI application to serve the Home Assistant API. For more details about this component, please refer to the documentation at https://home-assistant.io/components/http/ """ import hmac import json import logging import mimetypes import threading import re import ssl from ipaddress import ip_ad...
sdk_worker_main.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...
func.py
import importlib.util , time , threading def GetObj (script,name) : return getattr(script,name,"!object not found!") def GetDir (script) : fullTXT = dir(script) formatTXT = [] for txt in fullTXT : if ("__" not in txt) : formatTXT.append(txt) return formatTXT def GetScript (path) : script = path.split("/...
test_celery.py
import threading import pytest pytest.importorskip("celery") from sentry_sdk import Hub from sentry_sdk.integrations.celery import CeleryIntegration from celery import Celery, VERSION from celery.bin import worker @pytest.fixture def connect_signal(request): def inner(signal, f): signal.connect(f) ...
display.py
import threading try: import queue except ImportError: import Queue as queue from . import control from .inning import InningDisplay from .multiplexor import Multiplexor from .shiftregister import ShiftRegister DISPLAY_COUNT = 3 # None indicates that no number segments should be shown and False # indicates ...
common.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import json import yaml import logging import os import re import subprocess import stat import urllib.parse import threading import contextlib import tempfile import psutil from functools import reduce, wraps from decimal import Decimal # Django fro...
modelz.py
# Copyright (c) 2018 Greg Pintilie - gregp@slac.stanford.edu # 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, mod...
screens.py
import asyncio from decimal import Decimal import threading from typing import TYPE_CHECKING, List, Optional, Dict, Any from kivy.app import App from kivy.clock import Clock from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.factory import Factory from kivy.uix.recycleview import Recycl...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
control.py
#NAME: move.py #DATE: 12/11/2018 #AUTH: Ryan McCartney, EEE Undergraduate, Queen's University Belfast #DESC: A python class for moving the wheelchair in an intuative manner #COPY: Copyright 2018, All Rights Reserved, Ryan McCartney import numpy as np import threading import time import urllib import requests #define ...
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...
test_asyncore.py
import asyncore import unittest import select import os import socket import sys import time import errno import struct import threading from test import support from test.support import os_helper from io import BytesIO if support.PGO: raise unittest.SkipTest("test is not helpful for PGO") TIMEOUT = 3 HAS_UNIX_...
exporter.py
#!/usr/bin/python # vim: tabstop=4 expandtab shiftwidth=4 import argparse import requests import re import time import threading from datetime import datetime from os import environ # Prometheus client library from prometheus_client import CollectorRegistry from prometheus_client.core import Gauge, Counter from prome...
common_thread.py
# Copyright 2017 theloop, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing...
chrome_test_server_spawner.py
# Copyright (c) 2011 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """A "Test Server Spawner" that handles killing/stopping per-test test servers. It's used to accept requests from the device to spawn and kill instances...
ipc_pipe.py
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.optim as optim from torchvision import datasets, transforms from torch.optim.lr_scheduler import StepLR import multiprocessing as mp from time import sleep import copy class Net(nn.Mod...
28_1_multithread_deadlock.py
from threading import Thread, Lock, current_thread numa = 0 numb = 0 locka = Lock() lockb = Lock() def do_sth(): fun1() fun2() def fun1(): global numa, numb locka.acquire() # 线程1执行这行 第一步 try: print('%s--fun1()--locka' % current_thread().getName()) numa += 1 lockb.ac...
i2c_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import smbus import threading import time import sys import datetime # 初期化(38400bps) # 0:300, 1:600, 2:1200, 3:2400, 4:4800, 5:9600, 6:19200, 7:38400, 8:57600, 9:115200 event = threading.Event() lock = threading.Lock() i2c = smbus.SMBus(1) i2c.write_byte(0x40, 0x07) # ...
example_binance_us.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_binance_us.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api # Py...
pabotlib.py
# Copyright 2014->future! Mikko Korpela # # 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 agree...
test_etcdb.py
from multiprocessing import Process, Queue import psutil as psutil import time import etcdb def test_select_version(cursor): cursor.execute('SELECT VERSION()') assert cursor.fetchone()[0] == etcdb.__version__ def test_get_meta_lock(cursor): #print(cursor._get_meta_lock('foo', 'bar')) #print(cursor...
transports.py
from .logging import exception_log, debug from .types import ResolvedStartupConfig from .types import TCP_CONNECT_TIMEOUT from .typing import Dict, Any, Optional, IO, Protocol, List, Callable, Tuple from abc import ABCMeta, abstractmethod from contextlib import closing from functools import partial from queue import Qu...
maze_solver.py
import cv2 import threading import colorsys class Point(object): def __init__(self, x=0, y=0): self.x = x self.y = y def __add__(self, other): return Point(self.x + other.x, self.y + other.y) def __eq__(self, other): return self.x == other.x and self.y == other.y rw = 2...
human_agent.py
#!/usr/bin/env python # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. """ This module provides a human agent to control the ego vehicle via keyboard """ import time from threading import Thread import cv2 import numpy as np try: import pygame...
testability_prediction.py
""" This module contains testability prediction script to be used in refactoring process in addition to qmood metrics ## Reference [1] ADAFEST2 paper [2] TsDD paper """ __version__ = '0.1.0' __author__ = 'Morteza Zakeri' import os import math import datetime import warnings import pandas as pd import numpy as n...
engine.py
from multiprocessing import Process,Queue from threading import Thread # class EnginePool(): # def __init__( # self, # pool_num=10, # ): # self.spider_q = Queue() # for i in range(pool_num): # p = Process(target=self.process_spider,args=(self.spider_q,)) #...
utils.py
from time import time, sleep import threading from datetime import datetime, timedelta def spawn_daemon(func, interval): def _daemon(): last_run = datetime.now() while True: if datetime.now() - last_run > timedelta(seconds=interval): func() last_run = d...
base.py
import subprocess import json from threading import Lock, Thread import io import os import sys import locale import platform try: from json import JSONDecodeError except ImportError: JSONDecodeError = ValueError class BaseScope(object): # Tuple of class properties that will be passed as command-line ...
engine.py
# Copyright 2013: Mirantis 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 b...
3d_manual_trajopt.py
#!/usr/bin/env python import copy import rospy import moveit_commander import moveit_msgs.msg import geometry_msgs.msg from math import pi from std_msgs.msg import String from sensor_msgs.msg import JointState from moveit_msgs.msg import DisplayTrajectory, RobotTrajectory from trajectory_msgs.msg import JointTrajectory...
joy_teleop.py
#!/usr/bin/env python import importlib import rospy import genpy.message from rospy import ROSException import sensor_msgs.msg import actionlib import rostopic import rosservice from threading import Thread from rosservice import ROSServiceException class JoyTeleopException(Exception): pass class JoyTeleop: ...
package_reader.py
"""Read, organize and validate packages from data input""" import enum import threading class Symbol(enum.Enum): """Enumeration of all LCD symbols""" AUTO = enum.auto() DC = enum.auto() AC = enum.auto() REL = enum.auto() BEEP = enum.auto() BATTERY = enum.auto() LOZ = enum.auto() B...
send_sms.py
from misc.text import ( ask_no, ask_message, not_admin, repo_path, file_name, text_api, text_key, sending_fail, err_msg, sms_success, proxy_api, ) from telegram import ForceReply from telegram.ext import ConversationHandler, CommandHandler, MessageHandler, Filters from github...
recruit.py
import json import sys,os from time import sleep from threading import Thread from typing import List sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from session.Session import Session from request.RequestGetProductionQueue import RequestGetProductionQueue from request.RequestStartProducti...
sftp_file.py
# 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 Foundation; either version 2.1 of the License, or (a...
looperv8.py
#!/usr/bin/python import random import datetime import json import argparse import csv import pickle from collections import OrderedDict from decimal import Decimal from pymongo import MongoClient from multiprocessing import Process, Lock import dcm import pdb import sys import logging #############################---...
Download_Animes.py
from flask import Flask import threading import Anime_NAS import requests import json import Moe import os app = Flask(__name__) # Global variables so they are accessible from any function mp4_urls = [] referers = [] anime_data = {} def download_episode(): global mp4_urls global referers global anime_d...
__init__.py
import os import subprocess import threading from multiprocessing import Process try: from websockets.exceptions import ConnectionClosed from websockets import serve as websocket_serve except ImportError: from websockets import ConnectionClosed, serve as websocket_serve from platypush.backend import Back...
activity_monitor.py
import sys import time import json from pathlib import Path from pynput import mouse, keyboard from datetime import datetime from threading import Thread sys.path.append(r'.\monitor') from imonitor import IMonitor class ActivityMonitor(IMonitor): def __init__(self, min_stop:int, total:int) -> None: self._...
11-anquan.py
import threading import time count = 100 # 创建一把锁 lock = threading.Lock() def demo(n): global count for x in range(1, 1000000): lock.acquire() count += n count -= n lock.release() print('%s--线程,运行完之后count值为%s' % (threading.current_thread().name, count)) ...
ircthread.py
#!/usr/bin/env python # Copyright(C) 2011-2016 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, m...
vrc_prevent_sleep_gui.py
import time import datetime import tkinter # gui # from tkinter import ttk import threading import win32gui import pyautogui import pydirectinput import win32com.client # 関数に入れとくと動作しないでエラー出るので上流に置く shell = win32com.client.Dispatch("WScript.Shell") def tkinter_main(): ''' threading呼び出し ''' ...
RedNetwork.py
import threading import time import json import platform import websocket import base64 import RedConfig class RedNetwork: def __init__(self, client): self.socketEvtHandlerThread = threading.Thread(target = self.socketEvtHandler, args=()) self.senderThread = threading.Thread(target = self.sender,...
Speech_Recognizer.py
import speech_recognition as sr from tkinter import * from tkinter import ttk from tkinter import filedialog import threading import time import os from dtw import * import matplotlib.pyplot as plt import numpy as np import librosa.display import copy from sklearn.externals import joblib from winsound impo...
top.py
# -*- coding: utf-8 -*- """ Created on Wed Jan 20 2017 This the main python script for datataking and processing @author: Dong Wang """ from disper_t import * from storage_t import * from daq_t import * from datap_t import * from command import * from i2c_control import * import sys import os import shlex import socket...
test_redistools.py
# -*- coding: utf-8 -*- import os import time import threading import redistools from unittest import TestCase from unittest import mock import redislite class TestGetRedisApp(TestCase): def tearDown(self): redistools._redis_master = redistools._redis_slave = None @mock.patch.dict(os.environ, {"REDIS...
A3C_Original.py
import threading # 多线程 import tensorflow as tf import numpy as np import gym import os import shutil import time from utils import * import argparse os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" seed_setting = 600 parser = argparse.ArgumentParser() parser.add_argument('--mode', default='test', type=str) parser.add_argument...
simple_viewer.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """This sample uses Pyside2 and Vispy to present realtime detections from sensor """ __author__ = "Ondra Fisar", "Sujay Jayashankar" __copyright__ = "Copyright (c) 2019-2020, Magik-Eye Inc." # -----------------------------------------------------------------------------...
catalog_item.py
import datetime import time import urllib.request import re import threading from pymongo import MongoClient """основной хост для парсинга""" HOST = 'https://referat.ru' """максимально количество потоков""" MAX_THREADS = 5 START_TIME = time.time() client = MongoClient('mongodb://localhost/alumico') db = client.refe...
spatialquerytests.py
import json import sys import threading import time import unittest from threading import Thread import logger from basetestcase import BaseTestCase from couchbase_helper.cluster import Cluster from membase.helper.spatial_helper import SpatialHelper from remote.remote_util import RemoteMachineShellConnection class S...
test_system.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # The MIT License (MIT) # Copyright (c) 2020 SBofGaySchoolBuPaAnything # # 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, in...