source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
train_policy.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany
Adapted for use in CS294-112 Fall 2018 HW5 by Kate Rakelly and Michael Chang
"""
import numpy ... |
MoveRobot.py | #author: Rami Chaari
#!/usr/bin/python
# -*- coding: utf-8 -*-
from Motor import Motor
from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMotor, Adafruit_StepperMotor
import threading
from multiprocessing import Process, current_process
class MoveRobot:
angle = 0
distance = 0
MotorLef... |
RADIO REC NEW VERSION and NEW next FRONTEND 3.py | import sys, time, threading
# pip install python-vlc
import vlc
from guiradio import *
from time import strftime
from tkinter import filedialog
import pygame
import tkinter.font as TkFont
#import mp3play
from pygame import mixer
import imageio
from PIL import Image, ImageTk
from PyQt5 import QtCo... |
server.py | import socket
import sys
import threading
import time
from queue import Queue
NUMBER_OF_THREADS = 2
JOB_NUMBER = [1, 2]
queue = Queue()
all_connections = []
all_address = []
# Create a socket (connect to computer)
def create_socket():
try:
global host
global port
global s
host = ... |
bob.py | __author__ = "mashed-potatoes"
from threading import Thread
from os import _exit
from modules.hamming import *
from modules.config import *
from modules.iohelper import update_file
from modules.sender import RemoteHost
from modules.http_server import NetIO
from modules.logger import Logger
from modules.qber import cal... |
splunk_hec_logging_handler.py | from __future__ import absolute_import
import json
import logging
import os
import threading
import time
import datetime
import socket
import traceback
import platform
import commands
import atexit
from requests_futures import sessions
def setInterval(interval):
def decorator(function):
def wrapper(*args, ... |
px.py | "Px is an HTTP proxy server to automatically authenticate through an NTLM proxy"
"Me Test on GitHub"
from __future__ import print_function
__version__ = "0.4.0"
import base64
import ctypes
import ctypes.wintypes
import multiprocessing
import os
import select
import signal
import socket
import sys
import threading
im... |
transit_search_worker_v1.py | #!../../../../datadir_local/virtualenv/bin/python3
# -*- coding: utf-8 -*-
# transit_search_worker_v1.py
"""
Run speed tests as requested through the RabbitMQ message queue
This version receives all messages via a single connecion to the message queue, which is vulnerable to timing out
See:
https://stackoverflow.com... |
etcd_rendezvous.py | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
import datetime
import json
import logging
import random
import sys
import threading
impo... |
test_window_runner.py | # Copyright 2021 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... |
__init__.py | #! python3
import atexit
import json
from queue import Queue
import sys
from threading import Thread, Event, Lock
from subprocess import Popen, PIPE
from os import path, environ
from .__pkginfo__ import __version__
NODE_EXECUTABLE = "node"
VM_SERVER = path.join(path.dirname(__file__), "vm-server")
def eval(code, **... |
anybar.py | import threading
import socket
from i3pystatus import IntervalModule
class AnyBar(IntervalModule):
"""
This module shows dot with given color in your panel.
What color means is up to you. When to change color is also up to you.
It's a port of https://github.com/tonsky/AnyBar to i3pystatus.
Color ... |
rabbit.py | # -*- coding: utf-8 -*-
"""
Created on 21 August 2017
@author: dgrossman
"""
import logging
import threading
import time
from functools import partial
import pika
class Rabbit(object):
'''
Base Class for RabbitMQ
'''
def __init__(self):
self.logger = logging.getLogger('rabbit')
def make... |
3.thread_GIL.py | import threading
from queue import Queue
import copy
import time
def job(l, q):
res = sum(l)
q.put(res)
def multithreading(l):
q = Queue()
threads = []
for i in range(4):
t = threading.Thread(target=job, args=(copy.copy(l), q), name='T%i' % i)
t.start()
threads.append(t)
... |
website_receiver.py | import socket
import threading
import pickle
import os
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import unpad
import sys
AES_ENCRYPTION_KEY = b"N44vCTcb<W8sBXD@"
AES_BLOCKSIZE = 16
AES_IV = b"PoTFg9ZlV?g(bH8Z"
LISTEN_PORT = 1337
CHUNK_SIZE = 16384
GOOGLE_DNS_IP = "8.8.8.8"
DNS_PORT... |
PyBirthdayWish.py | #!/usr/bin/python3
import os,random
from threading import Thread
from time import sleep
import vlc
from termcolor import colored
from config import *
# Importing module specified in the config file
art = __import__(f'arts.{artFile}', globals(), locals(), ['*'])
def replaceMultiple(mainString, toBeRep... |
webauthn.py | """
Copyright 2018-present SYNETIS.
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 writing, s... |
_socketcan.py | # Copyright (c) 2019 UAVCAN Consortium
# This software is distributed under the terms of the MIT License.
# Author: Pavel Kirienko <pavel@uavcan.org>
import enum
import time
import errno
import typing
import socket
import struct
import select
import asyncio
import logging
import threading
import contextlib
import pyua... |
abstract_gatherer.py | '''
File: abstract_gatherer.py
Project: Envirosave: A simple attempt at saving a lot of
information about the execution environment at a given point
Author: csm10495
Copyright: MIT License - 2018
'''
import datetime
import os
import pprint
import threading
import time
import subprocess
GATHERER_MAGIC = '... |
Thread4.py | from threading import Thread
import time
""" 列表作为参数传递给线程,它和全局变量一样也是线程间共享的 """
def work1(nums):
nums.append(44)
print('---in work1---', nums)
def work2(nums):
time.sleep(1)
print('---in work2---', nums)
g_nums = [11, 22, 33]
t1 = Thread(target=work1, args=(g_nums,))
t1.start()
t2 = Thread(target=w... |
test_ga_robust_on_c7.py | '''
test for batch changing vm password
@author: SyZhao
'''
import apibinding.inventory as inventory
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import zstackwoodpecker.operations.vm_operations as vm_ops
import z... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet
from electrum.i18n import _
from electrum.paymentrequest import InvoiceStore
f... |
tcp_forwarding_multi_server.py | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2022, Vm, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.cub@gmail.com>
import time
import socket
import struct
import argparse
import threading
from forwarding import logger, create_tcp_socket_server, create_tcp_socket_client,... |
plotter.py | import numpy as np
import matplotlib
# Force matplotlib to not use any Xwindows backend.
matplotlib.use('Agg')
from matplotlib import pyplot as plt
from matplotlib import gridspec
from matplotlib import colors
from matplotlib import cm
from mpl_toolkits.mplot3d import Axes3D # noqa: F401 unused import
import networkx ... |
test_nn_trainer.py | # Copyright 2020 The FedLearner 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... |
concurrent_select.py | #!/usr/bin/env impala-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 (... |
base.py | #!/usr/bin/env python3
import fcntl
import logging
import os
import shlex
import subprocess
import threading
from barython.hooks import HooksPool
from barython.tools import splitted_sleep
logger = logging.getLogger("barython")
def protect_handler(handler):
def handler_wrapper(self, *args, **kwargs):
tr... |
main.py | import os
import sys
import random
import traceback
from tensorflow.keras.optimizers import RMSprop, Adam
from scipy.stats import rankdata
import math
import numpy as np
from tqdm import tqdm
import argparse
random.seed(42)
import threading
import configs
import logging
logger = logging.getLogger(__name__)
logging.bas... |
rdd.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 us... |
revocation_notifier.py | """
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
"""
import functools
import os
import signal
import sys
import threading
import time
from multiprocessing import Process
from typing import Optional
import requests
from keylime import config, crypto, json, keylime_logging, ... |
4wheels.py | #codigo por
#Eduardo Migueis
#Illy Bordini
#Guilherme Lima
from controller import Robot, Motor, DistanceSensor, Camera
import requests
from PIL import Image
import threading
import time
# cria a instancia do robo
robot = Robot()
time_step = 64
max_speed = 6.28
# motor
# rodas da frente
right_motor_front = robot.g... |
pipeline.py | """Pipeline building support for connecting sources and checks."""
import os
import traceback
from collections import defaultdict, deque
from concurrent.futures import ThreadPoolExecutor
from itertools import chain
from multiprocessing import Pool, Process, SimpleQueue
from pkgcore.package.errors import MetadataExcep... |
executor.py | """Server-like task scheduler and processor."""
import abc
import threading
import six
from jarvis.worker import base
RETRY_INTERVAL = 0.1
@six.add_metaclass(abc.ABCMeta)
class Executor(base.Worker):
"""Contract class for all the executors."""
def __init__(self, delay, loop):
super(Executor, self... |
pyagent.py | # -*- coding: utf-8 -*-
"""Agent - Agent object.
Manage wandb agent.
"""
from __future__ import print_function
import ctypes
import logging
import os
import socket
import threading
import time
from six.moves import queue
import wandb
from wandb import util
from wandb import wandb_sdk
from wandb.apis import Interna... |
OSC2.py | #!/usr/bin/python
"""
This module contains an OpenSoundControl implementation (in Pure Python), based
(somewhat) on the good old 'SimpleOSC' implementation by Daniel Holth & Clinton
McChesney.
This implementation is intended to still be 'simple' to the user, but much more
complete (with OSCServer & OSCClient classes) ... |
test_tracer.py | import time
import opentracing
from opentracing import (
child_of,
Format,
InvalidCarrierException,
UnsupportedFormatException,
SpanContextCorruptedException,
)
import ddtrace
from ddtrace.ext.priority import AUTO_KEEP
from ddtrace.opentracer import Tracer, set_global_tracer
from ddtrace.opentrace... |
backend.py | #!/usr/bin/env python3
import pika
import sys, os
import time
import threading
import logging
import redis
import queue
import pdfkit
import time
time.sleep(20)
xrange=range
if sys.argv[1:]:
max_threads = int(sys.argv[1])
else:
max_threads = int(os.environ.get('MAX_THREADS'))
logfile = os.environ.get('LOGF... |
azmi.py | # -*- coding: utf-8 -*-
#baru
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
from PyDictionary import PyDictionary
from bs4 import BeautifulSoup
from mergedict import MergeDict
from mergedict import ConfigDict
from gtts import gTTS
from pyowm import OWM
from enum import Enum
#from ... |
extract_feature.py | import modeling
import tokenization
from graph import optimize_graph
import args
from queue import Queue
from threading import Thread
import tensorflow as tf
import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
class InputExample(object):
def __init__(self, unique_id, text_a, text_b):
self.unique_id = uni... |
server_base.py | """
A base classes and utilities to provide a common set of behaviours for
the assemblyline core server nodes.
"""
import enum
import time
import threading
import logging
import signal
import sys
import io
import os
from typing import cast, Dict
from assemblyline.remote.datatypes import get_client
from assemblyline.re... |
__init__.py | """
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#
This file is part of the Smart Developer Hub Project:
http://www.smartdeveloperhub.org
Center for Open Middleware
http://www.centeropenmiddleware.com/
#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=... |
plugin.py | import sublime, sublime_plugin, json, threading
try:
from urllib2 import urlopen
except ImportError:
from urllib.request import urlopen
try:
from utils import cache
except:
from .utils import cache
@cache
def get_text(id):
try:
return (urlopen("http://sphereonlinejudge.herokuapp.com/pr... |
test_proxy.py | # -*- coding: utf8 -*-
# Copyright (c) 2019 Niklas Rosenstein
#
# 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, mo... |
test_httplib.py | import errno
from http import client
import io
import itertools
import os
import array
import socket
import threading
import unittest
TestCase = unittest.TestCase
from test import support
here = os.path.dirname(__file__)
# Self-signed cert file for 'localhost'
CERT_localhost = os.path.join(here, 'keycert.pem')
# Sel... |
crawling_to_db.py | from selenium import webdriver
import pandas as pd
from datetime import datetime
from multiprocessing import Process
from os import makedirs as mk
from os import path as pt
from os import listdir
from os.path import isfile, join
import time
import MySQLdb as db
import sys
def crawling(area,driver, count, cur_time):
... |
logParser.py | import threading, queue, re, time
DEBUG_LOG_PATH = '/var/log/tor/debug.log'
INTRO_ESTABLISHED_REGEX = '([A-Za-z]{2,3} [0-9]{1,2} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,2}.[0-9]{0,}) \[info\] service_handle_intro_established\(\): Successfully received an INTRO_ESTABLISHED cell on circuit ([0-9]{1,}) \(id: ([0-9]{1,})\)'
START_S... |
utils.py | #! coding=utf-8
__author__ = "Sriram Murali Velamur<sriram@likewyss.com>"
__all__ = ("ProcessManager",)
import sys
sys.dont_write_bytecode = True
from multiprocessing import Process, cpu_count, Pool
from time import sleep
import random
from types import FunctionType
class ProcessManager(object):
def __init__(se... |
backtester_vj_jj.py | import os
import sys
import sqlite3
import datetime
import pandas as pd
from matplotlib import gridspec
from matplotlib import pyplot as plt
from multiprocessing import Process, Queue
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from utility.setting import DB_TICK, DB_BACKTEST
from utili... |
pdf_viewer.py | import sys
from PyQt5 import QtWidgets
from multiprocessing import Process
from .window import Window
class PDFViewer:
"""
Viewer to show a PDF File
"""
def __init__(self, pdf, size):
"""
Initializes a pdf viewer for a certain pdf
:param pdf: pdf to be shown
""... |
cpuinfo.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) 2014-2020 Matthew Brennan Jones <matthew.brennan.jones@gmail.com>
# Py-cpuinfo gets CPU info with pure Python 2 & 3
# It uses the MIT License
# It is hosted at: https://github.com/workhorsy/py-cpuinfo
#
# Permission is hereby granted, free of charge, to any... |
hello.py | # Artificial-Assistant V1.0
'''
# Feature v1.0:
- Open some websites such as google, facebook, youtube, whatsapp, etc.
- Play a video on youtube. You can try by saying 'How to make a coffee on youtube' or 'youtube how to be a good person'.
'''
import __init__
from time import sleep
from tkinter import *... |
test_util.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
lifx-poly.py | #!/usr/bin/env python3
##!/home/e42/dev/py3_envs/udi-lifx-poly-venv/bin/python
"""
LiFX NodeServer for UDI Polyglot v2
by Einstein.42 (James Milne) milne.james@gmail.com
"""
import polyinterface
import time
import sys
import lifxlan
from copy import deepcopy
import json
from threading import Thread
from pathlib import... |
materialized_views_test.py | import collections
import re
import sys
import time
import traceback
import pytest
import threading
import logging
from flaky import flaky
from enum import Enum
from queue import Empty
from functools import partial
from multiprocessing import Process, Queue
from cassandra import ConsistencyLevel, InvalidRequest, Writ... |
lambda_executors.py | import os
import re
import sys
import glob
import json
import time
import logging
import threading
import traceback
import subprocess
import six
import base64
from multiprocessing import Process, Queue
try:
from shlex import quote as cmd_quote
except ImportError:
from pipes import quote as cmd_quote # for Pyth... |
chat.py | #!/usr/bin/env python3
import socket
import threading
import sys
import time
from random import randint
class Server:
connections = []
peers = []
def __init__(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bin... |
square_sum_recursion_all_variants.py | # This variant of the program will show every single possible way to complete a Square-Sum Hamiltonian Path
# with the chosen number.
# Note that half of these are just the reverse of the other half.
import threading
import time
from timeit import default_timer as timer
print("Choose length:")
count = int(input())
s... |
client.py | import socket
import random
from threading import Thread
from datetime import datetime
from colorama import Fore, init, Back
# init colors
init()
# set the available colors
colors = [Fore.BLUE, Fore.CYAN, Fore.GREEN, Fore.LIGHTBLACK_EX,
Fore.LIGHTBLUE_EX, Fore.LIGHTCYAN_EX, Fore.LIGHTGREEN_EX,
F... |
test_sync_clients.py | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
from azu... |
__init__.py | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
test_zeromq.py | # -*- coding: utf-8 -*-
"""
:codeauthor: Thomas Jackson <jacksontj.89@gmail.com>
"""
from __future__ import absolute_import, print_function, unicode_literals
import ctypes
import multiprocessing
import os
import threading
import time
from concurrent.futures.thread import ThreadPoolExecutor
import salt.config
impo... |
pebble.py | #!/usr/bin/env python
import array
import binascii
import glob
import itertools
import json
import logging
import os
import serial
import signal
import stm32_crc
import struct
import threading
import time
import traceback
import uuid
import zipfile
from collections import OrderedDict
from LightBluePebble import Light... |
test_main.py | import shutil
import subprocess
import threading
import sys
CMD = 'ffmpeg -y -i {input} -b:v {bit_rate}M -r {fps} -s hd{res} {output}'
def check_ffmpeg():
FFMPEG = shutil.which('ffmpeg')
if not FFMPEG:
raise FileNotFoundError('FFMPEG not found')
def test_func():
main("video.mp4")
def ffmpeg(... |
keylime_agent.py | #!/usr/bin/python3
'''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
import asyncio
import http.server
import multiprocessing
import platform
import datetime
import signal
from http.server import HTTPServer, BaseHTTPRequestHandler
from socketserver import ThreadingMixIn... |
PythonActuator.py | #!/usr/bin/env python
"https://github.com/jstasiak/python-zeroconf/blob/master/examples/registration.py"
from multiprocessing import Process
""" Example of announcing a service (in this case, a fake HTTP server) """
import logging
import socket
import ifaddr
import sys
from time import sleep
import numpy as np
impor... |
eventhub_detect_source.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from gnuradio import gr
from azure.eventhub import EventHubConsumerClient
from azure.schemaregistry import SchemaRegistryClient
from azure.schemaregistry.serializer.avroserializer import SchemaRegistryAvroSerializer
from azure.identity import DefaultAzureCredential
from ev... |
vc_branch.py | # -*- coding: utf-8 -*-
"""Prompt formatter for simple version control branchs"""
import os
import sys
import time
import queue
import builtins
import warnings
import threading
import subprocess
import xonsh.tools as xt
def _get_git_branch(q):
try:
branches = xt.decode_bytes(subprocess.check_output(
... |
sms_bomber.py | #dictawtor
#t.me/dictawt0r
import os
import time
import requests
from threading import Thread
proxy = {"https": "127.0.0.1:8000"}
def snap(phone):
#snap api
snapH = {"Host": "app.snapp.taxi", "content-length": "29", "x-app-name": "passenger-pwa", "x-app-version": "5.0.0", "app-version"... |
module.py |
import time
import logging
import queue
import threading
import mpd
import pyowm
import pydbus as dbus
from asteroid import Asteroid, DBusEavesdropper, WeatherPredictions
from gi.repository import GLib
def merge_dicts(first, second):
""" Recursively deep merges two dictionaries """
ret = first.copy()
for... |
test_sanity.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
import importlib
import logging
import pkgutil
from collections import defaultdict
import pytest
from multiprocessing import Queue, Process
from six import PY2
def imp... |
load_html.py | import webview
import threading
import time
"""
This example demonstrates how to load HTML in a web view window
"""
def load_html():
webview.load_url("http://www.baidu.com")
print(123123)
time.sleep(2)
webview.evaluate_js('alert("w00t")')
print(2222)
if __name__ == '__main__':
t = threading.T... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import copy
import datetime
from decimal import Decimal, Rounded
import re
import threading
import unittest
import warnings
from django.conf import settings
from django.core.exceptions import Improperly... |
bomber.py | #!/usr/bin/env python
from datetime import datetime
import os
import hashlib
import sys
import time
import threading
import string
import random
import base64
import urllib.request
import urllib.parse
try:
import requests
except ImportError:
print('[!] Error: some dependencies are not installed')
print('Ty... |
evaluation.py | import os
import pandas as pd
import numpy as np
from PIL import Image
import multiprocessing
import argparse
categories = ['background','aeroplane','bicycle','bird','boat','bottle','bus','car','cat','chair','cow',
'diningtable','dog','horse','motorbike','person','pottedplant','sheep','sofa','train','tvm... |
entrypoint.py | import json
from csv import DictReader
from datetime import datetime
from multiprocessing import Pipe, cpu_count
from pathlib import Path
from threading import Thread
from typing import Dict, Iterator, List, Optional, Tuple
import yaml # type: ignore
from click import Choice
from click.utils import echo
from pydantic... |
maas_telegraf_format.py | #!/usr/bin/env python
# Copyright 2017, Rackspace US, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
rersconnector.py | from suls.sul import SUL
import pexpect
from subprocess import check_output
import re
from abc import ABC, abstractmethod
from typing import Tuple
import threading
import time
# Restarting a process with pexpect takes a long time,
# So lets try creating a pool-ish thing that starts
# Them in the background, so they'r... |
reliability_tests.py | import imp
import sys
import threading
import time
from amqpstorm import AMQPConnectionError
from amqpstorm import AMQPMessageError
from amqpstorm import Connection
from amqpstorm import UriConnection
from amqpstorm import compatibility
from amqpstorm.tests import HOST
from amqpstorm.tests import PASSWORD
from amqpsto... |
server.py | import pika
import sys
import threading
def Send(msg):
# print("msg")
# print(msg)
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.exchange_declare(exchange='logs',
exchange_type='fanout')
mess... |
delivery_service.py | from http.server import BaseHTTPRequestHandler, HTTPServer
from threading import Thread
from web3.auto.infura import w3
import socketserver
import json
import cgi
import random
import sched, time
class ScrapingHTTPServer(HTTPServer):
SCRAPE_INTERVAL = 10 # scrape USPS once every 5 seconds
ERC20_ABI = json.loa... |
__main__.py | #!/usr/bin/env python3
import argparse
from datetime import timedelta, datetime
import io
import itertools as it
import json
import multiprocessing as mp
import multiprocessing.dummy as mp_dummy
import os
import os.path as path
import sys
from time import strptime, strftime, mktime
import urllib.request
from glob impo... |
test_run_tracker.py | # coding=utf-8
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import absolute_import, division, print_function, unicode_literals
import http.server
import json
import threading
from builtins import open
from future.mo... |
rbssh.py | #!/usr/bin/env python
#
# rbssh.py -- A custom SSH client for use in Review Board.
#
# This is used as an ssh replacement that can be used across platforms with
# a custom .ssh directory. OpenSSH doesn't respect $HOME, instead reading
# /etc/passwd directly, which causes problems for us. Using rbssh, we can
# work arou... |
TCPserver.py | from socket import *
import tkinter as tk
import tkinter.scrolledtext as tst
import time
import tkinter.messagebox
import threading
class Application(tk.Frame):
def __init__(self,master):
tk.Frame.__init__(self,master)
self.grid()
self.createWidgets()
def createWidgets(self):
#显... |
detect_tracking_recognize.py | # Copyright (c) 2017 InspiRED Robotics
# The project was based on David Sandberg's implementation of facenet
# 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 w... |
mainparallel.py | import pandas as pd
from threading import Thread
from queue import Queue
import os
def runXsec(index, row):
print("\n \n \n ************Starting Job*****************\n \n \n")
if row['ranXSec'] == 0:
print("calculating xsections for: n1={}, n2={}, n3={}, j0= {}".format(row['n1'], row['n2'], row['n3'], ... |
transient.py | from . import checked_threading
from . import configuration
from . import editor
from . import qemu
from . import image
from . import utils
from . import ssh
from . import sshfs
from . import static
import contextlib
import enum
import glob
import logging
import os
import pwd
import signal
import subprocess
import tem... |
customFVS.py | # import the necessary packages
from threading import Thread
import cv2
import time
class FileVideoStream:
def __init__(self, path, transform=None, queue_size=16, num_queues=1, queue_type="Q"):
self.stream = cv2.VideoCapture(path)
self.stopped = False
self.transform = transform
sel... |
ip.py | import socket
import threading
import logging
import socketserver
import queue
import time
from .core import KNXIPFrame,KNXTunnelingRequest,CEMIMessage
from . import util
logger = logging.getLogger(__name__)
class KNXIPTunnel(object):
# TODO: implement a control server
# control_server = None
... |
rhba_utils.py | import os
import cv2
import time
import math
import ctypes
import random
import win32ui
import win32gui
import warnings
import win32con
import threading
import subprocess
import pytesseract
import numpy as np
import pydirectinput
from fuzzywuzzy import process
from custom_input import CustomInput
from win32api import G... |
__init__.py | from __future__ import print_function
import ctypes
import inspect
import shlex
import tempfile
import threading
from queue import Queue, Empty
from typing import List, Callable, Optional
from subprocess import \
CalledProcessError, \
call, \
Popen, \
PIPE
__author__ = 'Simon Lee, Viktor Malyi'
__ema... |
testing1.py |
# Python program to illustrate the concept
# of threading
# importing the threading module
import threading
def print_cube(num):
"""
function to print cube of given num
"""
for i in range(num):
print("Cube: {}\n".format(num * num * num))
def print_square(num):
"""
function to print ... |
test.py | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 7 22:45:46 2020
@author: nicol
"""
import threading as mp
import time
global l
def main():
l = []
streamer = mp.Thread(target=stream_all, args=(l,))
streamer.daemon = True
streamer.start()
streamer.join()
print(l)
def stream_all(l):
l.ap... |
application_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... |
app.py | # ------------------------------------------------------------------------------
# Copyright IBM Corp. 2020
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... |
load_test.py | #!/usr/bin/python2.7
# Copyright 2016 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 ... |
baking_scd30.py | import logging
import sys, os
import numpy as np
import requests.exceptions
sys.path.append('../')
sys.modules['cloudpickle'] = None
import threading
import time
from instruments.scd30 import SCD30
from pymeasure.display.Qt import QtGui
from pymeasure.display.windows import ManagedWindow
from pymeasure.experiment im... |
momentary_switch_component.py | """This module contains the MomentarySwitchComponent type."""
import threading
from raspy.argument_null_exception import ArgumentNullException
from raspy.invalid_operation_exception import InvalidOperationException
from raspy.object_disposed_exception import ObjectDisposedException
from raspy.components.switches impo... |
runweb.py | """This file is for dev server only.
DO NOT USE FOR PROD
"""
from gevent import monkey
monkey.patch_all()
from lib.patch import patch_all
patch_all()
import multiprocessing
import os
import shlex
import sys
import subprocess
import gevent.pywsgi
import gevent.socket
from app.server import flask_app
def main... |
kb_JobStatsServer.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.