source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
task.py | # -*- coding:utf-8 -*-
from flask import Flask
from flask import request
from flask import jsonify
from json import dumps
from socket import gethostname
from socket import gethostbyname
from multiprocessing import Process
from requests import post
from requests import put
from requests import codes
from crawler import ... |
window.py | import threading, time
from gi.repository import Gtk, GObject, Gdk
from pywinusb.creator import USBCreator
from pywinusb.progress import ProgressWindow
# Okno aplikacji
class AppWindow(USBCreator, Gtk.Window):
def __init__(self):
super().__init__()
Gtk.Window.__init__(self, title="pyWinUSB")
... |
socket_server.py | import tornado.websocket as ws
import uuid
import logging
import threading
from tornado.httpclient import HTTPClient
import time
import asyncio
logging.basicConfig(level=logging.INFO)
class WebSocket(ws.WebSocketHandler):
clients = {}
def __init__(self, application, request, *args, **kwargs):
su... |
1242. Web Crawler Multithreaded.py | """
1242. Web Crawler Multithreaded
Given a url startUrl and an interface HtmlParser, implement a Multi-threaded web crawler to crawl all links that are under the same hostname as startUrl.
Return all urls obtained by your web crawler in any order.
Your crawler should:
Start from the page: startUrl
Call HtmlParser.... |
assistant_library_with_button_demo.py | #!/usr/bin/env python3
# Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... |
multiprocessing__QApplication__create_child_process__with__Tkinter_and_Qt.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
from multiprocessing import Process
def go_qt(name):
from PyQt5.Qt import QApplication, Qt, QLabel
app = QApplication([])
mw = QLabel()
mw.setAlignment(Qt.AlignCenter)
mw.setMinimumSize(150, 50)
mw.setText('Hello, ' + n... |
client.py | # coding=utf-8
import sys
import logging
import configparser
from tabulate import tabulate
import multiprocessing as mp
from selenium import webdriver
import hashlib
import hmac
import requests
import time
from operator import itemgetter
from .helpers import date_to_milliseconds, interval_to_milliseconds
from .exceptio... |
test_sb_imapfilter.py | # Test sb_imapfilter script.
import re
import sys
import time
import email
import types
import socket
import threading
import imaplib
import unittest
import StringIO
try:
IMAPError = imaplib.error
except AttributeError:
IMAPError = imaplib.IMAP4.error
import sb_test_support
sb_test_support.fix_sys_path()
fr... |
lisp-itr.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... |
threading_poller.py | # Copyright 2015 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... |
Deposits.py | # This file contains program to store records of all fee depositors
# Importing necessary libraries
from tkinter import *
import threading
from tkcalendar import DateEntry
import string
import pandas as pd
import time
from tkinter import ttk
from Classes import *
try:
table = pd.read_excel('Students_Records.xl... |
P2Pchat.py | import netifaces
import argparse
import os
import zmq
import threading
def recieve(message):
ctx = zmq.Context.instance()
reciever = ctx.socket(zmq.SUB)
for last in range(1, 255):
reciever.connect("tcp://{0}.{1}:9000".format(message, last))
reciever.setsockopt(zmq.SUBSCRIBE, b'')
while T... |
main_scenario.py | from hh_automation_server import HhAutomationHTTPRequestHandler, Automaton
from random import randint
import logger
import time
from http.server import ThreadingHTTPServer
from threading import Thread
import sqlite3
import sys
import configparser
class MainScenario():
config = configparser.ConfigParse... |
collision_avoidance_controller.py | import logging
import logging.config
import sys
import threading
from amberclient.common.amber_client import AmberClient
from amberclient.hokuyo.hokuyo import HokuyoProxy
from amberclient.roboclaw.roboclaw import RoboclawProxy
import os
from amberdriver.collision_avoidance import collision_avoidance_pb2
from amberdri... |
update_repository_manager.py | """
Determine if installed tool shed repositories have updates available in their respective tool sheds.
"""
import logging
import threading
from sqlalchemy import false
from galaxy import util
from galaxy.tool_shed.util.repository_util import get_tool_shed_status_for_installed_repository
from galaxy.tool_shed.util.s... |
s3cp.py | #!/usr/bin/env python
#
# AWS S3 Bucket Copy
#
import errno
import fcntl
import argparse
import logging
import os
import os.path
import sys
import time
import socket
import datetime
import itertools
import string
import Queue
import threading
from collections import defaultdict
import boto
import boto3
import boto3.... |
sensor_interface.py | import copy
import logging
import numpy as np
import os
import time
from threading import Thread
import carla
from srunner.scenariomanager.carla_data_provider import CarlaDataProvider
def threaded(fn):
def wrapper(*args, **kwargs):
thread = Thread(target=fn, args=args, kwargs=kwargs)
thread.setDa... |
test_ServerUpdater.py |
# Copyright 2016 Battelle Energy Alliance, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... |
test_decimal.py | # Copyright (c) 2004 Python Software Foundation.
# All rights reserved.
# Written by Eric Price <eprice at tjhsst.edu>
# and Facundo Batista <facundo at taniquetil.com.ar>
# and Raymond Hettinger <python at rcn.com>
# and Aahz (aahz at pobox.com)
# and Tim Peters
"""
These are the test cases for... |
AutoClicker.py | from pynput.mouse import Button, Controller
from pynput.keyboard import Key, Listener
import threading, time
cps = float(input("Enter the delay in seconds: "))
for i in range(3): print(f"\n {i+1}"); time.sleep(1)
print("\n GO\n\n Press ESCAPE to stop.\n\n\n")
mouse = Controller()
Spam = True
def o... |
main.py | from PySimpleGUI import PySimpleGUI as sg
from multiprocessing import Process, Manager, freeze_support
from classes.action_functions import Action_functions, Actual_signal, Where_save
from classes.process import Process as Operate
from classes.layouts import Layouts
from classes.readTXT import Read
from classes.api_ma... |
ShopApp.py | import json
import os
import sys
from os.path import exists
from threading import Thread
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtGui import QFontDatabase
from PyQt5.QtWidgets import QApplication
from ipregistry import IpregistryClient
from Frames.functions.getLogin import getTokens
from app import app
from ma... |
controller.py | #!/usr/bin/env python
"""A controller """
import json
import logging
import os
import time
import httplib
import sys
import requests
from kubernetes import client, config
from kubernetes.client.rest import ApiException
import crd
from multiprocessing import Process
from google.cloud import pubsub_v1
GROUP = "kubele... |
seam_erasure.py | """
Erase texture seams to prevent visible seams or tearing in various texture
maps (color, normal, displacement, ambient occlusion, etc.)
Written by Zachary Ferguson
"""
import sys
from multiprocessing import Process # For progress spinner
import logging
import scipy
import numpy
from recordclass import recordclas... |
solariot.py | #!/usr/bin/env python3
# Copyright (c) 2017 Dennis Mellican
#
# 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, mod... |
main.py | try:
import asyncio
except ImportError:
raise RuntimeError("This requries at least Python3.4/asyncio")
#LIBRARIES
#from geopy import distance
from faker import Faker
from geopy import distance
#import time
import random
from flask import Flask, render_template, request
from tornado.httpserver import HTTPServe... |
record_demo.py | import os
import sys
import time
import torch
import threading
import numpy as np
from pynput import keyboard
from pytorchrl.agent.env import VecEnv
from pytorchrl.envs.animal_olympics.animal_olympics_env_factory import animal_train_env_factory
from code_examples.train_animalai.ppod.train import get_args
pressed_key... |
macos.py | # Original work Copyright 2016 Google Inc. 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 applic... |
kahoot.py | import time
import threading
from selenium import webdriver
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
class KahootBotter:
def __init__(self):
... |
manager.py | """
Copyright (c) 2010-2012, Contrail consortium.
All rights reserved.
Redistribution and use in source and binary forms,
with or without modification, are permitted provided
that the following conditions are met:
1. Redistributions of source code must retain the
above copyright notice, this list of conditions
... |
manager.py | # -*- coding: utf-8 -*-
"""
:copyright: (C) 2010-2013 by Contrail Consortium.
"""
from threading import Thread
from conpaas.core.expose import expose
from conpaas.core.manager import BaseManager
from conpaas.core.https.server import HttpJsonResponse, HttpErrorResponse
from conpaas.services.selenium.agent impor... |
utils.py | import threading
from apscheduler.schedulers.blocking import BlockingScheduler
from datetime import datetime
# 启动nacos心跳服务
class StartNacosBeat(object):
instance = None
event_lock = threading.Event()
def __new__(cls, *args, **kwargs):
if StartNacosBeat.instance:
return StartNacosBeat.i... |
module.py | #!/usr/bin/env python
import rospy
from success_ros_msgs.msg import DetectedMarkers
import time
import tf2_ros
import tf2_geometry_msgs
import threading
from geometry_msgs.msg import PoseStamped
class ArucoTagModule(object):
"""Wrapper for Aruco Module
"""
def __init__(self, topic_name='/markers'):
... |
ui.py | from importlib import util
import tkinter as tk
import threading
import time
import json
import os
import sys
import functools
import typing
import modules.modloader
class UI:
def __init__(self, autostart = True):
self.ready = {'tkthread': False}
self.triggers = {}
self.root = Non... |
mp_fork_bomb.py | import multiprocessing as multiprocess, sys
def foo():
print("123")
# Because "if __name__ == '__main__'" is missing this will not work
# correctly on Windows. However, we should get a RuntimeError rather
# than the Windows equivalent of a fork bomb.
if len(sys.argv) > 1:
multiprocess.set_start_method(sys.a... |
Gamma.py | import numpy
from tqdm import tqdm
from multiprocessing import Pool, Value, Array, Lock
from ctypes import c_double
from contextlib import closing
from threading import Thread
from StatTools.analysis.dfa import bar_manager
from functools import partial
class GammaReplacement():
def __init__(self, dataset, set_me... |
paratyper.py | #!/usr/bin/env python3
from olctools.accessoryFunctions.accessoryFunctions import GenObject, make_path, MetadataObject, SetupLogging, \
run_subprocess, write_to_logfile
from genemethods.sipprCommon.objectprep import Objectprep
from argparse import ArgumentParser
from threading import Thread
from queue import Queue
... |
test-compl-mqtt.py | import cv2
import io
import socket
import struct
import time
import pickle
import zlib
import serial
import time
import sys
import multiprocessing
from multiprocessing import Queue
import paho.mqtt.client as mqtt
Conected = False
ArduinoOn = False
def cam():
global Conected
client_socket = socket.socket(sock... |
worker.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import atexit
import collections
import colorama
import copy
import hashlib
import inspect
import json
import numpy as np
import os
import redis
import signal
import sys
import threading
import time
import trac... |
ssh.py | import inspect
import logging
import os
import re
import shutil
import string
import sys
import tarfile
import tempfile
import threading
import time
import types
from .. import term
from ..context import context
from ..log import Logger
from ..log import getLogger
from ..timeout import Timeout
from ..util import hashe... |
apkleaks.py | #!/usr/bin/env python3
from apkleaks.colors import clr
from contextlib import closing
from distutils.spawn import find_executable
from pyaxmlparser import APK
from urllib.request import urlopen
from zipfile import ZipFile
import io
import json
import logging.config
import mimetypes
import numpy
import os
import re
impo... |
keep_alive.py | from flask import Flask, render_template
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return render_template("home.html")
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start() |
environment.py | import base64
import http.server
import json
import msgpack
import socketserver
import threading
"""
These mock severs are for the v2 indexer/algod path and response tests.
I was unable to get 'before_all' and 'after_all' working anywhere else besides
a file named 'environment.py in this directory. Otherwise all of t... |
server.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
linkcheck.py | # -*- coding: utf-8 -*-
"""
sphinx.builders.linkcheck
~~~~~~~~~~~~~~~~~~~~~~~~~
The CheckExternalLinksBuilder class.
:copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
import socket
import threading
from os import path
from six.... |
test_basic_auth.py | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import base64
import os
import threading
from contextlib import contextmanager
from http.server import BaseHTTPRequestHandler, HTTPServer
from pants.auth.basic_auth import BasicAuth, Basi... |
RTTMeasurement.py | #!/usr/bin/env python3
# -*- encoding: utf-8 -*-
import argparse
import json
import logging
import os
import random
import shlex
import signal
import socket
import subprocess
import threading
import time
import queue
class RTTMeasurement(object):
def __init__(self, host_list=[], port=6666, bind_ip = "0.0.0.0", o... |
tests.py | from __future__ import unicode_literals
import threading
import time
from multiple_database.routers import TestRouter
from django.conf import settings
from django.db import connection, router, transaction
from django.db.utils import DEFAULT_DB_ALIAS, ConnectionHandler, DatabaseError
from django.test import (
Tra... |
_keyboard_tests.py | # -*- coding: utf-8 -*-
"""
Side effects are avoided using two techniques:
- Low level OS requests (keyboard._os_keyboard) are mocked out by rewriting
the functions at that namespace. This includes a list of dummy keys.
- Events are pumped manually by the main test class, and accepted events
are tested against ... |
unsync.py | import asyncio
import concurrent
import functools
import inspect
import threading
import os
from threading import Thread
from typing import Generic, TypeVar
class unsync(object):
thread_executor = concurrent.futures.ThreadPoolExecutor()
process_executor = None
loop = asyncio.new_event_loop()
thread = ... |
core.py | from queue import Queue
from threading import Thread
from .conn import BoilerConn
from .controller import WaterColumnController, WaterTempController
from .reader import WaterColumnReader, WaterTempReader
class Main(object):
def __init__(self):
self._threads = []
self.column_queue = Queue()
... |
__init__.py | """
objectstore package, abstraction for storing blobs of data for use in Galaxy.
all providers ensure that data can be accessed on the filesystem for running
tools
"""
import logging
import os
import random
import shutil
import threading
import time
from xml.etree import ElementTree
import yaml
try:
from sqlalc... |
test_filesink_compression.py | import pytest
import os
import sys
import loguru
from loguru import logger
import datetime
import threading
import time
@pytest.mark.parametrize(
"compression", ["gz", "bz2", "zip", "xz", "lzma", "tar", "tar.gz", "tar.bz2", "tar.xz"]
)
def test_compression_ext(tmpdir, compression):
i = logger.add(str(tmpdir.j... |
ExpressionAPIServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from wsgiref.simple_server import make_server
import sys
import json
import traceback
import datetime
from multiprocessing import Process
from getopt import getopt, GetoptError
from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\
JSONRPCError, Inva... |
drEngine.py | # encoding: UTF-8
'''
本文件中实现了行情数据记录引擎,用于汇总TICK数据,并生成K线插入数据库。
使用DR_setting.json来配置需要收集的合约,以及主力合约代码。
'''
import json
import os
import copy
from collections import OrderedDict
from datetime import datetime, timedelta
from Queue import Queue
from threading import Thread
from eventEngine import *
from vtGateway import V... |
ParallelUploadServiceProvider.py | import time
from threading import Thread
from abc import abstractmethod
from queue import Queue
from src.service_provider.AbstractServiceProvider import AbstractServiceProvider
class ParallelUploadServiceProvider(AbstractServiceProvider):
def __init__(self, uploadTool, config):
super(ParallelUploadService... |
tunnel.py | import os
from multiprocessing import Process
import time
import threading
import socket
import signal
import logging
logger = logging.getLogger()
class Tunnel(object):
bind_address = '127.0.0.1'
remote_socket = None
local_socket = None
server_socket = None
def __init__(self, src_port, dst_port, ... |
fd_test.py | import threading, select, pickle, os, struct
class Q:
def __init__(self): ### Q object that uses a threading Lock and bytes pipe file for put() and get() ###
self.lock = threading.Lock()
self.rq, self.wq = os.pipe() # Pipe returns two file descriptors, this class's fileno and read mothods referenc... |
instrument_protocol.py | #!/usr/bin/env python
"""
@package ion.services.mi.instrument_protocol Base instrument protocol structure
@file ion/services/mi/instrument_protocol.py
@author Steve Foley,
Bill Bollenbacher
@brief Instrument protocol classes that provide structure towards the
nitty-gritty interaction with individual instrument... |
symbol.py | import abc
import asyncio
import collections
import json
import time
import multiprocessing
from typing import List, Tuple, Dict, Union
import websockets
VariableSymbol = collections.namedtuple("VariableSymbol", ["id", "value", "is_rtl"])
GeneratorVariableSymbol = collections.namedtuple("GeneratorVariableSymbol", ["n... |
collection_replica.py | # Copyright 2014-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... |
test_celery.py | import threading
import pytest
pytest.importorskip("celery")
from sentry_sdk import Hub, configure_scope
from sentry_sdk.integrations.celery import CeleryIntegration
from sentry_sdk._compat import text_type
from celery import Celery, VERSION
from celery.bin import worker
@pytest.fixture
def connect_signal(request... |
sms.py | """
Copyright (c) 2016-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
-
Handles outgoing SMS and deli... |
get_inside_temp.py | #!/usr/bin/env python2
# Copyright 2016 The Flexbox Authors. All rights reserved.
# Licensed under the open source MIT License, which is in the LICENSE file.
from flexbox import sensors
from flexbox import psql
from Queue import Queue
from threading import Thread
import time
from datetime import datetime
import yaml
w... |
app.py | # encoding: utf-8
'''
A REST API for Salt
===================
.. py:currentmodule:: salt.netapi.rest_cherrypy.app
:depends:
- CherryPy Python module.
Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through
3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use
... |
prisonersDilemma.py | import os
import itertools
import importlib
import numpy as np
import random
from tqdm import tqdm
from threading import Thread
from time import sleep
STRATEGY_FOLDER = "exampleStrats"
RESULTS_FILE = "results.txt"
done = 0
pointsArray = [[1,5],[0,3]] # The i-j-th element of this array is how many point... |
test.py | #!/usr/bin/env python3
# Copyright 2020 Anapaya Systems
import http.server
import time
import threading
from plumbum import cmd
from acceptance.common import base
from acceptance.common import tools
from acceptance.common import scion
class Test(base.TestBase):
"""
Constructs a simple Hidden Paths topolog... |
contract_invoker.py | # Copyright 2020 Dragonchain, Inc.
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
# 6. Tr... |
tf_util.py | import numpy as np
import tensorflow as tf # pylint: ignore-module
import copy
import os
import functools
import collections
import multiprocessing
def switch(condition, then_expression, else_expression):
"""Switches between two operations depending on a scalar value (int or bool).
Note that both `then_expres... |
test_client.py | import timeit
import multiprocessing
from speedysvc.client_server.base_classes.ClientMethodsBase import ClientMethodsBase
from speedysvc.test.test_server import TestServerMethods as srv
from speedysvc.client_server.network.NetworkClient import NetworkClient
from speedysvc.client_server.shared_memory.SHMClient import S... |
test4.py | import datetime
import operator
import threading
import easyquotation
from util import mysqlUtil
from time import strftime, localtime
import tushare as ts
quotation = easyquotation.use('sina') # 新浪 ['sina'] 腾讯 ['tencent', 'qq']
# 初始化tushare
tspro = ts.pro_api('679167463f27215174d15fc1f1cb216577b41f5f67d5740acce52f0b... |
debug_data_multiplexer_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... |
utils.py | #!/usr/bin/env python
import csv
import itertools
from collections import OrderedDict
import re
import sys
import os
import inspect
from jtutils import pairwise
def readcsv(f):
if isinstance(f, file):
f_in = f
for r in _readcsv(f_in):
yield r
elif isinstance(f, str):
with op... |
lock.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""These tests ensure that our lock works correctly.
This can be run in two ways.
First, it can be run as a node-local t... |
client.py | import logging
try:
import queue
except ImportError: # pragma: no cover
import Queue as queue
import signal
import threading
import time
import six
from six.moves import urllib
try:
import requests
except ImportError: # pragma: no cover
requests = None
try:
import websocket
except ImportError: #... |
val.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Validate a trained YOLOv5 model accuracy on a custom dataset
Usage:
$ python path/to/val.py --weights yolov5s.pt --data coco128.yaml --img 640
Usage - formats:
$ python path/to/val.py --weights yolov5s.pt # PyTorch
... |
random_shuffle_queue_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... |
test_openstack.py | #!/usr/bin/env python
from http.server import BaseHTTPRequestHandler, HTTPServer
import collections
import sys
from threading import Thread
import mock
import pytest
def import_module():
class MockCollectd(mock.MagicMock):
@staticmethod
def log(log_str):
print(log_str)
debug ... |
psutils.py | #
# Copyright (C) 2014-2017 Pico Technology Ltd. See LICENSE file for terms.
#
"""
Basic and helper functions/classes used in PicoScope modules
"""
import ctypes
from ctypes import *
from ctypes.util import find_library
import tables as tb
import numpy as np
import threading as th
import Queue
import sys
import os.pat... |
leetcode.py | # coding:utf-8
import re
import json
import os
import threading
import time
import requests
from requests.exceptions import RequestException
from bs4 import BeautifulSoup
def get_proble_set(url):
try:
response = requests.get(url, headers = {
'User-Agent': "Mozilla/5.0 (Windows NT 10.0; Win64; x... |
follow_waypoints.py | #!/usr/bin/env python
import threading
import rospy
import actionlib
from smach import State,StateMachine
from move_base_msgs.msg import MoveBaseAction, MoveBaseGoal
from geometry_msgs.msg import PoseWithCovarianceStamped, PoseArray ,PointStamped
from std_msgs.msg import Empty
from tf import TransformListener
import t... |
pickletester.py | import collections
import copyreg
import dbm
import io
import functools
import os
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
from test import support
from test.support import (... |
perf_test_mock_service_v2_concurrent.py | import requests
import threading
import queue
import sys
import time
# Global variables
queue_results = queue.Queue()
start_time = 0
#
# # request per seconds
# rps_mean = 0
# total_tested_requests = 0
# total_tested_time = 0
# total_pass_requests = 0
#
# # time per request
# tpr_min = 999
# tpr_mean = 0
# tpr_ma... |
test_scheduler.py | from datetime import datetime, timedelta
import os
import signal
import time
from threading import Thread
from rq import Queue
from rq.compat import as_text
from rq.job import Job
from rq_scheduler import Scheduler
from rq_scheduler.utils import to_unix, from_unix, get_next_scheduled_time
from tests import RQTestCase... |
avatar_protocol.py | import threading
import logging
from queue import Queue, Empty
from avatar.util.reference import Reference
from avatar.interfaces.avatar_stub.avatar_protocol_lowlevel import AvatarLowlevelProtocol
from avatar.interfaces.avatar_stub.avatar_messages import create_avatar_message
from avatar.interfaces.avatar_stub.avatar_e... |
multi_runner.py |
import multiprocessing as mp
import extern
class MultiRunner(object):
def __init__(self, num_threads):
self._num_threads = num_threads
def __workerThread(self, queueIn, queueOut):
"""Process each data item in parallel."""
while True:
program_index, program, stdin = queueIn... |
Module.py | import serial
from serial.tools import list_ports
import threading
import time
import datetime
import math
import warnings
from dynamikontrol.Protocol import Module2PC, PC2Module
from dynamikontrol.LED import LED
from dynamikontrol.BaseLED import BaseLED
from dynamikontrol.Motor import Motor
from dynamikontrol.Switch... |
test_signal.py | import errno
import os
import random
import signal
import socket
import statistics
import subprocess
import sys
import time
import unittest
from test import support
from test.support.script_helper import assert_python_ok, spawn_python
try:
import _testcapi
except ImportError:
_testcapi = None
class GenericTes... |
pool.py | import logging
import os
import sys
import random
import traceback
from uuid import uuid4
import collections
from multiprocessing import Process
from multiprocessing import Queue as MPQueue
from queue import Full as QueueFull, Empty as QueueEmpty
from django.conf import settings
from django.db import connection as dj... |
brute.py | from typing import ValuesView
import Cerbrutus.services as services
import time
import sys
import threading
from colorama import Fore, Style
'''
Add estimated time remaining...
Add output of how long its been running for already every few minutes.
'''
class BruteUtil:
threads = []
start = time... |
Beigebook.py | # -*- coding: utf-8 -*-
from __future__ import print_function
from bs4 import BeautifulSoup
from urllib.request import urlopen
import re
import pandas as pd
import pickle
import threading
import sys
class BeigeBooks(object):
'''
This class firstly extracts the release month of each previous Beige B... |
test_restful.py | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
NOTE:
This unittest is being used as a procedural test.
The tests must be run in-order and CANNOT be parallelized!
Tests all but two RESTful interfaces:
* agent's POST /keys/vkey
- Done by CV a... |
Cloud.py | import websocket
import json
import time
import threading
from pymitter import EventEmitter
import string
class Encoder:
def __init__(self, codec: list = list(string.ascii_uppercase + string.ascii_lowercase + string.digits + string.punctuation + ' ')):
self.codec = codec
class CloudVariable:
def... |
DeFiTranscation.py | # -*- coding: utf-8 -*-
"""
Created on Sun Aug 22 15:12:20 2021
@author: Zain
"""
import threading
import time
import winsound
from os import system
from bs4 import BeautifulSoup as bsp
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from web3 import Web3
from webdriver_manager.ch... |
threads.py |
import sys, logging, threading, multiprocessing
import queue
from . import WorkManager, WMFuture
import work_managers
log = logging.getLogger(__name__)
class Task:
def __init__(self, fn, args, kwargs, future):
self.fn = fn
self.args = args
self.kwargs = kwargs
self.future... |
avatar_protocol_lowlevel.py | #!/usr/bin/env python3
import threading
from select import select
import time
from avatar.util.indexable_queue import IndexableQueue
from avatar.util.checksum import Crc8
import logging
from functools import reduce
from avatar.interfaces.avatar_stub.avatar_messages import parse_avatar_message
log = logging.getLogger... |
session.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@File : session.py
@Time : 2022/03/08 21:58:12
@Author : felix
@Version : 1.0
@Contact : laijia2008@126.com
@License : (C)Copyright 2021-2025, felix&lai
@Desc : 用于协议测试连接会话
'''
# here put the import lib
import selectors
import socket
import qu... |
tutorial_mscolab.py | """
mss.tutorials.tutorial_mscolab
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This python script generates an automatic demonstration of how to use Mission Support System Collaboration for users
to collaborate in flight planning and thereby explain how to use it's various functionalities.
This file is part of ... |
jsonrpc_stream.py | # pyre-strict
from __future__ import absolute_import, division, print_function, unicode_literals
import json
from queue import Empty, Queue
from threading import Thread
from typing import BinaryIO, Optional
from utils import Json
class JsonRpcStreamReader:
def __init__(self, stream: BinaryIO) -> None:
... |
twisted_test.py | # Author: Ovidiu Predescu
# Date: July 2011
#
# 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.