source
stringlengths
3
86
python
stringlengths
75
1.04M
test_radius.py
# RADIUS tests # Copyright (c) 2013-2016, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import binascii import hashlib import hmac import logging logger = logging.getLogger() import os import select import struct import subprocess import...
active_count.py
import threading import time import random def myThread(i): print(f'Thread {i} started') time.sleep(random.randint(1, 5)) print(f'Thread {i} finished') def main(): for i in range(random.randint(2, 50)): thread = threading.Thread(target=myThread, args=(i,)) thread.start() time.sle...
app.py
import multiprocessing from threading import Thread from flask import Flask, render_template, request, jsonify from flask_httpauth import HTTPBasicAuth from werkzeug.security import check_password_hash from dataclasses import dataclass from datetime import datetime import scanner import json import config import schedu...
md.py
import asyncio import threading import datetime from functools import partial import pandas as pd from asyncio import AbstractEventLoop from typing import List from jotdx.consts import MARKET_SH, MARKET_SZ from jotdx.quotes import Quotes from joconst.maps import INTERVAL_TDX_MAP from vnpy.trader.gateway import Bas...
tcp_server.py
#! /use/bin/env python # -*- coding: utf-8 -*- import socket import threading BIND_IP = "0.0.0.0" BIND_PORT = 8080 server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind((BIND_IP, BIND_PORT)) server.listen(5) print "[*] Listening on %s:%d " % (BIND_IP, BIND_PORT) def handle_client(client_socket): ...
scheduler.py
import Queue import threading import time import json from logging import getLogger, StreamHandler, Formatter, DEBUG, INFO, ERROR, FileHandler, NullHandler import traceback import os import sys import uuid Q_JSON_FILENAME = 'qu.json' RESULT_PATH = '/home/muneel/Documents/results/' class MLOGGER: @staticmethod ...
test_socket.py
import unittest from test import support import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import array import contextlib from weakref import proxy import signal import math import pickle import struct import random import...
timeout.py
#!/usr/bin/env python3 from threading import Thread import functools def timeout(seconds_before_timeout): def deco(func): @functools.wraps(func) def wrapper(*args, **kwargs): res = [''] def newFunc(): try: res[0] = func(*args, **kwargs)...
panoramaDataExtraction.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,subprocess,psutil,re,sys,shutil,csv,time,datetime,glob import urllib,requests import html2text import unicodedata from bs4 import BeautifulSoup from Bio import SeqIO import xmltodict from xml.dom import minidom from xml.parsers.expat import ExpatError from collect...
wrappers.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # ######################################################################### # Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. # # # # Copyright 2015-2019. UChicago Argonne, LLC....
reverse.py
import logging import threading import select import socket from typing import Callable logger = logging.getLogger(__name__) should_run = {} def handler(chan, local_port, host, port): key = local_port, host, port sock = socket.socket() try: sock.connect((host, port)) except Exception as e: ...
test_multikernelmanager.py
"""Tests for the notebook kernel and session manager.""" import os import time import threading import multiprocessing as mp from subprocess import PIPE from unittest import TestCase from traitlets.config.loader import Config from jupyter_client import KernelManager from jupyter_client.multikernelmanager import Multi...
server.py
import socket # библиотека для приема/передачи данных import threading # имортируем потоки sock = socket.socket() # создание сокета (комбинация IP и номера порта) port = int(input("Введите порт: ")) sock.bind(('127.0.0.1', port)) sock.listen(3) # сколько клиентов готов слушать сервер clients = [] # список с подключе...
load_data.py
import numpy as np from scipy import ndimage import glob import itertools import threading import time import skimage.transform import skimage.io import skimage.filter import gzip import os import queue import multiprocessing as mp num_train = 61578 # 70948 num_test = 79975 # 79971 train_ids = n...
test_launcher.py
#!/usr/bin/env python3 # -*-coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Feb 14, 2014 █████████████████...
app.py
#!flask/bin/python from flask import Flask, request, jsonify import json import os from flask_cors import CORS import numpy as np import cv2 import datetime import time import logging from logging.handlers import RotatingFileHandler from threading import Thread app = Flask(__name__) app.config['JSON_SORT_KEYS'] = Fals...
__init__.py
# -*- coding: utf-8 -*- import sys from noval import _,GetApp,NewId import noval.iface as iface import noval.plugin as plugin import noval.util.utils as utils import noval.constants as constants import noval.consts as consts import noval.util.strutils as strutils import os import noval.core as core import no...
test_webgui.py
import sys import os import re import pytest import glob import time def start_server(): import tempfile from conftest import AppFileHandler from experimentum.Experiments import App from experimentum.WebGUI import Server # App Container class WebAppContainer(App): config_path = tempfi...
server.py
# Python packages from _socket import SHUT_RDWR import socket import struct import time import timer try: # Python 3 import socketserver except ImportError: # Python 2 import socketserver as socketserver import threading # Third-party packages # Modules from this project import globals as G # noinspection P...
Loader.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...
test_stdout.py
import os import random import string import sys import tempfile import time import pytest from dagster import ( DagsterEventType, InputDefinition, ModeDefinition, execute_pipeline, pipeline, reconstructable, resource, solid, ) from dagster.core.execution.compute_logs import should_disa...
test_basic_3.py
# coding: utf-8 import gc import logging import os import sys import time import subprocess import numpy as np import pytest import ray.cluster_utils from ray._private.test_utils import ( dicts_equal, wait_for_pid_to_exit, wait_for_condition, ) from ray.autoscaler._private.constants import RAY_PROCESSES f...
connection.py
#!/usr/bin/env python3 import sys import threading from .packet import \ SetCompression, LoginSuccess, JoinGame, \ OutgoingPluginMessage, IncomingPacket, Disconnect from .crypto import CryptoState from .keepalive import KeepAlive from .player import Player from .net import ProtocolError, IllegalData from .ty...
run-tests.py
#!/usr/bin/env python # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "Li...
test_itertools.py
import unittest from test import support from itertools import * import weakref from decimal import Decimal from fractions import Fraction import operator import random import copy import pickle from functools import reduce import sys import struct import threading maxsize = support.MAX_Py_ssize_t minsize = -maxsize-1 ...
subprocess_env_manager.py
from typing import Any, Union, List, Tuple, Dict, Callable, Optional from multiprocessing import Pipe, connection, get_context, Array from collections import namedtuple import logging import platform import time import copy import traceback import numpy as np import torch import ctypes import pickle import cloudpickle ...
server.py
import hmac import json import urllib.parse from .main import ( PullReqState, parse_commands, db_query, IGNORE_BLOCK_END, IGNORE_BLOCK_START, INTERRUPTED_BY_HOMU_RE, suppress_ignore_block, suppress_pings, synchronize, LabelEvent, ) from . import comments from . import utils from ...
esempio2.py
from threading import Thread, Lock import time import logging from random import randrange def thread_function(name): logging.info("Thread %s : starting", name) time.sleep(randrange(5)) logging.info("Thread %s : finishing", name) if __name__ == "__main__": format = "%(asctime)s: %(message)s" ...
mcom_rt.py
import os, copy, atexit, time, gzip, threading, zlib, asyncio import numpy as np from colorama import init from multiprocessing import Process from UTILS.colorful import * from UTILS.network import get_host_ip, find_free_port mcom_fn_list_define = [ "v2dx", "flash", "plot", "figure", "hold", "box", "pause", "clf",...
relay_test.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time import threading import random import click from influxdb.client import InfluxDBClient def generate_fake_data(points): # type: (int) -> list(dict) return [ { "measurement": "cpu_load_short", "tags": { "ho...
Tensorboard_reader.py
#Denis Rothman def launchTensorBoard(): import os os.system('tensorboard --logdir=' + 'log/') return import threading t = threading.Thread(target=launchTensorBoard, args=([])) t.start() #In your browser, enter http://localhost:6006 as the URL #add #projector to the URL if necessary: http://localhost:6006/...
remove_nans_dmstack.py
# Author : Bhishan Poudel # Date : July 5, 2019 # Update : Oct 29, 2019 # Description: #=============== # Remove nans from dmstack output csv files and do some filterings to give # txt files. # # Input/Oputputs: #================= # Reads all *.csv files and creates *.txt from them. # # # Filtering: #============...
trustedcoin.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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...
stream_emu.py
#!/usr/bin/env python """ This is an AARTFAAC imaging pipeline simulator. It will spawn 6 server sockets where multiple clients can connect to. once connected the server will send out empty fits images, with increasing timestamps. Each port has a different band. """ import struct import time import monotonic from datet...
ELM327CANInterface.py
''' Created on Oct 5, 2013 @author: gcardwel,doug@doug-brunner.com @summary: Driver plugin for ELM327 based interfaces. @note: The ELM327 uses an AT command set (as in Hayes modem) and as such is a half duplex interface to the CAN bus. Sending a frame means aborting reception, waiting for a prompt, ...
run_qa.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # Copyright (c) 2018, NVIDIA CORPORATION. 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 cop...
app.py
import os import sys # <<<<<<< Updated upstream # two file is created by developers # from main import grading # from helperFunction import readAndSaveAnswerFile from sample.web.helperFunction import saveImage, writeAnswer import sample.database.database as database import flask from flask import Flask, render_templa...
queue.py
# -*- encoding=utf-8 -*- import threading import time class ThreadSafeQueueException(Exception): pass # 线程安全的队列 class ThreadSafeQueue(object): def __init__(self, max_size=0): self.queue = [] self.max_size = max_size self.lock = threading.Lock() self.condition = threading.Con...
threaded_rec.py
''' Implement threaded requests ''' import threading as th import queue as Q import requests from pbutils.request.utils import all_contexts, populate_profile, create_request_params class ThreadedReq: ''' Threaded requests. ''' def __init__(self, n_threads, config, environ, error_handler=None): ...
basic-counting.py
# coding: utf-8 import gimpbbio.gpio as gpio import threading, time, datetime, signal class GeigerCounterDataCollector: def __init__(self): self.input_pin = None self.count_accumulator = 0 self.counts = [0] * 60 self.count_index = 0 self.counts_per_second = 0 self.counts_per_minute = 0 self.total_count...
backend_info.py
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
camera_setting.py
import logging import threading import subprocess import numpy as np import cv2 USB_GSTREAMER = True def add_camera_args(parser): """Add parser augument for camera options.""" parser.add_argument('--rtsp', dest='use_rtsp', help='use IP CAM (remember to also set --uri)', ...
client.py
import sys, socket import threading import traceback import json import datetime class SocketError(OSError): # Socket Error, based on OSError def __init__(self, *args): super().__init__(f"Client cannot connect. Recheck adress and ensure what the server is online.") class SendError(So...
test_uuid.py
# -*- coding: utf-8 -*- from threading import Thread from Queue import Queue import time import unittest import uuid import libuuid def test_property(): _PROPERTIES = [ 'bytes', 'bytes_le', 'clock_seq', 'clock_seq_hi_variant', 'clock_seq_low', 'fields', 'hex', 'node', 'time', 'time_hi_version', ...
simple_gripper_mimic_pybullet.py
import threading import time import airobot.utils.common as arutil from airobot.ee_tool.simple_gripper_pybullet import SimpleGripperPybullet from airobot.utils.arm_util import wait_to_reach_jnt_goal class SimpleGripperMimicPybullet(SimpleGripperPybullet): """ A base class for gripper with mimic joints in pyb...
extension.py
from system.platform import get_platform from tools.OJ.CP.setup import CpSetup import os import subprocess import json from termcolor import cprint import time import threading import socket from settings.compiler import competitive_companion_port, parse_problem_with_template from settings.compiler import editor edit...
jarvis.py
import os import re import sys from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta from email import message_from_bytes from email.header import decode_header, make_header from imaplib import IMAP4_SSL from json import dumps as json_dumps from json import load as json_load from js...
ftpserver.py
# -*- coding: utf-8 -*- """Simple FTP Server""" from __future__ import print_function import argparse import os import sys import threading import time import logging _stash = globals()["_stash"] try: import pyftpdlib except ImportError: print("Installing pyftpdlib...") _stash("pip install pyftpdlib") ...
tpu_estimator.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...
executor.py
from concurrent.futures import Future import typeguard import logging import threading import queue import pickle from multiprocessing import Process, Queue from typing import Dict, List, Optional, Tuple, Union import math from ipyparallel.serialize import pack_apply_message from ipyparallel.serialize import deseriali...
client.py
#!/usr/bin/python3 import json import socket import threading import pyaudio from loguru import logger from protocol import Message, MessageType CHUNK_SIZE = 512 AUDIO_FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 class Client: def __init__(self): self.lock = threading.Lock() self.talking...
test_distributed_sampling.py
import dgl import unittest import os from dgl.data import CitationGraphDataset from dgl.data import WN18Dataset from dgl.distributed import sample_neighbors, sample_etype_neighbors from dgl.distributed import partition_graph, load_partition, load_partition_book import sys import multiprocessing as mp import numpy as np...
sqlite_web.py
#!/usr/bin/env python import datetime import hashlib import math import operator import optparse import os import re import sys import threading import time import webbrowser from collections import namedtuple, OrderedDict from functools import wraps from getpass import getpass from io import TextIOWrapper # Py2k com...
test_config.py
import asyncio import copy import pytest import random import yaml from chaingreen.util.config import create_default_chaingreen_config, initial_config_file, load_config, save_config from chaingreen.util.path import mkdir from multiprocessing import Pool from pathlib import Path from threading import Thread from time i...
dataloader_iter.py
# Copyright (c) 2020 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...
PClient.py
# -*- coding : utf-8-*- # coding:unicode_escape from Proxy import Proxy import ast import threading import time import re class PClient: def __init__(self, tracker_addr=(str, int), proxy=None, port=None, upload_rate=0, download_rate=0, packet_size=20000, name=None): if proxy: ...
metrics.py
import atexit import time import socket import traceback import os import mod_wsgi from threading import Thread from queue import Queue from influxdb import InfluxDBClient from datetime import datetime session_namespace = os.environ["SESSION_NAMESPACE"] influxdb_hostname = f"{session_namespace}-influxdb" client = ...
oldtest.py
""" SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. """ import base64 import configparser import json import os import queue import shutil import signal import subprocess import tempfile import threading import time import unittest import uuid from distutils.dir_util import c...
reset_job_test_alone.py
# Copyright (c) 2018 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...
there.py
#!/usr/bin/env python3 """Plot results of a Where analysis Usage:: {exe:there} [date] [--<pipeline>] [pipeline-options] [options] The following commands are optional: =================== =========================================================== Command Description =================== ==========...
test_zeromq.py
# -*- coding: utf-8 -*- ''' :codeauthor: Thomas Jackson <jacksontj.89@gmail.com> ''' # Import python libs from __future__ import absolute_import, print_function, unicode_literals import os import time import threading import multiprocessing import ctypes from concurrent.futures.thread import ThreadPoolExecutor # ...
helperapi.py
import os import imp from bson import json_util import json import restapi import netifaces as ni import confparser as cp import pathdumpapi as pdapi from threading import Thread import time import socket import zmq cwd = os.getcwd() subsURL = "tcp://localhost:5556" subsFilter = "TIB " subsQueries={} subsSocket=None i...
server.py
import socket import threading IPADDR = "127.0.0.1" PORT = 49152 sock_sv = socket.socket(socket.AF_INET) sock_sv.bind((IPADDR, PORT)) sock_sv.listen() # クライアントのリスト client_list = [] def recv_client(sock, addr): while True: try: data = sock.recv(1024) if data == b"...
main.py
# < Импорт модулей > from PyQt5 import QtCore, QtGui, QtWidgets from threading import Thread from win32gui import GetWindowText, GetForegroundWindow import tkinter as tk import pymem, pymem.process, ctypes, requests, re, time, keyboard, pyautogui # <...> # < Переменные > _translate = QtCore.QCoreApplication....
period_max.py
import time import logging import threading import distutils from src.domain.cache import Cache from src.domain.exchanges import Exchange from . import TradingStrategy class PeriodMax(TradingStrategy): """ PeriodMax is a trading strategy that compares the current value with the maximum value of a given ...
event_source.py
# -*- coding: utf-8 -*- # # Copyright 2017 Ricequant, 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 ...
utility.py
import os import math import time import datetime from multiprocessing import Process from multiprocessing import Queue import config import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np import imageio import torch import torch.optim as optim import torch.optim.lr_scheduler as l...
background.py
import threading class BackgroundThread(object): def __init__(self, target_method): self.thread = threading.Thread(target=target_method, args=()) self.thread.daemon = True def run(self): self.thread.start() def is_alive(self): if self.thread.isAlive(): return ...
do_psiblast.py
# This script takes a fasta file as input and runs PSIBLAST # on each one individually. The results are saved in their # own files, with the names equal to their fasta IDs import os from multiprocessing import Process, Queue from pathlib import Path from Bio import SeqIO from Bio.Blast import NCBIXML from Bio.Blast.Ap...
plant_node.py
#!/usr/bin/env python from sys import version_info if version_info[0] <= 2: from Queue import Queue else: from queue import Queue import time import threading import rospy import actionlib import ros_opcua_srvs.srv as ros_opcua from robonomics_game_plant.msg import OrderAction, OrderFeedback, OrderResult from ...
trainingsrecorder.py
""" This program listens on OSC_IP_ADDRESS:OSC_PORT for incoming sound vectors (array of floats) via OSC protocol address '/record_sound_vector' and saves it to a buffer. After hitting ctrl-C in the terminal or receiving any data on address '/stop' the recording process stops and the sound vectors will be saved along n...
Query.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: Ivar Vargas Belizario # Copyright (c) 2021 # E-mail: ivar@usp.br import tornado.ioloop import tornado.web import tornado.httpserver import ujson import glob import os import time import sys import pandas as pd import numpy as np import os.path import math impo...
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 need t...
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 #...
reltestbase.py
############################################################################## # # Copyright (c) 2008 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOF...
atombot.py
# atombot.py from threading import Lock, Thread from time import sleep from atom import Element from atom.messages import Response class AtomBot: def __init__(self): # This defines atombot's current position self.pos = 2 # We allow 5 different positions that atombot can move to se...
database_server.py
from __future__ import print_function, absolute_import, division, unicode_literals # This file is part of the ISIS IBEX application. # Copyright (C) 2012-2016 Science & Technology Facilities Council. # All rights reserved. # # This program is distributed in the hope that it will be useful. # This program and the accomp...
utility.py
"""Contains general utility functions to be used by the execution server.""" import os import signal import json import sys import subprocess import threading import platform def load_configuration(): config_file_name = os.path.join(os.path.dirname(__file__), 'config.json') config = json.load(open(config_fil...
watcher_monitor.py
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
dokku-installer.py
#!/usr/bin/env python3 import cgi import json import os import re try: import SimpleHTTPServer import SocketServer except ImportError: import http.server as SimpleHTTPServer import socketserver as SocketServer import subprocess import sys import threading VERSION = 'v0.20.0' def bytes_to_string(b): ...
uploader-gui.py
#!/usr/bin/env python3 VERSION = " v1.10" VERSION_DATE =" Apr.2020 - Jun.2021" print("Arduboy Uploader GUI/FX activator/flasher" + VERSION + VERSION_DATE + " by Mr.Blinky running\n") from tkinter import filedialog from tkinter import * from tkinter.ttk import * from threading import Thread from tkinter import...
test_sqlqueue.py
# coding=utf-8 import random import shutil import sys import tempfile import unittest from threading import Thread from persistqueue import SQLiteQueue, FILOSQLiteQueue, UniqueQ from persistqueue import Empty from persistqueue.serializers import json as internal_json class SQLite3QueueTest(unittest.TestCase): d...
chart.py
import threading import matplotlib as mpl from mpl_toolkits.mplot3d import Axes3D import numpy as np import matplotlib.pyplot as plt import data from data import R fig = None axis = None # Creates an chart def createChart(): print("Initlialising plot") global fig, axis mpl.rcParams['legend.fontsize'] ...
save.py
#!/usr/bin/python import requests import sys import shutil import re import threading from BeautifulSoup import BeautifulSoup as soup THREAD_COUNTER = 0 THREAD_MAX = 5 def get_source( link ): r = requests.get( link ) if r.status_code == 200: return soup( r.text ) else: sys.exit( "[~] I...
websocketApi2.py
# -*- coding: utf-8 -*- import websocket import gzip import time import StringIO import json import zlib import json from threading import Thread from urlparse import urlparse import hmac import hashlib import requests import os import warnings from Queue import Queue, Empty SECRET = 'tRJs6HQP-cnpMnEB7-T9xRGOGM-TOusH...
daemon_tunnel_example.py
# daemon_tunnel_example.py """ Example showing how to use the DaemonTunnel to create an SSH tunnel to an object sitting on a remote server. This uses the daemon's URI on the remote server. Note that I use "remote_alias" as argument for remote_server_name. This corresponds to some SSH config alias that's sitting on my ...
conftest.py
# -*- coding: utf-8 -*- from __future__ import (absolute_import, unicode_literals, print_function, division) import threading try: import mock except ImportError: import unittest.mock as mock import pytest import valve.source.a2s import valve.source.master_server import valve.testing...
instrument.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Abstract serial instrument """ import queue import threading import logging from time import sleep __author__ = "Brent Maranzano" __license__ = "MIT" logger = logging.getLogger("instrument") class Instrument(object): """Abstract serial instrument that provides...
model.py
#!/usr/bin/env python3 from os import environ, path from queue import Queue from threading import Thread from typing import Callable, List, NoReturn, Optional, Union, cast import torch import numpy as np from loguru import logger from transformers import GPT2LMHeadModel, GPT2Tokenizer import random from nltk import ...
ipython.py
r""" The ParaViewWeb iPython module is used as a helper to create custom iPython notebook profile. The following sample show how the helper class can be used inside an iPython profile. # Global python import import exceptions, logging, random, sys, threading, time, os # Update python path to have ParaView libs pv_pa...
app.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
leetcode.py
import json import logging import re import time import os import pickle from threading import Semaphore, Thread, current_thread try: from bs4 import BeautifulSoup import requests inited = 1 except ImportError: inited = 0 try: import vim except ImportError: vim = None try: import browser_...
Principal.py
from iqoptionapi.stable_api import IQ_Option from PyQt5 import uic, QtWidgets from PyQt5.QtWidgets import QMessageBox import threading import time, configparser, logging, sys from datetime import datetime, timedelta from dateutil import tz import json logging.disable(level=(logging.DEBUG)) logging.disable(level=(loggi...
test_partition_20.py
import threading import pytest from base.partition_wrapper import ApiPartitionWrapper from base.client_base import TestcaseBase from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from common.code_mapping import PartitionErrorMessage prefix = ...
utils.py
# -*- coding: utf-8 -*- from __future__ import print_function __true_print = print # noqa import os import sys import pdb import time import json import datetime import argparse import threading import logging import string import random # import multiprocessing # import numpy # import psutil import h5py # import do...
threads.py
import sys import mpi4py mpi4py.profile('mpe', logfile='threads') from mpi4py import MPI from array import array try: import threading except ImportError: sys.stderr.write("threading module not available\n") sys.exit(0) send_msg = array('i', [7]*1000); send_msg *= 1000 recv_msg = array('i', [0]*1000); rec...
control.py
import atexit import errno import io import logging import mmap import os.path import pickle import queue import shutil import subprocess import tempfile import threading import types import uuid from collections import abc from shlex import quote import __main__ from speedling import conf # temporary solution with t...
dream_socket.py
from socket import AF_INET, SOCK_STREAM, socket, SOL_SOCKET, SO_REUSEADDR import asyncio async def echo_server(address): sock = socket(AF_INET, SOCK_STREAM) sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, True) sock.bind(address) sock.listen(5) while True: client, addr = await sock.accept() ...
utils.py
from __future__ import print_function from os.path import dirname, join from six.moves.http_client import HTTPConnection from threading import Thread from six.moves.BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from socket import error from sys import stderr from re import search from collective.solr.local ...
deletionwatcher.py
import json import requests import time import websocket from bs4 import BeautifulSoup from threading import Thread from metasmoke import Metasmoke from globalvars import GlobalVars from datahandling import is_false_positive, is_ignored_post, get_post_site_id_link class DeletionWatcher: @classmethod def updat...