source
stringlengths
3
86
python
stringlengths
75
1.04M
test_http.py
# 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, software # distributed under the Li...
vpp_papi.py
#!/usr/bin/env python # # Copyright (c) 2016 Cisco and/or its affiliates. # 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...
GetCourse.py
import requests as reqs import json import datetime as dt import telebot import threading import os import configparser as cp import time from telebot import types from multiprocessing import Value from timeloop import Timeloop from datetime import timedelta from requests.models import Response # Инициализация # conf...
test_async.py
import threading import time import unittest from common import TestCase import pyuv class AsyncTest(TestCase): def test_async1(self): self.async_cb_called = 0 self.prepare_cb_called = 0 def async_cb(async): with self.lock: self.async_cb_called += 1 ...
test_sentry.py
import multiprocessing import numpy as np import pytest import sentry_sdk import sentry_sdk.serializer import sentry_sdk.utils from sentry_sdk.client import Client from sentry_sdk.hub import Hub from sentry_sdk.serializer import serialize from PartSeg.common_backend.base_argparser import safe_repr from PartSegCore.an...
login.py
import os, sys, time, re, io import threading import json, xml.dom.minidom import copy, pickle, random import traceback, logging import requests from pyqrcode import QRCode from .. import config, utils from ..returnvalues import ReturnValue from ..storage.templates import wrap_user_dict from .contact impo...
kvstore_client_tests.py
#!/usr/bin/env python # # Copyright (c) 2014-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals from...
log.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 copy import io import logging import os import re import sys import threading import time from types import TracebackType from typing ...
process_replay.py
#!/usr/bin/env python3 import importlib import os import sys import threading import time import signal 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 ...
base.py
""" Module containing base classes that represent object entities that can accept configuration, start/stop/run/abort, create results and have some state. """ import os import sys import signal import time import uuid import threading import inspect import psutil import functools from collections import deque, Ordere...
AudioProcessor.py
from CommonData import * import matplotlib.pyplot as plt import sys import threading import time class AudioProcessor: # Parameters of AudioProcessor that shouldn't be touched within the class CHUNK = 1024 DEFAULT_ARRAY = np.zeros( CHUNK ) def __init__(self): # Initialize AudioDa...
util.py
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. import subprocess import os import sys import logging import time import settings import re import uuid import requests_unixsocket import requests from threading import T...
main.py
# coding=utf-8 # 18:34 24/09/19 Project starts. # 16:31 29/09/19 Entire project restructured. # 23:40 11/10/19 First version (1.0) finished. # 20:41 14/10/19 Version (1.0) debugged. # 16:46 26/10/19 Project successfully modularized. # 23:57 26/10/19 Version (1.1) finished and debugged. # Generic imports impor...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Version 3.2.3 is currently recommended when SSL is enabled, since this version worked the best with SSL in internal testing....
TestLooperServer.py
import collections import json import logging import threading import traceback import base64 import time import random import socket import test_looper.data_model.TestDefinition as TestDefinition import test_looper.core.SimpleServer as SimpleServer import test_looper.core.socket_util as socket_util import test_looper...
grab_api.py
# coding: utf-8 import six from tests.util import build_grab, temp_file from tests.util import BaseGrabTestCase from tests.util import reset_request_counter from grab import GrabMisuseError, GrabError class GrabApiTestCase(BaseGrabTestCase): def setUp(self): self.server.reset() def test_incorrect_op...
conduct.py
from hatano.util import Conf from hatano.iam import IamRole from hatano.lmbda import Lambda from hatano.apigateway import RestApi from hatano.acm import Cert from hatano.route53 import Route53 from hatano.s3 import S3 from hatano.cloudfront import CloudFront from hatano.errors import HatanoError import os import threa...
core.py
import threading import subprocess import logging import time import os import traceback import errno from collections import namedtuple, deque from itertools import chain import psutil import conf import client import utils import rpc.ttypes as ttypes from profile import SystemProfiler as _SystemProfiler logger...
clean_met.py
""" this is a simple script to clean the met dataset from all the already grayscale images """ import argparse import os import multiprocessing as mp import queue from PIL import Image, UnidentifiedImageError import numpy as np import tqdm def single(root, filename): """ performs on a single file """ try: ...
start_pipelined.py
""" Copyright (c) 2018-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. """ import logging import threa...
loader.py
from multiprocessing import Process from downstream_farmer.shell import main import argparse import time if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--number', help='Number of farmers to launch', type=int, default=1) args = parser.parse_args() ...
envs.py
from ssbm_gym.ssbm_env import BaseEnv, isDying from copy import deepcopy from ssbm_gym import embed opponent_pid = 1 def make_env(frame_limit, options): def _init(): env = GoHighEnv(frame_limit=frame_limit, options=options) return env return _init def GoHighEnvVec(num_envs, frame_limit=1e9, ...
ThreadingDoc.py
#!/usr/bin/env python """ Simple how-to-code-class for show all methods & functions of the Threading module. """ __author__ = "Rafael García Cuéllar" __email__ = "r.gc@hotmail.es" __copyright__ = "Copyright (c) 2018 Rafael García Cuéllar" __license__ = "MIT" import threading import os,sys,inspect current_dir...
lambda-handler.py
import os import subprocess import logging import base64 from threading import Thread logging.getLogger().setLevel(logging.INFO) class ReturningThread(Thread): """A wrapper around the Thread class to actually return the threaded function return value when calling join()""" def __init__(self, target=None...
spincoater.py
import odrive # odrive documentation https://docs.odriverobotics.com/ from odrive.enums import * # control/state enumerations import serial import time import numpy as np import os import yaml import threading from frgpascal.hardware.helpers import get_port from frgpascal.hardware.gantry import Gantry from frgpascal....
sh.py
""" http://amoffat.github.io/sh/ """ # =============================================================================== # Copyright (C) 2011-2017 by Andrew Moffat # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
__init__.py
# Author: Jacob Tsekrekos # Date: Jun 1, 2018 # File: DeviceInput.__init__.py # Description: Init for the DeviceInput module from pynput import keyboard as _keyboard from pynput import mouse as _mouse from .Gamepad import get_gamepad as _get_gamepad from .Gamepad import check_gamepad as _check_gamepad from .Gamepad im...
multithreaded.py
# multithreaded.py import threading import time from queue import Queue import requests def make_request(url): """Makes a web request, prints the thread name, URL, and response code. """ resp = requests.get(url) with print_lock: print("Thread name: {}".format(threading.current_thread().n...
train.py
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentParser def main(opt): ArgumentParser.validate_train_o...
run-tests.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 "Li...
me212bot_node.py
#!/usr/bin/python # 2.12 Lab 2 me212bot_node: ROS driver running on the pc side to read and send messages to Arduino # Peter Yu Sept 2016 import rospy import threading import serial import tf.transformations as tfm from geometry_msgs.msg import Pose, Quaternion ...
test_device.py
# SPDX-License-Identifier: MIT import threading import pytest import hidabc class DummyInterface(): def __init__(self): self._data = [] @property def name(self): # pragma: no cover return 'dummy device' @property def vid(self): # pragma: no cover return 0x0000 @...
windows.py
"""The window manager. Creates a bunch of curses frames with various functions. The "main" window is reserved for rendering Views that display data aggregated by the various collectors.""" import time import curses import threading from . import views MENU_WIDTH = 40 STATUS_WIDTH = 40 def setup_window(window): ...
test_connection_pool.py
import os import pytest import re import redis import time from unittest import mock from threading import Thread from redis.connection import ssl_available, to_bool from .conftest import skip_if_server_version_lt, _get_client from .test_pubsub import wait_for_message class DummyConnection: description_format = ...
main.py
import pdb import time import os import subprocess import re import random import json import numpy as np import glob from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import socket import argparse import threading import _thread import signal from datetime import datetime parser = ar...
run.py
#!/usr/bin/env python3 import logging import os from os import path as osp import sys import time from multiprocessing import Process, Queue import cloudpickle import easy_tf_log from a2c import logger from a2c.a2c.a2c import learn from a2c.a2c.policies import CnnPolicy, MlpPolicy from a2c.common import set_global_se...
client.py
import py_env import os from typing import * import queue import socket import threading import sys import argparse import selectors from py_env.utils import log class Client: def __init__(self, host_addr : Tuple[str, int], code_config : 'CodeConfig'): self.sock = socket.socket() self.sock.connect(host_ad...
conftest.py
import faulthandler import io import logging.handlers import multiprocessing as mp import os import signal import sys import threading from collections import namedtuple from os import getenv from pathlib import Path from random import randint from zipfile import ZipFile import pytest TEST_DATA = "data" TEST_PYBIO_ZI...
test_general.py
"""Collection of tests for unified general functions.""" # global import time import einops import jax.numpy as jnp import pytest from hypothesis import given, strategies as st import numpy as np from numbers import Number from collections.abc import Sequence import torch.multiprocessing as multiprocessing # local im...
local_job_service.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...
event_worker.py
# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # 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...
abstract.py
#!/usr/bin/env python #! -*- coding: utf-8 -*- """Includes the base-class for all commands of any service.""" from __future__ import unicode_literals import ecstasy import requests import threading import sys try: from Queue import Queue except ImportError: from queue import Queue import lnk.config import lnk.er...
test_gc.py
import unittest from test.support import (verbose, run_unittest, start_threads, requires_type_collecting) import sys import time import gc import weakref try: import threading except ImportError: threading = None ### Support code ######################################################...
test_pyepics_compat.py
#!/usr/bin/env python # unit-tests for ca interface # Lifted almost exactly from pyepics # The epics python module was orignally written by # # Matthew Newville <newville@cars.uchicago.edu> # CARS, University of Chicago # # There have been several contributions from many others, notably Angus # Gratton <angus.gr...
download_anime.py
from subprocess import Popen, PIPE, STDOUT import shlex import sys import threading import time import os import subprocess from threading import Thread import queue # this is a wrapper for: https://github.com/Pfuenzle/anime-loads # docker run --rm -it -v $PWD/config:/config pfuenzle/anime-loads add # docker run --rm...
webcam_demo.py
import argparse import time from collections import deque from operator import itemgetter from threading import Thread import cv2 import numpy as np import torch from mmcv import Config, DictAction from mmcv.parallel import collate, scatter from mmaction.apis import init_recognizer from mmaction.datasets.pipelines im...
_base.py
# Builtins import datetime as dt import time from pathlib import Path import yaml import traceback import threading from typing import List, Dict, Any from os.path import exists # External libraries import pandas as pd # Submodule imports from harvest.utils import * class API: """ The API class communicates...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import electrum from electrum.bitcoin import TYPE_ADDRESS from electrum import WalletStorage, Wallet from electrum_gui.kivy.i18n import _ from electrum.paymentrequest import InvoiceStore from electr...
server.py
#!/usr/bin/python3 import socket as soc import threading as thread import os import subprocess your_ip = subprocess.getoutput("hostname -i") your_port = 12345 # TO CREATE A SOCKET AND BIND IP AND PORT NUMBER : skt2 = soc.socket(soc.AF_INET, soc.SOCK_DGRAM) skt2.bind((your_ip, your_port)) # WE CAN USE THIS FUNCTION...
ble.py
from time import sleep from bleson import get_provider, Observer, logger from multiprocessing import Process, Manager from queue import Queue from logging import ERROR logger.set_level(ERROR) class BLEObserver(object): '''Bluetooth LE communications with bleson''' @staticmethod def _getData...
clock.py
import tkinter as tk from tkinter.font import Font from time import strftime, localtime, sleep from threading import Thread class Clock(tk.Frame): def __init__(self, parent): tk.Frame.__init__(self, parent) self.time = strftime("%I:%M:%S %p", localtime()) self.date = strftime("%a, %b, %d",...
parallel-python-benchmark.py
import os import time import threading import multiprocessing import concurrent.futures import gevent import gevent.pool NUM_WORKERS = os.cpu_count() def only_sleep(unused_arg=None): """ Do nothing, wait for a timer to expire """ print("PID: %s, Process Name: %s, Thread Name: %s" % ( os.getpid(), ...
mesh_pool.py
import torch import torch.nn as nn from threading import Thread from models.layers.mesh_union import MeshUnion import numpy as np from heapq import heappop, heapify class MeshPool(nn.Module): def __init__(self, target, multi_thread=False): super(MeshPool, self).__init__() self.__out_target = ...
server.py
import uvicorn from fastapi import FastAPI from pydantic import BaseModel import os import logging import json from google.protobuf import any_pb2 import grpc import time from threading import Thread import sys import redis import cache import service_pb2 import service_pb2_grpc import boto3 s3client = None app = F...
complex_image.py
import threading from instance import * class Complex: def __init__(self): self.images_info_obj_list = [] self.threading_list = [] self.threading_page = 0 self.max_thread = Vars.cfg.data.get("max_thread") self.semaphore = threading.Semaphore(self.max_thread) def add_im...
NonSSL.py
#!/bin/env python3 ''' ''' # 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 ...
Trading.py
# -*- coding: UTF-8 -*- # @yasinkuyu # Define Python imports import os import sys import time import config import threading import math # Define Custom imports from Database import Database from Orders import Orders class Trading(): # Define trade vars order_id = 0 order_data = None buy...
engine.py
# -*- coding: utf-8 -*- import sys import threading # Import logger from iemlav.lib.log_monitor.server_log.server_logger import ServerLogger # Import utilities from iemlav.lib.log_monitor.server_log import utils # Import log parser from iemlav.lib.log_monitor.server_log.parser import apache from iemlav.lib.log_monitor...
socks.py
#!/usr/bin/env python """Minimal non-feature complete socks proxy""" from __future__ import print_function import socket from struct import pack, unpack import threading import sys # Python 3 renamed SocketServer to socketserver try: from socketserver import StreamRequestHandler, ThreadingTCPServer except BaseEx...
queue_calibs.py
''' This script is used to produce lists of CCDs or bricks. This is useful for production purposes (building qdo queue, eg). python legacypipe/queue-calibs.py | qdo load cal - eg, DR3: * Staging to $SCRATCH to images required to run the EDR region: module switch legacysurvey/dr3 python legacypipe/queue-calibs.py...
PrefixSumParallelNaive.py
#!/usr/bin/env python ''' Naive parallel algorithm of prefix sum http://people.cs.vt.edu/yongcao/teaching/cs5234/spring2013/slides/Lecture10.pdf ''' import threading import math import TestFunction # test_data = [2,6,2,3,5] test_data = [3, 1, 7, 0, 4, 1, 6, 3] ''' Generic sum function ''' def ac...
estimator.py
""" """ import cPickle import copy from functools import partial from multiprocessing import Process, Pipe import time import numpy as np import hyperopt import scipy.sparse from . import components # Constants for partial_fit # The partial_fit method will not be run if there is less than # timeout * timeout_buffe...
process_manager.py
"""Tools for managing subprocesses.""" from enum import Enum, auto as enum_auto import subprocess from typing import NamedTuple, Optional from threading import Thread import os import signal class ProcessExitResult(Enum): """Result of the process termination.""" # Process exited successfully. Ok = enum_a...
map_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
getters.py
"""Store classes that retrieve data.""" import logging import sys import webbrowser # lazy loaded import textwrap # lazy loaded from pathlib import Path from threading import RLock, Thread from time import sleep from typing import TYPE_CHECKING, Optional, Type, Union from wiki_music.constants import (API_KEY_FILE, ...
EfficientDetFinetuningModel.py
# Copyright 2020 Google Research. 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...
util.py
import atexit import os import shutil import sys import ctypes if sys.version_info[0] < 3 or sys.version_info[1] < 5: print("\nPlease restart with python3. \n(Taichi supports Python 3.5+)\n") print("Current version:", sys.version_info) exit(-1) tc_core = None def in_docker(): if os.environ.get("TI_IN_DOCKE...
Final_Run_FaceRecognition.py
import datetime import threading import time import cv2 import timed_face_recognition import numpy as np import pandas as pd def timer(): time_limit = 100 # 120 seconds while time_limit >= 0: m, s = divmod(time_limit, 60) h, m = divmod(m, 60) time_left = str(h).zfill(2) + ...
context.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
test_smtplib.py
import asyncore import email.utils import socket import smtpd import smtplib import StringIO import sys import time import select import unittest from test import test_support try: import threading except ImportError: threading = None HOST = test_support.HOST def server(evt, buf, serv): serv.listen(5) ...
dask.py
# pylint: disable=too-many-arguments, too-many-locals, no-name-in-module # pylint: disable=missing-class-docstring, invalid-name # pylint: disable=too-many-lines, fixme # pylint: disable=import-error """Dask extensions for distributed training. See https://xgboost.readthedocs.io/en/latest/tutorials/dask.html for simple...
record2.py
import time import os from threading import Thread from bluepy.btle import BTLEException from bluepy.sensortag import SensorTag from config import SENSOR_TAG_LIST OUT_FILE = "lux.csv" TIME_BETWEEN_READS = 5 TIME_BETWEEN_WRITES = 10 TIME_BETWEEN_RETRY = 5 LUX_READINGS = [] def get_light_and_battery(tag): light =...
agents.py
######## # Copyright (c) 2014 GigaSpaces Technologies Ltd. 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...
executormarionette.py
import os import socket import threading import traceback import urlparse import uuid errors = None marionette = None pytestrunner = None here = os.path.join(os.path.split(__file__)[0]) from .base import (ExecutorException, Protocol, RefTestExecutor, RefTestIm...
test_boostrap_link_via_app_data.py
from __future__ import absolute_import, unicode_literals import os import sys from stat import S_IREAD, S_IRGRP, S_IROTH, S_IWUSR from threading import Thread import pytest from virtualenv.discovery.py_info import PythonInfo from virtualenv.info import fs_supports_symlink from virtualenv.run import cli_run from virt...
util.py
""" :mod:`miraiml.util` provides utility functions that are used by higher level modules. """ from threading import Thread import random as rnd import pickle import string import math def load(path): """ A clean `pickle.load` wrapper for binary files. :type path: string :param path: The path of the ...
_websocket.py
from __future__ import absolute_import import websocket import threading import logging import json import random import time class WebsocketHandler(object): """WebsocketHandler handles websocket connections to a ConnectorDB server. It allows subscribing and unsubscribing from inputs/outputs. The handler als...
test_subprocess.py
import unittest from test import script_helper from test import support import subprocess import sys import signal import io import locale import os import errno import tempfile import time import re import selectors import sysconfig import warnings import select import shutil import gc import textwrap try: import...
VytServerApp.py
import socket import threading # Python 会自动对齐到四字节,因此如果要发送单个字节的话,需要在格式字符串前加上=取消对齐 import struct from vyterm.cryptography import Base64 from vyterm.vythug.Handlers import handle_packet, handle_logout _cipher = Base64() class ClientPeer: @staticmethod def SendProc(*args, **kwargs): peer = kwargs['peer'] ...
server.py
#!/usr/bin/env python3 # Copyright 2021 Nicolas Surbayrole # Copyright 2021 Quarkslab # Copyright 2021 Association STIC # # 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.apa...
__init__.py
#!/usr/bin/env false # -*- coding: utf-8 -*- import sys import socket import base64 import time import re import traceback import os from threading import Lock, Thread # Netcat module taken from here: https://gist.github.com/leonjza/f35a7252babdf77c8421 # and slightly modified class Netcat: """ Python 'netcat lik...
graph-size-circum-trim.py
#! /usr/bin/env python # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. Contact: ctb@msu.edu # import khmer import sys import screed import os.path import threading imp...
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, seri...
generator.py
# coding=utf-8 import os from .batcher import Batcher from queue import Queue from threading import Thread import threading import numpy as np import torch from tqdm import tqdm import random script_abs_path = os.path.dirname(__file__) ROOT_DIR = os.path.join(script_abs_path, '../../../') DATA_DIR = os.path.join(ROOT...
run.pyw
import os import sys import webbrowser from threading import Thread from tkinter import Tk, Label, CENTER, Button from api.router import Router PATH = os.path.dirname(os.path.realpath(sys.argv[0])) class SimpleServer: def __init__(self): self.ui = Tk() self.init_ui() self.open_browser()...
search.py
from typing import List, Set import os from flask import Flask, json, request import torch import clip from PIL import Image import requests from io import BytesIO from waitress import serve from dotenv import load_dotenv import threading, queue from PIL import ImageFile ImageFile.LOAD_TRUNCATED_IMAGES = True load_do...
main.py
import argparse import toml import json import re import functools import urllib.parse from . import utils from . import gitlab from .utils import lazy_debug import logging from threading import Thread, Lock, Timer import time import traceback import sqlite3 import requests from contextlib import contextmanager from it...
main.py
""" main.py Copyright 2007 Andres Riancho This file is part of w3af, http://w3af.org/ . w3af 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 version 2 of the License. w3af is distributed in the hope that it wil...
master.py
# # Copyright Cloudlab URV 2020 # # 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...
configmanager.py
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2014 IBM Corporation # Copyright 2015-2019 Lenovo # # 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...
tello_control_ui.py
from PIL import Image from PIL import ImageTk import tkinter as tki from tkinter import Toplevel, Scale import threading import datetime import cv2 import os import time import platform class TelloUI: """Wrapper class to enable the GUI.""" def __init__(self,tello,outputpath): """ Initial all t...
process_controller.py
import multiprocessing import logging import time from inspect import getfullargspec import sys import os import signal import atexit from collections import deque from subprocess import Popen, DETACHED_PROCESS, CREATE_NEW_PROCESS_GROUP import tcp_log_socket """The default test logger and logging server ar...
test_single_exception.py
""" All tests should fail. """ from threading import Thread def test_reraise(reraise): def run(): with reraise: assert False Thread(target=run).start() def test_reraise_wrap(reraise): def run(): assert False Thread(target=reraise.wrap(run)).start() def test_reraise_wr...
conftest.py
# -*- coding: utf-8 -*- import pytest import subprocess import threading from urllib.parse import urlparse from .prepare import make_specs, default_appname, default_sha, default_network_name, default_podname, default_cpu_quota, default_memory, default_git, make_specs_text, default_combo_name, default_env_name, defaul...
__init__.py
"""Support for the Fibaro devices.""" from collections import defaultdict import logging from typing import Optional from fiblary3.client.v4.client import Client as FibaroClient, StateHandler import voluptuous as vol from homeassistant.const import ( ATTR_ARMED, ATTR_BATTERY_LEVEL, CONF_DEVICE_CLASS, ...
test_content.py
from __future__ import print_function import os import re import sys import json import time import argparse import threading import subprocess import traceback from time import sleep from datetime import datetime from distutils.version import LooseVersion import urllib3 import requests import demisto_client.demisto_a...
server.py
import click import questionary as q import docker import os import time import subprocess from threading import Thread from functools import wraps from colorama import (Fore, Style) from sqlalchemy.engine.url import make_url from docker.client import DockerClient from vantage6.common import (info, warning, error, de...
flocklab_serial.py
#! /usr/bin/env python3 """ Copyright (c) 2020, ETH Zurich, Computer Engineering Group 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 retain the above copyright n...
experiments.py
from __future__ import print_function from .. import datasets from . import metrics from . import models from . import methods from .. import __version__ import numpy as np import sklearn import os import pickle import sys import time import subprocess from multiprocessing import Pool import itertools import copy impor...
ducolib.py
#!/usr/bin/env python3 import socket import hashlib import urllib.request import time import os import logging import sys import multiprocessing logging.basicConfig(filename='ducolib.log', level=logging.DEBUG, format='%(asctime)s -> %(levelname)s :: %(message)s') class Miner: def __init__(s...