source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
motor_safety.py | #!/usr/bin/python3
import os
import time
import threading
import RPi.GPIO as GPIO
lock = threading.Lock()
run = True
def toggle():
frequency = 25
toggle_pin = 14
GPIO.setup(toggle_pin, GPIO.OUT)
state = True
my_run = True
while my_run:
GPIO.output(toggle_pin, state)
state = n... |
program.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... |
procutil.py | from multiprocessing import Process, Queue
import traceback
import logging
log = logging.getLogger(__name__)
def _wrapper(target, codec, queue, args, kwargs):
exc = tb = None
try:
if args is None:
args = []
if kwargs is None:
kwargs = {}
r = target(*args, **kwa... |
test_blocks.py | import threading
from ..base import BaseTest
from seafobj import block_mgr
Success = True
class TestSeafBlockManager(BaseTest):
def setUp(self):
self.repo_id = self.TEST_CEPH_REPO_ID
self.repo_id_2 = self.TEST_CEPH_REPO_ID_2
self.modified_bkid = '125f1e9dc9f3eca5a6819f9b4a2e17e53d7e2f78... |
rs_localisation.py | import pyrealsense2 as rs
import numpy as np
import cv2
class RSLocalisation():
origin = [0,0]
threshold_m00 = 70000
def __init__(self):
self.pipeline = rs.pipeline()
config = rs.config()
pipeline_wrapper = rs.pipeline_wrapper(self.pipeline)
pipeline_prof... |
Model.py | """
Deze Applicatie verzorgd een koppeling tussen:
* Radio Audtomatisering
* MySQL Database
* FTP Server
Daarnaast word een XML gegenereerd voor koppeling Website -> Fileserver
Deel van commentaar volgt in het Engels, statussen worden in het Nederlands gegeven.
"""
__version__ = '1.2'
__author__ = 'Sander Post'
impor... |
server3.py | ################################################################################
#
# 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 ... |
device.py | from time import sleep
from typing import List
from importlib import import_module
from multiprocessing import Process
import sys
sys.path.append('config/scripts/')
DeviceList = List[str]
class DeviceNotFoundException(Exception):
pass
class Device(object):
def __init__(self, name: str, script_name: str):
... |
commands.py | ###
# Copyright (c) 2002-2005, Jeremiah Fincher
# Copyright (c) 2009-2010,2015, James McCoy
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the a... |
job.py | import threading
import traceback
from util.array import unzip, none
from util.collection import for_each
from util.error import AlreadyRunning, CancelledError
[
PENDING,
RUNNING,
FINISHED,
CANCELLED
] = range(4)
TIMEOUT_ERROR = 'TimeoutError'
CANCELLED_ERROR = 'CancelledError'
class _Waiter(object... |
locators.py | # -*- coding: utf-8 -*-
# Copyright (c) 2020
# Author: xiaoweixiang
#
#
import gzip
from io import BytesIO
import json
import logging
import os
import posixpath
import re
try:
import threading
except ImportError: # pragma: no cover
import dummy_threading as threading
import zlib
from . import DistlibExce... |
test_context.py | # Copyright 2019, OpenTelemetry 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 i... |
framework.py | #!/usr/bin/env python
from __future__ import print_function
import gc
import sys
import os
import select
import unittest
import tempfile
import time
import faulthandler
import random
import copy
import psutil
from collections import deque
from threading import Thread, Event
from inspect import getdoc, isclass
from tra... |
main.py | print("importing...")
from config import Configuration
from server import AnylinkServer, SFTPHandler
import threading
from requests_manager import RequestsManager
from account_manager import AccountManager
import readchar
def main():
print("config...")
config = Configuration("/home/orikeidar01/config.json", "... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
test_index.py | import multiprocessing as mp
import os
import time
import unittest
import numpy as np
from jina.enums import FlowOptimizeLevel
from jina.executors.indexers.vector.numpy import NumpyIndexer
from jina.flow import Flow
from jina.main.parser import set_flow_parser
from jina.proto import jina_pb2
from tests import JinaTes... |
revocation_notifier.py | '''
SPDX-License-Identifier: Apache-2.0
Copyright 2017 Massachusetts Institute of Technology.
'''
from multiprocessing import Process
import threading
import functools
import time
import os
import sys
import signal
import zmq
import simplejson as json
from keylime import config
from keylime import crypto
from keylim... |
pants_daemon.py | # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import logging
import os
import sys
import threading
from contextlib import contextmanager
from dataclasses import dataclass
from setproctitle import setproctitle as set_process_title
fr... |
webtransport_h3_server.py | import asyncio
import logging
import os
import ssl
import threading
import traceback
from enum import IntEnum
from urllib.parse import urlparse
from typing import Any, Dict, List, Optional, Tuple
# TODO(bashi): Remove import check suppressions once aioquic dependency is resolved.
from aioquic.buffer import UINT_VAR_MA... |
__init__.py | import os
import sched, time
import threading
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.label import Label
from kivy.uix.screenmanager import Screen
from kivy_garden.mapview import MapMarker, MapLayer
_app_name_ = 'navigation'
class navigationApp(Screen):
def __init__(self, **kwargs):
... |
_channel.py | # Copyright 2016 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing... |
runtests.py | #!/usr/bin/env python
from __future__ import print_function
import atexit
import os
import sys
import re
import gc
import heapq
import locale
import shutil
import time
import unittest
import doctest
import operator
import subprocess
import tempfile
import traceback
import warnings
import zlib
import glob
from context... |
test_bigquery.py | import unittest
import os
import json
from unittest.mock import patch
import threading
from test.support import EnvironmentVarGuard
from urllib.parse import urlparse
from http.server import BaseHTTPRequestHandler, HTTPServer
from google.cloud import bigquery
from google.auth.exceptions import DefaultCredentialsError
... |
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... |
maxinet.py | #!/usr/bin/python
"""MaxiNet main file
This file holds the main components of MaxiNet and is intended to be the
only part of MaxiNet which needs to be used by the user or third-party
applications.
Classes in this file:
Experiment: Use this class to specify an experiment. Experiments are
created for one-time-usag... |
camera_feeder.py | import logging
import threading
import time
from typing import Optional
import cv2
import numpy as np
from custom_exceptions import CameraFeederInitException
logger = logging.getLogger(__name__)
class CameraFeeder:
CAPTURE_RETRY_MAX: int = 30
def __init__(self, src: str) -> None:
self._src: str = ... |
hipster_recon.py | #!/usr/bin/env python3
"""
Program: hipster_recon.py
Date: 01/27/2022
Author: Travis Phillips
Purpose: A pre-engagement script for confirming scope. Features include:
* Converts a CIDR notation IP into a range/list of IP addresses,
* Can dump a raw list and exit for creating target list.
... |
test_motor_tail.py | # Copyright 2012-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... |
test_operator_gpu.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 u... |
test_diskutils.py | import functools
import gc
import os
import queue
import shutil
import subprocess
import sys
from time import sleep
from unittest import mock
import pytest
import dask
from distributed.compatibility import WINDOWS
from distributed.diskutils import WorkSpace
from distributed.metrics import time
from distributed.utils ... |
client.py | # -*- coding=utf-8 -*-
import base64
import hashlib
import logging
import socket
import json
import platform
import time
try:
import ssl
except ImportError:
ssl = None
from multiprocessing import Process, Manager, Queue, pool
from threading import RLock, Thread
try:
# python3.6
from http import HTTPS... |
cpumultilimit.py | # coding: UTF-8
import subprocess
import threading
import time
import traceback
from subprocess import check_output
#######config###########
#設定。limitpercentでcpulimit -l で指定するCPUの制限値
limitpercent = 30
#設定。limitprocessnameでcpulimitするプロセス名を指定する
limitprocessname ="bedrock_server"
########################
########functi... |
object_detection_multithreading.py | import os
import cv2
import time
import argparse
import numpy as np
import tensorflow as tf
from socket import *
from queue import Queue
from threading import Thread
from utils.app_utils import FPS, WebcamVideoStream, draw_boxes_and_labels
from object_detection.utils import label_map_util
CWD_PATH = os.getcwd()
# Pa... |
python_GIL_01.py | # GIL全局终端锁 global interpreter Lock(cpython)
# python中的一个线程对应c语言中的一个线程
# GIL是的python同一时间只能有一个线程运行的cpu上执行字节码
# gil会根据执行的字节码行数以及时间片切换线程(时间片的时间),无法将多个线程映射到多个CPU上,gil遇到IO操作的情况下主动释放
# 对io操作来说,多线程和多进程效率差不多
# 共享变量和Queue
# pipy去GIL化的库
# Gil会根据执行的字节码行数以及时间片释放GIL,遇到IO操作的时候回释放GIL
# GIL在python2,Python3中的区别
# Python和Cpython的区别
# ... |
_local_.py | import time
import threading
threading_local = threading.local()
"""
threading.local()这个方法的特点用来保存一个全局变量,但是这个全局变量只有在当前线程才能访问,
localVal.val = name这条语句可以储存一个变量到当前线程,如果在另外一个线程里面再次对localVal.val进行赋值,
那么会在另外一个线程单独创建内存空间来存储,也就是说在不同的线程里面赋值 不会覆盖之前的值,因为每个
线程里面都有一个单独的空间来保存这个数据,而且这个数据是隔离的,其他线程无法访问
这个东西可以用在那些地方呢,比如下载,现在都是多线... |
parallel.py | import _thread as thread
import logging
import operator
import sys
from queue import Empty
from queue import Queue
from threading import Lock
from threading import Semaphore
from threading import Thread
from docker.errors import APIError
from docker.errors import ImageNotFound
from compose.cli.colors import green
fro... |
applications_test.py | import pytest
import random
import six
import numpy as np
import keras_applications
from keras.applications import densenet
from keras.applications import inception_resnet_v2
from keras.applications import inception_v3
from keras.applications import mobilenet
try:
from keras.applications import mobilenet_v2
except... |
SentenceTransformer.py | import json
import logging
import os
import shutil
from collections import OrderedDict
from typing import List, Dict, Tuple, Iterable, Type, Union, Callable
from zipfile import ZipFile
import requests
import numpy as np
from numpy import ndarray
import transformers
import torch
from torch import nn, Tensor, device
from... |
test_random.py | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises, assert_equal,
assert_warns)
from numpy import random
from numpy.compat import asbytes
class TestBinomial(TestCase):
def test_n_zero(s... |
nonblock.py | """
The nonblock module provides a handler class (NonBlockHandler) which allows
a tasklet to momentarily run in a seperate thread.
If a tasklet yields NonBlock(), it's next iteration will be performed in a
thread.
The handler uses a threadpool with a default of 2 worker threads.
"""
from Queue import Queue, Empty, F... |
script.py |
import os
import traceback
import threading
import shlex
from . import controller
class ScriptError(Exception):
pass
class ScriptContext:
def __init__(self, master):
self._master = master
def log(self, message, level="info"):
"""
Logs an event.
By default, only... |
simplequeue.py | import json
import threading
import time
from anchore_engine.clients.services import http
from anchore_engine.subsys import logger
from anchore_engine.utils import get_threadbased_id
from anchore_engine.clients.services.internal import InternalServiceClient
import retrying
class LeaseAcquisitionFailedError(Exception)... |
store_gc_service.py | # coding=utf-8
# Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import logging
impor... |
test_poplib.py | """Test script for poplib module."""
# Modified by Giampaolo Rodola' to give poplib.POP3 and poplib.POP3_SSL
# a real test suite
import poplib
import asyncore
import asynchat
import socket
import os
import time
import errno
from unittest import TestCase
from test import support as test_support
threading = test_suppo... |
mavmonitor.py | from pymavlink import mavutil
from threading import Thread
from PyQt5.QtGui import QTextCursor
from maximum_roverdrive.tablemodel import TableModel
from maximum_roverdrive.astral_dusk import is_dark
_MAX_STATUSTEXT_MESSAGES = 256 # number of STATUSTEXT messages to display
_ACK_RESULTS = ['ACCEPTED', 'TEMP_REJECTED',... |
RQSS_Extractor.py | import csv
import os
import sys
from argparse import ArgumentParser
from datetime import datetime
from multiprocessing.context import Process
from pathlib import Path
from typing import List, Optional, Union
from SPARQLWrapper import JSON, SPARQLWrapper
from EntitySchemaExtractor import EntitySchemaExtractor
from Que... |
keytar.py | #!/usr/bin/env python
# Copyright 2019 The Vitess 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 applic... |
QQCar.py | ###################################################
# 智能小车1.0
#
# @author chenph
# @date 2018/5/15
###################################################
# 光敏传感器 红 黑 任意
# 超声波传感器-发送 红 黑 任意 * 2
# 超声波传感器-接收
# 红外避障传感器-左 红 黑 任意
# 红外避障传感器-右 红 黑 任意
# 无源蜂鸣器 ... |
batchsim3.py | import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0, parentdir)
from pybullet_utils import bullet_client
import panda_sim
import time
useGUI = False
timeStep = 1./60... |
Tron_Environment.py | from enum import Enum
import time
import copy
import sys
import subprocess
import random
from threading import Thread
def monitorFile(connection, queue):
while True:
try:
line = connection.readline()
except:
break
if not line:
queue.append(None)
break
line = line.rstrip("\n")
queue.append(line)... |
apk_install.py | from os import environ
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
from sys import argv
apkpath = "~/Downloads/app-castrolZoomAlpha-release.apk"
aaptpath = "~/Library/Android/sdk/build-tools/28.0.1"
adbpath = "~/Library/Android/sdk/platform-tools"
pkgname = ''
"""
Get list of android d... |
lisp-rtr.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... |
wallet_multiwallet.py | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Widecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test multiwallet.
Verify that a widecoind node can load multiple wallet files
"""
from decimal import... |
cli.py | from multiprocessing import Process
from pathlib import Path
from time import sleep
import click
import libtmux
import structlog
import sys
from . import GeneralConfiguration
from . import ServerConfiguration
from . import ClientConfiguration
from .log import configure_logs
from .client import Client
from .repl imp... |
publicDNSv1.py | """
BSD 3-Clause License
Copyright (c) 2019, Antti Koskimäki, Aalto University, Finland
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright not... |
server.py | import socket
import sys
import time
import threading
import sqlite3
def clientSendThread(connection, user, tCur):
messageTotal = tMessages # set total message to equal the current number of messages sent
while True:
if messageTotal != tMessages: # if a new message has been sent
lastMessage = ... |
run_robot_library.py | import os
from tempfile import mkdtemp
from robot import run
from multiprocessing import Process
from allure_commons_test.report import AllureReport
def run_robot_with_allure(*args, **kwargs):
root = os.path.abspath(os.path.join(__file__, "..", ".."))
targets = map(lambda target: os.path.join(root, target), a... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test tiajiansd shutdown."""
from test_framework.test_framework import BitcoinTestFramework
from test_framew... |
collect_server_info.py | #!/usr/bin/env python
import getopt
import os
import platform
import subprocess
import sys
import time
from datetime import datetime
from threading import Thread
sys.path = [".", "lib"] + sys.path
from testconstants import WIN_COUCHBASE_BIN_PATH_RAW
import TestInput
def usage(error=None):
print("""\
Syntax: coll... |
threads_show_ver.py | #!/usr/bin/env python
"""
Use threads and Netmiko to connect to each of the devices. Execute
'show version' on each device. Record the amount of time required to do this.
"""
from __future__ import print_function, unicode_literals
import threading
from datetime import datetime
from netmiko import ConnectHandler
from my... |
job_runner.py | # Copyright (c) 2021-2022, NVIDIA 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 ... |
runner.py | import configparser
import datetime
import glob
import h5py
import json
import os
import requests
import smtplib
import subprocess
import sys
import time
import threading
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
config = configparser.Co... |
experiment.py | from multiprocessing import Process, Value
import os
import iotlabcli.parser.node
import argparse
import iotlabcli.experiment
from iotlabcli import helpers
from iotlabcli import rest
from iotlabcli import auth
from iotlabcli import profile
from iotlabcli.parser import common, help_msgs
from measurement import *
from ... |
tcp.py | # -*- coding: utf-8 -*-
"""
TCP transport classes
Wire protocol: "len(payload) msgpack({'head': SOMEHEADER, 'body': SOMEBODY})"
"""
# Import Python Libs
from __future__ import absolute_import, print_function, unicode_literals
import errno
import logging
import os
import socket
import sys
import threading
import tim... |
ex7_processes_show_ver.py | #!/usr/bin/env python
'''
Use processes and Netmiko to connect to each of the devices in the database. Execute
'show version' on each device. Record the amount of time required to do this.
'''
from __future__ import print_function, unicode_literals
from netmiko import ConnectHandler
from datetime import datetime
from m... |
experiment_test.py | # Copyright 2016 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 appl... |
WebSockets.py |
import socket
import select
import threading
import multiprocessing
import Queue
import time
import collections
import sys
import logging
BUFFER_SIZE = 4096
WEBSOCKET_VERSION = "13"
WEBSOCKET_MAGIC_HANDSHAKE_STRING = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
class WebSocketInitializationException(Exception):
"""Rai... |
watchdog_plugin.py | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... |
gui.py | import runpy
import threading
from Tkinter import *
def run():
th = threading.Thread(target=threadFunc)
th.start()
labelText1.set("Running...")
th.join()
labelText1.set("Done!")
def threadFunc():
runpy.run_path('./run.py', run_name='__main__')
app = Tk()
app.title("Fasternet")
app.configu... |
clientVideo.py | import cv2
from socket import socket, AF_INET, SOCK_STREAM
from imutils.video import WebcamVideoStream
from threading import Thread
import numpy as np
import zlib
import struct
HOST = input("Enter Server IP\n")
PORT = 3000
CHUNK=1024
lnF = 640*480*3
def SendFrame():
while True:
try:
frame = w... |
AlgorithmTest.py | import math
from src.Movement import FollowingDrone
import time
from threading import Thread
# Create sample world that the Car and Drone move within
class Car:
def __init__(self, start_x, start_y):
self.x = start_x
self.y = start_y
# Can be any series of movements within the world. Should ... |
test_tune_restore.py | # coding: utf-8
import signal
from collections import Counter
import os
import shutil
import tempfile
import time
import unittest
import skopt
import numpy as np
from hyperopt import hp
from nevergrad.optimization import optimizerlib
from zoopt import ValueType
import ray
from ray import tune
from ray.test_utils impor... |
test_3308_cache_id.py | #!/usr/bin/env python -i
# -*- mode: Python; tab-width: 4; indent-tabs-mode: nil; -*-
# ex: set tabstop=4
# Please do not change the two lines above. See PEP 8, PEP 263.
"""This script was built to test doing various large resultdata sets with and without caching and paging
"""
pytan_loc = '~/gh/pytan'
import os
impo... |
watcher.py | from datetime import datetime, timedelta
from genericpath import exists
from os import getcwd, mkdir, utime, listdir, rmdir, remove, environ
from os.path import join
from shutil import rmtree, disk_usage
from threading import Thread
from time import mktime, sleep
from unittest import TestCase
environ["VISION_HOME"] = ... |
jasper-client.py | #!/usr/bin/python
# Copyright (c) 2019, NVIDIA 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
#
# U... |
test_handler.py | #!/usr/bin/env python3
# pylint: disable=C0302
"""
Test the Lambda handler.
"""
# pylint: disable=C0103,C0111,R0904
from base64 import b32encode
from http.server import BaseHTTPRequestHandler, HTTPServer
from json import dumps as json_dumps, loads as json_loads
from logging import getLogger
from os import environ, uran... |
_core.py | # minqlx - Extends Quake Live's dedicated server with extra functionality and scripting.
# Copyright (C) 2015 Mino <mino@minomino.org>
# This file is part of minqlx.
# minqlx 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 Softw... |
main3.py | import sys
import random
import datetime
import asyncio
from threading import Thread
from PyQt5 import QtCore
from PyQt5.QtWidgets import QApplication
from tornado.ioloop import IOLoop
from rx import Observable
from rx.subjects import Subject
from rx.concurrency import QtScheduler, AsyncIOScheduler
from client.clien... |
test_pool.py | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_, is_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.te... |
datasets.py | # Copyright 2019-2021 Huawei Technologies Co., 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-2.0
#
# Unless required by applicable law or agre... |
md.py | print("Threading, (c) Verloka Vadim 2018\n\n\n")
import threading
import time
tLock = threading.Lock()
def Timer(name, delaySec, repeat, lock = False):
print("Timer {} started.".format(name))
if lock:
tLock.acquire()
while repeat > 0:
time.sleep(delaySec)
print("{}: {}".format(n... |
util.py | # -*- coding: utf-8 -*-
import random
import re
import string
import threading
import traceback
from typing import Any, Callable, List, Dict, Optional, Union
# noinspection PyPep8Naming
import queue as Queue
import logging
from telebot import types
try:
import ujson as json
except ImportError:
import json
t... |
crazyflie_calibration.py | #!/usr/bin/env python
import roslib
import rospy
import numpy as np
from geometry_msgs.msg import Twist
from test_package.msg import aircraft_controls
from threading import Thread
import sys, select, termios, tty
thrust_inc = 200
angle_inc = 200
thrust = 0
elevator = 0
rudder = 0
status = 0
speedBindings={
... |
tcpserver.py | import socket, threading
bind_ip = "0.0.0.0"
bind_port = 9999
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((bind_ip, bind_port))
server.listen(5)
print("[*] Listening on %s:%d" %(bind_ip, bind_port))
# this is our client-handling thread
def handle_client(client_socket):
# print ... |
websockets.py | #!/usr/bin/env python
#
# Electrum - Lightweight SmartCash 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 witho... |
streaming.py | import re
import sys
import time
import copy
import threading
import codecs
import tweepy
from tweepy.api import API
# Special Exceptions
from requests.exceptions import Timeout
from requests.exceptions import ConnectionError
from requests.packages.urllib3.exceptions import ReadTimeoutError
# Local Fi... |
trezor.py | from binascii import hexlify, unhexlify
from collections import defaultdict
import traceback
import sys
from electroncash.util import bfh, bh2u, versiontuple, UserCancelled
from electroncash.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE... |
flag.py | # ===============================================================================
# Copyright 2012 Jake Ross
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licens... |
object_detection_tf_vectorization_thread.py | """
Vectorization version.
---------------------------
use Vectorization to speed up.
"""
import os
import tensorflow as tf
import threading
import argparse
import logging
import time
from queue import Queue
import queue
import numpy as np
import cv2
from myutil import fps_measure
from object_detection.utils impor... |
db_import_multiplexer.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... |
dsr_service_tool_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... |
server.py | #!/usr/bin/env python
"""
Dummy server used for unit testing.
"""
from __future__ import print_function
import logging
import os
import random
import string
import sys
import threading
import socket
import warnings
import ssl
from datetime import datetime
from urllib3.exceptions import HTTPWarning
import tornado.ht... |
base.py | #
# Copyright 2020 Logical Clocks AB
#
# 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 ag... |
sentiment_predict.py | import sys,os
sys.path.append("..")
import numpy as np
import tensorflow as tf
from example import bert_classifier_estimator
from bunch import Bunch
from data_generator import tokenization
from data_generator import tf_data_utils
from model_io import model_io
from example import feature_writer, write_to_tfrecords, clas... |
example_chart_mac_windows.py | import Aidlab
from Aidlab.Signal import Signal
import numpy as np
from multiprocessing import Process, Queue, Array
import matplotlib.pyplot as pyplot
import matplotlib.animation as animation
buffer_size = 500
result = None
x = [i for i in range(buffer_size)]
y = []
figure = pyplot.figure()
axis = figure.add_subplot(... |
RomitiDj.py | import spotipy
import random
import re
import telegram
import schedule
import threading
import time
import pickle
import config
import os.path
import logging
from spotipy.oauth2 import SpotifyClientCredentials
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
# YOUTUBE API #
from apiclient.disc... |
events.py | """
This handler listens for TCP/Unix connections from the localhost and from this
agent sending us events. We will forward those events to the CorkAPI.
"""
from . import BaseHandler
from dart.common.settings import SettingsManager
from dart.common.exceptions import EventValidationException
import dart.agent.api
from ... |
multi_camera_multi_person_tracking.py | #!/usr/bin/env python3
"""
Copyright (c) 2019 Intel 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 applicable la... |
_profiler.py | # Coding: utf-8
"""Profiling Module
Monitors the CPU and Memory usage of an application
"""
# Standard Library
import os
import time
import sys
# Third Party Library
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import multiprocessing as mp
import psutil
... |
test_html.py | from functools import partial
from importlib import reload
from io import BytesIO, StringIO
import os
from pathlib import Path
import re
import threading
from urllib.error import URLError
import numpy as np
import pytest
from pandas.compat import is_platform_windows
from pandas.errors import ParserError
import pandas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.