source
stringlengths
3
86
python
stringlengths
75
1.04M
parameters.py
"""Thread-safe global parameters""" from .cache import clear_cache from contextlib import contextmanager from threading import local class _global_parameters(local): """ Thread-local global parameters. Explanation =========== This class generates thread-local container for SymPy's global paramet...
engine.py
"""""" from threading import Thread from queue import Queue, Empty from copy import copy from vnpy.event import Event, EventEngine from vnpy.trader.engine import BaseEngine, MainEngine from vnpy.trader.object import ( SubscribeRequest, TickData, BarData, ContractData ) from vnpy.trader.event import EV...
__init__.py
from flask import Flask, render_template from flask_bootstrap import Bootstrap from flask_sqlalchemy import SQLAlchemy from flask_migrate import Migrate from flask_login import LoginManager from config import Config, initialize, generate_peers from app.node import Node from threading import Thread from flask import g ...
test_tomcat.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import os import threading import time from types import ListType import unittest import mock # 3p from nose.plugins.attrib import attr # project from aggregator import MetricsAggregator import logging...
remind.py
# coding=utf8 """ remind.py - Sopel Reminder Module Copyright 2011, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://sopel.chat """ from __future__ import unicode_literals import os import re import time import threading import collections import codecs from datetime import datetime from...
train.py
# -*- coding: utf-8 -*- ############################################################## # train.py # Copyright (C) 2018 Tsubasa Hirakawa. All rights reserved. ############################################################## import os import time import math import numpy as np import multiprocessing as mp from MaxEntIR...
trainer.py
# coding: utf-8 ### # @file trainer.py # @author Arsany Guirguis <arsany.guirguis@epfl.ch> # # @section LICENSE # # Copyright (c) 2020 Arsany Guirguis. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to ...
timer_queue.py
""" A timer queue implementation """ import threading import Queue from time import time import traceback from splunktalib.timer import Timer from splunktalib.common import log logger = log.Logs().get_logger("util") class TimerQueue(object): """ A timer queue implementation, runs a separate thread to handl...
Pychat(client).py
from tkinter import * from tkinter import messagebox import threading import socket import time from itertools import cycle from ast import literal_eval import sqlite3 ad=False serv_search=('127.0.0.1',5001) serv_online=('127.0.0.1',5002) serv_del=('127.0.0.1',5003) serv_msg=('127.0.0.1',10101) check=F...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
__init__.py
import requests import datetime import logging import boto3 import gzip import io import csv import time import os import sys import json import hashlib import hmac import base64 from threading import Thread from io import StringIO import azure.functions as func import re TIME_INTERVAL_MINUTES = 10 DIVIDE_TO_MULTIP...
data_runner.py
import multiprocessing class DataRunnerMP: """ A multi-processing data runner for tensorflow """ def __init__(self, task_func, task_generator, capacity=100): self._task_func = task_func self._task_generator = task_generator self.counter = 0 self.processes = [] ...
test_threads.py
#!/usr/bin/env python from confluent_kafka import Producer import threading import time try: from queue import Queue, Empty except ImportError: from Queue import Queue, Empty class IntendedException (Exception): pass def thread_run(myid, p, q): def do_crash(err, msg): raise IntendedExceptio...
plutus.py
# Plutus Bitcoin Brute Forcer # Made by Isaac Delly # https://github.com/Isaacdelly/Plutus # Donate: 1B1k2fMs6kEmpxdYor6qvd2MRVUX2zGEHa; if you can Donate also here : 1TakawJC9DKG3cdFT7LazDrfvXvYpSKV7 import requests import os import binascii import ecdsa import hashlib import base58 import time import sys...
dataset.py
"""Data fetching with pandas """ # MIT License # # Copyright (c) 2018 Yichun Shi # Copyright (c) 2021 Kaen Chan # # 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, includi...
utils.py
import math import os.path as osp import multiprocessing from timeit import default_timer as timer import numpy as np import torch import matplotlib.pyplot as plt class benchmark(object): def __init__(self, msg, enable=True, fmt="%0.3g"): self.msg = msg self.fmt = fmt self.e...
SanePdfReport.py
import demistomock as demisto from CommonServerPython import * import traceback import os import shlex import base64 import random import string import subprocess from pathlib import Path import threading import time import http from http.server import HTTPServer WORKING_DIR = Path("/app") INPUT_FILE_PATH = 'sample.j...
handle_image.py
#!/usr/bin/env python3 # 用于处理用户上传的图片 import os import sys import json as JSON from PIL import Image import threading next_id = 0 def allowed_file(filename): return '.' in filename and filename.rsplit('.', 1)[1].lower() in ALLOWED_EXTENSIONS def near_value(i): if i < 64: return 0 elif i < 64*2: return 1 el...
piotroski_advanced.py
#!/usr/bin/env python3 # Para a análise, são utilizados princípios do Joseph D. Piotroski # Estipulados no livro: "Value Investing: The Use of Historical Financial Statement Information to Separate Winners from Losers" # No estudo original de Piotroski, ao longo de 20 anos (1976–1996), uma estratégia de investimento b...
main.py
''' 🐍🐍🐍 Snake: CLI ASCII Edition 🐍🐍🐍 Author: Faraz Malik Date Created: 10/25/2018 Last Updated: 10/29/2018 ''' try: # Make sure user ran setup.bat so program will have readchar import readchar except: raise Exception("Please run setup to install required modules") import time import threading import rand...
simulation_server.py
#!/usr/bin/env python3 # Copyright 1996-2019 Cyberbotics Ltd. # # 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...
tcp_server.py
from object_database.database_connection import DatabaseConnection from object_database.server import Server from object_database.messages import ClientToServer, ServerToClient, getHeartbeatInterval from object_database.algebraic_protocol import AlgebraicProtocol from object_database.persistence import InMemoryPersiste...
recorder.py
""" MIT License Copyright (c) 2020 PyKOB - MorseKOB in Python 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, me...
config_docker.py
#!/usr/bin/env python3 # scripts/config_docker.py # # Import/Export script for Docker.io. # # @author Andrea Dainese <andrea.dainese@gmail.com> # @copyright 2014-2016 Andrea Dainese # @license BSD-3-Clause https://github.com/dainok/unetlab/blob/master/LICENSE # @link http://www.unetlab.com/ # @version 20160719 import...
engine.py
""" """ import logging import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Sequence, Type from cryptoquant.event import Event, EventEngine from .app import BaseApp from .ev...
test_xmlrpc.py
import base64 import datetime import decimal import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import http, http.server import socket import threading import re import io import contextlib from test import support from test.support...
burp_wp.py
# ____ _ _ ____ ____ __ ______ # | __ )| | | | _ \| _ \ \ \ / / _ \ # | _ \| | | | |_) | |_) | \ \ /\ / /| |_) | # | |_) | |_| | _ <| __/ \ V V / | __/ # |____/ \___/|_| \_\_| \_/\_/ |_| # # MIT License # # Copyright (c) 2018 Kacper Szurek import collections import hashlib ...
msrc12_skels_to_h5.py
from __future__ import absolute_import, division, print_function import os import numpy as np import h5py as h5 import re import csv from glob import glob from tqdm import trange import shutil import time from multiprocessing import Process, Queue, current_process, freeze_support def worker(input, output): prog...
image_server.py
import logging import time from threading import Lock from threading import Thread import requests from flask import Flask from flask import redirect from flask import request from werkzeug.wrappers import Response import arc852.cli_args as cli from arc852.constants import CAMERA_NAME_DEFAULT from arc852.constants i...
worker.py
from dataclasses import dataclass, field import threading import time import typing as tp import stopit from pypeln import utils as pypeln_utils from . import utils from .queue import IterableQueue, OutputQueues WorkerConstructor = tp.Callable[[int, "StageParams", IterableQueue], "Worker"] Kwargs = tp.Dict[str, tp....
async_script.py
# -*- coding: utf-8 -*- """ Display output of a given script, updating the display when new lines come in. Always displays the last line of output from a given script, set by `script_path`. If a line contains only a color (/^#[0-F]{6}$/), it is used as such (set force_nocolor to disable). The script may have parameter...
mproc.py
import os import time import multiprocessing import concurrent.futures import py from _pytest.junitxml import LogXML from _pytest.terminal import TerminalReporter from _pytest.junitxml import Junit from _pytest.junitxml import _NodeReporter from _pytest.junitxml import bin_xml_escape from _pytest.junitxml import mangl...
nasdaq.py
#!/usr/bin/python # $Id: nasdaq.py,v 1.2 2003/04/29 06:44:17 ifindkarma Exp $ import KNCONFIG import time, random, urllib from mx import DateTime # Include local libraries: sys.path = [ "../" ] + sys.path from libkn import kn from pprint import pprint from threading import Thread NASDAQ_MAXRQUESTS=10 NASDAQ_URL='h...
AutCamera.py
import cv2 import numpy as np import struct import base64 import socket import threading import time import subprocess class Camera: def __init__(self, connect_camera = False, host = '', port = 8089, rotation = None, capture_interval = 1): """ A camera object which is used to capture single images...
bridge.py
#!/usr/bin/env python3 import argparse import math import os import signal import threading import time from multiprocessing import Process, Queue from typing import Any import carla # pylint: disable=import-error import numpy as np import pyopencl as cl import pyopencl.array as cl_array import cereal.messaging as m...
xla_client_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...
scene_executor.py
import threading import time from ws2812.scenes.WhiteLoading import WhiteLoading class SceneExecutor: def __init__(self): self.thread_running = False self.thread = None self.led_count = None self.frame_time = 0.5 self.step_size = 1 self.scene = WhiteLoading() ...
common.py
import cv2 import tensorflow as tf import matplotlib.pyplot as plt from PIL import Image import numpy as np import os import glob import matplotlib.pyplot as plt import numpy as np from tensorflow.python.keras import backend as K import glob import threading import time import matplotlib.pyplot as plt import numpy as ...
async_utils.py
# Lint as: python3 # Copyright 2018 DeepMind Technologies Limited. 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 # # ...
widget_screenshots.py
""" Script for generating Widget screenshots for documentation """ from multiprocessing.context import Process from tkinter import ttk from ttkbootstrap import Style from ttkbootstrap import widgets from ttkbootstrap.gallery.screenshot import Screenshot # get_screensize = lambda: print((window.winfo_width(), win...
runtime_manager_dialog.py
#!/usr/bin/env python """ Copyright (c) 2015, Nagoya University 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 notice, this ...
test_viewer.py
# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0 # For details: https://github.com/gaogaotiantian/viztracer/blob/master/NOTICE.txt from .cmdline_tmpl import CmdlineTmpl import json import multiprocessing import os import signal import socket import subprocess import sys import time impo...
main.py
# -*- coding: utf-8 -*- """ Test code to test multithread handling of DAO class The aim is to provide a DAO coherent with multithread access """ import threading from dao import DaoTestWrapper, DummyLogger, shutting_down, DaoTest logger = DummyLogger() TEST_OLD_CLASS = False # switch to True to test old class' ...
load-graph.py
#!/usr/bin/python2.7 # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2014. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: khmer-project@idyll.org # # pylint: disable=invalid-name,missing-docstring """ Build a ...
bartender.py
#!/usr/bin/env python # -*- coding: iso-8859-1 -*- import time import sys import RPi.GPIO as GPIO import json import traceback import threading import textwrap import subprocess import Adafruit_GPIO.SPI as SPI import Adafruit_SSD1306 from PIL import Image from PIL import ImageFont from PIL import ImageDraw from dot...
differential_evolution.py
""" Differential evolution implementation """ import random from collections import OrderedDict import os from hops import hdfs, tensorboard, devices, util from hops.experiment_impl.util import experiment_utils from hops.experiment import Direction import threading import six import time import copy import json imp...
controller.py
# # This software is released under the MIT License, see LICENSE # # Copyright (c) 2020 chimo # import RPi.GPIO as GPIO import time import os import threading import Queue as queue # pin name SPICLK = 11 SPIMOSI = 10 SPIMISO = 9 SPICS = 8 GPIO17 = 17 # pin11 GPIO27 = 27 # pin13 vol_old = 0 def pwm(q,event): pr...
client.py
import sys import pdb import random import logging import json import time, datetime from multiprocessing import Process from milvus import Milvus, IndexType, MetricType logger = logging.getLogger("milvus_benchmark.client") SERVER_HOST_DEFAULT = "127.0.0.1" # SERVER_HOST_DEFAULT = "192.168.1.130" SERVER_PORT_DEFAULT ...
abstractBatchSampler.py
import cv2 import time import numpy as np import mxnet as mx import mxnet.ndarray as nd from enum import Enum from dataProcessor.imageProcessor import ImageProcessor from dataProcessor.imageSampler import ImageSampler from dataProcessor.miningTypes import MiningTypes from multiprocessing import Process, Queue class ...
movo_jtas.py
"""-------------------------------------------------------------------- Copyright (c) 2017, Kinova Robotics inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code mus...
PyShell.py
#! /usr/bin/env python import os import os.path import sys import string import getopt import re import socket import time import threading import traceback import types import subprocess import macosxSupport import linecache from code import InteractiveInterpreter try: from Tkinter import * ...
test_mysqlx_connection.py
# -*- coding: utf-8 -*- # Copyright (c) 2016, 2020, Oracle and/or its affiliates. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License, version 2.0, as # published by the Free Software Foundation. # # This program is also distributed with certa...
remote_decorator.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 app...
_win.py
from pygwin.surface import surface as _surface from pygwin.tray import tray as _tray from datetime import datetime as _dt from pygwin.image import save as _s from pygwin._pg import pg as _pg import pygwin.image as _img try: import win32job as _w32j import win32api as _w32a import win32con as _w32c ...
raspberrypi_dht11_acfan_controller.py
"""Main module.""" import os # print(os.getpid()) import queue import signal import threading import logging import logging.config from os import kill from threading import Thread # Import our packets print("importing your libraries") from bot import run_bot from fan_caller import DHT11_Fan_caller print("done!") #...
power_monitoring.py
import random import threading import time from statistics import mean from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5.28 CAR_VOLTAGE_LOW_PASS_K =...
service.py
""" Base types for all anchore engine services """ import copy import enum import json import os import threading import time from pathlib import Path import connexion import yaml from flask import g, jsonify from anchore_engine import monitors from anchore_engine.apis.authorization import get_authorizer, init_authz...
test_local_task_job.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
maze-2fg-rfid.py
#!/usr/bin/python PWM_WARMUP_MS = 100 PWM_DC = 30 PWM_REFRESH_PERIOD = 2 import sys from argparse import ArgumentParser from threading import Thread, Lock from serial import Serial from time import sleep import signal import re, random from time import time, strftime class Tty(object): s = None def __init__(self,...
main.py
from __future__ import print_function,unicode_literals,with_statement,division # kivy related import matplotlib import threading matplotlib.use('module://kivy.garden.matplotlib.backend_kivy') from matplotlib import pyplot as plt from kivy.garden.graph import MeshLinePlot #import matplotlib.animation as animation from ...
Zip-Crack.py
#!/usr/bin/env python3 # Crack Zip Files using wordlists #Author Yehia Elghaly import zipfile import colorama from colorama import Fore, Back, Style from threading import Thread print ("Zip Brute Force Attack") def zip_crack(zipsec, password): try: password = bytes(password.encode('utf-8')) ...
helper.py
#-*- coding: utf-8 -*- import os import sys import time import warnings import queue as Queue import numpy as np import threading import collections def stream_shuffle_generator(generator, batch_size, shuffle_size=20000): """ Args: generator: iterable dataset batch_size: int shuffle_...
_boosting.py
""" Boosting as described by David et al. (2007). Versions -------- 7: Accept segmented data, respect segmentation (don't concatenate data) Profiling --------- ds = datasets._get_continuous() y = ds['y'] x1 = ds['x1'] x2 = ds['x2'] %prun -s cumulative res = boosting(y, x1, 0, 1) """ import inspect from itertools i...
websocket.py
from __future__ import annotations import asyncio import json import sys import threading import time import typing import zlib from copy import deepcopy import aiohttp from aiohttp.http_websocket import WSMessage, WSMsgType if typing.TYPE_CHECKING: from ..client import Client class WebSocket: # websocket ...
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...
tflite_webcam.py
import os import argparse import cv2.cv2 as cv2 import numpy as np import sys import time from threading import Thread import importlib.util from datetime import datetime import csv class VideoStream: """Camera object that controls video streaming from the Picamera""" def __init__(self, resolution=(640, 480)...
_testing.py
import bz2 from collections import Counter from contextlib import contextmanager from datetime import datetime from functools import wraps import gzip import operator import os from shutil import rmtree import string import tempfile from typing import Any, Callable, ContextManager, List, Optional, Type, Union, cast imp...
auto_running.py
import subprocess import os import time import pandas import glob import tqdm import logging import heapq import json from re import search import uuid import multiprocessing as mp import numpy as np import time from typing import List class PriorityQueue: """ Implements a priority queue data structure. E...
flick_kb_receiver.py
""" フリックキーボード(受信側) PC用 """ import sys import time import socket import pyautogui import pyperclip import threading def type_text(text): # 与えた文字を入力(クリップボードにコピー&ペースト) pyperclip.copy(text) pyautogui.hotkey("ctrl", "v") return True def type_backspace(): pyautogui.typewrite(["backspace"]) return Tr...
subonly.py
""" Copyright 2021 Ashe Muller 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...
videocaptureasync.py
# https://github.com/gilbertfrancois/video-capture-async import threading import cv2 import time WARMUP_TIMEOUT = 10.0 class VideoCaptureAsync: def __init__(self, src=0, width=640, height=480): self.src = src self.cap = cv2.VideoCapture(self.src) if not self.cap.isOpened(): ...
stress.py
import sys, random, optparse, time, json from itertools import islice from threading import Thread from collections import Counter from queue import Queue import requests from .utils import SplashServer, MockServer class StressTest(): def __init__(self, reqs, host="localhost:8050", requests=1000, concurrency=5...
mumbleBot.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re 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 logg...
automaton.py
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # Copyright (C) Gabriel Potter <gabriel@potter.fr> # This program is published under a GPLv2 license """ Automata with states, transitions and actions. """ from __future__ imp...
test_stdout.py
import multiprocessing import os import random import string import sys import tempfile import time import pytest from dagster import ( DagsterEventType, InputDefinition, ModeDefinition, execute_pipeline, fs_io_manager, pipeline, reconstructable, resource, solid, ) from dagster.core...
play_controller.py
import argparse import multiprocessing as mp import os current_dir = os.path.dirname(os.path.realpath(__file__)) parent_dir = os.path.dirname(current_dir) os.sys.path.append(parent_dir) import gym import numpy as np import torch from common.misc_utils import EpisodeRunner, POSE_CSV_HEADER FOOT2METER = 0.3048 FOOT2C...
Address_Validator.py
#!/usr/bin/python """ VALIDATE THE MATCHED ADDRESSES WITH GOOGLE MAPS APIs IN ORDER TO OBTAIN WHICH ADDRESS IS CORRECT AND WHICH ONES NEEDS TO BE CHANGED """ import itertools import json import os import re import sys import time import uuid from difflib import SequenceMatcher import requests import threa...
core.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
daemon_thread.py
#!/usr/bin/env python3 """ Barron finishes cooking while Olivia cleans """ import threading import time def kitchen_cleaner(): while True: print('Olivia cleaned the kitchen.') time.sleep(1) if __name__ == '__main__': olivia = threading.Thread(target=kitchen_cleaner) olivia....
pspnet_serving.py
from __future__ import print_function from __future__ import division import time import os import subprocess from os.path import splitext, join, isfile, basename from os import environ from math import ceil import argparse import numpy as np from scipy import misc, ndimage import pre_process import deeplearning import...
pipeline.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import ctypes import inspect from multiprocessing import Queue, Process, Value import logging import collections from threading import Thread import time import traceback from counter import AtomicCounter def _get_logger(name): logger = logging.getLogger(name) lo...
doom_gym.py
import copy import os import random import re import time from os.path import join from threading import Thread import cv2 import gym import numpy as np from filelock import FileLock, Timeout from gym.utils import seeding from vizdoom.vizdoom import ScreenResolution, DoomGame, Mode, AutomapMode from seed_rl.algorithm...
image_feeder.py
#!/usr/bin/env python import os import sys import glob import rospy import re import json import cv2 import threading import numpy as np from cv_bridge import CvBridge from sensor_msgs import msg as smsg from geometry_msgs import msg as gmsg from aist_depth_filter import DepthFilterClient from tf import TransformBroad...
attach_server.py
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution....
test_manager_options.py
import pytest import shutil import os import glob import subprocess import time as ttime import multiprocessing from bluesky.callbacks.zmq import RemoteDispatcher from bluesky_queueserver.manager.profile_ops import gen_list_of_plans_and_devices from bluesky_queueserver.manager.comms import zmq_single_request from ._c...
collapsar.py
import socks import socket import requests import threading import random import ssl import time from colorama import Fore print(Fore.RED + """ ____ ______ ____ _____ ________ ___ __ __ / __ \__ __/ ____/____/ __ \____ / ___/____ /_ __/ /_/ | _____/ //_/ ...
monitor.py
# Copyright 2018 Microsoft 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 law or agreed to in...
app.py
import os import signal import time import threading from http.server import ( BaseHTTPRequestHandler, HTTPServer ) def fib(n): a, b = 0, 1 for _ in range(n): a, b = b, a + b return a class MyMsgHandler(BaseHTTPRequestHandler): def do_GET(self): try: message = st...
base_crash_reporter.py
# Electrum - lightweight Bitcoin client # # 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, # publish...
onmyoji_win.py
# -*-coding:utf-8-*- import time import datetime import os import random import shelve import threading from queue import Queue import win32api, win32gui, win32con, win32com.client from ctypes import * from PIL import ImageGrab, Image as PLI_Image, ImageTk from tkinter import * from tkinter import ttk import tkinter.m...
multi_process_runner_test.py
# Copyright 2019 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...
test_instanceconnectionmanager_unit.py
"""" Copyright 2019 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dis...
cleaner.py
# Copyright 2013-2018 CERN for the benefit of the ATLAS collaboration. # # 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...
dashboard.py
# Copyright (c) 2019 Microsoft Corporation # Distributed under the MIT software license # TODO: Dashboard needs to be tested. from IPython import display import re import requests import threading import os from . import udash from gevent.pywsgi import WSGIServer from flask import Flask import socket import random f...
utils.py
# -*- coding: utf-8 -*- import datetime import json import functools import Queue import six from twisted.application.service import Service from twisted.internet import defer from twisted.python import deprecate from bouser.excs import SerializableBaseException, ExceptionWrapper from twisted.web.http import Request f...
wrap_test.py
from functools import wraps from threading import Thread, Lock import os import sys import time from pprint import pprint sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from lock import a, b counter = 0 def synchronized(lock): """ Synchronization decorator. """ def real_wrapper(function): ...
release.py
#!/usr/bin/python import re import sys import os import os.path import subprocess import shutil import tempfile from datetime import * from multiprocessing import Process from utils import * try: from xml.etree.ElementTree import ElementTree except: prettyprint(''' Welcome to the Infinispan Release Script....
servers.py
import SocketServer import mitm class SimpleTCPServer(SocketServer.TCPServer): def start_foreground(self): self.serve_forever() class ThreadedTCPServer(SocketServer.ThreadingTCPServer): daemon_threads = mitm.KILL_THREADS_WHEN_MAIN_ENDS def start_background(self): mitm.Thread(target=sel...
webhdfs_proxy.py
#!/usr/bin/python3 -u import threading import time import subprocess import json import http.server import http.client import urllib.parse class ChunkedWriter: def __init__(self, wfile): self.wfile = wfile def write(self, data): self.wfile.write(f'{len(data):x}\r\n'.encode()) self.wfi...
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...