source
stringlengths
3
86
python
stringlengths
75
1.04M
IndexFiles_zhCN_sim.py
# SJTU EE208 import sys, os, lucene, threading, time from datetime import datetime # from java.io import File from java.nio.file import Paths from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer from org.apache.lucene.analysis.standard import StandardAnalyzer from org.apache.lucene.analysis.co...
main.py
""" mlperf inference benchmarking tool """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals # pylint: disable=unused-argument,missing-docstring import argparse import json import logging import os import threading import time from queue import Queue impor...
node.py
import hashlib import time import math import random import socket import sys from thread import * import threading from bitcoin import * elementlength=1000 #max number per array element, not number of elements vectorlength=32 #number of elements per vector neighbormax=10 homeip='71.198.63.116' max_neighbors=10 tim...
process_replay.py
#!/usr/bin/env python3 import importlib import os import sys import threading import time from collections import namedtuple import capnp from tqdm import tqdm import cereal.messaging as messaging from cereal import car, log from cereal.services import service_list from common.params import Params from selfdrive.car....
master.py
# -*- coding: utf-8 -*- ''' This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. ''' # Import python libs from __future__ import absolute_import, with_statement, print_function, unicode_literals import copy import c...
executor.py
"""HighThroughputExecutor builds on the Swift/T EMEWS architecture to use MPI for fast task distribution """ from concurrent.futures import Future import logging import threading import queue import pickle from multiprocessing import Process, Queue from ipyparallel.serialize import pack_apply_message # ,unpack_apply...
main.py
import os import torch import numpy as np from torch.multiprocessing import SimpleQueue, Process, Value, Event, Barrier import torch.distributed as dist from torch.nn.parallel import DistributedDataParallel from algorithms.ppo.core import ActorCritic, PPOBuffer, count_vars from algorithms.ppo.worker import worker from ...
main.py
#!/usr/bin/env python3 # @File:main.py # @Date:2018/5/9 # Author:Cat.1 # 2018/05/20 代码部分重构 # 2018/07/15 重构系统 # 2018/07/29 增加酷狗音乐初步支持 # 2018/08/03 增加百度、酷我音乐初步支持 # 2018/08/25 增加Spotify初步支持 #t #te #tes #test #testt #testte #testtes import re import sys import copy import redis import datetime import threading import ...
__init__.py
import argparse import fnmatch import os import re import subprocess import threading import signal import fswatch.libfswatch import sys class UserError(Exception): pass def log(message): print(f'dirwatch: {message}', file=sys.stderr, flush=True) _debug = False def parse_args(): parser = argparse.A...
main_VLPR.py
# -*- coding: utf-8 -*- __author__ = '樱花落舞' import threading import time import tkinter as tk import cv2 import config import debug import img_function as predict import img_math from threading import Thread from tkinter import ttk from tkinter.filedialog import * from PIL import Image, ImageTk class ThreadWithReturn...
ec2_distributed_job_demo.py
''' Data collection tool for gathering website data from a list of EC2 nodes author: Marcela S. Melara (melara@cs.princeton.edu) date created: 10/21/2015 ''' # system imports import sys import time from multiprocessing import Process # external imports from boto import ec2 # use boto 2, the API is better import ec2...
client.py
import json from multiprocessing import Queue from threading import Thread import uuid from coapthon import utils from coapthon.messages.request import Request import os from coapthon.messages.response import Response from coapthon.server.coap import logging from coapthon.utils import create_logging import coapthon.de...
catalog_collections.py
# cspell:ignore ftype, chksum """Catalog collections within the execution environment.""" import argparse import hashlib import json import multiprocessing import os import re import subprocess import sys from collections import Counter from collections import OrderedDict from datetime import datetime from json.decode...
dropbox.py
#! /usr/bin/python # # Copyright (c) Dropbox, Inc. # # dropbox # Dropbox frontend script # This file is part of nautilus-dropbox 2015.10.28. # # nautilus-dropbox 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,...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum.storage import WalletStorage, StorageReadWriteError from electrum.wallet_db import WalletDB from el...
zxcar_driver_gui_node.py
#! /usr/bin/env python # coding: utf-8 import rospy from PyQt5.QtWidgets import * from PyQt5.QtCore import * import sys from std_srvs.srv import SetBool, SetBoolRequest, SetBoolResponse from sensor_msgs.msg import Imu, MagneticField, BatteryState from geometry_msgs.msg import Twist from std_msgs.msg import Float32 im...
start.py
import copyreg from datetime import datetime from logging import getLogger, basicConfig, INFO from socket import socket from threading import Thread, Lock from typing import Dict, Optional, Tuple, List from drivebuildclient import accept_at_server, create_server, create_client, process_requests from drivebuildclient.a...
commander.py
import time import threading from src.helpful.mr_clean import Mr from src.messages import Log as report class Commander: def __init__(self, commands, admins, connection, log = print, sleep = time.sleep): self.log = log self.sleep = sleep self.commands = commands self.admins = [Mr.lo...
test_debug.py
import importlib import inspect import os import re import sys import tempfile import threading from io import StringIO from pathlib import Path from unittest import mock from django.core import mail from django.core.files.uploadedfile import SimpleUploadedFile from django.db import DatabaseError, connection from djan...
worker.py
import os from datetime import datetime import logging import requests import json from urllib.parse import quote from multiprocessing import Process, Queue from linux_badge_worker import __data_source__, __tool_source__, __tool_version__ import pandas as pd import sqlalchemy as s from sqlalchemy.ext.automap import au...
NB_Server_Gateway.py
# Gateway for CNDingtek kindes sensor NB-IoT version gateway # change log Nov 28, 2020. change the created threading not close automatically. # coding:utf-8 import socket # import json # import struct # import base64 # from multiprocessing import Process import Logger import threading import http.client import time ...
conftest.py
# shapely has to be imported before rasterio to work around # https://github.com/Toblerity/Shapely/issues/553 import shapely.geometry # noqa: F401 import os import multiprocessing import time from functools import partial import pytest import numpy as np import rasterio def pytest_configure(config): os.enviro...
remote_command_server.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/licens...
common.py
# Copyright 2021 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from enum import Enum from functools import wraps from pathlib import...
test_e2e.py
import h2o import os import socket import threading import unittest from six.moves import urllib from websocket import create_connection SIMPLE_PATH = b'/simple' SIMPLE_BODY = b'<h1>It works!</h1>' PEERNAME_PATH = b'/peername' HEADER_PATH = b'/header' HEADER_NAME = b'X-My-Header' HEADER_VALUE = b'Hello world!' RES_HEA...
zipPasswdAttack.py
import zipfile import optparse from threading import Thread def extractFile(zFile,password): try: # print(password) zFile.extractall(pwd=password.encode(encoding='utf-8', errors = 'strict')) print("[+] Found password {}".format(password)) except Exception as e: pass ...
__init__.py
import threading import time from collections import OrderedDict, defaultdict from concurrent import futures from functools import partial from queue import SimpleQueue from typing import NamedTuple, Callable from spherov2.controls.v1 import Packet as PacketV1 from spherov2.controls.v2 import Packet as PacketV2 from s...
__init__.py
# Copyright 2018 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...
test__core_fork.py
from __future__ import print_function import gevent.monkey; gevent.monkey.patch_all() import gevent import os import multiprocessing hub = gevent.get_hub() pid = os.getpid() newpid = None def on_fork(): global newpid newpid = os.getpid() fork_watcher = hub.loop.fork(ref=False) fork_watcher.start(on_fork) ...
DarkFB2.py
# -*- coding: utf-8 -*- import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool try: import mechanize except ImportError: os.system('pip2 install mechanize') else: try: import requests except ImportEr...
update_data.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ This module contains classes that handle the data update efficiently. Historical data of stocks and indices are updated via the pandas_datareader package. Financal statements of stocks are also updated. The update has beed parallelized using threads. """ imp...
base_scanner.py
# =============================================================================== # Copyright 2016 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...
test_streaming_pull_manager.py
# Copyright 2018, 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
smart-contract.py
""" Example of running a NEO node and receiving notifications when events of a specific smart contract happen. Events include Runtime.Notify, Runtime.Log, Storage.*, Execution.Success and several more. See the documentation here: http://neo-python.readthedocs.io/en/latest/smartcontracts.html """ import threading from...
tests.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import errno import os import shutil import tempfile import time from datetime import datetime, timedelta from io import BytesIO try: import threading except ImportError: import dummy_threading as threading from django.conf impo...
command.py
import threading import queue from abc import ABC, abstractmethod from ratelimiter import RateLimiter # type: ignore from typing import Optional class Command(ABC): """ Generic command representation. """ @abstractmethod def execute(self) -> None: """ Executes the command logic. ...
status_manager.py
# Copyright 2015 Hewlett-Packard Development Company, L.P. # Copyright 2020 SAP SE # # 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 re...
SmartServo.py
import _thread import time from flask_socketio import SocketIO from components.Servo import Servo from helpers.dataHelper import mapValueToIntRange class SmartServo(Servo): def __init__(self, potentiometer, ee, kitServo, name, pin, pulse_min, pulse_max, max_angle): super().__init__(kitServo, name, pin, ...
email.py
from flask import current_app, render_template from flask_mail import Message from . import mail from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) current_app.logger.debug(f"sent email, from {current_app.config['RAGTIME_MAIL_SENDER']} to {msg.recipi...
collapsar.py
import socks import socket import requests import threading import random import ssl import time from colorama import Fore print(Fore.RED + """ ____ ______ ____ _____ ________ ___ __ __ / __ \__ __/ ____/____/ __ \____ / ___/____ /_ __/ /_/ | _____/ //_/ ...
test_remote_file.py
import unittest import sys, os import shutil sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) # Insanity for getting parent folder in path from remote_file import * import SocketServer import threading from handler import TestHandler class TestShapefile2Geojson(unittest.TestCase): def...
mbed_greentea_cli.py
""" mbed SDK Copyright (c) 2011-2016 ARM Limited 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 w...
test_simple.py
# -*- coding: utf-8 -*- import unittest from . import create_auth_provider from .ldap_server import get_reactor import threading from mock import Mock class LdapSimpleTestCase(unittest.TestCase): @classmethod def setUpClass(cls): """ Starts the Twisted-based "ldaptor" LDAP server in the ...
inference_video.py
""" Inference video: Extract matting on video. Example: python inference_video.py \ --model-type mattingrefine \ --model-backbone resnet50 \ --model-backbone-scale 0.25 \ --model-refine-mode sampling \ --model-refine-sample-pixels 80000 \ --model-checkpoint "PATH_TO...
rkeeletests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
ObjectSpace.py
import pi3d from multiprocessing import Process import time import RPi.GPIO as GPIO from encoder import Encoder from scanline import get_pixels from PIL import Image class ObjectSpace: def __init__(self): # GPIO.setmode(GPIO.BCM) self.prevValue = 0 self.rotation = 0 self.rotateVert ...
people_counter.py
from typing import Dict from sensor.tof_sensor import ToFSensor, Directions from datetime import datetime import threading COUNTING_CB = "counting" TRIGGER_CB = "trigger" CHANGE_CB = "changes" START_TIME = "start_time" END_TIME = "end_time" TRIGGER_DISTANCES = "trigger_distances" END_DISTANCE = "end_distance" class...
Main.py
""" * By M.K 6/24/2020 * Licensed under the MIT License. * https://github.com/MI-K253 * https://github.com/MI-K253/Python-Plays-Game """ import GetFrame import numpy as np from tensorflow import keras import time import cv2 import keyboard from random import randint import os import threading import Mo...
telnet_ser_P.py
#from threading import Thread #from Queue import Queue from sock_ser import sock_ports_ops from multiprocessing import Process,Queue class telnet_ports_ops(sock_ports_ops): def __init__(self): sock_ports_ops.__init__(self) self.__telnet_thread_id = None self.__telnet = None def telnet_process_sock(se...
geemap.py
"""Main module for interactive mapping using Google Earth Engine Python API and ipyleaflet. Keep in mind that Earth Engine functions use both camel case and snake case, such as setOptions(), setCenter(), centerObject(), addLayer(). ipyleaflet functions use snake case, such as add_tile_layer(), add_wms_layer(), add_mi...
FTS.py
import multiprocessing import threading import argparse import linecache import sys import random from FreeTAKServer.controllers.CreateStartupFilesController import CreateStartupFilesController CreateStartupFilesController() from FreeTAKServer.model.User import User from FreeTAKServer.controllers.services.TCPDataPa...
core.py
import os import cv2 import time import random import platform import subprocess import numpy as np from threading import Thread from PyQt5.QtCore import QObject, pyqtSignal # QWidget无法在主线程之外被调用,因此构造一个QObject,使用自定义的信号来触发主线程的槽函数 # 具体可以看:https://stackoverflow.com/questions/2104779/qobject-qplaintextedit-multithreading-...
jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
mqtt-data-logger.py
#!c:\python34\python #!/usr/bin/env python #If Running in Windows use top line and edit according to your python #location and version. If running on Linux delete the top line. ###demo code provided by Steve Cope at www.steves-internet-guide.com ##email steve@steves-internet-guide.com ###Free to use for any purpose """...
PySC2_A3C_FullyConv.py
""" PySC2_A3C_AtariNetNew.py A script for training and running an A3C agent on the PySC2 environment, with reference to DeepMind's paper: [1] Vinyals, Oriol, et al. "Starcraft II: A new challenge for reinforcement learning." arXiv preprint arXiv:1708.04782 (2017). Advantage estimation uses generalized advantage estimat...
sampdos.py
import random import socket import threading print(''' DDOS TOOL BY HAZIQ JK''') ip = str(input(" Target Ip:")) port = int(input(" Target Port:")) choice = "y" times = int(60048) threads = int(9999) def run(): data = random._urandom(16) i = random.choice(("[*]","[!]","[#]")) while True: try: s...
interface_rpc.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Tests some generic aspects of the RPC interface.""" import os from test_framework.authproxy import JSO...
server.py
import socket import threading from Crypto.PublicKey import RSA from Crypto.Cipher import AES from Crypto import Random import base64 class server(): def __init__(self): self.running = True key = RSA.generate(2048) # Use RSA for public key encryption to send key at start ...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
ExtToolDefs.py
import json import time from threading import Thread def fileToJson(filename, encoding="utf-8"): f = open(filename, 'r') content = f.read() f.close() try: return json.loads(content) except: return None class BaseIndexWriter: ''' 基础指标输出工具 ''' def _...
rebase_test.py
#!/usr/bin/env python3 # # Copyright (c) 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. ...
controller.py
#!/usr/bin/env python3 # # Copyright (c) Viveris Technologies. # Licensed under the MIT license. See LICENSE file in the project root for details. # __author__ = 'Viveris Technologies' __credits__ = '''Contributors: * David FERNANDES <david.fernandes@toulouse.viveris.com> ''' import re import os import glob import ...
monocular.py
import threading, cv2, time from .monocam import MonoCam from .vision_config import BallConfig, MonocularConfig from . import preprocessing from .trajectory_estimation import get_target_pixel_position_moment from vision import monocam from vision import vision_config def check_empty(frame): """Checks...
stream_detect.py
import sys import threading import time import humanfriendly import json import uuid import warnings import logging import yaml import numpy as np import torch from torchvision import transforms import cv2 from PIL import Image import cougarvision_utils.alert as alert_util import cougarvision_utils.cropping as cro...
directory_utils.py
""" Utilities related to project directory. """ import datetime import os import subprocess from multiprocessing.dummy import Pool, Process, Manager from antlr4 import FileStream, CommonTokenStream from antlr4.TokenStreamRewriter import TokenStreamRewriter from joblib import Parallel, delayed from gen.java.JavaLexer ...
CrawlerChrome.py
from func_timeout import func_timeout, FunctionTimedOut, func_set_timeout from logging import root from tmp.path import find_cookies_path from Ops import delFolder, delProfileFolder, editLogQueue, isThirdParty, newLogQueue, terminateProcessBySiteID, timestamp2Datetime, LocalStorage, visitLogNew, visitLogUpdate from re ...
ip_lib.py
# Copyright 2012 OpenStack Foundation # 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 requ...
utils.py
""" Utility Functions and Classes This module collects small pieces of code used throughout :py:mod:`bioconda_utils`. """ import os import re import glob import fnmatch import subprocess as sp import sys import shutil import contextlib from collections import Counter, Iterable, defaultdict, namedtuple from itertools i...
engine.py
""" """ import logging import smtplib 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 from vnpy.event import Event, EventEngine from .app import BaseApp from .event import ( EVENT_...
scan_target_ip.py
import urllib import ssl import OpenSSL import requests import socket import subprocess import socket import threading from netaddr import IPNetwork import netaddr import mysql.connector as mariadb from configparser import ConfigParser top1Kports = [1, 3, 6, 9, 13, 17, 19, 20, 21, 22, 23, 24, 25, 30, 32, 37, 42, 49, ...
serial_udp_bridge.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Convert serial data in CSV format to XML and send via UDP. """ import argparse import marshal import math import queue import socket import socketserver import struct import sys import threading import time import serial #import hanging_threads DEFAULT_BAUDRATE = 2...
cli.py
# -*- coding: utf-8 -*- """ flask.cli ~~~~~~~~~ A simple command line application to run flask apps. :copyright: © 2010 by the Pallets team. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import ast import inspect import os import platform import re import...
spinner.py
import sys import threading import itertools from time import sleep def spin(): spinner = itertools.cycle(['-', '/', '|', '\\']) while True: sys.stdout.write(next(spinner)) sleep(0.1) sys.stdout.flush() sys.stdout.write('\b') def get_spinner_thread(): return threading.Thr...
gcsio_test.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...
pyusb_backend.py
""" USB HID API from pyOCD project Copyright (c) 2006-2013 ARM Limited 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 appl...
stress.py
from __future__ import print_function import threading import requests import time import json import sys import hashlib import datetime from random import randint requests.packages.urllib3.disable_warnings() appid = "stressss" apikey = "12345678901234567890123456789012" url = "http://localhost:9002/1/indexes/stress" ...
ClientTest.py
import socket, threading, time, json def main(): client = Client("localhost", 10000) client.verbose = True while True: try: if (client != None): client.Run() except Exception as error: print(error) if (client != None): clie...
main.py
####################################################################################### # # frick is distributed under the MIT License (MIT) # Copyright (c) 2018 Giovanni - iGio90 - Rocca # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fil...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import cv2 import glob import hashlib import json import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import Pool, ThreadPool from pathlib import Path from threading import ...
client.py
import sys import dbm import json import time import math import gzip import logging import argparse import datetime import threading import functools import socketserver import urllib.request from http.server import SimpleHTTPRequestHandler from concurrent.futures import ThreadPoolExecutor from typing import List, Any...
test_socketserver.py
""" Test suite for socketserver. """ import contextlib import io import os import select import signal import socket import tempfile import threading import unittest import socketserver import test.support from test.support import reap_children, reap_threads, verbose test.support.requires("network") TEST_STR = b"h...
TaskSystem.py
import sys from queue import Queue from threading import Event, Thread, Lock, RLock import better_exchook import Persistence import Logging kNumWorkers = 5 kMinQueuedActions = kNumWorkers # fill workerQueue always up to N elements, via the watcher thread kSuggestedMaxQueuedActions = kNumWorkers * 2 # Reloads shou...
serve.py
import abc import argparse import importlib import json import logging import multiprocessing import os import platform import subprocess import sys import threading import time import traceback import urllib import uuid from collections import defaultdict, OrderedDict from itertools import chain, product from typing i...
kombu_server.py
# Copyright 2015 - Mirantis, 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 agree...
test_examples.py
# Copyright 2020 Tensorforce Team. 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 la...
smtpd_mock.py
# Copyright 2021 Northern.tech AS # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
postproc.py
#!/usr/bin/python -OO # Copyright 2008-2017 The SABnzbd-Team <team@sabnzbd.org> # # 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; either version 2 # of the License, or (at your option) any later...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. import os import pickle import random import subprocess import sys import textwrap import time import unittest from test import support from test.support import MISSING_C...
A.py
import sys import threading sys.setrecursionlimit(10**6+1) threading.stack_size(10**8) def solve(): [n,m] = list(map(int,input().split())) matrix = [[] for i in range(n)] for i in range(n): aux = list(map(int,input().split())) matrix[i] = aux levels = [-1 for i in range(n)] visi...
test_search.py
import pdb import struct from random import sample import threading import datetime import logging from time import sleep import concurrent.futures from multiprocessing import Process import pytest import numpy import sklearn.preprocessing from milvus import IndexType, MetricType from utils import * dim = 128 collecti...
dos.py
import shlex, subprocess import threading import time import ctypes import os from select import * #import commands class dos_ops: def __init__(self): self.__subp_args = {} self.__ringbuffer_len = 8192 self.__read_callback = None self.__thread = None self.__thread_args = {} def port_thread(s...
test_dag_serialization.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...
helpers.py
import colorsys # for get_N_HexCol import os import json import csv import sys import subprocess from multiprocessing import Process, Queue import time from datetime import datetime as dt import importlib import numpy as np import pickle import logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger...
test_general.py
""" Collection of tests for unified general functions """ # global import os import math import time import einops import pytest import threading import numpy as np from numbers import Number from collections.abc import Sequence import torch.multiprocessing as multiprocessing # local import ivy import ivy.functional....
test_table_read.py
import os from datetime import datetime from threading import Barrier, Thread try: import pandas as pd except ModuleNotFoundError: _has_pandas = False else: _has_pandas = True import pyarrow as pa import pyarrow.dataset as ds import pytest from pyarrow.dataset import ParquetReadOptions from pyarrow.fs imp...
main.py
import base64 import os import random import string import requests import colorama from colorama import * import time import console from console.utils import set_title import json import threading """ with open("config.json", "r") as f: data = f.read() print(data) """ config = {"cracker_mode"...
threading_file.py
import threading from Queue import Queue import time print_lock = threading.Lock() def example_job(worker): time.sleep(0.5) with print_lock: print(threading.current_thread(), worker) def threader(): while True: worker = q.get() example_job(worker) q.task_don...
wifiConnection.py
""" Holds all the data and commands needed to fly a Bebop drone. Author: Amy McGovern, dramymcgovern@gmail.com """ from zeroconf import ServiceBrowser, Zeroconf from datetime import datetime import time import socket import ipaddress import json from pyparrot.utils.colorPrint import color_print import struct import t...
test_dict_semaphore.py
import pytest import time from threading import Thread from src.hw3.dict_semaphore import LockDict def test_safe_access(): def long_calculation(value: int) -> int: time.sleep(0.001) return value def add_to_counter(value: int, locked_dictionary: LockDict): with locked_dictionary as ld:...