source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_utility.py | import threading
import pytest
from base.client_base import TestcaseBase
from base.utility_wrapper import ApiUtilityWrapper
from utils.util_log import test_log as log
from common import common_func as cf
from common import common_type as ct
from common.common_type import CaseLabel, CheckTasks
from common.milvus_sys im... |
send.py | #!/usr/bin/env python3.6
import pika
import sys,datetime,time
import multiprocessing,logging
logger = logging.getLogger("MQ_SENDER")
logger.setLevel(logging.DEBUG)
fh = logging.FileHandler("/var/log/mq_sender.log")
fh.setLevel(logging.DEBUG)
#ch = logging.StreamHandler()
#ch.setLevel(logging.INFO)
formatter = logging.... |
grid_world.py | # -*- coding: utf-8 -*-
'''
to run this , sudo apt-get install python3-pyqt5
'''
import sys
from PyQt5.QtCore import QPoint, QRect, QSize, Qt
from PyQt5.QtGui import (QBrush, QPainter, QColor, QPen )
from PyQt5.QtWidgets import (QApplication, QPushButton, QCheckBox, QGridLayout,QLabel, QWidget, QInputDialo... |
s2e_remote_memory.py | from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from builtins import super
from builtins import dict
from builtins import int
from future import standard_library
standard_library.install_aliases()
import threading
impor... |
middleware.py | """
Here are all the sockets.
There shall not be any sockets outside of this file.
There shall be one socket in one seperate thread (multithreading)
for every tcp connections
also one socket in a thread for the udp socket for broadcast
"""
import threading
import socket
from time import sleep
usleep = lam... |
procutil.py | # procutil.py - utility for managing processes and executable environment
#
# Copyright 2005 K. Thananchayan <thananck@yahoo.com>
# Copyright 2005-2007 Matt Mackall <mpm@selenic.com>
# Copyright 2006 Vadim Gelfer <vadim.gelfer@gmail.com>
#
# This software may be used and distributed according to the terms of the
# G... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018-2019 The Hiphopcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test hiphopcoind shutdown."""
from test_framework.test_framework import HiphopcoinTestFramework
fro... |
test.py | #!/usr/bin/env python
import rospy
import time
from std_msgs.msg import Int32
from geometry_msgs.msg import Twist
from std_msgs.msg import Bool
import numpy as np
import threading
import os
################################################################################ DEBUG
debug_disable_hilens = os.getenv('DEBUG_N... |
__init__.py | import os
import re
import sys
import inspect
import warnings
import functools
import threading
from timeit import default_timer
from flask import request, make_response, current_app
from flask import Flask, Response
from flask.views import MethodViewType
from werkzeug.serving import is_running_from_reloader
from prom... |
concurrency.py | from invoke.vendor.six.moves.queue import Queue
from invoke.util import ExceptionWrapper, ExceptionHandlingThread as EHThread
# TODO: rename
class ExceptionHandlingThread_:
class via_target:
def setup(self):
def worker(q):
q.put(7)
self.worker = worker
de... |
Misc.py | ## @file
# Common routines used by all tools
#
# Copyright (c) 2007 - 2017, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the lic... |
runtime.py | from metatools.imports import load_entrypoint
from Queue import Queue
import argparse
import datetime
import json
import os
import sys
import threading
import weakref
import traceback
NoResult = object()
def log(msg, *args, **kwargs):
if args or kwargs:
msg = msg.format(*args, **kwargs)
msg = '[mm52... |
recipe-577129.py | #!/usr/bin/python
"""
Run asynchronous tasks in gobject using coroutines. Terminology used:
* Job: A coroutine that yield tasks.
* Task: A function which returns a callable whose only parameter
(task_return) is called with the result of the task.
Tasks themselves must be asynchronous (they are run in the... |
shotgunEventDaemonHttpd.py | #!/usr/bin/env python
#
# Init file for Shotgun event daemon
#
# chkconfig: 345 99 00
# description: Shotgun event daemon
#
### BEGIN INIT INFO
# Provides: shotgunEvent
# Required-Start: $network
# Should-Start: $remote_fs
# Required-Stop: $network
# Should-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Short-Description:... |
ajax.py | import json
import logging
import os
import threading
import time
import cherrypy
import datetime
import core
from core import config, library, searchresults, searcher, snatcher, notification, plugins, downloaders
from core.library import Metadata, Manage
from core.movieinfo import TheMovieDatabase, YouTube
from core.p... |
elg_demo.py | #!/usr/bin/env python3
"""Main script for gaze direction inference from webcam feed."""
import argparse
import os
import queue
import threading
import time
import coloredlogs
import cv2 as cv
import numpy as np
import tensorflow as tf
from datasources import Video, Webcam
from models import ELG
import util.gaze
if _... |
__init__.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
download.py | #!/usr/bin/env python3
"""
Usage: download.py host port client_id file
"""
import os
import sys
import time
import json
import threading
import _thread
import hashlib
import base64
import paho.mqtt.client as mqtt
summary = {}
chunks = []
file_array = b''
done = False
lock = threading.Lock()
def md5(data):
... |
beauty.py | import sys
import json
import traceback
import re
import random
import threading
from datetime import date, timedelta
import datetime
import time
from PyPtt import PTT
Woman = []
in_update = False
def get_pw():
try:
with open('account.txt') as AccountFile:
account = json.load(AccountFile)
... |
bench.py | #!/usr/bin/env python
import collections
import os
import subprocess
import sys
import time
import threading
class TimeoutException(Exception):
pass
class ProcDiedException(Exception):
pass
def check_call(*args, **kw):
timeout = kw.pop("timeout", None)
kw['stdout'] = subprocess.PIPE
kw['stderr']... |
channel_inner_service.py | """Channel Inner Service."""
import json
import multiprocessing as mp
import signal
from asyncio import Condition
from collections import namedtuple
from concurrent.futures import ThreadPoolExecutor
from typing import Union, Dict, List, Tuple
from earlgrey import *
from pkg_resources import parse_version
from loopch... |
installwizard.py | # Copyright (C) 2018 The Electrum developers
# Distributed under the MIT software license, see the accompanying
# file LICENCE or http://www.opensource.org/licenses/mit-license.php
import os
import json
import sys
import threading
import traceback
from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH... |
grab_api.py | # coding: utf-8
from grab import GrabMisuseError, GrabError
from grab.error import GrabTooManyRedirectsError
from grab.base import reset_request_counter
from test.util import build_grab
from test.util import BaseGrabTestCase
import six
import tempfile
import os
class GrabApiTestCase(BaseGrabTestCase):
def setUp(s... |
dataset.py | import tensorflow as tf
import numpy as np
import threading, time
import h5py
class Dataset():
def __init__(self, data_path, batch_size):
self.data_path = data_path
# Patch size for training
self.input_size = 41
self.label_size = 41
self.batch_size = batch_size
... |
tpu_estimator.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
test_07_concurrency.py | #!/usr/bin/python
from common import *
import logging
import sys
import time
import threading
import swampyer
logging.basicConfig(stream=sys.stdout, level=30)
# We want to see the protocol information
# being exchanged
#logging.basicConfig(stream=sys.stdout, level=1)
"""
The following function keeps track of the n... |
youtubequeue.py | import os
import settings
settings.generateConfigFile()
import soundfile as sf
from pydub import AudioSegment
import generatorclient
from time import sleep
from subprocess import *
import videouploader
from threading import Thread
import pickle
import datetime
from datetime import timedelta
import subproce... |
test_functools.py | import abc
import builtins
import collections
import collections.abc
import copy
from itertools import permutations
import pickle
from random import choice
import sys
from test import support
import threading
import time
import typing
import unittest
import unittest.mock
import os
import weakref
import gc
from weakref ... |
test_closing.py | from fixtures import * # noqa: F401,F403
from flaky import flaky
from pyln.client import RpcError
from shutil import copyfile
from pyln.testing.utils import SLOW_MACHINE
from utils import (
only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT,
account_balance, first_channel_id, basic_fee, TEST_NETWORK,
... |
DipPy.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '.\GUI.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
###############################################################################
#
# Be... |
botmonitor.py | #########################################################
from os import environ
from utils.misc import geturljson
from time import sleep
import heroku3
from random import randint
from threading import Thread
#########################################################
BOT_TOKENS = environ["BOT_TOKENS"]
tokens = {}
f... |
dsr_service_drl_simple.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# ##
# @brief [py example simple] motion basic test for doosan robot
# @author Kab Kyoum Kim (kabkyoum.kim@doosan.com)
import rospy
import os
import threading, time
import sys
sys.dont_write_bytecode = True
sys.path.append( os.path.abspath(os.path.join(os.path.dirn... |
tello.py | from collections import namedtuple
import socket
import threading
from threading import Thread
import queue
from datetime import datetime
import time
import traceback
Address = namedtuple('Address', 'ip, port')
class AtomicInt(object):
def __init__(self, initial=0):
self.value = initial
self._lock... |
executors.py | # -*- coding: utf-8 -*-
""" Single and multi-threaded executors."""
import os
import tempfile
import threading
from abc import ABCMeta, abstractmethod
import datetime
from typing import (Any, Dict, List, Optional, # pylint: disable=unused-import
Set, Text, Tuple)
from schema_salad.validate import ... |
generic_websocket.py | """
Module used as a interfeace to describe a generick websocket client
"""
import asyncio
import websockets
import socket
import json
import time
from threading import Thread, Lock
from pyee import AsyncIOEventEmitter
from ..utils.custom_logger import CustomLogger
# websocket exceptions
from websockets.exceptions i... |
stats.py | from client import client
from datetime import datetime
import discord
import os
import socket
import threading
import time
try:
import psutil
except ModuleNotFoundError:
has_psutil = False
else:
has_psutil = True
cmd_name = "stats"
client.basic_help(title=cmd_name, desc=f"shows various running statistics of {c... |
dnsserver.py | import configparser
import socket
import re
import binascii
from datetime import datetime
import threading
import time
import requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
import sqlite3
#///////////////////// thread functions /////////////////////#
def load_blacklist_fr... |
alexa_manager.py | import hassapi as hass
import re
import sys
import time
from queue import Queue
from threading import Thread
"""
Class Alexa Manager handles sending text to speech messages to Alexa media players
Following features are implemented:
- Speak text to choosen media_player
- Full queue support to manage as... |
_conn_proc.py |
import threading as th
import multiprocessing as mp
from modi.task.conn_task import ConnTask
from modi.task.ser_task import SerTask
from modi.task.can_task import CanTask
from modi.task.spp_task import SppTask
class ConnProc(mp.Process):
def __init__(self, recv_q, send_q, conn_mode, module_uuid, verbose,
... |
autoreload.py | import functools
import itertools
import logging
import os
import pathlib
import signal
import subprocess
import sys
import threading
import time
import traceback
import weakref
from collections import defaultdict
from pathlib import Path
from types import ModuleType
from zipimport import zipimporter
from django.apps ... |
cache.py | from octopus.core import app
from octopus.modules.cache import models
from octopus.lib import plugin
import os
from datetime import datetime, timedelta
from operator import itemgetter
from multiprocessing import Process
class CacheException(Exception):
pass
def load_file(name):
cf = models.CachedFile.pull(nam... |
user.py | from logger import Logger
from protocol import Header,HeaderParser,Protocol
from mail import sendRecoveryMail
import requests, json, hashlib, os, socket, threading ,time
class URL(object):
local = 'http://127.0.0.1:5000/api/'
remote = 'http://molly.ovh:5000/api/'
class User(object):
def __init__(self, c... |
controller_gui.py | import threading
import random
from time import sleep
from math import sqrt,cos,sin,pi
from functools import partial
from Tkinter import *
import tkMessageBox as messagebox
from ttk import *
import tkFont
from PIL import Image, ImageTk
import numpy as np
import networkx as nx
from event import myEvent
from Object im... |
nbzz_set_alias.py | from pathlib import Path
import os
import subprocess
import threading
try:
from tqdm import tqdm
except:
try:
os.system('pip3 install tqdm')
except:
print("tqdm install error ")
exit(1)
from tqdm import tqdm
try:
from nbzz.util.config import load_config
from web3 import ... |
dataset.py | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2020-05-09 20:27
import math
import os
import random
import tempfile
import warnings
from abc import ABC, abstractmethod
from copy import copy
from logging import Logger
from typing import Union, List, Callable, Iterable, Dict, Any
import torch
import torch.multiprocessi... |
spotify.py | import os
import typing
from multiprocessing import Pipe, Process
import uvicorn
from pyfy import ApiError, ClientCreds, Spotify
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
def _code_server(connection):
async def homepage(request):... |
corpusiter.py | #!/usr/bin/env python
# coding: utf-8
#
# Usage:
# Author: wxm71(weixing.mei@aispeech.com)
import pdb
import logging
import threading
import numpy as np
import mxnet as mx
import multiprocessing
from multiprocessing import Queue
from .utils import batchify
from .generator import NceLabGenerator
class NceCorpusIt... |
worker.py | # Copyright (c) 2020-2021, NVIDIA CORPORATION & AFFILIATES. 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 ... |
web.py | # coding=utf-8
from flask import Flask, request, url_for, redirect, session
import logging
from src import telegramClient
from src import config
import threading
import requests
import feedparser
from datetime import datetime
from time import mktime
from wtforms import form
import wtforms.fields
from src import db
i... |
serialize_tensorboard.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... |
testing.py | """Testing utilities."""
import os
import re
import threading
import functools
from tempfile import NamedTemporaryFile
from numpy import testing
import numpy as np
from ._warnings import expected_warnings
import warnings
from .. import data, io, img_as_uint, img_as_float, img_as_int, img_as_ubyte
SKIP_RE = re.com... |
test_websocket_integration.py | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... |
multprocess_test.py | #!/usr/bin/python
"""
mutiple process example
"""
import random
from multiprocessing import Process, Queue
import os
def put_num(que):
num = random.randint(1, 100)
que.put(num)
print(f'put num {num} on pid {os.getpid()}')
def main():
queue = Queue()
childs = []
for i in range(4):
p... |
client.py | # ###############----------------->import<--------------------############
import socket
from PIL import Image, ImageGrab, ImageTk
import pygetwindow
import re
import os
import time
import win32gui
import lz4.frame
from io import BytesIO
from threading import Thread
from multiprocessing import freeze_support, Process, ... |
master.py | #!/usr/bin/env python
from multiprocessing import Process, Pipe, Queue
from audioproc import AudioRecorder
from videoproc import VideoRecorder
import time
import signal
TRIGGER_HEADER = 'TRGR'
def run_audio_proc(pipe_endpt):
""" Run audio monitor in its own process
"""
rec = AudioRecorder()
print("audiop... |
test__threading_vs_settrace.py | from __future__ import print_function
import sys
import subprocess
import unittest
from gevent.thread import allocate_lock
script = """
from gevent import monkey
monkey.patch_all()
import sys, os, threading, time
# A deadlock-killer, to prevent the
# testsuite to hang forever
def killer():
time.sleep(0.1)
sy... |
Hiwin_RT605_Socket_v3_20190628113312.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd_v3 as TCP
import HiwinRA605_socket_Taskcmd_v3 as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.s... |
test_urllib.py | """Regresssion tests for urllib"""
import urllib
import httplib
import unittest
from test import test_support
import os
import sys
import mimetools
import tempfile
import StringIO
def hexescape(char):
"""Escape char as RFC 2396 specifies"""
hex_repr = hex(ord(char))[2:].upper()
if len(hex_repr) == 1:
... |
cron.py | from collections import namedtuple
from datetime import datetime, timedelta
import logging
import threading
from time import sleep
CRON_ENCORE = 'CRON_ENCORE'
CRON_STOP = 'CRON_STOP'
logger = logging.getLogger('liberapay.cron')
Daily = namedtuple('Daily', 'hour')
Weekly = namedtuple('Weekly', 'weekday hour')
cl... |
duet_test.py | # stdlib
from multiprocessing import set_start_method
import socket
import time
from typing import Callable
from typing import List
from typing import Tuple
# third party
import pytest
# syft absolute
from syft.grid.duet import test_duet_network
# syft relative
from .duet_scenarios_tests import register_duet_scenari... |
train.py | """
train your model and support eval when training.
"""
import os
import sys
base_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(base_path)
import multiprocessing as mp
import time
import argparse
import megengine as mge
import megengine.distributed as dist
from megengine.jit im... |
prettierd.py | import sublime
import sublime_plugin
import pathlib, socket, json, subprocess, threading, fnmatch
from .lib.diff_match_patch import diff_match_patch
__version__ = "0.1.0"
prettierd: "Prettierd | None" = None
save_without_format = False
def toggle_save_without_format(force=None, timeout=500):
global save_without_f... |
cli.py | # -*- coding: utf-8 -*-
"""
flask.cli
~~~~~~~~~
A simple command line application to run flask apps.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from __future__ import print_function
import ast
import inspect
import os
import re
import sys
import trace... |
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... |
minion.py | # -*- coding: utf-8 -*-
'''
Routines to set up a minion
'''
# Import python libs
from __future__ import absolute_import, print_function, with_statement, unicode_literals
import os
import re
import sys
import copy
import time
import types
import signal
import random
import fnmatch
import logging
import threading
import ... |
messmenu.py | from flask import Flask, request
import bs4 as bs
import requests
import json
import os
import datetime
import time
import pytz
import threading
app = Flask(__name__)
debug_print_on = False
######################### Global Variables #########################
f = open('./data.json', "r")
db = json.loads(f.read())
f.cl... |
core.py | from __future__ import print_function
import requests
import warnings
import numpy as np
import sys
from bs4 import BeautifulSoup
import keyring
import getpass
import time
import smtplib
import re
from six.moves.email_mime_multipart import MIMEMultipart
from six.moves.email_mime_base import MIMEBase
from six.moves.emai... |
__init__.py | import bpy
from .scene_exporter import get_scene_data, export_scene
from collections import OrderedDict
from ws4py.client.threadedclient import WebSocketClient
import ws4py.messaging
import json
import threading
from io import BytesIO
import struct
from . import engine
bl_info = {
"name": "Blender Tools",
"aut... |
processing.py | import multiprocessing as mp
from processing_annexes import *
"""Processing_annexes contient la fonction process, qui doit être dans un 'module' séparé."""
def multiproc(function, nombreproc, args):
"""
Exécute la fonction function sur nombreproc processus, avec les arguments *args.
Les valeurs sont... |
data_iterator.py | # Copyright (c) 2017 Sony Corporation. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... |
test_consumer_client.py | import time
import pytest
import threading
import sys
from azure.eventhub import EventData
from azure.eventhub import EventHubConsumerClient
from azure.eventhub._eventprocessor.in_memory_checkpoint_store import InMemoryCheckpointStore
from azure.eventhub._constants import ALL_PARTITIONS
@pytest.mark.liveTest
def test... |
cleanup.py | """
sentry.runner.commands.cleanup
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2015 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
from datetime import timedelta
from uuid import uuid4
import click
from djan... |
spawn_n_terminate.py | import time, os, signal
from multiprocessing import Process
from main_proc_spoof import counter, counter_p
def proc_factory(fname,var):
return Process(target=fname, args=(var,))
def run_main(proc):
try:
proc.start()
except KeyboardInterrupt:
proc.terminate()
proc.join()
proc.close()
print('Counter now at... |
socket.py | import abc
import json
import logging
import os
import socket
from collections import namedtuple
from threading import Thread
from types import coroutine
from typing import List
from taro import paths
log = logging.getLogger(__name__)
class SocketServer(abc.ABC):
def __init__(self, socket_name):
self._... |
setup.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
print '''
Free anyZipcrack-dictionary created by:
pyc0d3r: http://www.umarbrowser.co.vu/
'''
#imports
import zipfile
import optparse
from threading import Thread
#Try extarct if found password
def extractFile(zFile, password):
try:
zFile.extractall(pwd=password)
... |
run_manager.py | # -*- encoding: utf-8 -*-
import errno
import json
import logging
import os
import re
import signal
import socket
import stat
import subprocess
import sys
import time
from tempfile import NamedTemporaryFile
import threading
import yaml
import numbers
import inspect
import glob
import platform
import fnmatch
import cl... |
segment_coco.py | import argparse
import json
import logging
import os
import threading
from os.path import exists, join, split, dirname
import time
import numpy as np
import shutil
import sys
from PIL import Image
import torch
import torch.utils.data
from torch import nn
import torch.backends.cudnn as cudnn
from torch.autograd impor... |
udpClient.py | #!/usr/bin/python
# -*- encoding: utf-8 -*-
'''
@Time : 2021/03/16 10:35:28
@Author : Camille
@Version : 0.7beta
'''
from concurrent import futures
import socket
from sys import argv
import time
import threading
import struct
import uuid
import json
import os, subprocess
from concurrent.futures import threa... |
car_helpers.py | import os
import threading
import json
import requests
from common.params import Params
from common.basedir import BASEDIR
from selfdrive.version import comma_remote, tested_branch
from selfdrive.car.fingerprints import eliminate_incompatible_cars, all_known_cars
from selfdrive.car.vin import get_vin, VIN_UNKNOWN
from ... |
penv.py | import torch
from multiprocessing import Process, Pipe
from typing import List, Callable, Dict
import gym
def worker(conn, env_suppliers:list):
envs = [supplier() for supplier in env_suppliers]
while True:
cmd, data = conn.recv()
if cmd == "step":
conn.send([env.step(d) for env,d i... |
test_subprocess.py | import unittest
from unittest import mock
from test import support
import subprocess
import sys
import signal
import io
import itertools
import os
import errno
import tempfile
import time
import traceback
import selectors
import sysconfig
import select
import shutil
import threading
import gc
import textwrap
from test.... |
setup.py | import sys
import yaml
import re
import json
import logging
import threading
import queue
import time
from os import path
import kraken.cerberus.setup as cerberus
import kraken.kubernetes.client as kubecli
import kraken.invoke.command as runcommand
import kraken.pvc.pvc_scenario as pvc_scenario
import sshv.utils as uti... |
run_threaded.py | import functools
from threading import Thread
def threaded(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
thread = Thread(target=func, args=args, kwargs=kwargs)
wrapper.__thread__ = thread
try:
thread.start()
except KeyboardInterrupt:
thread... |
test_insert.py | import copy
import threading
import pytest
from pymilvus import DataType, ParamError, BaseException
from utils import util_pymilvus as ut
from common.constants import default_entity, default_entities, default_binary_entity, default_binary_entities, \
default_fields
from common.common_type import CaseLabel
from uti... |
runtime.py | __all__ = [
"Runtime"
]
from traceback import (
print_exc
)
from threading import (
Thread
)
from collections import (
defaultdict,
deque
)
from itertools import (
repeat
)
from common import (
charcodes,
bstr,
notifier,
cached,
reset_cache
)
from .value import (
Returne... |
example3.py | import threading
import requests
import time
def ping(url):
res = requests.get(url)
print(f"{url}: {res.text}")
urls = [
"http://httpstat.us/200",
"http://httpstat.us/400",
"http://httpstat.us/404",
"http://httpstat.us/408",
"http://httpstat.us/500",
"http://httpstat.us/524",
]
star... |
nodes2_job.py | import evaluate
import payout
#import db
import config
import logging
import time
import threading
#import requests
import json
# Evaluate node data
# After the end of every 10 minute period, after 1 minute run evaluation of the last 2+ slots
# After the end of every 4-hours, reevaluate the last 1+ days
config = con... |
gpufilestream.py | # _____ ______ _____
# / ____/ /\ | ____ | __ \
# | | / \ | |__ | |__) | Caer - Modern Computer Vision
# | | / /\ \ | __| | _ / Languages: Python, C, C++
# | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer
# \_____\/_/ \_ \______ |_| \_\
# Licensed ... |
evaluation.py | import os
import json
import torch
import threading
import numpy as np
from functools import partial
from PyQt5 import QtWidgets
import matplotlib.pyplot as plt
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.backends.backend_qt5agg import NavigationToolbar2QT as Navigat... |
test_browser.py | # coding=utf-8
# Copyright 2013 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
import argparse
import json
import multiprocessing
imp... |
crawler-lvl2.py | import logging
import os
import signal
import time
from threading import Thread, Lock
import pandas as pd
import requests
import yaml
from TSEData import TSEData, helper
with open('./config.yaml') as f:
conf = yaml.safe_load(f)
helper.folder_check(conf['general']['log_path'])
logging.basicConfig(filename=os.path... |
oplog_manager.py | # Copyright 2013-2014 MongoDB, 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... |
plotting.py | """PyVista plotting module."""
import platform
import ctypes
import sys
import pathlib
import collections.abc
from typing import Sequence
import logging
import os
import textwrap
import time
import warnings
import weakref
from functools import wraps
from threading import Thread
from typing import Dict
import numpy as... |
WebGUI.py | import threading
import time
import cv2 as cv
from flask import Flask
from flask import render_template
from flask import Response
from .utils import visualization_utils as vis_util
category_index ={0:{
"id": 0,
"name": "Pedestrian",
}} # TODO: json file for detector config
class WebGUI:
"""
The we... |
tcp_server.py | import socket
import threading
import struct
import time
class TcpServer(object):
def __init__(self, host, port):
self.host_ = host
self.port_ = port
self.sock_ = None
self.quit_event_ = threading.Event()
def launch(self):
print("Server launched at ... |
peer.py | import sys
import datetime
import time
from concurrent import futures
import threading
import socket
import grpc
import p2p_msg_pb2
import p2p_msg_pb2_grpc
class PeerServicer(p2p_msg_pb2_grpc.PeerServicer):
"""This class implements p2p_msg_pb2_grpc.PeerServicer interface that was generated from .proto."""
... |
startup.py | #startup.py v4 - by Mark Harris with contribution from Stuart. Thank you for your help.
# Used to start 3 scripts, one to run the metar leds and one to update an LCD display or OLED displays. A 3rd as watchdog.
# Taken from https://raspberrypi.stackexchange.com/questions/39108/how-do-i-start-two-different-pytho... |
utils.py | import asyncio
import functools
import html
import importlib
import inspect
import json
import logging
import multiprocessing
import os
import pkgutil
import re
import shutil
import socket
import sys
import tempfile
import threading
import warnings
import weakref
import xml.etree.ElementTree
from asyncio import Timeout... |
upnp.py | import logging
import threading
from queue import Queue
try:
import miniupnpc
except ImportError:
pass
log = logging.getLogger(__name__)
class UPnP:
def __init__(self):
self.queue = Queue()
def run():
try:
self.upnp = miniupnpc.UPnP()
self.up... |
webserver_context.py | """Provides context manager that runs local webserver."""
import contextlib
import os
import posixpath
import requests
import time
from multiprocessing import Process
from http.server import HTTPServer, SimpleHTTPRequestHandler
from urllib.parse import unquote
class MyHTTPRequestHandler(SimpleHTTPRequestHandler):
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.