source
stringlengths
3
86
python
stringlengths
75
1.04M
mission.py
#!/usr/bin/env python3 import time import threading import csv import os from picam_lib import PicamImpl, FilterContWheel, FilterPosWheel from mycelium_utils import DronekitConnector # MANUAL indicates mission has not started or has finished # HOLD indicates robot is stationary or mission is paused # AUTO indicates ...
pm_db.py
import json import base64 import random from cryptography.hazmat.primitives.kdf.scrypt import Scrypt from cryptography.fernet import Fernet import getpass import os import threading import difflib import string import secrets import pyperclip import time from inputimeout import inputimeout, TimeoutOccurred import keybo...
test_insert.py
import pytest from milvus import DataType, ParamError, BaseException from utils import * from constants import * ADD_TIMEOUT = 60 uid = "test_insert" field_name = default_float_vec_field_name binary_field_name = default_binary_vec_field_name default_single_query = { "bool": { "must": [ {"vector...
webqq_client.py
# -*- coding: utf-8 -*- """ 用于内嵌到其他程序中,为其他程序添加发送到qq功能 参数格式: _参数名_=_{{{{参数内容}}}}_ 发送方式允许任意基于tcp的方式,如http等(比如说出现在url中、post表单中、http头、cookies、UA中) 本py使用的发送方式是urt-8的raw socket数据 参数名、内容、标示符_={} 都允许不编码(gbk/utf-8)或urlencode 只要发送的数据中出现上述格式的串,即会被解析 一个例子: 若想要发送一条信息'hello world'到QQ 345678901 (假设webqq消息服务器是127.0.0.1 端口为默认的34567...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Running" def run(): app.run(host='0.0.0.0', port=8000) def keep_alive(): t = Thread(target=run) t.start()
test_poplib.py
"""Test script for poplib module.""" # Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL # a real test suite import poplib import asyncore import asynchat import socket import os import time import errno from unittest import TestCase, skipUnless from test import support as test_support threading ...
BotClass.py
import datetime import tweepy import json import os import threading import time from time import sleep print_lock = threading.Lock() class authorization: def __init__(self, Consumer_key, Consumer_secret, Access_token, Access_secret): self.consumer_key = Consumer_key self.consumer_sec...
mumbleBot.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import threading import time import sys import math import signal import configparser import audioop import subprocess as sp import argparse import os import os.path import pymumble_py3 as pymumble import pymumble_py3.constants import variables as var import logging impor...
beakerx_server.py
# Copyright 2018 TWO SIGMA OPEN SOURCE, LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agre...
test_basic.py
# -*- coding: utf-8 -*- """ tests.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: © 2010 by the Pallets team. :license: BSD, see LICENSE for more details. """ import re import time import uuid from datetime import datetime from threading import Thread import pytest import werkze...
play.py
import os import time import sys from multiprocessing import Process import subprocess from flask import Flask, jsonify from flask_restful import Resource, Api, reqparse app = Flask(__name__) api = Api(app) class VideoStream(Resource): ''' REST API class for creation/deletion of video stream on a (part of the...
web_server.py
import Utils, time, cgi, web_pages, json, threading, hashlib u = Utils.Utils() seconds_between_updates = "2" if u.dev_env: seconds_between_updates = "20" def application(env, start_response): ########################## Preprations ########################## if not u.init_successful: start_response...
urls.py
# ***************************************************************************** # # Copyright (c) 2020, the pyEX authors. # # This file is part of the pyEX library, distributed under the terms of # the Apache License 2.0. The full license can be found in the LICENSE file. # from __future__ import print_function impor...
train_multi.py
#!/usr/bin/env python """ Multi-GPU training """ import argparse 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 def main(opt, train_type): """ Spawns 1 process per GPU """ ...
util.py
import math import cv2 import tensorflow as tf import os import sys ''' output states: 0: has rewards? 1: stopped? 2: num steps 3: ''' STATE_REWARD_DIM = 0 STATE_STOPPED_DIM = 1 STATE_STEP_DIM = 2 STATE_DROPOUT_BEGIN = 3 def get_expert_file_path(expert): expert_path = 'data/artists/fk_%s/' % expert ...
lepton.py
# lepton 3.5 purethermal camera dll imports # the proper folder and file are defined by the __init__ file from Lepton import CCI from IR16Filters import IR16Capture, NewBytesFrameEvent # python useful packages from datetime import datetime from typing import Tuple from scipy import ndimage import PySide2.QtWi...
app.py
from tkinter import * from tkinter.ttk import Combobox import tkinter.messagebox import whois import subprocess import threading import socket class Googles: def __init__(self,root): self.root=root self.root.title("Domain Search") self.root.geometry("500x400") self.root.iconbitma...
utils.py
from collections import namedtuple import asyncio import os import sys import signal import operator import uuid from functools import reduce from weakref import ref, WeakKeyDictionary import types import inspect from inspect import Parameter, Signature import itertools import abc from collections.abc import Iterable i...
test_memory.py
import ctypes import gc import pickle import threading import unittest import fastrlock import pytest import cupy.cuda from cupy.cuda import device from cupy.cuda import memory from cupy.cuda import stream as stream_module from cupy import testing class MockMemory(memory.Memory): cur_ptr = 1 def __init__(s...
server.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import logging import tornado.web import tornado.websocket from tornado.ioloop import IOLoop, PeriodicCallback import Queue import sys import threading import time import json import argparse #from types import * global args global q q_channels = {} wsMapingChannel = ...
test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import Queue import time import sys import os import gc import signal import array import socket import random import logging import errno import weakref import test.script_helper from test import test_support from StringIO import StringIO _multiprocessi...
url_info_finder.py
#this plugin searches for url links in each message, and sends a message with #info about each link. import re import urllib2 from cookielib import CookieJar import lxml.html import simplejson import logging import settings import threading class url_info_finder(): def url_info_finder(self, main_ref, msg_in...
backups.py
# Copyright (C) 2018-2019 Amano Team <contact@amanoteam.ml> # -*- coding: utf-8 -*- #███╗ ███╗ █████╗ ███╗ ██╗██╗ ██████╗ ██████╗ ███╗ ███╗██╗ ██████╗ #████╗ ████║██╔══██╗████╗ ██║██║██╔════╝██╔═══██╗████╗ ████║██║██╔═══██╗ #██╔████╔██║███████║██╔██╗ ██║██║██║ ██║ ██║██╔████╔██║██║██║ ██║ #██║╚██╔╝██║██╔...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-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. """Test multiwallet. Verify that a mericad node can load multiple wallet files """ from decimal import De...
serial_connection.py
from logging import getLogger import pathlib import platform import sys import threading import time from textwrap import dedent from thonny.plugins.micropython.bare_metal_backend import ( NORMAL_PROMPT, FIRST_RAW_PROMPT, OUTPUT_ENQ, OUTPUT_ACK, ) from thonny.common import ConnectionFailedException fro...
test.py
import os.path as p import random import threading import time import pytest from random import randrange import pika from sys import getdefaultencoding from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV from helpers.client import QueryRuntimeException from helpers.network import Partiti...
mesos.py
#!/usr/bin/env python3 """ DMLC submission script by mesos One need to make sure all slaves machines are ssh-able. """ from __future__ import absolute_import import os import sys import json import uuid import logging from threading import Thread from . import tracker try: import pymesos.subprocess logging.ge...
SearchEngine.py
from ScienceSearcher.DownloadClient import DownloadClient from ScienceSearcher.ESClient import ESClient from time import sleep import threading import os import re class SearchEngine: def __init__(self, download_server_ip, download_server_port, download_client_ip, download_client_port, es_ip, es_...
get_video.py
import json import threading import cv2 import PySimpleGUI as sg import trt_pose.coco import trt_pose.models from flask import Flask from flask_restful import Api, Resource from trt_pose.parse_objects import ParseObjects from camera import Camera from exercise import LeftBicepCurl, RightBicepCurl, Shoulde...
scale_config.py
#python scale_v3.py --api_server_ip '10.204.216.64' --keystone_ip '10.204.216.150' --n_vns 10 --vnc --cleanup --n_process 2 #python scale_v3.py --api_server_ip '10.204.216.64' --keystone_ip '10.204.216.150' --n_policies 5 --n_policy_rules 2 --vnc --cleanup --n_process 2 #python scale_v3.py --api_server_ip '10.204.216....
b2.py
import json import time from requests import get, post from requests.auth import HTTPBasicAuth from threading import Thread from typing import Callable, Dict, List, Tuple from b2py import constants, utils class B2Error(Exception): """General exception type when interacting with the B2 API.""" pass class B2: ...
can_bridge.py
#!/usr/bin/env python3 #pylint: skip-file import os import time #import math #import atexit #import numpy as np #import threading #import random import cereal.messaging as messaging #import argparse from common.params import Params from common.realtime import Ratekeeper from selfdrive.golden.can import can_function, se...
axonwebsocket.py
import logging import time import json import datetime from threading import Thread from websocket import WebSocketApp logger = logging.getLogger(__name__) class AxonWebsocket: """ A simple to use python wrapper for automatic trading based on Axon's websocket. Enhance your trading decisions by leveragin...
utils.py
# -*- coding: utf-8 -*- from __future__ import division import os import sys import socket import signal import functools import atexit import tempfile from subprocess import Popen, PIPE, STDOUT from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue import Queue, Empty f...
get-panw-interfaces.py
#!/usr/bin/env python3.8 ''' Remove nargs='*' from firewalls arg and split to make compatible with Golang calls and Comment out stdin.isatty() code block Print header to sys.stdout Add blank line in between firewalls (line 192) ''' '''Get firewall interfaces get-panw-interfaces.py Author: David Cruz (da...
main.py
import numpy as np import os import tensorflow as tf import gym import multiprocessing from src.networks.ac_network import AC_Network from src.worker import Worker import threading from time import sleep import shutil from gym.envs.box2d import LunarLanderContinuous max_global_steps = 200000 max_episode_length = 20 ga...
meter.py
#-*- coding: UTF-8 -*- #!/usr/bin/env python from pathlib import Path cur_file_path = Path(__file__).absolute() workdir = Path(cur_file_path).parent.parent import argparse import configparser import cv2 import numpy as np import os import signal import threading from gevent import monkey from gevent....
lyr_fillin.py
#!/usr/bin/python import pxlBuffer as pxb import random from time import sleep import time def wheel(pos, brightness): """Generate rainbow colors across 0-255 positions.""" if pos < 85: return pxb.Color(pos * 3 * brightness, (255 - pos * 3) * brightness, 0) elif pos < 170: ...
client.py
# -*- coding: utf-8 -*- # # Cloud Robotics FX クライアント # # @author: Hiroki Wakabayashi <hiroki.wakabayashi@jbs.com> # @version: 0.0.1 import os import time, datetime import json import urllib import ssl import base64 import hashlib, hmac from threading import Thread,Lock import logging import paho.mqtt.client as mqtt fr...
test_path_utils.py
# -*- coding: utf-8 -*- u""" Copyright 2018 Telefónica Investigación y Desarrollo, S.A.U. This file is part of Toolium. 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/lic...
presentation.py
#!/usr/bin/env python3 import os import shutil import time import cairosvg import validators import wget import urllib import threading from PyPDF2 import PdfFileMerger def download_and_convert(url: str, i: int, out: str): try: wget.download('{}/svg/{}'.format(url, i), out='{}/{}/'.format(out, 'svg')) ...
cache_agent.py
import logging import threading import time import datetime #import gdrivefs.report import gdrivefs.state from gdrivefs.conf import Conf from gdrivefs.cache_registry import CacheRegistry, CacheFault _logger = logging.getLogger(__name__) _logger.setLevel(logging.INFO) class CacheAgent(object): """A particular ...
upgrade_tests_collections.py
from .newupgradebasetest import NewUpgradeBaseTest import queue import copy import threading from random import randint from remote.remote_util import RemoteMachineShellConnection from couchbase_helper.tuq_helper import N1QLHelper from pytests.eventing.eventing_helper import EventingHelper from eventing.eventing_base i...
websocket_unittest.py
# Copyright 2013 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from __future__ import absolute_import import base64 import hashlib import socket import threading import unittest import six import six.moves.BaseHTTPServe...
api.py
"""Remotely control your Coinbase Pro account via their API""" import re import json import hmac import hashlib import time import requests import base64 import sys import pandas as pd from numpy import floor from datetime import datetime, timedelta from requests.auth import AuthBase from requests import Request from ...
global_handle.py
#!/usr/bin/python3 ''' (C) Copyright 2018-2022 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' import ctypes import traceback from multiprocessing import sharedctypes from avocado import fail_on from apricot import TestWithServers from pydaos.raw import DaosPool, DaosContainer, DaosApiError, I...
api.py
""" API ====== """ import zipfile try: import queue except ImportError: import Queue as queue import threading import datetime import math import requests import mimetypes import os import re try: from urllib.parse import urlunparse, urlencode, urlparse, parse_qs except ImportError: from urllib import ...
Linkedin DL.py
"""MIT License Copyright (c) 2019 Zdravko Georgiev 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, publis...
naccessWithComplexPDBFileGenerator_Socket.py
################# ## Created by Engin Cukuroglu ################# import multiprocessing from codesOfTools import interfaceNameSorter, naccessRSAFileReaderReturnOnlyAbsASADictionary from multiprocessing import Queue, Process import os, sys, time import subprocess import tempfile import socket def generateComplexPDBFi...
client.py
import argparse import base64 import io import json import os import re import time import wave import zlib from threading import Lock, Thread from tkinter import * from tkinter.ttk import * import PIL.ImageTk as itk import pyaudio import pyttsx3 import requests import speech_recognition as sr from manage_audio impor...
nns.py
import os,sys,socket,re from time import sleep from threading import Thread,Lock from queue import Queue socket.setdefaulttimeout(5) # read file def readpath2dict(filename): with open(filename, 'r') as file: c = file.read() lines=re.split('\r?\n',c) res={} minlengthdict={1:0} ...
scanrun.py
""" scanrun.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 ...
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...
mock_distribute.py
# Copyright 2019 The Keras Tuner Authors # # 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...
dppo_cont_gae_dist_gpu.py
""" Distributed Proximal Policy Optimization (Distributed PPO or DPPO) continuous version implementation with distributed Tensorflow and Python’s multiprocessing package. This implementation uses normalized running rewards with GAE. The code is tested with Gym’s continuous action space environment, Pendulum-v0 on Colab...
oauth.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import time import uuid import string import codecs import logging import threading # pylint: disable=import-error from six.moves.urllib.parse import urlparse, parse_qs from six.moves.BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer fr...
modis_processing.py
# -*- coding: utf-8 -*- import logging import shutil from datetime import datetime, timedelta from multiprocessing import Process, Queue from time import sleep from configuration import ( data_dir, download_file, env_bin, output_dir, processed_file, temporary_dir, ) from wildfires.data.mosaic_...
_parallelize.py
"""Module used to parallelize model fitting.""" from typing import Any, Union, Callable, Optional, Sequence import joblib as jl from threading import Thread from multiprocessing import Manager from cellrank.ul._utils import _get_n_cores import numpy as np from scipy.sparse import issparse, spmatrix def paralleliz...
gym_gazeboros.py
#!/usr/bin/env python from datetime import datetime import copy import traceback import os, subprocess, time, signal #from cv_bridge import CvBridge import gym import math import random # u import numpy as np import cv2 as cv import rospy # Brings in the SimpleActionClient import actionlib # Brings in the .actio...
TransformServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestError from os imp...
PeerToPeer.py
import socket import threading from .Worker import Worker from ..Diagnostics.Debugging import Console from .Commands import Commands import time class PeerToPeer: def __init__(self, listenerSock): self.TalkerAddr = (0,0) self.ListenerAddr = (0,0) self.TalkerSock = socket.socket(socket...
amqp.py
# --coding:utf-8-- # Copyright (c) 2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable l...
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...
cross_barrier.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from byteps.torch.compression import Compression from byteps.torch.ops import push_pull_async_inplace as byteps_push_pull from byteps.torch.ops import poll, synchronize from byteps.torch.ops import init, shutdo...
CAM_CANoe.py
# -*- coding:utf-8 -*- import threading from time import sleep import cv2 import numpy as np import traceback import socketserver from datetime import datetime import os from pylab import array, plot, show, axis, arange, figure, uint8 def image_process(image, level=12): # image = cv2.cvtColor(image, cv2.COLOR_BGR2...
common.py
# -*- coding: utf-8 -*- import json, subprocess, threading, sys, platform, os PY3 = sys.version_info[0] == 3 JsonLoads = PY3 and json.loads or (lambda s: encJson(json.loads(s))) JsonDumps = json.dumps def STR2BYTES(s): return s.encode('utf8') if PY3 else s def BYTES2STR(b): return b.decode('utf8') if PY3 e...
data_interface.py
import importlib import os import shutil import yaml from abc import ABC, abstractmethod from pathlib import Path from queue import Queue from threading import Thread from jigsaw import models class LabeledImage(ABC): def __init__(self, image_id): self.image_id = image_id @classmethod @abstract...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading from collections impo...
callback_test.py
import threading import time from queue import Empty import multiprocessing import cv2 class test: def __init__(self): self.callbacks = [] def start(self): self.queue = multiprocessing.Queue() self.t = threading.Thread(target=self.deamon) self.t.setDaemon(True) self....
tensorflow serv.py
# # Server in Python # Binds REP socket to tcp://*:3001 # Expects input from client to reply with something # import time import zmq import numpy as np import pandas as pd import math import os import sys import json os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' # Keras stuff from keras.models import Sequential from...
csharpserver.py
from __future__ import print_function import os from empire.server.common.plugins import Plugin import empire.server.common.helpers as helpers import subprocess import time import socket import base64 class Plugin(Plugin): description = "Empire C# server plugin." def onLoad(self): print(helpers.co...
build.py
# Copyright 2014 The Oppia 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 applicable ...
utils.py
# Copyright 2012-present MongoDB, 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 wri...
grid.py
""" Codes to submit multiple jobs to JCVI grid engine """ from __future__ import print_function import os.path as op import sys import re import logging from multiprocessing import Pool, Process, Queue, cpu_count from jcvi.formats.base import write_file, must_open from jcvi.apps.base import ( OptionParser, A...
run_parallel.py
from multiprocessing import Process, Event, Queue, JoinableQueue import multiprocessing import tqdm import dill import numpy as np import csaf.system as csys import csaf.config as cconf import csaf.trace as ctc from csaf import csaf_logger def save_states_to_file(filename, states): np.savetxt(filename, [val['plan...
camera.py
"""camera.py This code implements the Camera class, which encapsulates code to handle IP CAM, USB webcam or the Jetson onboard camera. In addition, this Camera class is further extended to take a video file or an image file as input. """ import logging import threading import subprocess import numpy as np import c...
object_storage_service_benchmark.py
# Copyright 2016 PerfKitBenchmarker Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
sendImg.py
import time, pickle, requests, threading from picamera import PiCamera from picamera.array import PiRGBArray class sendImg: def __init__(self): self.count = 0 # camera initialisation self.camera = PiCamera() self.camera.exposure_mode = "sports" self.camera.resolution = (640, 480) self.output...
monitors.py
""" Common threading utils for anchore engine services. """ import time import threading from anchore_engine.subsys import logger # generic monitor_func implementation click = 0 running = False last_run = 0 monitor_thread = None def default_monitor_func(**kwargs): """ Generic monitor thread function for in...
test_autograd.py
# Owner(s): ["module: autograd"] import contextlib import gc import io import math import os import random import sys import tempfile import threading import time import unittest import uuid import warnings import operator import subprocess from copy import deepcopy from collections import OrderedDict from itertools i...
rotation_calc_addon.py
# this file defines the addon that the user uses to control the rotation calculator in the veiwport import bpy from bpy.props import IntProperty, FloatProperty, StringProperty, BoolProperty, EnumProperty from math import pi from time import sleep from mathutils import Matrix import threading import os import pip # pyt...
epi_serial.py
''' epi_serial.py is part of the micro:bit epidemic project. It handles communication between the management GUI, and the master micro:bit via the serial port. The MIT License (MIT) Copyright (c) 2019 Wes Hinsley MRC Centre for Global Infectious Disease Analysis Department of Infectious Disease Epidemiology Imperial ...
relay_integration.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 u...
__init__.py
#!/usr/bin/python3 import argparse import logging import multiprocessing.dummy as mp import os import shutil import sys from ctypes import c_bool from multiprocessing.context import TimeoutError from time import sleep import tbf.testcase_converter as testcase_converter import tbf.tools.afl as afl import tbf.tools.cpa...
parallel.py
#!/usr/bin/env python # coding=utf-8 """ Utility functions for easy parallel processing, thanks go to: http://stackoverflow.com/a/5792404/1467943 """ from multiprocessing import Process, Pipe from itertools import izip def spawn(f): def fun(pipe,x): pipe.send(f(x)) pipe.close() return fu...
start_capture.py
""" Copyright (c) 2019 Cisco and/or its affiliates. This software is licensed to you under the terms of the Cisco Sample Code License, Version 1.0 (the "License"). You may obtain a copy of the License at https://developer.cisco.com/docs/licenses All use of the material herein must be in accordance with t...
composed_writer.py
#!/usr/bin/env python3 import logging import sys import threading from os.path import dirname, realpath sys.path.append(dirname(dirname(dirname(realpath(__file__))))) from logger.writers.writer import Writer # noqa: E402 from logger.utils import formats # noqa: E402 class ComposedWriter(Writer): ############...
locking.py
#!/usr/bin/env python # ===- system_tests/locking/locking.py ------------------------------------===// # * _ _ _ * # * | | ___ ___| | _(_)_ __ __ _ * # * | |/ _ \ / __| |/ / | '_ \ / _` | * # * | | (_) | (__| <| | | | | (_| | * # * |_|\___/ \___|_|\_\_|_| |_|\__, | * # * ...
test_storange_and_inference_scp.py
# Copyright (C) 2020 Matthew Cooper # 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 writi...
test_preload.py
import time import pytest import threading from unittest.mock import Mock from irrd.rpki.status import RPKIStatus from irrd.utils.test_utils import flatten_mock_calls from ..database_handler import DatabaseHandler from ..preload import Preloader, PreloadStoreManager, PreloadUpdater, REDIS_KEY_ORIGIN_SOURCE_SEPARATOR ...
main.py
################################################################################## # # # Copyright (c) 2020 AECgeeks # # ...
forecast.py
# Copyright (C) 2013-2016 Martin Vejmelka, UC Denver # # 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, mer...
traceroute.py
#!/usr/bin/env python3 import socket import struct import icmplib import threading R = '\033[31m' # red G = '\033[32m' # green C = '\033[36m' # cyan W = '\033[0m' # white Y = '\033[33m' # yellow def icmp_trace(ip, tr_tout, output, collect): result = icmplib.traceroute(ip, count=1, interval=0.05, timeout=tr_tout, i...
pyport.py
'''Author = Yatin Kalra Website : yatinkalra.github.io Github : www.github.com/yatinkalra ''' from queue import Queue import socket, threading, sys from datetime import datetime t1 = datetime.now() print("-" * 60) print(" ___ ___ _ ") print(" / _ \_ _ / _ \_...
runOnLinux.py
#!/usr/bin/env python """This script is used by ../../runOnLinux - It can be used for debugging by running a terminal-like interface with the FPGA - And it can be used for running a program (or more) above linux on FPGA """ import threading import warnings import re from test_gfe_unittest import * class BaseGfeForLin...
helpers.py
""" Helper functions file for OCS QE """ import logging import re import datetime import statistics import os from subprocess import TimeoutExpired, run, PIPE import tempfile import time import yaml import threading from ocs_ci.ocs.ocp import OCP from uuid import uuid4 from ocs_ci.ocs.exceptions import ( TimeoutE...
test_imperative_signal_handler.py
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
helper.py
from pathlib import Path import sys import time import threading import itertools import re from texttable import Texttable from termcolor import colored class Logger: show_warnings = True @classmethod def error(cls, text): Logger.print(text, "ERROR:", "red") @classmethod def clear(cls)...
__init__.py
import builtins import contextlib import errno import glob import importlib.util from importlib._bootstrap_external import _get_sourcefile import marshal import os import py_compile import random import shutil import stat import subprocess import sys import textwrap import threading import time import unittest from uni...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.support import sys, io, os import struct import subprocess import textwrap class SysModuleTest(unittest.TestCase): def setUp(self): self.orig_stdout = sys.stdout self.orig_stderr = sys.stderr self.orig_displayhook = sys.displayhook de...