source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
simple_thread_runner.py | import threading
import queue
from loguru import logger
from typing import Callable, Any, Iterator, Iterable
class SimpleThreadsRunner:
"""
A simple ThreadsRunner. This runs multiple threads to do the I/O;
Performance is at least as good as Queue producer/consumer, which works in an analogous fashion.
... |
dns_server.py | #!/usr/bin/env python2.7
# Copyright 2015 gRPC 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 la... |
composed_writer.py | #!/usr/bin/env python3
import logging
import sys
import threading
from os.path import dirname, realpath
sys.path.append(dirname(dirname(dirname(realpath(__file__)))))
from logger.writers.writer import Writer # noqa: E402
from logger.utils import formats # noqa: E402
class ComposedWriter(Writer):
############... |
transfer.py | #!/usr/bin/env python
#
# Copyright 2015 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 o... |
test_urllib.py | """Regression tests for what was in Python 2's "urllib" module"""
import urllib.parse
import urllib.request
import urllib.error
import http.client
import email.message
import io
import unittest
from unittest.mock import patch
from test import support
import os
try:
import ssl
except ImportError:
ssl = None
imp... |
multicluster.py | #!/usr/bin/python
"""
multicluster.py: multiple ONOS clusters example
We create two ONOSClusters, "east" and "west", and
a LinearTopo data network where the first and second halves
of the network are connected to each ONOSCluster,
respectively.
The size of the ONOSCluster is determined by its
topology. In this examp... |
server.py | import logging
import multiprocessing as mp
import os
import signal
import socket
import socketserver
import threading
import time
from IPy import IP
from setproctitle import setproctitle
from irrd.conf import get_setting, get_configuration
from irrd.server.access_check import is_client_permitted
from irrd.server.who... |
test_multiplexer.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... |
simulate_serial.py | #!/usr/bin/env python3
import logging
import subprocess
import sys
import threading
import time
sys.path.append('.')
from logger.readers.logfile_reader import LogfileReader
from logger.transforms.slice_transform import SliceTransform
from logger.writers.text_file_writer import TextFileWriter
from logger.utils.read_j... |
webserver.py | import time
import urllib.parse
import threading
import traceback
import json
import nose
import sys
import linecache
import inspect
import os.path
import http.server
import socketserver
import queue as queue
from mpi4py import MPI
from nose.plugins.capture import Capture
from nose.plugins.skip import Skip, SkipTest
f... |
login.py | import os, sys, time, re, io
import threading
import json, xml.dom.minidom
import copy, pickle, random
import traceback, logging
try:
from httplib import BadStatusLine
except ImportError:
from http.client import BadStatusLine
import requests
from pyqrcode import QRCode
from .. import config, utils
from ..retu... |
launch.py | #!/usr/bin/env python3
#import sys
#sys.path.append("./lib")
import os
import crontab
from signal import pause
from time import sleep
from threading import Thread, ThreadError
from lib.log import logger
from lib.audiomoth import audiomoth
from lib.camera import camera
from lib.diskio import diskio
from lib.config im... |
torrent_script.py | '''
@author: Joseph Milazzo
@description: A script which is run after a uTorrent torrent has completed downloading. This script will copy the torrent data to the appropriate directory on
a remote machine. Directory is determined by torrent's label. This script is configurable through config.ini file.
T... |
run_parameter_sweep.py | '''
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License.
'''
import time
import itertools
import subprocess
from multiprocessing import Process, Queue
def do_work(work):
while not work.empty():
experiment = work.get()
print(experiment)
subprocess.call(ex... |
webserver.py | #!/usr/bin/env python
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import BaseHTTPServer
import SimpleHTTPServer
import errno
import logging
import threading
import... |
watcher.py | #!/usr/bin/python3
from threading import Thread, Event
from owtapi import OWTAPI
from db_query import DBQuery
from configuration import env
import time
office = list(map(float,env["OFFICE"].split(","))) if "OFFICE" in env else None
dbhost= env.get("DBHOST",None)
inactive_time=float(env["INACTIVE_TIME"])
class RoomWa... |
servidor_chat.py | from socket import *
from threading import *
import mysql.connector
clientes = {}
direcciones = {}
def configuracion():
global servidor
servidor = socket()
servidor.bind(("", 9998))
servidor.listen(10)
print("Esperando conexiones...")
aceptar_hilo = Thread(target=aceptar_conexiones)
acepta... |
fn_runner.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... |
kv_server.py | # Copyright 2022 kuizhiqing
#
# 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... |
mqtt.py | # coding=utf-8
'''
连接MQTT服务器的Python代码,在EasyIoT、SIoT上测试成功,实现消息发送和订阅。
代码编写:姜浩、谢作如,2019.5.7
'''
import threading
import paho.mqtt.client as mqtt
import time
SERVER = "127.0.0.1" #MQTT服务器IP
CLIENT_ID = " " #在SIoT上,CLIENT_ID可以留空
TOPIC = 'DFRobot/linmy' #“topic”为“项目名称/设备名称”
username='siot' #用户名
password='dfrobot' #密码
c... |
test_utils.py | """Utilities shared by tests."""
import cgi
import contextlib
import gc
import email.parser
import http.server
import json
import logging
import io
import os
import re
import ssl
import sys
import threading
import traceback
import urllib.parse
import asyncio
import aiohttp
from aiohttp import server
from aiohttp impo... |
tasks.py | """
Long-running tasks for the Deis Controller API
This module orchestrates the real "heavy lifting" of Deis, and as such these
functions are decorated to run as asynchronous celery tasks.
"""
from __future__ import unicode_literals
import requests
import threading
from celery import task
from django.conf import se... |
binance_pairs_ema.py | import requests
import json
import os
import time
from threading import Thread
from bfxhfindicators import EMA
BASE_URL = 'https://api.binance.com'
TIMEFRAME = '4h'
EMA_PERIODS = [50, 200]
symbols = []
candles = {}
prices = {}
ema_values = {}
def load_candles(sym):
global candles, prices, BASE_URL
payload =... |
debug.py | import time
import datetime
import threading
class Debugger:
thread = None
def __init__(self):
self.error_log = 'error_log'
self.debug_log = 'debug_log'
self.error_file = None
self.debug_file = None
self.files_closing = False
self.flush_thread = None
def r... |
discretization.py | # Copyright (c) 2011-2016 by California Institute of Technology
# Copyright (c) 2016 by The Regents of the University of Michigan
# 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. Redistrib... |
core.py | import copy
import enum
import threading
import typing
import torch
import torch.utils.checkpoint
DUAL_OR_QUAD_TENSOR = typing.Union[typing.Tuple[torch.Tensor, torch.Tensor, torch.Tensor, torch.Tensor],
typing.Tuple[torch.Tensor, torch.Tensor]]
TENSOR_OR_LIST = typing.Union[typing.L... |
wallet.py | # -*- coding: utf-8 -*-
import os
import sys
print(sys.stdout.encoding)
sys.path.append(os.getcwd())
import io
import threading
import socket
import bottle
from bottle import request
from bottle_sqlite import SQLitePlugin
from app.config import *
from app.routes import *
bottle.install(SQLitePlugin(dbfile = Config... |
miphy_daemon.py | import os, sys, threading
from collections import deque
from random import randint
from flask import Flask, request, render_template, json
from miphy_resources.miphy_instance import MiphyInstance
from miphy_resources.miphy_common import MiphyValidationError, MiphyRuntimeError
from miphy_resources.phylo import PhyloValu... |
pydoc.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
dfu.py | #!/usr/bin/env python
"""
Tool for flashing .hex files to the ODrive via the STM built-in USB DFU mode.
"""
import argparse
import sys
import time
import threading
import platform
import struct
import requests
import re
import io
import os
import usb.core
import fibre
import odrive
from odrive.utils import Event, Oper... |
test_drne_and_dn.py | # coding=utf8
# Author: TomHeaven, hanlin_tan@nudt.edu.cn, 2017.08.19
from __future__ import print_function
from tensorflow.contrib.layers import conv2d, avg_pool2d
import tensorflow as tf
import numpy as np
from data_v3 import DatabaseCreator
import time
import tqdm
import cv2
import re
import os
import argparse
impo... |
test_nntplib.py | import io
import socket
import datetime
import textwrap
import unittest
import functools
import contextlib
import os.path
import threading
from test import support
from nntplib import NNTP, GroupInfo
import nntplib
from unittest.mock import patch
try:
import ssl
except ImportError:
ssl = None
TIMEOUT = 30
ce... |
chatWidget.py | from PyQt5 import QtGui,QtWidgets,QtCore
from ..Chat.client import ChatClient
import sys,socket, threading
class ChatWidget(QtWidgets.QWidget):
def __init__(self,name):
super().__init__()
self.name=name
self.client=None
self.initUI()
def initUI(self):
self.chatMessages=QtWidgets.QListWidget()
self.inpu... |
__init__.py | import threading
from async_services.core.exceptions import ManagerNotInitialized
from async_services.core.manager import ServiceManager
# There will be only one Service Manager at a time
# The Service Manager can be Stopped at any point of time
service_manager = None
def run_manager(block=False):
"""
Star... |
threaded_server.py | from socket import *
from t1 import fib
from threading import Thread
import sys
print(sys.getswitchinterval())
#sys.setswitchinterval(.000005) # new 3.2 every .05 sec it switch
#sys.setcheckinterval(1) old python 2.7 before Antoine Pitrou 3.2
def fib_server(address):
server=socket(AF_INET,SOCK_STREAM)
server... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
threadclient.py | from __future__ import annotations
import asyncio
import concurrent.futures as conc
import time
from queue import Empty, Queue
from threading import Lock, Thread
from typing import Iterable, List, Optional, SupportsFloat, Union
from .client import Client
from .request import Request
from .response import Response
c... |
master.py | # -*- coding: utf-8 -*-
'''
This module contains all of the routines needed to set up a master server, this
involves preparing the three listeners and the workers needed by the master.
'''
# Import python libs
import os
import re
import time
import errno
import signal
import shutil
import stat
import logging
import ha... |
presubmit_support.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
__version__ = '1.8.0'
# TODO(joi) Add caching ... |
server.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... |
semaphore.py | """
semaphore dapat digunakan untuk menentukan berapa banyak proses yang dapat
mengakses shared resource
semaphore dengan nilai 1, cuma mengizinkan satu proses untuk mengakses shared
resource (sama dengan lock)
"""
import threading, time, random
counter = 0
sem = threading.Semaphore(1)
def worker(name):
global co... |
initial_inbound_sync.py | #! /usr/bin/env python3
# Copyright 2018 Contributors to Hyperledger Sawtooth
#
# 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 re... |
dev_test_cex_subscribe.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: dev_test_cex_subscribe.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://py... |
app.py |
#####################################################################
#
# Data Simulator for Apache Kafka
#
# Deployed as a container (scaled with Kubernetes, GKE)
#
# Test with python 3.7
# https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
#
# Prereqs:
# pip install kafka-python
#
####... |
alpacaHistorical.py | import json
import threading
from threading import Thread
import time
import logging
from datetime import datetime, timedelta
from enum import Enum
import requests
from alpaca_trade_api.rest import REST, TimeFrame
from .yahooFin import YahooFin
from util import AlpacaAccess, RedisTimeFrame
custom_header = {
'user-... |
test_multiprocessing.py | #!/usr/bin/env python
#
# Unit tests for the multiprocessing package
#
import unittest
import Queue
import time
import sys
import os
import gc
import signal
import array
import socket
import random
import logging
import errno
import test.script_helper
from test import test_support
from StringIO import StringIO
_multi... |
sequence_input_layer.py | #!/usr/bin/env python
#Data layer for video. Change flow_frames and RGB_frames to be the path to the flow and RGB frames.
import sys
sys.path.append('../../python')
import caffe
import io
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
import scipy.misc
import time
import pdb
import glob
imp... |
crack.py | # -*- coding: utf-8 -*-
import os
import re
import sys
import string
import requests
import threading
flag = False
correct = "None"
def getpwd(username,query_str,minr,maxr):
global flag
global correct
url = 'http://192.168.50.3:8080/eportal/InterFace.do?method=login'
i = minr
while i < maxr:
password = "%06d... |
plugin.py | ###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008-2010, James McCoy
# Copyright (c) 2014, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistribution... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import electrum_ltc as electrum
from electrum_ltc.bitcoin import TYPE_ADDRESS
from electrum_ltc import WalletStorage, Wallet
from electrum_ltc_gui.kivy.i18n import _
from electrum_ltc.paymentrequest... |
25.thread_Thread-specific Data.py | # While some resources need to be locked so multiple threads can use them,
# others need to be protected so that they are hidden from view in threads that do not “own” them. The local() function creates an object capable of hiding values from view in separate threads.
import random
import threading
import logging
log... |
test_transaction.py | #!/usr/bin/env python
# test_transaction - unit test on transaction behaviour
#
# Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org>
#
# psycopg2 is free software: you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published
# by the Free Software... |
views.py | import threading
from datetime import datetime
from django.contrib import messages
from django.core.cache import cache
from django.shortcuts import HttpResponseRedirect, reverse
from django.views.generic import FormView
from django.views.generic import View
from django.views.generic.list import ListView
from dispatch... |
Scraper_Main.py | import requests
from bs4 import BeautifulSoup
import time
import os
import sys
import threading
#Multi-threaded Hand History Scraper V2.2
#Contact me if you encounter significant connection errors or large numbers of attribute errors being logged.
#Try to keep usage responsible as this script will pull data as quick... |
multi_envs_wrapper.py | import numpy as np
import multiprocessing as mp
from envs_utils import VecEnv, CloudpickleWrapper, clear_mpi_env_vars
def worker(remote, parent_remote, env_fn_wrapper):
parent_remote.close()
env = env_fn_wrapper.x()
try:
while True:
cmd, data = remote.recv()
if cmd == 'step'... |
main.py | # -*- coding:utf-8 -*-
"""
Million Heroes
"""
import multiprocessing
from multiprocessing import Event
from multiprocessing import Pipe
import os
import win32api
import pythoncom
from PIL import ImageFilter
from threading import Thread
import time
from argparse import ArgumentParser
import string
import re
imp... |
eidolon.py | # Made by @venaxyt on Github
import threading, requests, gratient, random, string, os
banner = """
▄███▄ ▄█ ██▄ ████▄ █ ████▄ ▄
█▀ ▀ ██ █ █ █ █ █ █ █ █
██▄▄ ██ █ █ █ █ █ █ █ ██ █
█▄ ▄▀ ▐█ █ █ ▀████ ███▄ ▀████ █ █ █
▀███▀ ▐ ███▀ ▀ █ ... |
SpecialRunner.py | import os
from threading import Thread
from subprocess import Popen, PIPE
from time import sleep, time
from select import select
class SpecialRunner:
"""
This class provides the interface to run special job types like
CWL, WDL and HPC.
"""
def __init__(self, config, job_id, logger=None):
... |
test.py | import pytest
import time
import psycopg2
import os.path as p
import random
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import assert_eq_with_retry
from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT
from helpers.test_tools import TSV
from random import randrange
import threading
clu... |
connection.py | # Copyright (c) 2018 Anki, 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 in the file LICENSE.txt or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
login.py | import os, time, re, io
import threading
import json, xml.dom.minidom
import random
import traceback, logging
try:
from httplib import BadStatusLine
except ImportError:
from http.client import BadStatusLine
import requests
from pyqrcode import QRCode
from .. import config, utils
from ..returnval... |
netgrasp.py | from utils import debug
from utils import exclusive_lock
from utils import email
from utils import simple_timer
from utils import pretty
from config import config
from notify import notify
from database import database
import logging
import logging.handlers
import pwd
import os
import datetime
import time
netgrasp_in... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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_windows_events.py | import os
import signal
import socket
import sys
import time
import threading
import unittest
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _overlapped
import _winapi
import asyncio
from asyncio import windows_events
from test.test_asyncio i... |
DLHandler.py |
import logging
from DLInfos import *
from DLProgress import *
from packer import Packer
import time, os
LOG_FORMAT = "%(asctime)s,%(msecs)03d - %(levelname)s - %(threadName)-12s - (%(progress)s)[%(urlid)s] - %(message)s"
logging.basicConfig(format=LOG_FORMAT, datefmt="%m/%d/%Y %H:%M:%S", level=logging.CRITICAL)
lo... |
common.py | """Test the helper method for writing tests."""
import asyncio
import os
import sys
from datetime import timedelta
from unittest import mock
from unittest.mock import patch
from io import StringIO
import logging
import threading
from contextlib import contextmanager
from homeassistant import core as ha, loader
from ho... |
diode_server.py | #!flask/bin/python
# Copyright 2019-2021 ETH Zurich and the DaCe authors. All rights reserved.
import aenum
import dace
import dace.serialize
import dace.frontend.octave.parse as octave_frontend
from dace.codegen import codegen
from diode.DaceState import DaceState
from dace.transformation.optimizer import SDFGOptimiz... |
ServerComm.py | #!/usr/bin/python
import urllib2
import urlparse
import urllib
import json
import threading
import time
import socket
import sys
from BaseHTTPServer import HTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
from datetime import datetime
import sys
sys.path.insert(0, '/usr/lib/python2.7/bridge/')
... |
model.py | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 14 03:44:03 2021
@author: kmwh0
"""
'''
send price data to price_queue
method:
run_tracking()
while True:
if not self.price_queue.empty():
data = price_queue.get() //receive json data
print(data)
'''
from mul... |
video_reader.py | import numpy as np
import cv2
import threading
import time
class VideoReader():
def __init__(self, video_path):
self.video_path = video_path
self.vid_cap = cv2.VideoCapture(self.video_path)
self.frame_time = (1/self.vid_cap.get(cv2.CAP_PROP_FPS)) * 1000 # in ms
self.cur_frame = np.z... |
scovolini.py | #!/usr/bin/python
import sys
import os
import argparse
import time
import json
import signal
import traceback
import threading
from stepper import Stepper
import ui
# ----- global variables ------
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_PATCH = 0
CONFIG_FILE = "config.json"
DEFAULT_SPEED = 70
save_configurati... |
app.py | import abc
import datetime
import json
import numpy as np
import pickle
import sys
import threading
import traceback
from enum import Enum
from time import sleep
from typing import Dict, List, Tuple, Union, TypedDict, Literal
DATA_POLL_INTERVAL = 0.1 # Interval (seconds) to check for new data pieces, adapt if necess... |
send_request_test.py | import threading
from requests import Response
import responses
from castle.test import unittest
from castle.core.send_request import CoreSendRequest
from castle.configuration import configuration
try:
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
except ImportError:
from http.server import Bas... |
test_http.py | import gzip
import io
import json
import logging
import threading
import unittest
from spectator import Registry
from spectator.http import HttpClient
try:
from BaseHTTPServer import HTTPServer
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
# python3
from http.server import HTTP... |
connection.py | # Copyright (c) 2018 Anki, 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 in the file LICENSE.txt or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
node.py | #!/bin/python
import sys
import random
import math
import threading
import rpyc
from chordsite.env import *
from chordsite.address import inrange
from chordsite.finger_entry import FingerEntry
# from rpc_server import RPC
# from rpc_client import RPCClient
from rpyc.utils.server import ThreadedServer
# class represe... |
daemon.py | from autobrightness import brightness
import keyboard
import time
import Xlib.display
from threading import Thread
class Daemon:
"""
Background service
Parameters:
settings: config object
lang: gettext object
"""
def __init__(self, settings, lang):
global _
_ = lan... |
MCHandleTrainer.py | from tkinter import *
from tkinter import messagebox
from keras.layers import Dense
from keras.models import Sequential, load_model
import tensorflow as tf
import serial
import serial.tools.list_ports
import threading
from PIL import Image, ImageDraw, ImageTk
import numpy as np
import time
import multiprocessing
import... |
test_tcp.py | import asyncio
import asyncio.sslproto
import gc
import os
import select
import socket
import unittest.mock
import uvloop
import ssl
import sys
import threading
import time
import weakref
from OpenSSL import SSL as openssl_ssl
from uvloop import _testbase as tb
class MyBaseProto(asyncio.Protocol):
connected = No... |
Update_MODS_TEXTURES.py | from wakeonlan import send_magic_packet
from fabric import Connection
import marshal
import types
import threading
from queue import Queue
import socket
import time
import base64
import sys
import paramiko.ssh_exception
def starting_module(c_q):
print("###########################################")
print("## ... |
env_player.py | # -*- coding: utf-8 -*-
"""This module defines a player class exposing the Open AI Gym API.
"""
from abc import ABC, abstractmethod, abstractproperty
from gym.core import Env # pyre-ignore
from queue import Queue
from threading import Thread
from typing import Any, Callable, List, Optional, Tuple, Union
from poke_... |
method.py | import threading
# def matmult(a,b):
# zip_b = zip(*b)
# out = [[sum(ele_a*ele_b for ele_a, ele_b in zip(row_a, col_b))
# for col_b in zip_b] for row_a in a]
# # for ele_a, ele_b in zip(row_a, col_b)
# return out
def mult(w,a,i,j, o):
sum = 0
for k in range(len(w[0])):
#print("w:{}... |
agent_test.py | import unittest
import sys
import threading
import random
import time
import stackimpact
from stackimpact.runtime import runtime_info, min_version
# python3 -m unittest discover -v -s tests -p *_test.py
class AgentTestCase(unittest.TestCase):
def test_run_in_main_thread(self):
if runtime_info.OS_WIN:
... |
Redsb1.1.py | # -*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile
from bs4 import BeautifulSoup
from urllib import urlopen
fr... |
test_flight.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
# "... |
debugger_unittest.py | from collections import namedtuple
from contextlib import contextmanager
import json
try:
from urllib import quote, quote_plus, unquote_plus
except ImportError:
from urllib.parse import quote, quote_plus, unquote_plus # @UnresolvedImport
import re
import socket
import subprocess
import threading
import time
i... |
start.py | #!/usr/bin/env python
#imports
from __future__ import print_function
import threading as th
import multiprocessing as mp
import serial
import time
import struct
import datetime
import sys
import os.path
sys.path.append("..") #Import varaibles in run from AQ_Plot_server directory
sys.path.append(sys.path[0][0:sys.path... |
mimic_tts.py | # Copyright 2017 Mycroft AI 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 agreed to in writin... |
updater_short.py | import os
import sys
import time
import sqlite3
import zipfile
import pythoncom
import pandas as pd
from PyQt5 import QtWidgets
from PyQt5.QAxContainer import QAxWidget
from multiprocessing import Process, Queue, Lock
sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__))))
from login.manuallogin im... |
test_worker.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import json
import os
import psutil
import shutil
import signal
import subprocess
import sys
import time
import zlib
from datetime import datetime, timedelta, timezone
from multiprocess... |
cloud.py | """
Object Store plugin for Cloud storage.
"""
import logging
import multiprocessing
import os
import os.path
import shutil
import subprocess
import threading
import time
from datetime import datetime
from galaxy.exceptions import ObjectInvalid, ObjectNotFound
from galaxy.util import (
directory_hash_id,
safe... |
broadcastmanager.py | # coding: utf-8
"""
Exposes several methods for transmitting cyclic messages.
The main entry point to these classes should be through
:meth:`can.BusABC.send_periodic`.
"""
import abc
import logging
import threading
import time
import warnings
log = logging.getLogger('can.bcm')
class CyclicTask(object):
"""
... |
emails.py | #
# MySlice version 2
#
# Activity process service: manages emails
#
# (c) 2016 Ciro Scognamiglio <ciro.scognamiglio@lip6.fr>
##
import signal
import threading
from queue import Queue
import rethinkdb as r
from myslice.db import connect, changes, events
from myslice.db.activity import Event
from myslice.services... |
emails.py | # -*- coding: utf-8 -*-
"""
"""
from threading import Thread
from flask import url_for, current_app
from flask_mail import Message
from myblog.extensions import mail
def _send_async_mail(app, message):
with app.app_context():
mail.send(message)
def send_mail(subject, to, html):
app = current_app.... |
connector.py | import socket
import threading
import time
import json
import pkg_resources
import logging
class AgoPgn:
""" PGN message from AGOpenGPS:
PGN message has a always a HeaderHi and a HeaderLo which are the first two bytes of the message.
Then a variable data part follows
"""
def __init__(... |
interface.py | from PyQt5 import QtCore, QtGui, QtWidgets, uic
import sys
import cv2
import numpy as np
import threading
import time
import queue
import re
from recordsave import Recorder
from ssd_engine import SSD_Detector
from motiondetector import MotionDetector
from settings import EmailSender
# Title
WINDOW_TITLE = "DeepEye v1... |
launch.py | #!/usr/bin/python
from __future__ import print_function
import os
import subprocess
import threading
import sys
import time
def worker(local_rank, local_size, command):
my_env = os.environ.copy()
my_env["BYTEPS_LOCAL_RANK"] = str(local_rank)
my_env["BYTEPS_LOCAL_SIZE"] = str(local_size)
if os.getenv(... |
appsrc-py-appsink3.py | import random
import ssl
import websockets
import asyncio
import threading
import os
import sys
import json
import argparse
import time
from io import BytesIO
import cv2
import numpy
import sys
import mp as pn
detector = pn.Model()
import gi
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GLib... |
environment.py | import abc
import consul
import datetime
import etcd
import kazoo.client
import kazoo.exceptions
import os
import psutil
import psycopg2
import json
import shutil
import signal
import six
import subprocess
import tempfile
import threading
import time
import yaml
@six.add_metaclass(abc.ABCMeta)
class AbstractControlle... |
main.py | from ros.lib.cw_logging import commence_cw_log_streaming
from ros.processor.inventory_events_consumer import InventoryEventsConsumer
from ros.processor.insights_engine_result_consumer import InsightsEngineResultConsumer
from ros.processor.garbage_collector import GarbageCollector
from prometheus_client import start_htt... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.