source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_threads.py | import sys
try:
import threading
HAVE_THREADING = True
except ImportError:
import dummy_threading as threading
HAVE_THREADING = False
VERBOSE = False
#VERBOSE = True
import mpi4pyve.rc
mpi4pyve.rc.thread_level = 'multiple'
from mpi4pyve import MPI
import mpiunittest as unittest
pypy3_lt_50 = (hasattr... |
test_db_thread_safe.py | import os
import random
import time
from threading import Thread
import pytest
from graphility.database_thread_safe import ThreadSafeDatabase
from .hash_tests import HashIndexTests
from .shared import DB_Tests, WithAIndex
from .tree_tests import TreeIndexTests
class Test_Database(DB_Tests):
_db = ThreadSafeDa... |
videoplayer.py | import time
import threading
import xbmc
import xbmcgui
import kodigui
import windowutils
import opener
import busy
import search
import dropdown
from lib import util
from lib import player
from lib import colors
from lib.util import T
PASSOUT_PROTECTION_DURATION_SECONDS = 7200
PASSOUT_LAST_VIDEO_DURATION_MILLIS ... |
flow_runner.py | import os
import signal
<<<<<<< HEAD
import sys
=======
>>>>>>> prefect clone
import threading
from time import sleep as time_sleep
from typing import Any, Callable, Dict, Iterable, Optional, Iterator
from contextlib import contextmanager
import pendulum
import prefect
from prefect.client import Client
from prefect.c... |
test_lsl_node.py | from pylsl import StreamInfo, StreamOutlet, StreamInlet, resolve_stream
import pytest
import asyncio
import time
from multiprocessing import Process
from typing import Sequence
from labgraph.graphs import (
AsyncPublisher,
Config,
Connections,
Graph,
Module,
Node,
Topic,
publisher,
... |
NozomiMain.py | import traceback
import requests
import wx
import re
import webbrowser
from wxglade_out import NozomiDownloader
from threading import Thread
from pathlib import Path
from nozomi import api
class NozomiDownloaderBody(NozomiDownloader):
def __init__(self, *args, **kw):
self.downloading = False
sup... |
app_mt.py | '''
Copyright 2020 Xilinx 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, software
distr... |
build_graph_manually.py | import sys
import time
from threading import Thread
import cv2
from pynput.keyboard import Key, Listener
from algorithms.utils.algo_utils import main_observation
from algorithms.utils.env_wrappers import reset_with_info
from algorithms.tmax.agent_tmax import AgentTMAX
from algorithms.tmax.tmax_utils import parse_args... |
TestController.py | import collections
import os
import random
import threading
import collections
import shutil
import sys
import tempfile
import time
import traceback
import unittest
import wx
from . import HydrusConstants as HC
from . import ClientConstants as CC
from . import HydrusGlobals as HG
from . import ClientAPI
from . import C... |
pi_controller.py | import logging
import os
import time
import traceback
import sys
from datetime import date, datetime
from tanager_tcp.tanager_server import TanagerServer
from tanager_tcp.tanager_client import TanagerClient
from threading import Thread
from pi_feeder import goniometer
INTERVAL = 0.25
CONFIG_LOC = os.path.join(os.pa... |
sessions.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, division, print_function, unicode_literals
import contextlib
import itertools
import os
import threading
import tim... |
add-geometry.py | # ----------------------------------------------------------------------------
# - Open3D: www.open3d.org -
# ----------------------------------------------------------------------------
# The MIT License (MIT)
#
# Copyright (c) 2018-2021 www.open3d.org
#
# Permission i... |
toolbox_opencv.py | # -*- coding: utf-8 -*-
import remi
import remi.gui as gui
import cv2
from threading import Timer, Thread
import traceback
import time
import math
def default_icon(name, view_w=1, view_h=0.6):
"""
A simple function to make a default svg icon for the widgets
such icons can be replaced later with a good o... |
index.py | # -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2020 gomashio1596
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, ... |
tracks_manipulation_lib.py | import sys, os, fnmatch
import pandas as pd
import numpy as np
import sys
import random
from trackml.dataset import load_event
from trackml.dataset import load_dataset
from trackml.randomize import shuffle_hits
from trackml.score import score_event
import multiprocessing
from multiprocessing import Process, Value, L... |
example_APImode2.py | #!/usr/bin/env python
import threading
import time
import XBee_API
import read_comm
# authorship info
__author__ = "Francesco Vallegra"
__copyright__ = "Copyright 2017, MIT-SUTD"
__license__ = "MIT"
# create XBee module object
# NOTE: no need to specify serial port (can be found automatically) BUT the ... |
test_transport.py | """Unit tests for the transport module."""
from datetime import datetime
import logging
try:
import queue
except ImportError:
import Queue as queue
import os
import select
import socket
import ssl
from struct import pack
import sys
import threading
import time
import pytest
from pydicom import dcmread
impor... |
concurrency_test.py | # Copyright 2021 The Magenta Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
eval1024Old.py | # System libs
import os
import argparse
from distutils.version import LooseVersion
from multiprocessing import Queue, Process
# Numerical libs
import numpy as np
import math
import torch
import torch.nn as nn
from scipy.io import loadmat
# Our libs
from config import cfg
from dataset1024 import ValDataset
from models i... |
game.py | import threading
import copy
import time
import random
import sys
import multiprocessing as mp
UP = 0
DOWN = 1
LEFT = 2
RIGHT = 3
FREE = 0
WALL = 1
# Game state
STOPPED = 0
STARTED = 1
GAMEOVER = 2
class GameError(Exception):
pass
class PlaygroundError(Exception):
pass
class Playground(object):
FR... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
from typing import List, Tuple, Union
import cereal.messaging as messaging
import selfdrive.sentry as sentry
from common.basedir import BASEDIR
from common.params import Para... |
cloud.py | # -*- coding: utf-8 -*-
# pylint: disable=broad-except, bare-except
import json
import time
import urllib
import threading
from datetime import datetime, timedelta
from .compat import s
from .const import LOGGER
try:
import http.client as httplib
except:
import httplib
class Cloud():
d... |
query.py | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from __future__ import annotations
import datetime
import itertools
import multiprocessing
from pathlib import Path
import aiida.common
import aiida.engine
import aiida.manage.configuration
import aiida.orm
from .data import PyRemoteArray, PyR... |
manager.py | #!/usr/bin/env python2.7
import os
import sys
import fcntl
import errno
import signal
import subprocess
from common.basedir import BASEDIR
sys.path.append(os.path.join(BASEDIR, "pyextra"))
os.environ['BASEDIR'] = BASEDIR
def unblock_stdout():
# get a non-blocking stdout
child_pid, child_pty = os.forkpty()
if ch... |
mapviewer.py | #!/usr/bin/env python
"""
GUI for displaying maps from HDF5 files
"""
import os
import platform
import sys
import time
import json
import socket
import datetime
from functools import partial
from threading import Thread
from collections import OrderedDict, namedtuple
import wx
from wx.adv import AboutBox, AboutDialo... |
main.py | import shutil
import os
import sys
from threading import Thread
from configparser import RawConfigParser
import time
# from win32api import MessageBox
global out
out = 0
def createBatchFile( source , destination , isfile=True):
cached_stamp = 0
while (out == 0):
if isfile:
stamp = os... |
test_cig_multiplayer.py | # Copyright 2019 The PlaNet 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 applicable... |
manager.py | #!/usr/bin/env python3
import datetime
import os
import signal
import subprocess
import sys
import traceback
from multiprocessing import Process
import cereal.messaging as messaging
import selfdrive.crash as crash
from common.basedir import BASEDIR
from common.params import Params, ParamKeyType
from common.text_window... |
multitester.py | """
Certbot Integration Test Tool
- Configures (canned) boulder server
- Launches EC2 instances with a given list of AMIs for different distros
- Copies certbot repo and puts it on the instances
- Runs certbot tests (bash scripts) on all of these
- Logs execution and success/fail for debugging
Notes:
- Some AWS ima... |
sendmail2.py | from flask import Flask,render_template,render_template_string
from flask_script import Manager
from flask_mail import Mail,Message
import os
from threading import Thread #导入线程
app = Flask(__name__)
app.config['MAIL_SERVER'] = os.environ.get('MAIL_SERVER','smtp.1000phone.com')
app.config['MAIL_USERNAME'] = os.environ.... |
elastic_cvr_extract.py | from elasticsearch import Elasticsearch
# import elasticsearch_dsl
from elasticsearch_dsl import Search
from collections import namedtuple
import datetime
import ujson as json
import os
import pytz
import tqdm
import logging
import threading
from .field_parser import utc_transform
from . import config, create_session, ... |
bigipconfigdriver.py | #!/usr/bin/env python
# Copyright (c) 2016-2018, F5 Networks, 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 a... |
mumbleBot.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import threading
import time
import sys
import math
import signal
import configparser
import audioop
import subprocess as sp
import argparse
import os
import os.path
import pymumble_py3 as pymumble
import pymumble_py3.constants
import variables as var
import logg... |
DrawableMesh.py | import pythreejs as three
import numpy as np
from time import time, sleep
from .Colors import colors
from ..utils import Observer, ColorMap
import threading
import copy
class DrawableMesh(Observer):
def __init__(self, geometry, mesh_color = None, reactive = False):
super(DrawableMesh, self).__init... |
sock.py | import json
import logging
import threading
from pajbot.managers.redis import RedisManager
log = logging.getLogger(__name__)
class SocketManager:
def __init__(self, streamer_name, callback):
self.handlers = {}
self.pubsub = RedisManager.get().pubsub()
self.running = True
self.str... |
waterrowerinterface.py | # ---------------------------------------------------------------------------
# Original code from the bfritscher Repo waterrower
# https://github.com/bfritscher/waterrower
# ---------------------------------------------------------------------------
#
# -*- coding: utf-8 -*-
import threading
import logging
import tim... |
api_image_test.py | import contextlib
import json
import shutil
import socket
import tarfile
import tempfile
import threading
import pytest
import six
from six.moves import BaseHTTPServer
from six.moves import socketserver
import docker
from ..helpers import requires_api_version, requires_experimental
from .base import BaseAPIIntegrat... |
test_cloudpickle.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# 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-... |
led.py | import RPi.GPIO as GPIO
import time
import atexit
import threading
GPIO.setmode(GPIO.BOARD)
GPIO.setup(11,GPIO.OUT)
GPIO.setup(12,GPIO.OUT)
GPIO.setup(15,GPIO.OUT)
GPIO.setup(16,GPIO.IN, pull_up_down=GPIO.PUD_UP)
GPIO.output(15,1)
def flashLights(arg1, stop_event):
#print "Flashing"
x = 0
while(not stop_event.is... |
superspider_mongo.py | # -*- coding: utf-8 -*-
import time
import json
import datetime
import requests
from urllib.parse import urlencode
import re
from bs4 import BeautifulSoup
from requests.exceptions import ConnectionError
import threading
import queue
import pymongo
from config import *
lock = threading.RLock()
q = queue.Queue()
clie... |
reaper.py | # Copyright 2016-2018 CERN for the benefit of the ATLAS collaboration.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... |
__init__.py | import io
import os
import pathlib
import socket
import threading
import time
from abc import ABC, abstractmethod
from contextlib import contextmanager
from datetime import datetime
from multiprocessing import Process
from queue import Queue
from typing import Optional, Union, Dict, Tuple, IO
from platypush.config im... |
iterators.py | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import itertools
import math
impor... |
systrace_controller.py | # Copyright 2014 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.
import threading
import zlib
from profile_chrome import controllers
from profile_chrome import util
from pylib import cmd_helper
_SYSTRACE_OPTIONS = [
... |
qt.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin 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... |
hook.py | import copy
import json
import logging
import threading
from functools import wraps
from platypush.config import Config
from platypush.message.event import Event
from platypush.message.request import Request
from platypush.procedure import Procedure
from platypush.utils import get_event_class_by_type, set_thread_name,... |
main.py | # -*- coding: utf-8 -*-
import logging
import multiprocessing
import os
import time
import wave
from multiprocessing import set_start_method
from multiprocessing.queues import Queue
from typing import Optional
import uvicorn
from fastapi import Cookie, Depends, FastAPI, Query, WebSocket, status, Request
from fastapi.s... |
compare_WalternatingCNOT_qng.py | import qiskit
import numpy as np
import sys
sys.path.insert(1, '../')
import qtm.base, qtm.constant, qtm.nqubit, qtm.fubini_study, qtm.encoding
import multiprocessing
def run_walternating(num_layers, num_qubits):
thetas = np.ones(int(num_layers*num_qubits / 2) + 3 * num_layers * num_qubits)
psi = 2 * np.rand... |
test_dbus.py | #!/usr/bin/python
# Copyright 2021 Northern.tech AS
#
# 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 ap... |
controller.py | """A pythonic Xbox 360 controller library for Linux.
Partly inspired by the following libraries/codes:
- https://www.freebasic.net/forum/viewtopic.php?t=18068 (libjoyrumble)
- https://gist.github.com/rdb/8864666
"""
import os
import select
import struct
import sys
import time
import warnings
from array import array
f... |
machine_unit.py | #!/usr/bin/env python
#
# provide host/guest conatainer manager
#
import os
import abc
import time
import shutil
import pathlib
import difflib
import threading
from dataclasses import dataclass
from arkon_config import host_user
from arkon_config import has_ci_azure
from arkon_config import project_repo
from arkon_c... |
wikiConverter.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 2 18:56:24 2019
@author: descentis
"""
import os
from multiprocessing import Process, Lock
import time
import numpy as np
import glob
import difflib
import xml.etree.ElementTree as ET
import math
import textwrap
import html
import requests
import ... |
base.py | # Copyright (C) 2016 Nippon Telegraph and Telephone 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/LICENSE-2.0
#
# Unless required by appli... |
PC_Miner.py | #!/usr/bin/env python3
##########################################
# Duino-Coin Python PC Miner (v2.4)
# https://github.com/revoxhere/duino-coin
# Distributed under MIT license
# © Duino-Coin Community 2019-2021
##########################################
# Import libraries
import sys
from configparser import Co... |
ttt_client_gui.py | #! /usr/bin/python3
# Import the GUI library Tkinter
import tkinter
# Import the messagebox module explicitly
from tkinter import messagebox
# Import the webbroswer module for opening a link
import webbrowser
# Import the client module
from ttt_client import TTTClientGame
# Import multi-threading module
import threadi... |
gong_obs_plugin.py | from flask import Flask, render_template, jsonify, request
import logging
import os
import requests
import threading
from os.path import normpath, realpath, dirname
### OBS hooks
def script_description():
return "<b>Gong OBS plugin</b>" + \
"<hr>" + \
"Script to receive web commands at http... |
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 ... |
tasks.py | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ansible, Inc.
# All Rights Reserved.
# Python
from collections import OrderedDict, namedtuple
import errno
import functools
import importlib
import json
import logging
import os
import shutil
import stat
import tempfile
import time
import traceback
from distutils.dir_util ... |
common.py | import inspect
import json
import os
import random
import subprocess
import ssl
import time
import requests
import ast
import paramiko
import rancher
import pytest
from urllib.parse import urlparse
from rancher import ApiError
from lib.aws import AmazonWebServices
from copy import deepcopy
from threading import Lock
fr... |
test_examples.py | # Copyright 2020 Tensorforce Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... |
email.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Project : flask-mega-tutorial
# @Author : wangc
# @CreateTime : 2019/5/6 9:55
# @File : email
from threading import Thread
from flask_mail import Message
from flask import current_app
from app.extensions import mail
def send_async_email(app, msg):
w... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Webserver OK, Discord Bot OK"
def run():
app.run(host='0.0.0.0',port=8080)
def keep_alive():
t = Thread(target=run)
t.start()
|
spinner.py | """
Date : 2018. 9. 1
Author : Jiwoo Park
"""
import time
import threading
import itertools
import sys
class Spinner():
spinner_char = itertools.cycle(['-','/','|','\\'])
def __init__(self):
self.stop_running = threading.Event()
self.spin_thread = threading.Thread(target=self.init_spin)
d... |
wiiremote.py | # -*- coding: utf-8 -*-
import cwiid
import threading
import time
class WiiRemote:
def __init__(self, n):
self.btn1 = False
self.btn2 = False
self.btnA = False
self.btnB = False
self.btnC = False
self.btnZ = False
self.btnUp = False
self.btnDown = Fa... |
_app.py | import select
import sys
import threading
import time
import traceback
import six
from ._abnf import ABNF
from ._core import WebSocket, getdefaulttimeout
from ._exceptions import *
from ._logging import *
"""
websocket - WebSocket client library for Python
Copyright (C) 2010 Hiroki Ohtani(liris)
This library i... |
power_monitoring.py | import random
import threading
import time
from statistics import mean
from cereal import log
from common.params import Params, put_nonblocking
from common.realtime import sec_since_boot
from selfdrive.hardware import HARDWARE
from selfdrive.swaglog import cloudlog
CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau... |
pipeline_ops_test.py | # Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
2.py | import sys
import random
import json
import concurrent.futures
import urllib.request
import uvicorn
from http.server import HTTPServer, ThreadingHTTPServer, BaseHTTPRequestHandler
from threading import Thread
from io import BytesIO
async def read_body(receive):
"""
Read and return the entire body from an inco... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import absolute_import, unicode_literals
import datetime
import threading
from django.conf import settings
from django.core.management.color import no_style
from django.core.exceptions import ImproperlyConfigured
from django.d... |
utils.py | import contextlib
import errno
import importlib
import itertools
import json
import os
import queue
import sys
import click
import click_threading
from atomicwrites import atomic_write
from . import cli_logger
from .. import BUGTRACKER_HOME
from .. import DOCS_HOME
from .. import exceptions
from ..sync.exceptions imp... |
server.py | import os
import logging
import json
import uvicorn
from fastapi import FastAPI
from pydantic import BaseModel
import grpc
from google.protobuf import any_pb2
import sys
import time
from threading import Thread
import redis
import boto3
import cache
import service_pb2
import service_pb2_grpc
s3client = None
class P... |
pystats_v8.py | #!/usr/bin/env python3
#Needs PIP3 install pandas numpy
from slickrpc import Proxy
import time
import sys
import datetime
import os
from subprocess import check_output, CalledProcessError
import json
import re
import platform
import calendar
import pandas as pd
import numpy as np
from threading import Thread
utxoamt... |
app_manager.py | import json
import random
from datetime import datetime
from io import UnsupportedOperation
from os.path import join
from pathlib import Path
import numpy as np
from kivy.app import App
from kivy.clock import Clock
# from kivy.core.window import Window
from kivy.lang import Builder
from communicator import Communicat... |
frequency.py | #
# This script verifies the frequency at which the
# sled server returns position information.
#
# Scenarios:
# - Single client
# - Multiple streaming clients start before and end after test
# - Other clients start at random times within the measurement
#
from testclient import SledClient
import time
import thread... |
__init__.py | # -*- coding: utf-8 -*-
"""
Gestión de datos recogidos en web de forma periódica
@author: Eugenio Panadero
"""
import threading
import time
import numpy as np
__author__ = 'Eugenio Panadero'
__copyright__ = "Copyright 2015, AzogueLabs"
__credits__ = ["Eugenio Panadero"]
__license__ = "GPL"
__version__ = "1.0"
__maint... |
kalmanVideoMultiCFI.py | import time
import cv2
import math
import numpy as np
import multiprocessing
import matplotlib.pyplot as plt
from Modules.foregroundExtraction import readyFrame, frameDifferencing, morphologicalOperations, natural_sort, readySingleFrame
from Modules.ballDetection import findContours, sizeDetection, playerProximityDetec... |
test_context.py | import logging
import mock
import threading
import pytest
from ddtrace.span import Span
from ddtrace.context import Context
from ddtrace.constants import HOSTNAME_KEY
from ddtrace.ext.priority import USER_REJECT, AUTO_REJECT, AUTO_KEEP, USER_KEEP
from .test_tracer import get_dummy_tracer
from tests import BaseTestCa... |
baidu.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... |
test_launcher.py | import pytest
import multiprocessing as mp
from pathlib import Path
import json
import copy
from blendtorch import btt
BLENDDIR = Path(__file__).parent/'blender'
LAUNCH_ARGS = dict(
scene='',
script=str(BLENDDIR/'launcher.blend.py'),
num_instances=2,
named_sockets=['DATA', 'GY... |
batcher.py | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
# Modifications Copyright 2017 Abigail See
#
# 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... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
__main__.py | from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3
import os
import labscript_utils.excepthook
try:
from labscript_utils import check_version
except ImportError:
raise ImportError('Require labscript_utils > 2.1.0')
check_version('labscript_ut... |
proxy_api.py | from flask import Flask, jsonify, make_response
from proxy import Proxy
import multiprocessing
import sqlite3
import time
import yaml
import random
app = Flask(__name__)
def activate():
print("Inside activate")
while 1:
conn = sqlite3.connect("Proxy.db")
cursor = conn.cursor()
x = Pro... |
webserver.py | #!/usr/bin/python
from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer
import os, socket, requests, re, random
from SocketServer import ThreadingMixIn
from multiprocessing import Process
PORT_NUMBER = 80
WORKING = False
HEALTHY = True
PROCESS = None
class myHandler(BaseHTTPRequestHandler):
def get_zone(self)... |
stats_server.py | #!/usr/bin/env python
"""Stats server implementation."""
import BaseHTTPServer
import collections
import json
import logging
import socket
import threading
from grr import config
from grr.lib import registry
from grr.lib import stats
from grr.lib import utils
def _JSONMetricValue(metric_info, value):
if metric... |
sdk_worker.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... |
servers.py | """
Starting in CherryPy 3.1, cherrypy.server is implemented as an
:ref:`Engine Plugin<plugins>`. It's an instance of
:class:`cherrypy._cpserver.Server`, which is a subclass of
:class:`cherrypy.process.servers.ServerAdapter`. The ``ServerAdapter`` class
is designed to control other servers, as well.
Multiple servers/p... |
RobotHandArduino.py | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 28 17:40:25 2021
@author: DiegoDiazGarciaDev
"""
import cv2
from tensorflow.keras.models import load_model
import requests
import threading
import numpy as np
from tensorflow.keras.preprocessing import image
#flag in case we are going to use our ESP8266 connected to the... |
nvwave.py | #nvwave.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2008 NVDA Contributors <http://www.nvda-project.org/>
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
"""Provides a simple Python interface to playing audio using the Windows multimedia wave... |
look_at_closest_person.py | #!/usr/bin/env python
# The look-at-closest-person action in a task plan
import numpy as np
from threading import Thread
import rospy
from task_executor.abstract_step import AbstractStep
from rail_people_detection_msgs.msg import Person, DetectionContext
from .look import LookAction
class LookAtClosestPersonAct... |
main.py |
import threading
from slackbot.bot import Bot
from app.rtm.emoji_fetcher import connect
import app
def main():
rtm_reaction_loop = threading.Thread(target=connect)
rtm_reaction_loop.start()
bot = Bot()
bot.run()
if __name__ == "__main__":
main()
|
subscriptions.py | import gc
import logging
import threading
import ujson
import websocket
import time
import random
from typing import List, Optional, Dict, Union
from queue import Queue
from tinkoff_invest.config import EVENTS_PROCESSING_WORKERS_COUNT
from tinkoff_invest.base_strategy import BaseStrategy
from tinkoff_inves... |
SpreadingServer.py | #!/usr/bin/env python3
import socket
import threading
import time
from message import Message
import TorzelaUtils as TU
class SpreadingServer:
# nextServers is an array of tuples in the form
# (<IP>, <Port>)
# where <IP> is the IP address of a Dead Drop and
# <Port> is the port that the Dead Drop is list... |
test_worker.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import shutil
import signal
import subprocess
import sys
import time
import zlib
from datetime import datetime, timedelta
from multiprocessing import Process
from time import ... |
views.py | """
Views for using in actions app.
"""
import threading
from django.contrib.auth.decorators import user_passes_test
from django.core.checks import messages
from django.core.files.base import ContentFile
from django.http import JsonResponse
from django.shortcuts import render, redirect, get_object_or_404
from django.co... |
shape_intersection_loader.py | import numpy as np
import time
import random
import math
import os
import sys
from multiprocessing import Process, Queue
import _pickle as cPickle
import io
import pdb
import gizeh
def draw(shape, pixel, filename=None):
resize = pixel / 10
surface = gizeh.Surface(width=pixel, height=pixel, bg_color=(0, 0, 0))... |
test_failure.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.ray_constants as ray_constants
from ray.cluster... |
__init__.py | __version__ = '0.0.19'
import threading
import socket
import logging
import time
import logging
from types import SimpleNamespace
# logger for background processes (pinger and data stream)
logger = logging.getLogger('psrt')
DEFAULT_PORT = 2873
DEFAULT_TIMEOUT = 5
BUF_SIZE = 1024
PROTO_VERSION = 1
SLEEP_STEP = 0.1... |
test_downloader_http.py | #!/usr/bin/env python
# coding: utf-8
from __future__ import unicode_literals
# Allow direct execution
import os
import re
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import http_server_port, try_rm
from yt_dlp import YoutubeDL
from yt_dl... |
client.py | import threading
import socket
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES
from Crypto import Random
import base64
class client():
def __init__(self):
self.running = True
self.server_host = '127.0.1.1'
self.key = b'network security' # 16 bits
def run(self)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.