source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
a3c_test.py | # -*- coding: utf-8 -*-
import pdb
import tensorflow as tf
import os
import threading
import numpy as np
import random
from networks.qa_planner_network import QAPlannerNetwork
from networks.free_space_network import FreeSpaceNetwork
from networks.end_to_end_baseline_network import EndToEndBaselineNetwork
from reinfor... |
py4j.py | #!/usr/bin/python
# -- Content-Encoding: UTF-8 --
"""
Py4j-based Distribution and Discovery Provider
:author: Scott Lewis
:copyright: Copyright 2020, Scott Lewis
:license: Apache License 2.0
:version: 1.0.1
..
Copyright 2020 Scott Lewis
Licensed under the Apache License, Version 2.0 (the "License");
yo... |
reinstall.py | from core.config import Settings
from core.providers.aws.install import Install
from core import constants as K
from core.terraform import PyTerraform
from threading import Thread
from datetime import datetime
import os
import sys
class ReInstall(Install): # Do not inherit Destroy
"""
AWS provider for destro... |
when_above.py | # --------------------------------------------------
# Copyright (C) 2020 Antonio Viesti (a.viesti@eutropia.it).
# Creative Commons CC BY (https://creativecommons.org/licenses/by/4.0/)
# --------------------------------------------------
# Mareografie (1) — When above — Alta e bassa marea.
#
# «Mareografie (1) — When ... |
midi_player.py | # Created by Xinyu Zhu on 2020/12/23, 23:16
import pygame.midi
import time
import threading
from node.pianoNode.ply_standardlizer import auto_format_for_file
from node.pianoNode.music_visualizer import MusicDataManager
from common.io.file.PlainTextClient import read_io_file
class MidiPlayer:
def __init__(self):
... |
ThreadImage.py | from threading import Lock, Thread
from time import sleep
import threading
import pyzed.sl as sl
import time
import cv2
import numpy as np
import imutils
def load_image_into_numpy_array(image):
ar = image.get_data()
ar = ar[:, :, 0:3]
(im_height, im_width, channels) = image.get_data().shape
return np.... |
listenSer.py | '''
**************************************************
* 智能体监听模块 *
* *
* 1. 监听智能体控制器设置请求 *
* 2. 循环处理任务队列中的任务 *
* 3. 接收请求并执行 *
* ... |
runKeywordAsync.py | import sys
import os
import time
from robot.libraries.BuiltIn import BuiltIn
from robot.output.logger import LOGGER
class runKeywordAsync:
def __init__(self):
self._thread_pool = {}
self._last_thread_handle = 1
#self._robot_log_level = BuiltIn().get_variable_value("${LOG_LEVEL}")
def r... |
stream.py | from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.chrome.options import Options
from threading import ... |
threading.py | #!/usr/bin/env python3
from threading import *
from mylib.easy.common import T
def ez_thread_factory(group=None, name=None, daemon=None):
def new_thread(target: T.Callable, *args, **kwargs):
return Thread(group=group, target=target, name=name, args=args, kwargs=kwargs, daemon=daemon)
return new_threa... |
TCppServerTestManager.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
sim.py | from collections import defaultdict
from multiprocessing import Process, Queue, JoinableQueue
import queue
from threading import Thread
import time
from paxos import Proposer, Acceptor, Learner, BaseSystem
class Mailbox:
"""
Provides messaging functionality for a paxos system instance.
"""
def __ini... |
oledui-nightly.py | #!/usr/bin/python
from __future__ import unicode_literals
import requests
import os
import sys
import time
import json
import pycurl
import pprint
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
from time import*
from threading import Thread
from socketIO_client import SocketIO
from datetime import ... |
engine.py | """
Event-driven framework of vn.py framework.
"""
import sys
from collections import defaultdict
from queue import Empty, Queue
from threading import Thread
from time import sleep, time
from typing import Any, Callable
EVENT_TIMER = "eTimer"
class Event:
"""
Event object consists of a type string which is u... |
algo_with_multi.py | import sys
import os
import time
import threading
import numpy as np
from robolearn.old_utils.algo_interface import AlgoInterface
from robolearn.old_envs.manipulator2d.manipulator2d_env import Manipulator2dEnv
from robolearn.old_utils.ros_utils import get_available_port
init_roscore_port = 11312
init_gzserver_port = 1... |
MultiplesStreams.py | import pyaudio
import wave
import time
import threading
wf = wave.open("audio/bird.wav", 'rb')
wf2 = wave.open("audio/cat.wav", 'rb')
#init obj
p = pyaudio.PyAudio()
p2 = pyaudio.PyAudio()
# define callback (2)
def callback1(in_data, frame_count, time_info, status):
data = wf.readframes(frame_count)
return (... |
protocols.py | import multiprocessing
import logging.config
import threading
import hashlib
import logging
import queue
import uuid
import time
import sys
import os
import module
logging.config.fileConfig(os.path.join(os.path.dirname(__file__), "logging.conf"))
logger = logging.getLogger("tamperproofbroadcast")
class FOTB(module.M... |
IMU_script.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 8 10:42:15 2019
@author: mitchell & stefan
"""
from IMU_module import IMU
import queue
import threading
import time
import sys
import signal
# def run(name,q):
# while True:
# header, data = imu.get_IMU_data()
# timestamp = hea... |
RATAttack.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os, os.path, platform, ctypes
os.environ["PBR_VERSION"]='5.0.0'
import logging
from consoleTools import consoleDisplay as cd
from PIL import ImageGrab # /capture_pc
from shutil import copyfile, copyfileobj, rmtree, move # /ls, /pwd, /cd, /copy, /mv
f... |
ui_utils.py | # -*- coding: utf-8 -*-
import collections
import logging
import os
import platform
import re
import shutil
import signal
import subprocess
import textwrap
import threading
import time
import tkinter as tk
import tkinter.font
import traceback
from tkinter import filedialog, messagebox, ttk
from typing import Callable, ... |
test_leaks.py | import unittest
import sys
import gc
import time
import weakref
import greenlet
import threading
class ArgRefcountTests(unittest.TestCase):
def test_arg_refs(self):
args = ('a', 'b', 'c')
refcount_before = sys.getrefcount(args)
g = greenlet.greenlet(
lambda *args: greenlet.get... |
jax_utils.py | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... |
DataProcess.py | #!/usr/bin/env python
# coding: utf-8
__author__ = 'whoami'
"""
@version: 1.0
@author: whoami
@license: Apache Licence 2.0
@contact: skynet@gmail.com
@site: http://www.itweet.cn
@software: PyCharm Community Edition
@file: DataProcess.py
@time: 2015-12-29 下午4:25
"""
import ActionProcess
import Tools
import pickle
impo... |
concurrent.py | """
@Author Jay Lee
My attempt to provide a set of generic functions
that enable ease of leverage of the power that
concurrency brings to programs.
TODO: Work on this during my downtime
"""
import multiprocessing as mp
def parallel_process(handler_fn, *args, process_count=5):
"""
A fun... |
server.py | import logging
import os
import select
import socket
import subprocess
import threading
try:
from queue import Queue
except ImportError: # Python 2.7
from Queue import Queue
import paramiko
from mockssh import sftp
__all__ = [
"Server",
]
SERVER_KEY_PATH = os.path.join(os.path.dirname(__file__), "serv... |
ddos.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# Lwa Ddos SCRİPT
#ÇALAN İTİNA İLE SEVİLİR
from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random
def user_agent():
global uagent
uagent=[]
uagent.append("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0... |
pseudo-library.py | #!/usr/bin/python
'''
This is a pseudo-library implementation
Example:
./pseudo-library.py -t b168ccc8c8734fad98323247afbc1113 --dump
Author: Volodymyr Shymanskyy
License: The MIT license
'''
import select, socket, struct
import os, sys, time, getopt
from threading import Thread
# Configuration options
#... |
background_thread.py | # 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 agreed to in writing, ... |
__init__.py | #!/usr/bin/env python3
"""Library for performing speech recognition, with support for several engines and APIs, online and offline."""
__author__ = "Anthony Zhang (Uberi)"
__version__ = "3.4.6"
__license__ = "BSD"
import io, os, subprocess, wave, aifc, base64
import math, audioop, collections, threading
import platf... |
multiprocessing.py | #
# Copyright 2021 Johannes Hörmann
#
# ### MIT license
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, ... |
gcsio.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... |
context.py | #!/usr/bin/env python3
from http import HTTPStatus
from socketserver import ThreadingMixIn
from urllib.parse import urlparse
from ruamel.yaml.comments import CommentedMap as OrderedDict # to avoid '!!omap' in yaml
import threading
import http.server
import json
import queue
import socket
import subprocess
import time
... |
test_runtime_captures_signals.py | import multiprocessing
import os
import signal
import time
import pytest
from cli.api import gateway, executor_native
from jina import Executor, DocumentArray, Document, requests
from jina.clients.request import request_generator
from jina.parsers import set_gateway_parser, set_pod_parser
from jina.serve.networking i... |
test_memory.py | import ctypes
import gc
import pickle
import threading
import unittest
import fastrlock
import cupy.cuda
from cupy.cuda import device
from cupy.cuda import memory
from cupy.cuda import stream as stream_module
from cupy import testing
class MockMemory(memory.Memory):
cur_ptr = 1
def __init__(self, size):
... |
text_client.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... |
factory.py | # ===============================================================================
# Copyright 2012 Jake Ross
#
# 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... |
bitvavo.py | import hashlib
import hmac
import json
import time
import datetime as dt
from threading import Thread
from typing import Any, Callable, Dict, List, Union
import websocket as ws_lib
from requests import delete, get, post, put
from structlog.stdlib import get_logger
from websocket import WebSocketApp # missing stubs fo... |
dec23.py | #!/usr/bin/env python
# -*- coding: utf-8
from queue import Empty, Queue
from threading import Thread, Lock
from .intcode import load_program, IntCode
IDLE_THRESHOLD = 10
class Nic(object):
def __init__(self, id, inq, outq):
self._id = id
self._inq = inq
self._outq = outq
progra... |
messaging.py | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See LICENSE in the project root
# for license information.
from __future__ import absolute_import, print_function, unicode_literals
"""An implementation of the session and presentation layers as used in the Debug
Adap... |
fn_api_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... |
swarmlib.py | #!/usr/bin/env python
from __future__ import division
import rospy
import tf
from geometry_msgs.msg import PoseStamped, TransformStamped, Twist
from nav_msgs.msg import Path
from visualization_msgs.msg import Marker
from math import *
import math
import time
from time import sleep
from std_srvs.srv import Empty
from ... |
__init__.py |
import json
import sys
import re
import os
import stat
import fcntl
import shutil
import hashlib
import tempfile
import subprocess
import base64
import threading
import pipes
import uuid
import codecs
from distutils.spawn import find_executable
from ansible_runner.exceptions import ConfigurationError
try:
from c... |
blockchain_bbs.py | import hashlib
import threading
import os
from blockchain import *
from network import *
from blockchain_constants import *
from time import sleep
def ensure_keys():
"""
Ensures that our public and private keys exist in the folder.
:return: None
"""
if not os.path.exists(PRIVATE_KEY_FILE):
... |
test_tracer.py | """
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
from os import getpid
import warnings
from unittest.case import SkipTest
import mock
import pytest
import ddtrace
from ddtrace.ext import system
from ddtrace.context import Context
from ddtrace.constants import VERSION_KEY, ENV_KEY
fro... |
DLManager.py |
from .packer import Packer
import time, threading
class Manager(Packer, object):
def __init__(self):
self.tasks = {}
self.id_map = []
self.name_id = {}
self.max_task = 2
self.queue = TaskQueue()
self._insp_thr = None
self.shutdown_flag = False
s... |
colaboratory.py | # coding: utf-8
"""Colaboratory: the Jupyter Collaborative Computational Laboratory.
"""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import errno
import json
import logging
import os
import random
import select
import sign... |
ears.py | # ReSpeaker Microphone Array v2.0 Code for BinBot
# Author: Jon Gillespie
# Waterford Institute of Technology
# IOT Applications in the Robotics Lab
# EARS : Manages all listening capabilities of the BinBot, which, can determine the angle of arrival of
# a human's voice and recognise keywords.
# - - - - - - - ... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum - Lightweight Avian Client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without l... |
PythonExecutor.py | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License")... |
UdpController.py | import logging
import time
import socket
from Packet import *
from packetConstructor import *
from const import *
from Window import *
import sys
class UdpController:
__conn = None
__routerAddr = None
__packetBuilder = None
def __init__(self):
pass
def connectServer(self):
"""
... |
ReadData.py | from DataUtils import *
import threading, cv2, sys, time
class ReadData():
def __init__(self, dsName='airsim', subType='mr', seq=0):
self.dsName = dsName
self.subType = subType
self.path = getPath(dsName, seq=seq, subType=subType)
if dsName == 'airsim':
self.data = pd.r... |
websocket_client.py | import json
import logging
import socket
import ssl
import sys
import traceback
from datetime import datetime
from threading import Lock, Thread
from time import sleep
from typing import Optional
import websocket
from vnpy.trader.utility import get_file_logger
class WebsocketClient(object):
"""
Websocket AP... |
wsdump.py | #!/Users/conradscherb/Documents/v3/env/bin/python3
import argparse
import code
import six
import sys
import threading
import websocket
try:
import readline
except:
pass
OPCODE_DATA = (websocket.ABNF.OPCODE_TEXT, websocket.ABNF.OPCODE_BINARY)
ENCODING = getattr(sys.stdin, "encoding", "").lower()
class VActio... |
test_c10d.py | import copy
import logging
import math
import operator
import os
import random
import signal
import sys
import tempfile
import threading
import time
import traceback
import unittest
from unittest import mock
from contextlib import contextmanager
from datetime import timedelta
from functools import reduce
from itertools... |
thread_pool.py | #
# Copyright 2021 Splunk 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 writing, so... |
pyminer.py | #!/usr/bin/python
#
# Copyright (c) 2011 The Bitcoin developers
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
import time
import json
import pprint
import hashlib
import struct
import re
import base64
import httplib
import... |
feeder.py | import logging
import queue
import threading
import time
import j1939
from j1939.message_id import MessageId
from j1939.parameter_group_number import ParameterGroupNumber
logger = logging.getLogger(__name__)
class AcceptAllCA(j1939.ControllerApplication):
"""CA to accept all messages"""
def __init__(self, ... |
register.py | import logging, traceback, sys, threading
try:
import Queue
except ImportError:
import queue as Queue
from ..log import set_logging
from ..utils import test_connect
logger = logging.getLogger('itchat')
def load_register(core):
core.auto_login = auto_login
core.configured_reply = co... |
playsound.py | import logging
logger = logging.getLogger(__name__)
_openedSoundsWin = []
class PlaysoundException(Exception):
pass
def _canonicalizePath(path):
"""
Support passing in a pathlib.Path-like object by converting to str.
"""
import sys
if sys.version_info[0] >= 3:
return str(path)
els... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017-2019 The Raven Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mulecoind shutdown."""
from threading import Thre... |
_finder.py | #!/usr/bin/python
# filename: _finder.py
#
# Copyright (c) 2015 Bryan Briney
# License: The MIT license (http://opensource.org/licenses/MIT)
#
# 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 ... |
msa_muscleServer.py | #!/usr/bin/env python
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, ServerError, InvalidRequestE... |
dataloader_iter.py | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
simple_tcp_server.py | import socket
import threading
#adapted from Blackhat Python
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip,bind_port))
server.listen(5)
print "[*] Listening on %s:%d" % (bind_ip, bind_port)
#this is our client handling thread
def handle_clien... |
twisterlib.py | #!/usr/bin/env python3
# vim: set syntax=python ts=4 :
#
# Copyright (c) 2018 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import os
import contextlib
import string
import mmap
import math
import sys
import re
import subprocess
import select
import shutil
import shlex
import signal
import hashlib
import thre... |
threading_while_scanning.py | import RPi.GPIO as GPIO
import time
from threading import Thread
distances = []
TRIG = 24
ECHO = 26
GPIO.setmode(GPIO.BOARD)
GPIO.setup(TRIG, GPIO.OUT) # trigger voltage setup
GPIO.setup(ECHO, GPIO.IN) # echo input setup
GPIO.output(TRIG, False)
distances = []
def scan_for_obstacles():
GPIO.setmode(GPIO.... |
api.py | # -*- coding: utf-8 -*-
import json
from decimal import Decimal, getcontext
import logging
import traceback
import calendar
import time
import tornado.ioloop
# from tornaduv import UVLoop
import sys
import Queue
import copy
import tornado.web
# import tornaduv
# import pyuv
import threading
# Create your views he... |
sniffer.py | #packet sniffer in python
#for linux
import socket
from struct import *
from multiprocessing import Process, Lock, Pipe, Value
import random
import sched, time
ip_send_rtcp_on = '127.0.0.1'
port_send_rtcp_on = 5009
rtcp_sending_delay = 30 #in seconds
def giveRandom(givenRange=(0,5000)):
return random.randint(givenR... |
test_capture.py | import contextlib
import io
import os
import pickle
import subprocess
import sys
import textwrap
from io import StringIO
from io import UnsupportedOperation
from typing import BinaryIO
from typing import Generator
from typing import List
from typing import TextIO
import pytest
from _pytest import capture
from _pytest.... |
main.py | import os
from ui.button import Button
from tkinter import BooleanVar, Entry, Frame, PanedWindow, StringVar, Toplevel
from app import App
root = App('File Manager using Tkinter')
root.grid_rowconfigure(1, weight=1)
root.grid_columnconfigure(0, weight=1)
# <header>
from toolbar import Toolbar
header = Toolbar(roo... |
markov.py | from . import config
from . import derpymodel
import importlib
import re
import random
import time
import threading
import markovify
import os
import common
from collections import defaultdict
version = '0.9.3.14'
model = None
unsaved = False
lines = list()
test_kwargs = {'max_overlap_ratio': config.max_overlap_ratio... |
main.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# --------------------------------------------------------
# 疼讯课堂小助手 (TXClass Helper) Ver 0.6
# Copyright (c) 2022 MoeTwo Studio
# Licensed under The MIT License
# Written by Coolsong
# 提示:在运行本程序前请先阅读自述文件。
# Tip: Please read the readme file before running this.
# ----------... |
dsc_io.py | #!/usr/bin/env python
__author__ = "Gao Wang"
__copyright__ = "Copyright 2016, Stephens lab"
__email__ = "gaow@uchicago.edu"
__license__ = "MIT"
'''
Test rpy2 installation:
python -m 'rpy2.tests'
'''
from dsc.utils import flatten_list
def load_mpk(mpk_files, jobs=2):
import msgpack, collections
from multipro... |
untitled1.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Feb 22 16:57:44 2019
@author: cliffk
"""
from distributed import Scheduler
from tornado.ioloop import IOLoop
from threading import Thread
loop = IOLoop.current()
t = Thread(target=loop.start, daemon=True)
t.start()
s = Scheduler(loop=loop)
s.start('t... |
myServer.py | import threading
import socket
import sys
#Host and port declaration (uses localhost)
host = '127.0.0.1'
port = 8080
#Creates socket
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
#Server binding
server.bind((host, port))
server.listen()
#Handles the client messeges
def clientHandler(cli... |
server.py | import socket
from time import sleep
from threading import Thread
from typing import Union
from utils.video_stream import VideoStream
from utils.rtsp_packet import RTSPPacket
from utils.rtp_packet import RTPPacket
class Server:
FRAME_PERIOD = 1000//VideoStream.DEFAULT_FPS # in milliseconds
SESSION_ID = '123... |
__init__.py | import requests
import datetime
import dateutil
import logging
import gzip
import io
import csv
import time
import os
import sys
import json
import hashlib
import hmac
import base64
import pysftp
from threading import Thread
from io import StringIO
import azure.functions as func
sentinel_customer_id = os.environ.get(... |
main.py | import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = os.path.split(curPath)[0]
sys.path.append(os.path.split(rootPath)[0])
print(sys.path)
from src.analysis.QQZoneAnalysis import QQZoneAnalysis
from src.spider.QQZoneSpider import QQZoneSpider
from src.util.constant import WEB_SPIDER_INFO... |
helper.py | import asyncio
import functools
import json
import math
import os
import random
import re
import sys
import threading
import time
import uuid
import warnings
from argparse import ArgumentParser, Namespace
from datetime import datetime
from itertools import islice
from types import SimpleNamespace
from typing import (
... |
handlers.py | # Copyright 2001-2016 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... |
trainer.py | import time
from games.base_classes import MuZeroConfigBase
from threading import Thread
from torch.utils.tensorboard import SummaryWriter
import numpy
import torch
import models
class Trainer:
"""
Class which run in a dedicated thread to train a neural network and save it in the shared storage.
"""
d... |
master.py | #
# Copyright Cloudlab URV 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... |
babycrypto2.py | #!/usr/bin/env python
from base64 import b64decode
from base64 import b64encode
import socket
import multiprocessing
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
from Crypto.Util.Padding import pad, unpad
import hashlib
import sys
class AESCipher:
def __init__(self, key):
self.... |
nanoleaf.py | """nanoleafapi
This module is a Python 3 wrapper for the Nanoleaf OpenAPI.
It provides an easy way to use many of the functions available in the API.
It supports the Light Panels (previously Aurora), Canvas and Shapes (including Hexgaons)."""
import json
from threading import Thread
import colorsys
import os
from typ... |
log.py | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
# pyre-strict
import argparse
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import L... |
camera_t265.py | #!/usr/bin/env python3
import sys
sys.path.append("/usr/local/lib/")
import os
import time
from threading import Thread
import transformations as tf
import numpy as np
import math as m
import csv
import pyrealsense2 as rs
from mycelium.components import Camera, RedisBridge
class CameraT265(Camera):
def __init... |
runSignalAlign.py | #!/usr/bin/env python
"""Main driver script for running an ionic current-to-sequence alignment on a single machine.
"""
from __future__ import print_function
import sys
import os
#import pysam
from argparse import ArgumentParser
from random import shuffle
from multiprocessing import Process, current_process, Manager... |
node_test.py | from multiprocessing import Process
import unittest
import numpy as np
import time
import torch
from tinygrad.tensor import Tensor
from node import NodeManager, Worker
U_init = np.random.randn(3,3).astype(np.float32)
V_init = np.random.randn(3,3).astype(np.float32)
W_init = np.random.randn(3,3).astype(np.float32)
de... |
main.py | import os
import streamlit.components.v1 as components
import streamlit as st
import time
import numpy as np
import IPython.display as ipd
#ipd.Audio(audio, rate=16000)
from online_scd.model import SCDModel
from online_scd.streaming import StreamingDecoder
import timeit
import base64
import scipy.io.wavfile
from on... |
Report_util_landmlServer.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import datetime
import json
import os
import random as _random
import sys
import traceback
from getopt import getopt, GetoptError
from multiprocessing import Process
from os import environ
from wsgiref.simple_server import make_server
import requests as _requests
from json... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from pyln.client import RpcError, Millisatoshi
from shutil import copyfile
from pyln.testing.utils import SLOW_MACHINE
from utils import (
only_one, sync_blockheight, wait_for, TIMEOUT,
account_balance, first_channel_id, closing_fee, TEST_NETWORK... |
process.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
import tempfile
import subprocess
import tensorflow as tf
import numpy as np
from . import tfimage as im
import threading
import time
import multiprocessing
parser = argparse.Argume... |
main.py | from corylus.app import app
from corylus.huey_tasks.consumer import task_consumer
from multiprocessing import Process
if __name__ == '__main__':
process = Process(target=task_consumer)
process.start()
app.run(debug=True)
process.join()
|
concurrency.py | import codecs
from invoke.vendor.six.moves.queue import Queue
from invoke.vendor.six.moves import zip_longest
from invoke.util import ExceptionHandlingThread
from spec import Spec, ok_, skip
from fabric import Connection
_words = '/usr/share/dict/words'
def _worker(queue, cxn, start, num_words, count, expected):
... |
agent.py | #!/usr/bin/env python
#
# AzureMonitoringLinuxAgent Extension
#
# Copyright 2021 Microsoft Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... |
__init__.py | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Logging utils
"""
import warnings
from threading import Thread
import torch
from torch.utils.tensorboard import SummaryWriter
from utils.general import colorstr, emojis
from utils.loggers.wandb.wandb_utils import WandbLogger
from utils.plots import plot_images, plot_res... |
smtclient.py | # Copyright 2017,2020 IBM Corp.
#
# 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... |
server_gbk.py | import sys
import os
import socket
import time
import base64
import tabulate
import signal
import subprocess
import argparse
import shutil
import threading
import platform
import PyInstaller.__main__
from datetime import datetime
__LOGO__ = """
____ _ _ _ ____ _ _____
/ ___|(_) | |_ _| _ \\ / \\|_ ... |
computerVisionAnimation.py | #!/usr/bin/python3
# NOTE: SET THE CAMERA MATRIX CORRECTLY!!
import cv2
import time
import numpy as np
import math
import pickle as pkl
import statistics
from threading import Thread
from computerVisionFunctions import process_image, rotation_vector_list, translation_vector_list, get_contour_corners, \
rotate_con... |
common.py | """Test the helper method for writing tests."""
import asyncio
from datetime import timedelta
import functools as ft
import os
import sys
from unittest.mock import patch, MagicMock, Mock
from io import StringIO
import logging
import threading
from contextlib import contextmanager
from homeassistant import core as ha, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.