source
stringlengths
3
86
python
stringlengths
75
1.04M
manager.py
#!/usr/bin/env python3 import os import time import sys import fcntl import errno import signal import shutil import subprocess import datetime import textwrap from typing import Dict, List from selfdrive.swaglog import cloudlog, add_logentries_handler from common.basedir import BASEDIR from common.hardware import HA...
3.thread competetion with lock.py
import time, threading # 假定这是你的银行存款: balance = 0 lock = threading.Lock() def change_it(n): # 先存后取,结果应该为0: global balance balance = balance + n balance = balance - n def run_thread(n): for i in range(2000000): try: lock.acquire() change_it(n) finally: ...
usage_statistics.py
import atexit import copy import datetime import enum import json import logging import platform import signal import sys import threading import time from functools import wraps from queue import Queue from typing import Optional import jsonschema import requests from great_expectations import __version__ as ge_vers...
go.py
#!/usr/bin/python # -*- coding:utf-8 -*- import time import threading import os import RPi.GPIO as GPIO from pn532 import * # a path to my processing sketch which generate random graphic for screen in standby mode # comment line 160 to prevent errors :) # runSketch = '/home/pi/bin/random_person.sh' import subprocess ...
custom-datablock.py
#!/usr/bin/env python ''' Pymodbus Server With Custom Datablock Side Effect -------------------------------------------------------------------------- This is an example of performing custom logic after a value has been written to the datastore. ''' #--------------------------------------------------------------------...
invocation.py
# Copyright 2012 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Classes and Methods related to invoking a test.""" import logging import os import pickle import signal import sys import tempfile import threading im...
cli.py
# -*- coding: utf-8 -*- from __future__ import print_function import click import copy from functools import wraps import glob import io import json import logging import netrc import os import random import re import requests import shlex import signal import socket import stat import subprocess import sys import tex...
tc_utility_action.py
import io import os import re import time import threading import subprocess from ite.multi_logger import print_runner_output, show_exeception, print_to_file class TcUtilityAction: def __init__(self, dynamic_runner): self.dynamic_runner = dynamic_runner def common_tc_pre_action(self, binary_name, co...
server.py
from flask import Flask, render_template, request, jsonify from gevent.pywsgi import WSGIServer from requests import get from random import choice import sys import json import pafy import subprocess import os import threading app = Flask(__name__) current = None queue = [] now = 'files/Nothing currently playing.mp3' ...
syncobj.py
import time import random import os import sys import threading import weakref import collections import functools import struct import logging import copy import types try: import Queue is_py3 = False def iteritems(v): return v.iteritems() except ImportError: # python3 import queue as Queue ...
script.py
import sys import getopt import json from kapacitor.udf.agent import Agent, Handler, Server from kapacitor.udf import udf_pb2 import signal import logging import re from flask import Flask, request, jsonify import requests from threading import Lock, Thread logging.basicConfig(level=logging.DEBUG, format='%(asctime)s ...
test_gtp_wrapper.py
import unittest from AlphaGo import go from multiprocessing import Process from interface.gtp_wrapper import run_gtp class PassPlayer(object): def get_move(self, state): return go.PASS class mystd_simulator(): def mystdin_simulator(): return "\n".join([ "1 name", ...
remote_doc.py
import copy import time from enum import Enum from logging import getLogger from threading import Thread, Condition, Semaphore from typing import * from ..typing_ import * from .misc import deep_copy __all__ = [ 'RemoteUpdateMode', 'RemoteDoc', ] def merge_updates(target: DocumentType, *source...
lab12_h.py
from sys import setrecursionlimit import threading setrecursionlimit(10 ** 9) threading.stack_size(3 * 67108864) def main(): #time O(n^2) n = int(input()) seq = ''.join([str(elem) for elem in list(map(int, input().split()))]) #number of palindromic subseq matrix = [[0 for _ in range(n + 2)] for i in ra...
terminal_integrated.py
from __future__ import annotations from .typecheck import * from .console_view import ConsoleView from .typecheck import * from .import core import threading import re import sublime class TerminalIntegrated: def __init__(self, window: sublime.Window, name: str, command: list[str], cwd: str|None): cwd = cwd or ...
nn.py
# coding=utf-8 # # Yu Wang (University of Yamanashi) # Mar,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 applic...
threading_join.py
import threading import time lock = threading.Lock() # join 用法 def runner(i, p1, p2, p3="benzi", p4="BMW", **kwargs): """ :return: """ count = 0 print("线程{} param1:====".format(i), p1) print("线程{} param2:====".format(i), p2) print("线程{} param3:====".format(i), p3) print("线程{} param3:=...
QueueProcess.py
#!/usr/bin/evn python # -*- coding: utf-8 -*- # python version 2.7.6 import time import random from multiprocessing import Process, Queue, JoinableQueue, cpu_count """ Adjust time.sleep() values to see action of consumer """ def work(id, jobs, result): while True: task = jobs.get() if task is Non...
data_service_ops_ft_test.py
# Copyright 2020 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...
halEmu.py
#!/usr/bin/env python3 # dummy lib """ library to emulate esp8266 hardware for micropython on a PC with python3 uncomplete 2022 by lifesim.de """ import machine import tkinter as tk import time import threading # consts __version__ = "0.1.0.0" #self for one instace obj = None # classes class Pin: """pin emulator...
analyse.py
import json import re import threading import timeit import urllib.request, urllib.error, urllib.parse from time import gmtime, strftime import RSS_URL import requests from SA_Scrape import getSaURL from newspaper import Article from vaderSentiment import vaderSentiment ##################################...
3-processes.py
from multiprocessing import Process import time ####### SINGLE PROCESS def ask_user(): start = time.time() user_input = input('Enter your name: ') greet = f'Hello, {user_input}' print(greet) print('ask_user: ', time.time() - start) def complex_calculation(): print('Started calculating...') start...
ThreadCommand.py
import threading import queue from deepleaps.app.app import SingletoneInstance from multiprocessing import Queue, Process import time class ProcessWrapper(object): def __init__(self, func, worker_num=8): self.queue = Queue() self.worker_num = worker_num self.processes = [Process(target=func...
yunbi.py
from befh.restful_api_socket import RESTfulApiSocket from befh.exchanges.gateway import ExchangeGateway from befh.market_data import L2Depth, Trade from befh.util import Logger from befh.instrument import Instrument from befh.clients.sql_template import SqlClientTemplate from functools import partial from datetime impo...
test_content.py
from __future__ import print_function import logging import os import re import sys import json import time import argparse import threading import subprocess from time import sleep import datetime from distutils.version import LooseVersion from typing import Union, Any import pytz from google.cloud import storage f...
worker.py
import ctypes import logging import math import random import sys import threading import time import traceback from .api import Job, ConcurrencyError, RetriableError __all__ = [ 'ResourceManager', 'BasicResourceManager', 'InterruptJob', 'Worker', 'JobChannel' ] class InterruptJob(Exception): pass cl...
github.py
import copy import json import re import threading import time from urllib.request import urlopen from i3pystatus import IntervalModule, formatp from i3pystatus.core import ConfigError from i3pystatus.core.desktop import DesktopNotification from i3pystatus.core.util import user_open, internet, require try: import...
session_test.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...
vhSockets.py
# Websocket handler from socketIO_client_nexus import SocketIO, LoggingNamespace import threading, json, math import numbers, decimal def dummyOnConnection(): print("onConnection not overwritten") class vhSockets: devices = [] connected = False win = False socketIO = None #bindable events ...
websocket.py
import asyncio import json import logging import os from threading import ( Thread, ) import websockets from vns_web3.providers.base import ( JSONBaseProvider, ) def _start_event_loop(loop): asyncio.set_event_loop(loop) loop.run_forever() loop.close() def _get_threaded_loop(): new_loop = a...
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...
ng.py
#!/usr/bin/env python # # Copyright 2004-2015, Martian Software, Inc. # Copyright 2017-Present Facebook, 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/license...
sensor_interface.py
import copy import logging import numpy as np import time from threading import Thread import carla def threaded(fn): def wrapper(*args, **kwargs): thread = Thread(target=fn, args=args, kwargs=kwargs) thread.setDaemon(True) thread.start() return thread return wrapper class ...
engine.py
# encoding: UTF-8 # 算法引擎的代理 from vnpy.amqp.consumer import worker, rpc_server, pika import json, os, random import traceback import logging from threading import Thread from datetime import datetime from vnpy.event import Event, EventEngine from vnpy.trader.event import EVENT_LOG, EVENT_TIMER from vnpy.trader.consta...
lisp-etr.py
#----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # 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 ...
train-stable-bd.py
import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = "2" import wandb import sys import multiprocessing import collections import random import warnings import numpy as np import tensorflow as tf from tensorflow.keras.utils import to_categorical from tensorflow.keras.preprocessing import sequence from tensorflow.keras.mode...
game_ver2.py
import pygame from random import * from turtle import* import time #import led_display as led #import threading pygame.init() Pixel = 30 win = pygame.display.set_mode((32*Pixel, 16*Pixel)) X = 3 * Pixel Y = 16 * Pixel - Pixel vel_x = 10 vel_y = 10 jump = False Eaten_Box = set() eaten_color = 0 BLA...
PrefetchingIter.py
# -------------------------------------------------------- # Deep Feature Flow # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by Yuwen Xiong # -------------------------------------------------------- # Based on: # MX-RCNN # Copyright (c) 2016 by Contributors # Licen...
build_tfrecord.py
import os import math import threading from random import shuffle import tensorflow as tf FLAGS = tf.app.flags.FLAGS tf.app.flags.DEFINE_string('image_dir', '/data2/nfs_share/loktarxiao/microscope_images_classificaiton/datasets/mix_up', 'directory path to raw image files') tf.app.flags.DEFI...
future_test.py
import logging import threading import time from concurrent.futures import Future def thread_function(name, ft): tid = threading.get_ident() logging.info("Thread %s <%s>: starting", name, tid) time.sleep(3) ft.set_result(3) logging.info("Thread %s <%s>: finishing", name, tid) def callback(ft): ...
siap_jadwal.py
from module import kelas from lib import wa, reply from email import encoders from email.mime.base import MIMEBase from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from fpdf import FPDF from selenium.common.exceptions import NoSuchElementException from selenium.webdriver.support.ui im...
undertaker.py
# -*- coding: utf-8 -*- # Copyright 2013-2020 CERN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2019 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 bitcoind node can load multiple wallet files """ from threading import...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread from threading import Lock as Locking # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 ...
kinect2grasp_python2.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author : Hongzhuo Liang # E-mail : liang@informatik.uni-hamburg.de # Description: # Date : 05/08/2018 6:04 PM # File Name : kinect2grasp_python2.py # Note: this file is written in Python2 import torch import rospy from sensor_msgs.msg import PointCloud2 fr...
content_bruter.py
#!/usr/bin/env python3 import argparse import os import psutil import queue import requests import threading ''' IANAL but: At the time of writing, this website allows testing tools and manual hacking against this intentionally vulnerable app. It is your responsibility to use this code only for good. It is your res...
neuroScanToolbox.py
import time import struct import socket import threading import numpy as np from .BCIDecoder import generate_simulation_data from . import logger simulationMode = True maxLength = 3600 # Seconds class SimulationDataGenerator(object): ''' Generate simulation data ''' def __init__(self): ...
python_test03.py
#!env python # -*- coding: utf-8 -*- """ Python test 03: Detect local mounted disk (make sure it is local) with at least X MB free space, create Z files of size Y, run Z "dd" processes which where each process will fill selected file with Data and print time took to complete the work. """ # This is free and unencumb...
frontendcomm.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ In addition to the remote_call mechanism implemented in CommBase: - Implements _wait_reply, so blocking calls can be made. """ import pickle import socket impor...
sopare.py
import os from multiprocessing import Process import json from ..ast import AST import logging import yaml logger = logging.getLogger(__name__) import socket import subprocess import threading #TODO add udp listener middleware for both keras and sopare? def udp_listen(q, UDP_IP, UDP_PORT): sock = socket.socket(s...
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...
__main__.py
##################################################################### # # # /main.pyw # # # # Copyright 2014, Monash University ...
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_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 u...
camerafeed.py
# -*- coding: utf-8 -*- """Camera Feed This Module is used for grabbing frames from RTSP streams All Args are set using Environment variables. Args: REDIS_SERVICE_HOST: The IP of the Redis server (set automatically through k8s) REDIS_SERVICE_PORT: The port Redis is running on (set automatically through k8s) ...
bazelci.py
#!/usr/bin/env python3 # # Copyright 2018 The Bazel 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 ...
Connection.py
#### Filename: Connection.py #### Version: v1.0 #### Author: Marie Jankujova #### Date: March 4, 2019 #### Description: Connect to database and get atalaia dataframe. import psycopg2 import sys import os import pandas as pd import logging from configparser import ConfigParser from resqdb.CheckData import CheckData imp...
oepoll.py
# -*- coding: utf-8 -*- from .client import LINE from types import * import os, sys, threading, time class OEPoll(object): OpInterrupt = {} client = None __squareSubId = {} __squareSyncToken = {} def __init__(self, client): if type(client) is not LINE: raise Exception("You nee...
test_backfill_job.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...
labours.py
#!/usr/bin/env python3 import argparse from collections import defaultdict, namedtuple from datetime import datetime, timedelta from importlib import import_module import io from itertools import chain import json import os import re import shutil import subprocess import sys import tempfile import threading import tim...
metrics_manager.py
from __future__ import division import logging from time import time, sleep from threading import Thread from multiprocessing import Process import os from os import kill, getpid import traceback from sys import version_info import os.path from ast import literal_eval from timeit import default_timer as timer # @added...
server.py
import socket import threading # Connection Data host = '127.0.0.1' port = 55555 # Starting Server server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((host, port)) server.listen() # Lists For Clients and Their Nicknames clients = [] nicknames = [] # Sending Messages To All Connec...
server.py
#!/usr/bin/env python3 import tornado.ioloop import tornado.web from tornado.escape import json_decode from multiprocessing import Process, Queue import json import notes from scanners import * from scrapers import * from results import * import re from os.path import join import collections import ipaddress from log i...
sayhi.py
#!/usr/bin/env python #-*- coding:utf-8 -*- """ module to say hi """ import os import time import threading def handler(event, context): """ function handler """ if 'i' in event: if event['i'] > 10: return None if 't' in event: time.sleep(event['t']) event['sl...
regrtest.py
#! /usr/bin/python3.2 """ Usage: python -m test [options] [test_name1 [test_name2 ...]] python path/to/Lib/test/regrtest.py [options] [test_name1 [test_name2 ...]] If no arguments or options are provided, finds all files matching the pattern "test_*" in the Lib/test subdirectory and runs them in alphabetical order ...
deploy.py
import argparse import sys import threading import subprocess import time from typing import Callable, Tuple, List, Optional, Any import os from kubernetes import config def print_to_output(verbose: int, out: str): if verbose < 2: return print(out) def uninstall_release(verbose: int): print_to_o...
test_generic_controller.py
# Copyright (c) 2017 LSD - UFCG. # # 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...
main.py
from datetime import datetime from http.server import BaseHTTPRequestHandler from http.server import HTTPServer from threading import Event from threading import Thread from time import sleep from analysis import Analysis from logs import Logs from trading import Trading from twitter import Twitter # Whether to send ...
daemon.py
from concurrent.futures import ThreadPoolExecutor import logging import queue as local_queue import threading import time from kombu import Queue as KombuQueue from kombu.mixins import ConsumerMixin from raven.contrib.django.raven_compat.models import client from share.search.exceptions import DaemonSetupError, Daem...
Dh.py
# -*- coding: utf-8 -*- import Adhi from Adhi.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen import r...
main.py
from comet_ml import Experiment from Common import get_params, Logger, Worker, Play from torch.multiprocessing import Process, Pipe import numpy as np from Brain.brain import Brain from nes_py.wrappers import JoypadSpace import gym_super_mario_bros from gym_super_mario_bros.actions import SIMPLE_MOVEMENT from tqdm impo...
zuul_google_storage_upload.py
#!/usr/bin/env python3 # # Copyright 2014 Rackspace Australia # Copyright 2018-2019 Red Hat, Inc # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0...
run_bk.py
from mylib import config, thread from mylib.yolo import YOLO #from mylib.mailer import Mailer from mylib.detection import detect_people from imutils.video import VideoStream, FPS from scipy.spatial import distance as dist import numpy as np import argparse, cv2, os, time , imutils import matplotlib.pyplot as plt from ...
aws_lambda.py
# Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License. # This product includes software developed at Datadog (https://www.datadoghq.com/). # Copyright 2015-Present Datadog, Inc from datadog.threadstats import ThreadStats from threading import Lock, Thread from dat...
test_gauge.py
"""Unit tests for gauge""" from collections import namedtuple import random import re import shutil import tempfile import threading import time import os import unittest from unittest import mock from http.server import HTTPServer, BaseHTTPRequestHandler import yaml import requests from requests.exceptions import ...
rsmeter.py
#!/usr/bin/python import serial, time modes=['DC V','AC V','DC uA','DC mA','DC A', 'AC uA','AC mA','AC A','OHM','CAP', 'Hz','Net Hz','Amp Hz','Duty','Net Duty', 'Amp Duty','Width','Net Width','Amp Width','Diode', 'Continuity','hFE','Logic','dBm','EF','Temperature'] segs={ 0x00: ' ', ...
udp_echo.py
""" mbed SDK Copyright (c) 2011-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 applicable law or agreed to in wr...
train_pg_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany """ import numpy as np import tensorflow as tf import gym import logz import os import time im...
copyutil.py
# cython: profile=True # 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_threading.py
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose import random import re import sys import threading import thread import time import unittest import weakref # A trivial mutable counter. class Counter(object): def __init__(self): self.value = 0 ...
test_state.py
# -*- coding: utf-8 -*- ''' Tests for the state runner ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import re import shutil import signal import tempfile import time import textwrap import threading # Import Salt Testing Libs f...
ScriptRequestQueueTest.py
# -*- coding: utf-8 -*- # Copyright 2018-2020 Streamlit 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 applicabl...
rse.py
# -*- coding: utf-8 -*- # Copyright 2014-2020 CERN # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
test_fuse.py
import os import signal import time from multiprocessing import Process import pytest try: pytest.importorskip("fuse") # noqa: E402 except OSError: # can succeed in importing fuse, but fail to load so pytest.importorskip("nonexistent") # noqa: E402 from fsspec.fuse import run from fsspec.implementation...
ddos.py
from scapy.all import * from threading import Thread import time import random def sendPackets(victimAddress,victimPort): for port in victimPort: for i in range(1,254): #raw = str(createRandomString()) raw = "stuff" packetSYN=IP(src="10.0.0." + str(i), dst=victimAddress,...
htmlwidgets.py
from bindings import TkinterWeb from utilities import (AutoScrollbar, StoppableThread, cachedownload, download, notifier, currentpath, threadname) from imageutils import newimage import platform try: from urllib.parse import urlparse, urldefrag except ImportError: from urlparse impo...
p2p_stress.py
import testUtils import p2p_test_peers import random import time import copy import threading from core_symbol import CORE_SYMBOL class StressNetwork: speeds=[1,5,10,30,60,100,500] sec=10 maxthreads=100 trList=[] def maxIndex(self): return len(self.speeds) def randAcctName(self): ...
creator.py
""" Project: pubsne Authors: kceades """ # importing from files I wrote import snmc import tools import snetools # imports from standard packages import os import numpy as np from sklearn.decomposition import PCA from mfa import FactorAnalysis import pickle from multiprocessing import Process from threading import T...
stress.py
from pprint import pprint from threading import Thread from copy import deepcopy from time import time from random import randint from django.conf import settings from django.db import connections from django.test.utils import CaptureQueriesContext from rest_framework.reverse import reverse from rest_framework.test im...
bank.py
import bank_pb2 import socket import sys import threading import random from time import sleep import select initialized = False class Channel_States: """ Class contains channel state for other and current branch """ channel_states = {} #value of current branch in this is local state. @classmetho...
base.py
import logging import os import threading from abc import abstractmethod from collections import Iterable from datetime import datetime from typing import Tuple, Union, Optional from dnslib import DNSRecord, DNSQuestion from util import warning, ok class Client: def __init__(self, domain: str): self.dom...
destroy.py
from core.config import Settings from core.providers.aws import BaseAction from core.terraform import PyTerraform from core import constants as K from time import sleep from threading import Thread from datetime import datetime import importlib import sys class Destroy(BaseAction): """ AWS provider for destro...
xiami.py
#!/usr/bin/env python #-*- coding:utf-8 _*- """ @author: Selonsy @file: xiami.py @time: 2019-01-21 从虾米搜索和下载音乐 """ import datetime import threading import glovar from core.common import * from core.exceptions import * from utils.customlog import CustomLog logger = CustomLog(__name__).getLogger() def xiami_sea...
db_test.py
import uuid import string import secrets import random import requests from multiprocessing import Process from pprint import pprint from time import time char_string = string.ascii_letters + string.digits def get_password(n): return ''.join(secrets.choice(char_string) for _ in range(n)) def get_string(n): ...
determinism.py
""" Example wrapper to improve determinism of Retro environments """ import retro import numpy as np import argparse import gym import multiprocessing as mp CHUNK_LENGTH = 128 class MoreDeterministicRetroState(gym.Wrapper): """ Save/restore state on each step to avoid de-sync It's likely that reward and...
actor_factory.py
#!/usr/bin/env python # # Copyright (c) 2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # import rospy try: import queue except ImportError: import Queue as queue import time from threading import Thread, Lock impor...
auto_build.py
#!/usr/bin/env python ####################################### # # Marlin 3D Printer Firmware # Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin] # # Based on Sprinter and grbl. # Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm # # This program is free software: you can redistribute it a...
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 import concurrent.fu...
LiabilityExecutionThread.py
import threading from robonomics_msgs.msg import Result from .player import Player, get_rosbag_from_file from .recorder import Recorder import rospy import os from ipfs_common import ipfs_fileutils from ipfs_common.srv import IpfsUploadFileRequest, IpfsDownloadFileRequest class LiabilityExecutionThread(object): ...
mcsoda.py
#!/usr/bin/env python import re import sys import math import time import socket import string import struct import random import threading import multiprocessing import queue import logging import logging.config from collections import deque from hashlib import md5 import json import inspect sys.path.extend(('.', 'li...