source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
alarm_perf-hos.py | # alarm_perf-hos.py
# measure alarm creation rate
# adapted to run in CEQA HLM203 environment
import datetime
import re
import sys
import time
import multiprocessing
from monascaclient import client
from monascaclient import ksclient
from agent_sim import agent_sim_process
import warnings
# suppress warnings to im... |
multiproc_utils.py | from __future__ import annotations
import multiprocessing as mp
from functools import partial
from multiprocessing import Pool, Process
from typing import Callable
from more_itertools import chunked
from tqdm import tqdm
__all__ = ["batch_multiprocess", "batch_multiprocess_with_return"]
def batch_multiprocess(
... |
main.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... |
tracker.py | import threading
import time
import rtplot
import openocd
import logging
import cProfile, pstats, io
class VarTracker:
def __init__(self, tracking_delay = 0.01):
self.vars = []
self.oocd = openocd.launch("stm32f4")
self._stop = 0
self.thread = threading.Thread(target = self.run)
... |
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... |
window.py | # -*- coding: utf-8 -*-
from threading import Thread
from traceback import print_exc
from os import stat
from os.path import splitext
from sys import version_info
from io import open
from re import compile as re_compile, U as re_U
from enum import Enum
from gi.repository import Gtk, GLib, Gio
from formiko.vim import ... |
test_backfill_job.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... |
torch_policy_v2.py | import copy
import functools
import gym
import logging
import math
import numpy as np
import os
import threading
import time
import tree # pip install dm_tree
from typing import (
Any,
Dict,
List,
Optional,
Set,
Tuple,
Type,
Union,
TYPE_CHECKING,
)
import ray
from ray.rllib.models.... |
recording_manager.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... |
neovim_rpc_server.py | # vim:set et sw=4 ts=8:
import json
import socket
import sys
import os
import threading
import vim
import logging
import msgpack
import neovim_rpc_server_api_info
import neovim_rpc_methods
import threading
import socket
import time
import subprocess
from neovim.api import common as neovim_common
import neovim_rpc_prot... |
Validator.py | # coding:utf-8
import sys
import chardet
from gevent import monkey
monkey.patch_all()
import json
import os
import gevent
import requests
import time
import psutil
from multiprocessing import Process, Queue
import config
from db.DataStore import sqlhelper
from util.exception import Test_URL_Fail
def detect_from_db... |
loader.py | # Copyright (c) 2017-present, Facebook, 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... |
preprocess.py | import os, sys, tempfile, glob, argparse
sys.path.insert(0, '.')
import shutil
import numpy as np
from skimage import io as sio
from pyutils.iolib.video import getFFprobeMeta
from utils import gen_eac2eqr_maps, save_pgm
from pyutils.iolib.audio import save_wav, AudioReader
from pyutils.iolib.video import VideoR... |
SideBar.py | import os
import shutil
import sublime
import sublime_plugin
import threading
from functools import partial
class SideBarCommand(sublime_plugin.WindowCommand):
def copy_to_clipboard(self, data):
sublime.set_clipboard(data)
lines = len(data.split('\n'))
self.window.status_message('Copied {} to clipboard'... |
detection_test.py | import os
import math
import pprint
from core.detection_module import DetModule
from core.detection_input import Loader
from utils.load_model import load_checkpoint
from utils.patch_config import patch_config_as_nothrow
from functools import reduce
from queue import Queue
from threading import Thread
import argparse
... |
GuardAgent.py | #!/usr/bin/env python3
# from __future__ import print_function
import swagger_client
from swagger_client.rest import ApiException
from swagger_client.models.guard_agent import GuardAgent
import threading
from swagger_client.GuardAgentSecurityContext import GuardAgentSecurityContext
from swagger_client.models.security... |
smtclient.py | # Copyright 2017,2018 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... |
s3booster-download-dir.py | #!/bin/env python3
'''
** Chaveat: not suitable for millions of files, it shows slow performance to get object list
ChangeLogs
- 2021.07.23: applying multiprocessing.queue + process instead of pool
- 2021.07.21: modified getObject function
- for parallel processing, multiprocessing.Pool used
- used bucket.all inste... |
dipdiff.py | #!/usr/bin/env python3
from threading import Thread
import sys
import subprocess
import os
import argparse
from distutils import spawn
pipeline_dir = os.path.dirname(os.path.realpath(__file__))
MINIMAP2 = os.path.join(pipeline_dir, "submodules", "minimap2", "minimap2")
SAMTOOLS = "samtools"
sys.path.insert(0, os.pa... |
task.py | import logging
import threading
import time
from typing import TYPE_CHECKING, Any, Callable, Tuple
if TYPE_CHECKING:
from core.gui.app import Application
class ProgressTask:
def __init__(
self,
app: "Application",
title: str,
task: Callable,
callback: Callable = None,
... |
crawler.py | import logging
import time
import re
import urllib.parse
from queue import Empty
from multiprocessing import Process, Event
from queue import Queue as Queue
from multiprocessing import Queue as MPQueue
from threading import Thread
from enum import Enum
# Used to enable launch as a main
import os.path, sys
sys.path.in... |
notebookapp.py | # coding: utf-8
"""A tornado based IPython notebook server.
Authors:
* Brian Granger
"""
from __future__ import print_function
#-----------------------------------------------------------------------------
# Copyright (C) 2013 The IPython Development Team
#
# Distributed under the terms of the BSD License. The fu... |
queue_example_hang.py | import threading
import queue
tasks_queue = queue.Queue()
def process_tasks_from_queue():
while True:
task_data: str = tasks_queue.get()
do_some_work(task_data)
def do_some_work(task_data: str):
print(f'Doing task_data: {task_data}...')
for _ in range(3):
thread = threading.Thread(ta... |
bot.py | from google_sheeets_client import GoogleSheetsClient
from music import Music
from discord.ext import commands
from threading import Thread
from help_formatter import NewHelpFormatter
import os
import signal
import socket
import getpass
import sys
from enum import Enum
new_help_formatter = NewHelpFormatter()
new_help_... |
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... |
tuner.py | #!/usr/bin/env python3
'''Usage: {0} <model>
'''
import multiprocessing as mp
import os
import sys
import traceback as tb
import numpy as np
# Filter out debug messages from TF.
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '1'
if __name__ == '__main__':
print('*** Starting up...')
import tensorflow as tf... |
global_data.py | import uuid
import json
import time
import threading
import websocket
import requests
from app.global_data.config import Config
from app.global_data.consul_client import ConsulClient
from app.global_data.oauth_client import OauthClient
import logging
class GlobalData:
def __init__(self):
self.inited = Fal... |
test_mix.py | import pdb
import copy
import pytest
import threading
import datetime
import logging
from time import sleep
from multiprocessing import Process
import sklearn.preprocessing
from milvus import Milvus, IndexType, MetricType
from utils import *
dim = 128
index_file_size = 10
table_id = "test_mix"
add_interval_time = 2
ve... |
test_threading.py | """
Tests for the threading module.
"""
import test.support
from test.support import verbose, strip_python_stderr, import_module, cpython_only
from test.support.script_helper import assert_python_ok, assert_python_failure
import random
import re
import sys
_thread = import_module('_thread')
threading = import_module(... |
mad.py | # Mounted Assistant Device
# The M.A.D. MK.1
# BY SHANE PATON
import socket
import sys
import os
import time
import threading
from datetime import datetime
import RPi.GPIO as GPIO
from RPLCD.i2c import CharLCD
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.clo... |
test_server.py | import logging
from pytest import fixture
from stubilous.builder import Builder
logging.basicConfig(level=logging.DEBUG)
@fixture(scope="session")
def server(request):
from multiprocessing import Process
from stubilous.server import run
builder = Builder()
builder.server(host="localhost", port=9999)
... |
update.py | #!/usr/bin/env python
import os
import math
import datetime
from contextlib import contextmanager
import smtplib
from email.mime.text import MIMEText
from threading import Thread
from optparse import OptionParser
import requests
import dateutil
from dateutil.parser import parse as parse_date
from db import DB
from mode... |
asyncio.py | import asyncio
import concurrent.futures
import inspect
import os
import socket
from functools import partial
from threading import Thread
from typing import (
Callable, Set, Optional, Union, Tuple, cast, Coroutine, Any, Awaitable, TypeVar,
Generator)
from weakref import WeakKeyDictionary
from async_generator ... |
ipc.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Helper functions for inter-process communication via AddonSignals
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __futur... |
test_misc.py | import threading
import unittest
from unittest import mock
import cupy
from cupy import testing
from cupy_tests.core_tests.fusion_tests import fusion_utils
class FusionTestBase(unittest.TestCase):
def generate_inputs(self, xp, nargs, dtype):
inputs = [
testing.shaped_random((3, 4), xp, dtype,... |
producer.py |
# Copyright 2020 Nedeljko Radulovic, Dihia Boulegane, Albert Bifet
#
# 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... |
main.py | from pyrogram import Client, filters, idle
from pkg_resources import get_distribution
from config import API_ID, API_HASH, TOKEN, sudofilter, db_url
import os, sys
from tortoise import run_async
from threading import Thread
from datetime import datetime
from db.db import init_db
from db.functions import get_users_count... |
scylla_node.py | # ccm node
from __future__ import with_statement
import datetime
import errno
import os
import signal
import shutil
import socket
import stat
import subprocess
import time
import threading
import psutil
import yaml
import glob
from six import print_
from six.moves import xrange
from ccmlib import common
from ccmlib... |
phasespace.py | '''Classes for fetching and handling data from phasespace.'''
import collections
import logging
import OWL
import random
import threading
import time
import viz
ERROR_MAP = {
OWL.OWL_NO_ERROR: 'No Error',
OWL.OWL_INVALID_VALUE: 'Invalid Value',
OWL.OWL_INVALID_ENUM: 'Invalid Enum',
OWL.OWL_INVALID_OP... |
scheduler.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
| This file is part of the web2py Web Framework
| Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu>
| License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html)
Background processes made simple
---------------------------------
"""
USAGE = """
## Example
For an... |
command.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# 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... |
multiprocessing2.py | import multiprocessing
import time
def worker_1(interval):
print("worker_1")
time.sleep(interval)
print("end worker_1")
def worker_2(interval):
print("worker_2")
time.sleep(interval)
print("end worker_2")
def worker_3(interval):
print("worker_3")
time.sleep(interval)
print("end wo... |
trainer_factory.py | # Copyright (c) 2019 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 app... |
repeated_sweep_saving_engine.py | from pynput import keyboard
from time import sleep
from threading import Thread
from multiprocessing import Process, Queue
import numpy as np
import pandas as pd
from handlers.file import get_setting, get_selected_file_path, get_visa_search_term, get_current_date_time_str
from osa.anritsu_wrapper import Anritsu
# ... |
multiprocessing.py | import os
import pickle
import select
class Process:
def __init__(self, group=None, target=None, name=None, args=(), kwargs={}):
self.target = target
self.args = args
self.kwargs = kwargs
self.pid = 0
self.r = self.w = None
def start(self):
self.pid = os.fork(... |
dsr_service_modbus_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... |
threading.py | import asyncio
import threading
import datetime
from queue import Queue
from random import randint
import re
import sys
import traceback
import inspect
from datetime import timedelta
import logging
import functools
import iso8601
from appdaemon import utils as utils
from appdaemon.appdaemon import AppDaemon
class Th... |
test_pickle_core.py | """Test for the Cachier python package."""
# This file is part of Cachier.
# https://github.com/shaypal5/cachier
# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2016, Shay Palachy <shaypal5@gmail.com>
# from os.path import (
# realpath,
# dirname
# )
import ... |
token_grabber by Hassan.py | import os
if os.name != "nt":
exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from datetime import datetime
from threading import Thread
from time import sleep
from sys import argv
LOC... |
utils.py | #!/usr/bin/env python
# Vectorized environment implementation based on OpenAI Gym| Praveen Palanisamy
# Chapter 8, Hands-on Intelligent Agents with OpenAI Gym, 2018
import multiprocessing as mp
import gym
from abc import ABC, abstractmethod
import numpy as np
import cv2
class VecEnv(ABC):
"""
An abstract asyn... |
test_service.py | # Copyright 2019 Uber Technologies, Inc. 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... |
brutespray.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from argparse import RawTextHelpFormatter
import readline, glob
import sys, time, os
import subprocess
import xml.dom.minidom
import re
import argparse
import argcomplete
import threading
import itertools
import tempfile
import shutil
from multiprocessing import Process
servic... |
__init__.py | #! /usr/bin/env python
'''Our base worker'''
import os
import code
import signal
import shutil
import itertools
import traceback
import threading
from contextlib import contextmanager
from qless import _reloadLogger
# Internal imports
from qless.listener import Listener
from qless import logger, exceptions
# Try to... |
r2d3.py | import tensorflow as tf
import rl
import rl.core
import keras
from keras.layers import Input, Flatten, Permute, TimeDistributed, LSTM, Dense, Concatenate, Reshape, Lambda
from keras.models import Model
from keras.models import model_from_json
from keras import backend as K
import numpy as np
import multiprocessing as ... |
core.py | import logging
import sys
from abc import ABCMeta, abstractmethod
import struct
import time
import threading
from bgapi.module import BlueGigaClient, GATTService, GATTCharacteristic
from bgapi.module import ProcedureManager, BLEScanResponse
from bgapi.cmd_def import gap_discover_mode
from .message import MessageDefin... |
Spot.py | import time
from bosdyn.api import robot_state_pb2, robot_command_pb2, synchronized_command_pb2, mobility_command_pb2, basic_command_pb2, geometry_pb2, trajectory_pb2
from bosdyn.api import world_object_pb2
from bosdyn.api.spot import robot_command_pb2 as spot_command_pb2
from bosdyn.api.geometry_pb2 import SE2Velocity... |
radio_session.py | import threading
import json
import traceback
import queue
import requests
import os
from multiprocessing import Process, Queue
from elasticsearch import Elasticsearch
from .http_cmd import create_radio_session_endpoint
from tlm.oauth2 import *
from .uplink_timer import UplinkTimer
from .cases.utils import str_to_val
... |
fetchirisdmc.xpy | #!/opt/antelope/python2.7.8/bin/python
import os
import sys
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
sys.path.append(os.environ['ANTELOPE'] + "/data/python")
sys.path.append(os.environ['ANTELOPE'] + "/contrib/data/python")
import os
import sys, traceback
import time
from time import localtime, s... |
lisp.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com>
#
# 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... |
tree-orders.py | #!/usr/bin/env python3
"""Binary Tree Reversals
Implement in-order, pre-order, and post-order traversals of a binary tree.
Given a binary rooted tree, build and output its in-order, pre-order, and
post-order traversals.
"""
import sys, threading
sys.setrecursionlimit(10**6) # max depth of recursion
threading.stack_... |
part2.py | from itertools import permutations
from aoc2019.intcode_computer import IntCodeComputer
import multiprocessing as mp
def part2(program):
sequences = permutations(range(5, 10))
best_output = 0
best_sequence = None
for seq in sequences:
# Initialize our computers, each will run in its own proces... |
acquire.py | import numpy as np
import multiprocessing
import threading
from inspect import signature
import copy
import types
import time
from pycromanager.core import serialize_array, deserialize_array, Bridge
from pycromanager.data import Dataset
import warnings
import os.path
import queue
### These functions outside class to p... |
test_main.py | # -*- coding: utf-8 -*-
import json
import threading
import time
from http.server import HTTPServer, BaseHTTPRequestHandler
from datapackage_pipelines.manager import execute_pipeline, run_pipelines
from datapackage_pipelines.specs.specs import pipelines
from datapackage_pipelines.utilities.execution_id import gen_exec... |
log-prefixer.py | #!/usr/bin/env python3
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source Licen... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import importlib.machinery
import importlib.util
import os
import pickle
import random
import re
import subprocess
import sys
import t... |
connection.py | # Copyright (c) 2015 Red Hat, 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 ... |
main.py | #!/usr/bin/python
import paho.mqtt.client as paho
import pyupm_grove as grove
import json
import uuid
import psutil
import pywapi
import signal
import sys
import time
import dweepy
from threading import Thread
from flask import Flask
from flask_restful import Api, Resource
DeviceID = 0
Sensor = 0
Actuator = 0
class... |
util.py | #
# Copyright (C) 2012-2017 The Python Software Foundation.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
import codecs
from collections import deque
import contextlib
import csv
from glob import iglob as std_iglob
import io
import json
import logging
import os
import py_compile
import re
import socket
try:
import ssl
... |
serializers.py | from rest_framework import serializers
from variants.models import *
from beeswax.design import hql_query
from beeswax.server import dbms
from beeswax.server.dbms import get_query_server_config
from hbase.api import HbaseApi
from converters import *
from models import *
import time
import os
import json
import threadin... |
multi_threaded_tests.py | #!/usr/bin/env python
from PyMiniQbt import QasmAsyncInterpreter
import unittest
import threading
class MultiThreadedTests(unittest.TestCase):
'''
Check if the native code and the python wrapper can be used in a multithreaded enviroment.
Due the fact that a global static vector in c++ stores all th... |
server.py | """
A high-speed, production ready, thread pooled, generic HTTP server.
For those of you wanting to understand internals of this module, here's the
basic call flow. The server's listening thread runs a very tight loop,
sticking incoming connections onto a Queue::
server = HTTPServer(...)
server.start()
->... |
environment.py | import abc
import consul
import datetime
import etcd
import kazoo.client
import kazoo.exceptions
import os
import psutil
import psycopg2
import json
import shutil
import signal
import six
import subprocess
import tempfile
import threading
import time
import yaml
@six.add_metaclass(abc.ABCMeta)
class AbstractControlle... |
utils.py | """."""
from threading import Event as _Event
import logging as _log
import sys as _sys
from epics.ca import CAThread as _Thread
from mathphys.functions import save_pickle as _save_pickle, \
load_pickle as _load_pickle
import apsuite.commisslib as _commisslib
class DataBaseClass:
"""."""
def __init__(... |
cmp_sync_thread.py | from compliance_standards import cmp_compare, cmp_get
from compliance_standards.cmp_migrate_thread import break_into_threads
from sdk.color_print import c_print
from tqdm import tqdm
import threading
def sync(tenant_sessions: list, addMode: bool, upMode: bool, delMode: bool, logger, tenant_compliance_standards_data=[]... |
CloneConnector.py | # *******************************************************************************
# * Copyright 2017 McGill University 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 ... |
distance.py | #导入 GPIO库
import RPi.GPIO as GPIO
import time
import ui,main
import threading
distmin=25
whiletime=1
distmax=1
#设置 GPIO 模式为 BCM
GPIO.setmode(GPIO.BCM)
#定义 GPIO 引脚
GPIO_TRIGGER = 20
GPIO_ECHO = 21
#设置 GPIO 的工作方式 (IN / OUT)
GPIO.setup(GPIO_TRIGGER, GPIO.OUT)
GPIO.setup(GPIO_ECHO, GPIO.IN)
def distance():
# 发送高电平信... |
test.py | import os.path as p
import random
import threading
import time
import pytest
from helpers.cluster import ClickHouseCluster
from helpers.test_tools import TSV
from helpers.client import QueryRuntimeException
from helpers.network import PartitionManager
import json
import subprocess
import kafka.errors
from kafka impor... |
MultithreadedWebcam.py | import threading
import cv2
class VideoCaptureThreading(object):
def __init__(self, src, width, height):
self.src = src
self.cap = cv2.VideoCapture(self.src)
self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)
self.cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)
self.grabbed, self.fr... |
utils.py | import asyncio
import contextlib
import io
import logging
import os
import signal
import socket
import ssl
import threading
import unittest
from test.support import TEST_HOME_DIR
import objc_asyncio
from objc_asyncio._log import logger
MAX_TEST_TIME = 30
@contextlib.contextmanager
def captured_log():
try:
... |
process_replay.py | #!/usr/bin/env python3
import importlib
import os
import sys
import threading
import time
import signal
from collections import namedtuple
import capnp
from tqdm import tqdm
import cereal.messaging as messaging
from cereal import car, log
from cereal.services import service_list
from common.params import Params
from ... |
connectivity_monitor.py | from datetime import datetime
from dataclasses import dataclass
from typing import List, Dict, Optional
import ipwhois
import logging
import time
import requests
import threading
import os
import pickle
@dataclass()
class ConnectionInfo:
date: datetime
is_connected: bool
ip_address: str
ip_info: Dict[s... |
__main__.py | #####################################################################
# #
# /main.pyw #
# #
# Copyright 2014, Monash University ... |
stats.py | import os
import threading
import time
import pandas as pd
import psutil
import pynvml
from manta_client.sdk.interface.interface import Interface
# TODO: add vendor pandas?
# TODO: track gpu per process
# TODO: add thread
# WARNING: DO NOT CHANGE THIS VALUE, SERVER WILL BLOCK YOUR REQUEST
DEBOUNCE_SE... |
dask.py | # This file is part of the Open Data Cube, see https://opendatacube.org for more information
#
# Copyright (c) 2015-2020 ODC Contributors
# SPDX-License-Identifier: Apache-2.0
""" Dask Distributed Tools
"""
from typing import Any, Iterable, Optional, Union, Tuple
from random import randint
import toolz
import queue
fr... |
nats_pub.py | # @file nats_pub.py
# @brief QoT Coordination Service NATS Data Publisher
# @author Anon D'Anon
#
# Copyright (c) Anon, 2018. All rights reserved.
# Copyright (c) Anon Inc., 2018. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that ... |
heat-device.py | import json
from connection import *
import connection
from datetime import datetime
state = 0
def getIncomingCommands():
global state
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
sock.bind(("0.0.0.0", 5006))
... |
release.py | #!/usr/bin/python
import re
import sys
import os
import os.path
import subprocess
import shutil
from datetime import *
from multiprocessing import Process
from utils import *
try:
from xml.etree.ElementTree import ElementTree
except:
prettyprint('''
Welcome to the Infinispan LevelDB Cache Store Release Scr... |
lightdiscovery.py | #!/usr/bin/env python3
"""
Light Discovery and Categorization
"""
import threading
import requests
import socket
from time import sleep
from json import dumps, loads, JSONDecodeError
import psutil as psutil
from common.logs import LOG
from common.common import CPARAMS, URLS
__maintainer__ = 'Alejandro Jurnet'... |
netgear.py | """
===============================================
vidgear library source-code is deployed under the Apache 2.0 License:
Copyright (c) 2019 Abhishek Thakur(@abhiTronix) <abhi.una12@gmail.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the Licen... |
main.py | from flask import Flask
from discord.ext import commands
from threading import Thread
import discord
import json
print('BrianYT Notifier')
app = Flask('')
@app.route('/')
def main():
return "Bot is currently online!"
def run():
app.run(host="0.0.0.0", port=8000)
def keep_alive():
server = Thread(target=run)
... |
app.py | # -*- coding: utf-8 -*-
import json
from threading import Thread
from time import sleep
from groupprediction import GroupPrediction
from team import Team, oauth
from flask import Flask, request, make_response, render_template, jsonify
app = Flask(__name__)
gds = {}
@app.route("/install", methods=["GET"])
def pre_i... |
main.py | """
Adapted from: https://github.com/ikostrikov/pytorch-a3c/blob/master/main.py
The main file needed within a3c. Runs of the train and test functions from their respective files.
Example of use:
`cd algorithms/a3c`
`python main.py`
Runs A3C on our AI2ThorEnv wrapper with default params (4 processes). Optionally it can... |
main.py | import LED_display as LED
import threading
import time
import random
card=[[[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1]... |
T02.py | #
# full blown threading stability test, higher enent rate...
#
import threading
import time
import random
from pymol import cmd
#cmd.feedback("ena","thread","debug")
cmd.rock()
cmd.load("dat/pept.pdb","obj1")
def bg_rgb():
while 1:
time.sleep(random.random()*0.05)
cmd.set('bg_rgb','%8.3f %8.3... |
test_capture.py | import contextlib
import io
import os
import subprocess
import sys
import textwrap
from io import UnsupportedOperation
from typing import BinaryIO
from typing import cast
from typing import Generator
from typing import TextIO
import pytest
from _pytest import capture
from _pytest.capture import _get_multicapture
from ... |
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... |
test.py | # Load the trained model
# Test it on the seen and unseen environment
#
# Seen environment - (X, Y) = (143.5, 207.0)
# Unseen envioronment - (X, Y) =
from keras.models import load_model
import glob
import os
import sys
import random
import time
import numpy as np
import cv2
import math
from collections import... |
runtime.py | ###
### Copyright (C) 2021 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
import os
import psutil
import slash
import threading
import time
from ...lib.common import get_media, startproc, killproc
class MFXRuntimeTest(slash.Test):
def expected(self, dispatcher):
if "msdk" == dispatcher:
... |
SFWindow.py | #-*- coding: utf-8 -*-
import time
import json
from threading import Thread
from Tkinter import *
from softZmq import *
from AI.AI import AI
#classe qui gère l'affichage du jeu et le jeu en lui même
class SFWindow(object) :
def __init__(self):
#principal window
self.window = Tk()
self.windo... |
segment.py | """Controls functions for segmentation of white/gray matter and other things in the brain.
"""
import os
import time
import shlex
import warnings
import numpy as np
import subprocess as sp
from builtins import input
import multiprocessing as mp
from . import formats
from . import blender
from . import freesurfer
from ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.