source
stringlengths
3
86
python
stringlengths
75
1.04M
test_dataloader.py
# Owner(s): ["module: dataloader"] import math import sys import errno import multiprocessing import os import ctypes import faulthandler import torch import gc import time import signal import unittest import itertools import warnings import tempfile from torch import multiprocessing as mp from torch.utils.data impor...
webcam_demo.py
import tensorflow as tf import json import math import cv2 import time import argparse import concurrent.futures import posenet import keyboard import sys import numpy as np from threading import Thread from slugify import slugify parser = argparse.ArgumentParser() parser.add_argument('--model', type=int, default=101)...
utils.py
# # Copyright (c) 2017 Intel Corporation # # 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...
dcgm_health_check.py
# Copyright (c) 2021, NVIDIA 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 # # Unless required by appli...
main.py
from kivy.app import App from kivy.uix.button import Button from kivy.uix.label import Label from kivy.uix.popup import Popup from kivy.uix.dropdown import DropDown from kivy.uix.boxlayout import BoxLayout from kivy.graphics import Color, Rectangle from kivy.utils import get_color_from_hex from kivy.storage.jsonstore i...
ccbench.py
# -*- coding: utf-8 -*- # This file should be kept compatible with both Python 2.6 and Python >= 3.0. from __future__ import division from __future__ import print_function """ ccbench, a Python concurrency benchmark. """ import time import os import sys import functools import itertools import threading import subpr...
test_external.py
# Copyright (c) 2013, 2018 Potential Ventures Ltd # Copyright (c) 2013 SolarFlare Communications Inc # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must ret...
views.py
from .models import Camera,Recording from .serializers import RecordingSerializer,CameraSerializer from django.views.decorators.csrf import csrf_exempt from rest_framework.decorators import api_view from rest_framework.response import Response from .recorder import startRecording import threading import datetime,os fro...
bhp_net.py
import sys import socket import getopt import threading import subprocess #global var listen = False command = False upload = False execute = "" target = "" upload_destination = "" port = 0 def run_command(cmd): """runs a command and return the output """ cmd = cmd.rstrip() try: output = subp...
loghandler_33.py
# # Copy/pasted from the Python 3.3 standard library, and distributed # under the Python Software Foundation License. # import logging import threading import Queue class QueueHandler(logging.Handler): """ This handler sends events to a queue. Typically, it would be used together with a multiprocessing ...
padding_oracle_hunter.py
from burp import IBurpExtender, IContextMenuFactory, ITab, IExtensionStateListener, IContextMenuInvocation, IHttpRequestResponse from javax.swing import (JScrollPane, JPanel, JTabbedPane, JTextField, JLabel, JTextArea, JButton, JEditorPane, JMenuItem, JComboBox, JCheckBox, JOptionPane, JProgressBar, GroupLayout) ...
scanFile.py
import os import threading from requests import api import virustotal3.core import logging import time _API_KEY="3d29cdabf6d196748d9b810412d3494c6ebb7a4972427877a5196bc3ceadf01d" _vsTotUploader=virustotal3.core.Files(api_key=_API_KEY) #_FILE=os.path.abspath() FILE TO BE PASSED _result=False _info={} print(_FILE) ...
broadcast.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import multiprocessing as mp from maro.communication import Proxy, SessionType def worker(group_name): """ The main worker logic includes initialize proxy and handle jobs from the master. Args: group_name (str): Identifie...
prepare_data.py
import argparse from io import BytesIO import multiprocessing from multiprocessing import Lock, Process, RawValue from functools import partial from multiprocessing.sharedctypes import RawValue from PIL import Image from tqdm import tqdm from torchvision.transforms import functional as trans_fn import os from pathlib i...
adb.py
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
__init__.py
# Copyright 2019 Uber Technologies, 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 applica...
lrs.py
import rospy import pickle import os import time import math import yaml import sympy as sp import numpy as np from scipy.optimize import minimize from threading import Thread from ar_track_alvar_msgs.msg import AlvarMarkers from nav_msgs.msg import Odometry from geometry_msgs.msg import PoseWithCovarianceStamped cl...
ScanBeaconUtility.py
# https://github.com/bowdentheo/BLE-Beacon-Scanner class Beacon_Obj(object): mac = str() rssi = int() uuid = str() tx_power = int() major = int() minor = int() tipo = str() empresa = str() def __init__(self, mac: str, rssi: int, uuid: str, tx: int, maj: int, min: int, tip: str, com...
jetson_infer_op.py
# Copyright (c) 2021 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 ap...
mod_file.py
import os from lib import status from src import video from src import extract import threading import time #limit max threads max_threads = 5 #function to register a thread #wait until a new thread is avaible, then start a new thread def thread_get(FILE, PATH): while True: if threading.active_count() <= m...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
train.py
"""Train a YOLOv5 model on a custom dataset Usage: $ python path/to/train.py --data coco128.yaml --weights yolov5s.pt --img 640 """ import argparse import logging import os import random import sys import time import warnings from copy import deepcopy from pathlib import Path from threading import Thread import ...
CameraStream.py
import os import cv2 import urllib.request import numpy as np from networktables import NetworkTables import time from collections import deque from threading import Thread from queue import Queue """ This code was written very roughly and quickly to try and improve camera latency by running all stream manipulations ...
main.py
from helper.parser import * import random import torch.multiprocessing as mp from helper.utils import * import train import warnings if __name__ == '__main__': args = create_parser() if args.fix_seed is False: if args.parts_per_node < args.n_partitions: warnings.warn('Please enable `--fix-...
games_pi.py
# WS2812 LED Matrix Gamecontrol (Tetris, Snake, Pong) # by M Oehler # https://hackaday.io/project/11064-raspberry-pi-retro-gaming-led-display # ported from # Tetromino (a Tetris clone) # By Al Sweigart al@inventwithpython.com # http://inventwithpython.com/pygame # Released under a "Simplified BSD" license import rando...
test_connection.py
from test.UdsTest import UdsTest from udsoncan.connections import * from test.stub import StubbedIsoTPSocket import socket import threading import time import unittest try: _STACK_UNVAILABLE_REASON = '' _interface_name = 'vcan0' import isotp import can s = isotp.socket() s.bind(_i...
Node.py
import time from collections import namedtuple from datetime import datetime from io import BytesIO import netaddr import redis import uuid import threading from Jumpscale import j from ..capacity.Capacity import Capacity from ..container.Container import Containers from ..disks.Disks import Disks, StorageType from ....
utils.py
# -*- coding: utf-8 -*- {{{ # vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et: # # Copyright 2017, Battelle Memorial Institute. # # 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...
ChatterBox.py
#Main import tkinter as tk import tkinter.messagebox import threading from time import sleep import socket class ChatterBox: def __init__(self): self.port = 51540 self.root = tk.Tk() self.q = None self.root.geometry("460x250") self.root.title("ChatterBox! Me...
core.py
""" Work in progress worker management for lynxfall Note: This will only handle startup/shutdown and other tasks, not micromanaging individual workers. Stats and error handling is a maybe that will be implemented after core functionality Worker-specific tasks are another maybe unless that task is done via redis PUBSUB...
logging.py
""" Tango makes heavy use of the :mod:`logging` module from the standard library to convey information to users. When you're writing your own :class:`~tango.step.Step` implementations we encourage you to also use standard Python logging as opposed to :func:`print` or other functions that write directly to ``stdout`` or...
MainTest.py
import bs4, requests, os, xlsxwriter, time, multiprocessing start_time = time.time() def generateID(n): canID = str(n) count = 0 num = n while num > 0: count += 1 num//=10 count0 = 8 - count for i in range (count0): canID = "0" + canID return canID workbook = xls...
cmd.py
import socket import termcolor import json import os import threading def reliable_recv(target): data = '' while True: try: data = data + target.recv(1024).decode().rstrip() return json.loads(data) except ValueError: continue def reliable_send(target, data):...
mtping.py
import subprocess import threading def ping(host): rc = subprocess.call( 'ping -c2 %s &> /dev/null' % host, shell=True ) if rc == 0: print(host) if __name__ == '__main__': ips = ['172.40.58.%s' % i for i in range(1, 255)] for ip in ips: # 创建线程,ping是上面定义的函数, args是传给p...
time_env.py
''' Copyright (c) 2018 Uber Technologies, 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 writ...
nng.py
""" Provides a Pythonic interface to cffi nng bindings """ import logging import threading import atexit import pynng from ._nng import ffi, lib from .exceptions import check_err from . import options from . import _aio logger = logging.getLogger(__name__) __all__ = ''' ffi Bus0 Pair0 Pair1 Pull0 Push0 Pub0 Sub0 ...
listen.py
import socket import time import sys from colorama import Fore, init import connection import threading import argparse #make sure colors work properly in Windows if sys.platform == 'win32' or sys.platform == 'win64': init(convert=True) host = '' port = '' sockets = [] ports = [] args = '' desc...
helperclient.py
import random from multiprocessing import Queue from queue import Empty import threading from coapthon.messages.message import Message from coapthon import defines from coapthon.client.coap import CoAP from coapthon.messages.request import Request from coapthon.utils import generate_random_token import socket __author...
networking.py
import ast import asyncio import ipaddress import socket from abc import abstractmethod from argparse import Namespace from threading import Thread from typing import TYPE_CHECKING, Optional import grpc from jina.logging.logger import JinaLogger from jina.proto import jina_pb2_grpc from jina.types.message import Mess...
_threading_local.py
"""Thread-local objects (Note that this module provides a Python version of thread threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the local class from threading.) Thread-local objects support the management of thread-local dat...
eexec2.py
import RPi.GPIO as GPIO import time import picamera import face_recognition.api as face_recognition import os,shutil import json import numpy from PIL import Image from datetime import date,datetime import smtplib import random import math import openpyxl from openpyxl.styles import Font import openpyxl ...
data_collection_class.py
import serial import RPi.GPIO as gpio import time import pandas as pd import threading import numpy as np class data_collection: def __init__(self, coms_chan, ouput_csv, cols): self.ouput_csv = ouput_csv # name of output csv file self.ser = serial.Serial(coms_chan, 9600, timeout=30) # establish com...
_watcher.py
from __future__ import absolute_import import logging from threading import Thread from time import sleep import grpc from etcd3 import _utils from etcd3._grpc_bd_stream import GrpcBDStream from etcd3._grpc_stubs.rpc_pb2 import WatchCreateRequest, WatchRequest _DEFAULT_SPIN_PAUSE = 3 # seconds _log = logging.getL...
main.py
from __future__ import print_function # python imports from multiprocessing import Process, Value, Array, Queue from collections import deque from time import sleep # RPi imports import serial # my imports from capture_layer import CaptureLayer from input_layer import InputLayer from control_layer impor...
test_monitor.py
import asyncio import pytest import telnetlib import threading import time from aiomonitor import Monitor, start_monitor from aiomonitor.monitor import MONITOR_HOST, MONITOR_PORT @pytest.yield_fixture def monitor(loop): def make_baz(): return 'baz' locals_ = {'foo': 'bar', 'make_baz': make_baz} m...
pool.py
from __future__ import absolute_import, unicode_literals, print_function, division import time from queue import Queue, Empty from threading import Lock class _ResourcePoolSession(object): def __init__(self, pool, obj, close_on_exc=False): self.__pool = pool self.__obj = obj self.__close...
KSP_controller_starship.py
import krpc import time import math import numpy as np import numpy.linalg as npl import SC_solver as solver import SC_params from KSP_controller_utils import * from threading import Thread print('--------') # 读取KSP_controller_params.txt中的参数 params = {} with open('KSP_controller_starship_params.txt', 'r', encodin...
remoteControlThread.py
#!/usr/bin/python import socket import sys import os.path import fcntl import struct import serial import threading import time from Gripper import Gripper # Move Specified Gripper to Specified Angle (-180, 180) myGripper = Gripper() # Make sure the script is run as sudo if not os.geteuid() == 0: sys.exit("\nOnl...
scheduler_job.py
# pylint: disable=no-name-in-module # # 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, Versio...
test_events.py
"""Tests for events.py.""" import collections.abc import concurrent.futures import functools import gc 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 ...
module.py
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
Receiver.py
import copy import numpy as np from bitarray import bitarray import sounddevice as sd import threading from utils import * class Receiver: def __init__(self, config, debug_data=None): self.fs = config.fs self.fc = config.fc self.header_length = config.header_length self.data_per_f...
run.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Program to run Cloudfoundry process inside cloudfoundry/cflinuxfs3 Docker container """ __program__ = "runner" __version__ = "0.1.0" __author__ = "Jose Riguera" __year__ = "2021" __email__ = "<jose.riguera@springer.com>" __license__ = "MIT" __purpose__ = """ Runner for...
bridge.py
#!/usr/bin/env python # # Copyright (c) 2018-2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # """ Rosbridge class: Class that handle communication between CARLA and ROS """ import os import pkg_resources try: import que...
manager.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...
evaluator.py
# Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
TFCluster.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """ This module provides a high-level API to manage the TensorFlowOnSpark cluster. There are three main phases of operation: 1. **Reservation/Startup** - reserves a port for the T...
test.py
# -*- coding: utf-8 -*- # MegEngine is Licensed under the Apache License, Version 2.0 (the "License") # # Copyright (c) 2014-2020 Megvii Inc. All rights reserved. # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT ARRANTI...
worker.py
import logging from datetime import timedelta, datetime from importlib import import_module from logging import getLogger from pickle import loads import os import signal from multiprocessing import Process from time import sleep import sys logger = getLogger(__name__) logger.setLevel(logging.DEBUG) ch = logging.St...
Callbacks_Refactored.py
''' Created on Jun 9, 2019 Ch08 @author: Burkhard ''' #====================== # imports #====================== import tkinter as tk from time import sleep from threading import Thread from pytz import all_timezones, timezone from datetime import datetime class Callbacks(): def __init__(self, oop)...
test_bmuf.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 from multiprocessing import Manager import random import unittest import torch import torch.nn as nn from fairs...
explorer_scheduler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Aldo Sotolongo # Contact: aldenso@gmail.com # Description: Schedule automatic explorer of ZFS Storage Appliance. from __future__ import print_function import os from datetime import datetime import argparse import time import threading import schedule import inot...
main_parallel.py
#!/usr/bin/env python3 import os, sys os.environ["MKL_NUM_THREADS"] = "1" import numpy as np from math import pi, sqrt, exp from scipy.sparse import csr_matrix as csr from scipy import linalg import random import torch import time from termcolor import colored import copy if __name__ == '__main__': from math import...
tcp_server.py
import socket import threading bind_ip = "0.0.0.0" bind_port = 9999 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip, bind_port)) server.listen(5) print(f"[*] Listening on {bind_ip}, {bind_port}") #client handling thread def handle_client(client_socket): """Print out what the cl...
main.py
#!/usr/bin/python3 # coding=utf-8 import pymysql import pydle import random from random import choice import datetime import time from threading import Timer, Thread import urllib.request import requests import json import threading import math import functools from string import ascii_letters from collections import d...
web_service.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
ping.py
import logging import subprocess from subprocess import run, check_output, CalledProcessError, TimeoutExpired from threading import Thread, Lock import time import utils.pingparse as pingparse LOGGER = logging.getLogger(__name__) def setup_sensor(config): return PingMonitor(config['name'], config['host'], confi...
kodigui.py
# -*- coding: utf-8 -*- import xbmc import xbmcgui import time import threading import traceback MONITOR = None class BaseFunctions: xmlFile = '' path = '' theme = '' res = '720p' width = 1280 height = 720 usesGenerate = False def __init__(self): self.isOpen = True def ...
plugin.py
import threading from binascii import hexlify, unhexlify from electroncash.util import bfh, bh2u from electroncash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT) from electroncash.i18n import _ from electroncash.networks import NetworkConstants from ...
HashCracker.py
import hashlib import threading import queue import time def info(): info = { 'name': 'hash', 'path': 'HashCracker', 'fullname': 'SWEP HASH CRACKER', 'description': 'Hash cracker. Supports md5 and all sha types.', 'parameters':{ 'Hash': 'Hash to crack', ...
build_image_data.py
"""Converts image data to TFRecords file format with Example protos. The image data set is expected to reside in JPEG files located in the following directory structure. data_dir/label_0/image0.jpeg data_dir/label_0/image1.jpg ... data_dir/label_1/weird-image.jpeg data_dir/label_1/my-image.jpeg ... where th...
automated_run.py
# =============================================================================== # Copyright 2011 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...
mock_full_cycle.py
import threading import time import rospy from std_msgs.msg import String, Bool from mock.mock_robot_consumption import mock_robot_consumption from mock.mock_current_step import mock_current_step, Step from mock.mock_resistance import mock_resistance from mock.mock_puck_colors import mock_puck_colors from mock.mock_le...
alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Bot started! Running..." def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
websocket.py
import asyncio import websockets import sys import os, tempfile from signal import * from config import named_pipe_path, websocket_port, websocket_host, debug_mode, use_ssl, cert_file, key_file, refresh_rate import threading from queue import Queue import json import time import ssl if debug_mode: print ("Websocke...
tests.py
import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation from django.core.files.base ...
labelImg.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import codecs import distutils.spawn import os import platform import re import sys import subprocess import threading from functools import partial from collections import defaultdict try: from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWid...
interpreter.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------------- # Name: Interpreter.py # Purpose: # # Author: wukan # # Created: 2019-01-10 # Copyright: (c) wukan 2019 # Licence: GPL-3.0 #-----------------------------------------------------------...
PythonHttpSpamer.py
import sys import argparse import requests from bs4 import BeautifulSoup from queue import Queue from threading import Thread # set up some global variables newAccountNameTemplate = "tester-" num_threads = 4 jobsQueue = Queue() resultQueue = Queue() startIndex = 1 stopIndex = 10 def parseArgs(argv): # WIP par...
PythonExecutor.py
#!/usr/bin/env python ''' 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")...
light_server.py
''' pip install flask gevent requests pillow https://github.com/jrosebr1/simple-keras-rest-api https://gist.github.com/kylehounslow/767fb72fde2ebdd010a0bf4242371594 ''' ''' Usage python ..\scripts\classifier.py --socket=5000 --weights=weights\obj_last.weights curl -X POST -F image=@dog.png http://localho...
engine.py
""" This file contains functions to regulate game play. """ from api import State, Deck, util from multiprocessing import Process, Manager def play( player1, # type: Bot player2, # type: Bot state, # type: State max_time=5000, # ty...
hammer.py
#!/Library/Frameworks/Python.framework/Versions/3.4/bin/python3 # -*- coding: utf-8 -*- # python 3.3.2+ Hammer Dos Script v.1 # by Can Yalçın # only for legal purpose from queue import Queue from optparse import OptionParser import time,sys,socket,threading,logging,urllib.request,random def user_agent(): global ua...
easyshare.py
import ctypes import hashlib import multiprocessing from multiprocessing.sharedctypes import RawValue import threading import json import cPickle class Share( property ): __ver__ = 2 def __init__( self, _v=None, maxsize=10240, serializing=json, szarg=None ): class...
dx_operations_vdb.py
#!/usr/bin/env python # Corey Brune - Oct 2016 #This script starts or stops a VDB #requirements #pip install docopt delphixpy #The below doc follows the POSIX compliant standards and allows us to use #this doc to also define our arguments for the script. """List all VDBs or Start, stop, enable, disable a VDB Usage: ...
bot_utils.py
import logging import re import threading import time import math from bot.helper.telegram_helper.bot_commands import BotCommands from bot import dispatcher, download_dict, download_dict_lock, STATUS_LIMIT from telegram import InlineKeyboardMarkup from telegram.ext import CallbackQueryHandler from bot.helper.telegram_...
run_traffic_gen.py
# #© Copyright 2021 Xilinx, 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, s...
ip_db.py
import requests import telnetlib from threading import Lock,Thread from apis import Apis from random import choice import redis import time from qq_hook import Hook from settings import Ip_db_settings c=Ip_db_settings() apis=Apis() #读setting send_to_qq=c.send_to_qq t_num=c.t_num tel_timeout=c.tel_timeout apis.timeout=...
main.py
from online import online import threading import time instance = None received = '1' sent = '1' name = input("What's your name?\n> ") def receiving(): global received global sent while(received!='0' and sent!='0'): received = instance.any_receive_mesage() print(received) def sending(): ...
rust_test_common.py
import sublime import queue import sys import os import unittest import subprocess import threading import time # Used for debugging. from pprint import pprint # Depends on how you install the plugin. plugin = sys.modules.get('sublime-rust', sys.modules.get('Rust Enhanced', None)) if not plugin: raise ValueErr...
session_test.py
# Copyright 2015 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...
dispatcher.py
import argparse import subprocess import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = "3" import multiprocessing import pickle import csv import json import sys from os.path import dirname, realpath import random from collections import OrderedDict import copy sys.path.append(dirname(dirname(realpath(__file__)))) from sand...
test_enum.py
import enum import inspect import pydoc import sys import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, EnumMeta, Flag, IntFlag, unique, auto from io import StringIO from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL from test import support from datetime im...
test_bd_block.py
#coding:utf-8 import threading import multiprocessing import requests import time import logging import random import time import sys import uuid from lxml import etree fm = "%(asctime)s-%(filename)s-%(threadName)s-%(funcName)s-%(levelname)s-%(lineno)d:\t%(message)s" logging.basicConfig(filename='test_web.log',level=...
record_kinect_to_img.py
from navirice_get_image import KinectClient from navirice_helpers import navirice_img_set_write_file from navirice_helpers import navirice_image_to_np from navirice_helpers import navirice_ir_to_np import navirice_image_pb2 from tkinter import * import cv2 import numpy as np from threading import Thread HOST = '127....
helpers.py
""" Helper functions file for OCS QE """ import logging import re import datetime import statistics import os from subprocess import TimeoutExpired, run, PIPE import tempfile import time import yaml import threading from ocs_ci.ocs.ocp import OCP from uuid import uuid4 from ocs_ci.ocs.exceptions import ( TimeoutE...
menubars.py
from tkinter import * from tkinter import ttk, messagebox from halo import Halo from threading import Thread def close(app:Tk): msg = messagebox.askyesno('Exit App', 'Are you sure you want to quit' , icon='warning') if msg: app.destroy() app.quit() root = Tk() menu_bar = Menu(root) ro...
pytorch.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import atexit import logging import time from dataclasses import dataclass import os from pathlib import Path import socket from subprocess import Popen from threading import Thread import time from typing import Any, List, Optional, Union impor...
consistency_test.py
import queue import sys import threading import time import pytest import logging from collections import OrderedDict, namedtuple from copy import deepcopy from cassandra import ConsistencyLevel, consistency_value_to_name from cassandra.query import BatchStatement, BatchType, SimpleStatement from tools.assertions imp...
test.py
import os.path as p import random import threading import time import pytest from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV from helpers.client import QueryRuntimeException from helpers.network import PartitionManager import json import subprocess import kafka.errors from kafka impor...