source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
basic_connector.py | from enum import Enum
from functools import partial
from queue import Queue
from threading import Condition, Event, Thread
from time import sleep
from social_interaction_cloud.abstract_connector import AbstractSICConnector
class RobotPosture(Enum):
STAND = 'Stand'
STANDINIT = 'StandInit'
STANDZERO = 'Sta... |
server.py | import logging
from multiprocessing import Process, Queue
import requests
from flask import Blueprint, Response, request
from hoststats.collection import collect_metrics
from hoststats.stats import FORWARD_HEADER, SERVER_PORT
metrics_api = Blueprint("metrics_api", __name__)
metrics_process = None
kill_queue = None
... |
mp_extract.py | # JN 2015-02-13 refactoring
from __future__ import absolute_import, print_function, division
from collections import defaultdict
from multiprocessing import Process, Queue, Value
import numpy as np
np.seterr(all='raise')
import tables
from .. import DefaultFilter
from .tools import ExtractNcsFile, OutFile, read_matf... |
__main__.py | import youtube_dl.extractor
import youtube_dl
import os
import pathlib
import tempfile
import sys
import re
import multiprocessing
from tqdm import tqdm
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
def clean_path(fname: str) -> str:
fname = re.sub("/", "\\/", fname)
fname = re.sub("\.", "\\.", fname)
if os.p... |
snake.py | # adapted from https://gist.github.com/sanchitgangwar/2158084
from random import randint
from time import sleep
import sys, vim
from threading import Thread, Lock
sys.excepthook = lambda *args: sys.stderr.write('error %s, %s, %s\n' % args) and sys.stderr.flush()
buf = vim.current.buffer
key = 'right'
prevKey = 'righ... |
test.py | #!/usr/bin/env python
#
# Copyright 2008 the V8 project authors. 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
# noti... |
main.py | import multiprocessing
import threading
import sys
import os
from time import sleep, time
import time
import signal
import subprocess
from datetime import datetime
import socket
from collections import OrderedDict
import binascii
import Crypto
import Crypto.Random
from Crypto.Hash import SHA
from Crypto.PublicKey imp... |
__init__.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import json
import logging
import os
import random
import re
import sys
import time
import Queue
import threading
from geopy.geocoders import GoogleV3
from pgoapi import PGoApi
from pgoapi.utilities import f2i, get_cell_ids
import cell_w... |
test_callbacks.py | import os
import sys
import multiprocessing
import numpy as np
import pytest
from csv import Sniffer
from keras import optimizers
np.random.seed(1337)
from keras import callbacks
from keras.models import Sequential
from keras.layers.core import Dense
from keras.utils.test_utils import get_test_data
from keras import... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
from electrum_vestx.bitcoin import TYPE_ADDRESS
from electrum_vestx.storage import WalletStorage
from electrum_vestx.wallet import Wallet, InternalAddressCorruption
from electrum_vestx.paymentreques... |
test_runner.py | # Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "LICENSE.txt" file acc... |
engine.py | ###############################################################################
#
# Copyright 2009-2011, Universitat Pompeu Fabra
#
# This file is part of Wok.
#
# Wok 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... |
stun_server.py | import socket
import sys
import os
import traceback
import struct
import threading
from threading import Thread
import time
from datetime import date, timedelta
import datetime
import json
import buffered_message
import psycopg2
from connection_state import ConnectionState
import tcp
import sqlalchemy
from sqlalchemy... |
prepare_dataset.py | #!/usr/bin/python
import os
import json
import glob
import utils
import random
import tables
import argparse
import skimage.io
import numpy as np
import multiprocessing
from tqdm import tqdm
from math import ceil
from skimage.morphology import remove_small_objects
def start_process(target, args):
process = multiproc... |
test_asyncore.py | import asyncore
import unittest
import select
import os
import socket
import sys
import time
import errno
import struct
import threading
from test import support
from test.support import os_helper
from test.support import socket_helper
from test.support import threading_helper
from test.support import warnings_helper
... |
run_dqn_atari.py | import argparse
import gym
from gym import wrappers
import os
import time
import random
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers
from multiprocessing import Process
import dqn
from dqn_utils import *
from atari_wrappers import *
def atari_model(img_in, num_actions, scope, ... |
collective_ops_test.py | # Copyright 2020 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 applicab... |
voltage_source.py | from functools import partial
from pubsub import pub
from threading import Thread
from time import sleep
import wx
from wx.lib.agw.floatspin import FloatSpin
from spacq.gui.tool.box import load_csv, save_csv, Dialog, MessageDialog
from spacq.interface.units import Quantity
"""
Configuration for a VoltageSource.
"""
... |
typosquatting.py | # Typosquatting Detection Scheme (npm)
from itertools import permutations
from functools import lru_cache
import re
delimiter_regex = re.compile('[\-|\.|_]')
delimiters = ['', '.', '-', '_']
version_number_regex = re.compile('^(.*?)[\.|\-|_]?\d$')
scope_regex = re.compile('^@(.*?)/.+$')
allowed_charac... |
b3_indexes.py | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 10 22:00:13 2018
@author: Gaston Guillaux
"""
import os
import time
import shutil
import requests
import pandas as pd
from threading import Thread
from datetime import datetime
from bs4 import BeautifulSoup as bs
#export to csv ibovespa composition
def get_ibov():
now ... |
Hilos1.py | import threading
import sys
import time
from random import randint
print('SUPER THREADING GAME v0.1 By Iván Sánchez')
print()
# Declaramos nuestras variables globales para guardar los numeros aleatorios
number1 = 0
number2 = 0
ejecutarHilo_1 = True
ejecutarHilo_2 = True
# Declaramos la función que genera un nuevo ... |
mqtt.py | # Copyright 2021 Nokia
# Licensed under the BSD 3-Clause Clear License.
# SPDX-License-Identifier: BSD-3-Clear
import paho.mqtt.client as mqtt
import a10.structures.identity
import a10.asvr.db.configuration
import threading
import time
def on_disconnect(client, userdata, rc):
logging.info("disconnecting reason ... |
rfc2217.py | #! python
#
# Python Serial Port Extension for Win32, Linux, BSD, Jython
# see __init__.py
#
# This module implements a RFC2217 compatible client. RF2217 descibes a
# protocol to access serial ports over TCP/IP and allows setting the baud rate,
# modem control lines etc.
#
# (C) 2001-2013 Chris Liechti <cliech... |
online_chess.py | # coding: UTF-8
from __future__ import (absolute_import, division,
print_function, unicode_literals)
import json
import urllib
import urllib2
import sys
import logging
import threading
from time import sleep, time
from scenes.chess import Chess
from cython.functions import tuple_to_chess_notati... |
classes.py | import os
import time
import string
import random
import requests
import threading
import mysql.connector
from mysql.connector import Error
class Apk:
def __init__(self, name, method):
self.downloadedDir = "/var/www/catchmeifyoucan.tech/malwareHidingSystem/necessaryFiles/apk/"
sel... |
bitcoind.py | import decimal
import json
import logging
import os
import threading
from cheroot.wsgi import PathInfoDispatcher, Server
from decimal import Decimal
from ephemeral_port_reserve import reserve
from flask import Flask, request, Response
from test_framework.authproxy import AuthServiceProxy, JSONRPCException
from test_fr... |
__init__.py | """
objectstore package, abstraction for storing blobs of data for use in Galaxy.
all providers ensure that data can be accessed on the filesystem for running
tools
"""
import abc
import logging
import os
import random
import shutil
import threading
import time
from typing import (
Any,
Dict,
List,
Ty... |
test_highlevel.py | import os.path
import socket
import tempfile
import textwrap
import threading
import time
from future import standard_library
with standard_library.hooks():
import http.server
import socketserver
import mock
import pytest
import pyipptool
@mock.patch.object(pyipptool.wrapper, '_call_ipptool')
def test_ippt... |
functions.py | #!/usr/bin/python3
__author__ = 'Trifon Trifonov'
import sys, os
#sys.path.insert(0, '../lib')
import numpy as np
import jac2astrocen
import corner
import matplotlib
matplotlib.pyplot.switch_backend('Agg')
import re
from subprocess import PIPE, Popen
import signal
import platform
import tempfile, shutil
from threa... |
control.py | """
SleekXMPP: The Sleek XMPP Library
Implementation of xeps for Internet of Things
http://wiki.xmpp.org/web/Tech_pages/IoT_systems
Copyright (C) 2013 Sustainable Innovation, Joachim.lindborg@sust.se, bjorn.westrom@consoden.se
This file is part of SleekXMPP.
See the file LICENSE for copying per... |
mapd.py | #!/usr/bin/env python
# Add phonelibs openblas to LD_LIBRARY_PATH if import fails
from common.basedir import BASEDIR
try:
from scipy import spatial
except ImportError as e:
import os
import sys
openblas_path = os.path.join(BASEDIR, "phonelibs/openblas/")
os.environ['LD_LIBRARY_PATH'] += ':' + openblas_path... |
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... |
stage.py | import random
import threading
import numpy as np
import datetime
from rules import SendTriggers
from targets import Target
import config
import time
class Stage:
""""""
def __init__(self, processor, target_space, send_triggers, source=config.site_name):
self.processor = processor
self.targe... |
client.py | """A semi-synchronous Client for the ZMQ cluster
Authors:
* MinRK
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as... |
i2pvain.py | #!/usr/bin/env python3
import sys
import os
import struct
import socket
import re
from hashlib import sha256
from base64 import b32encode, b64decode, b64encode
from multiprocessing import Process, Queue
def get_sam_address():
value = os.getenv("I2P_SAM_ADDRESS")
if value:
value = value.split(":")
... |
test_stray.py | # -*- coding: utf-8 -*-
"""
.. module:: test_stray
:platform: Unix
:synopsis: tests for the stray submodule.
.. moduleauthor:: Mehmet Mert Yıldıran <mert.yildiran@bil.omu.edu.tr>
"""
from multiprocessing import Process, Event
import time
from ava.stray import SystemTrayExitListenerSet, SystemTrayInit
impor... |
live_demo.py | """Live demo of target pose matching."""
import utils
import inference
import cv2
import numpy as np
import seaborn as sns
import yaml
from time import sleep
from time import perf_counter as time
from threading import Thread
from collections import deque
from typing import Optional, Tuple
import argparse
import os
cl... |
test_fake_operator_server.py | import pytest
import os
import copy
import time
from threading import Thread
import json
from queue import Queue
from flask import Flask, request
from ding.worker import Coordinator
from ding.worker.learner.comm import NaiveLearner
from ding.worker.collector.comm import NaiveCollector
from ding.utils import find_free_... |
test.py | from threading import Thread
import time
from _actual_aside import AsidePrint
aside = AsidePrint()
aside.run()
for x in range(10):
aside.append(x)
def threaded_adder(num):
global aside
for x in range(10):
aside.append(f"Adder {num} added {x}")
time.sleep(0.5)
adders = []
... |
server.py | import logging
import multiprocessing as mp
import os
import signal
import socket
import socketserver
import threading
import time
from IPy import IP
from daemon.daemon import change_process_owner
from setproctitle import setproctitle
from irrd import ENV_MAIN_PROCESS_PID
from irrd.conf import get_setting
from irrd.s... |
eval_coco_format.py | # Copyright 2019 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 applicab... |
zeroconf_client.py | # This file is part of the clacks framework.
#
# http://clacks-project.org
#
# Copyright:
# (C) 2010-2012 GONICUS GmbH, Germany, http://www.gonicus.de
#
# License:
# GPL-2: http://www.gnu.org/licenses/gpl-2.0.html
#
# See the LICENSE file in the project's top-level directory for details.
import re
import select
imp... |
scheduling_manager.py | import os
import time
import logging
import threading
from xml.etree import ElementTree
from galaxy import model
from galaxy.util import plugin_config
import galaxy.workflow.schedulers
log = logging.getLogger( __name__ )
DEFAULT_SCHEDULER_ID = "default" # well actually this should be called DEFAULT_DEFAULT_SCHEDU... |
combo_test_example.py | import trio
import time
from threading import Thread
from kivy.app import App
from kivy.lang import Builder
from kivy.clock import Clock
from kivy.properties import NumericProperty, StringProperty, BooleanProperty
from kivy_trio.to_kivy import async_run_in_kivy, EventLoopStoppedError, \
AsyncKivyBind
from kivy_tr... |
go_tool.py | from __future__ import absolute_import
import argparse
import copy
import json
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import six
from functools import reduce
import process_command_files as pcf
arc_project_prefix = 'a.yandex-team.ru/'
std_lib_prefix = 'contrib/... |
adb.py | # Copyright 2019 Google LLC
#
# 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, ... |
misc.py | # -*- coding: utf-8 -*-
"""Some miscellaneous utility functions."""
# Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
#
# License: BSD-3-Clause
from contextlib import contextmanager
import fnmatch
import gc
import inspect
from math import log
import os
from queue import Queue, Empty
from string import Format... |
runners.py | """
Copyright (c) 2020 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 law or agreed to in wri... |
core.py | # @Author: Arthur Voronin
# @Date: 17.04.2021
# @Filename: core.py
# @Last modified by: arthur
# @Last modified time: 16.09.2021
"""
.. hint:: This module contains functions enabling interactive analyses. Its main
parts are the iPlayer and iPlot classes, which allow the use of a trajectory
viewer or a dyna... |
misc1.py | from threading import Thread
lx = 0
def function():
while True:
global lx # We are referring to the globally assigned variable.
lx+=1
#return lx
def function1():
while True:
global lx # We are referring to the globally assigned variable.
print(... |
safe_t.py | from binascii import hexlify, unhexlify
import traceback
import sys
from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING
from electrum_vtc.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException
from electrum_vtc.bip32 import BIP32Node
from electrum_vtc import constants... |
main.py | #!/usr/bin/env python3
from timeit import Timer
import multiprocessing
import math
import time
import cherrypy
import os
from datetime import datetime
from pythonping import ping
import requests
try:
logFilePath = os.environ["LOGFILE"]
logFile = open(logFilePath, "a", 1)
print("Writing logs to " + logFile... |
sensor_source.py | # Greengrass lambda source -sensor source
import json
import logging
from threading import Thread, Lock
from time import sleep, time
from random import gauss
import greengrasssdk
import flask
from flask import request, jsonify
# Configure logger
logger = logging.getLogger()
logger.setLevel(logging.WARN)
client = gree... |
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 __future__ import with_statement
import sys
import time
import random
import unittest
import threading
from test import support
import _testcapi
def testfunction(s... |
main.py | import socket
import logging.config
from datetime import datetime
from multiprocessing import Process
from signal import signal, SIGTERM
LISTEN_PORT = 8000
ECHO_LOG_PATH = './logs/sessions/'
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'formatters': {
'simple': {
'form... |
prototype_restoration.py | from __future__ import division
from __future__ import print_function
# ---------------------------- IMPORTS ---------------------------- #
# multiprocessing
from builtins import zip
from builtins import range
from builtins import object
from past.utils import old_div
import itertools as it
from multiprocessing... |
player.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: omi
# @Date: 2014-07-15 15:48:27
# @Last Modified by: omi
# @Last Modified time: 2015-01-30 18:05:08
'''
网易云音乐 Player
'''
# Let's make some noise
from __future__ import (
print_function, unicode_literals, division, absolute_import
)
import subprocess
imp... |
sensor_driver.py | #...................Drive a pressure/temperature sensor..................
#Author: James Bramante
#Date: May 8, 2017
import ms5837
import threading
import time
import statistics as stats
class SensorDriver(object):
def __init__(self, samplerate = 100., density = 997., baseTime = 0.):
""" Cons... |
generate-runtime-tests.py | #!/usr/bin/env python
# Copyright 2014 the V8 project 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 itertools
import js2c
import multiprocessing
import optparse
import os
import random
import re
import shutil
import signal
imp... |
state.py | # -*- coding: utf-8 -*-
"""This class maintains the internal dfTimewolf state.
Use it to track errors, abort on global failures, clean up after modules, etc.
"""
from concurrent.futures import ThreadPoolExecutor
import importlib
import logging
import threading
import traceback
from typing import Callable, Dict, List,... |
mtsleepF.py | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author: NetworkRanger
# Date: 2019/8/10 4:09 PM
from atexit import register
from random import randrange
from threading import Thread, Lock, currentThread
from time import sleep, ctime
class CleaOutputSet(set):
def __str__(self):
return ', '.join(x for x in ... |
app.py | from Tunnel.packetBackUp import startIntercept
from Tunnel.VirtualDevice import addNewDevice
import configparser
from xeger import Xeger
import logging.handlers
import os
from vfssh.CyderSSHServer import start_ssh_server
from connection.server_telnet import start_telnet_server
from connection.server_http import start_h... |
_ops_test.py | # https://github.com/tensorflow/tensorflow/issues/27023
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
warnings.filterwarnings("ignore", category=FutureWarning)
import random
import string
import tempfile
import os
import contextlib
import json
import urllib.request
import... |
new1.py | from mininet.net import Mininet
from mininet.topo import Topo
from mininet.util import dumpNodeConnections
from mininet.log import setLogLevel
from mininet.cli import CLI
import threading, time, socket, logging, SocketServer, sys
#tree4 = TreeTopo(depth=2, fanout=2)
##net = Mininet(topo=tree4)
#net.start()
#h1, h4 = n... |
loop.py | # Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import annotations
import abc
import asyncio
import logging
import time
from typing import Dict, List, NoReturn, Optional,... |
simple_tcp_server.py | #!/usr/bin/env python
import socket
import threading
# this is our client-handling thread
def handle_client(client_socket):
# print out what the client sends
request = client_socket.recv(1024)
print "[*] Received: %s" % request
# send back a packet
client_socket.send("ACK!")
client_socket.close()
bind_ip = ... |
test_badgereader_wiegand_gpio.py | # Copyright 2018 Google 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 applicable law or a... |
master_classes.py | '''
Python module containing "Master" classes of easy_gui project.
The classes in here are designed to be subclassed in user applications.
'''
import tkinter as tk
import tkinter.scrolledtext
from tkinter import ttk
from tkinter import _tkinter
from .styles import BaseStyle
from . import widgets
import os
import sys
im... |
test-client-concurrent-connections.py | #!/usr/bin/env python3
# Creates a ghostunnel. Ensures that multiple servers can communicate.
from subprocess import Popen
from multiprocessing import Process
from common import *
import socket, ssl, time, random
def send_data(i, p):
counter = 0
while counter < 100:
r = random.random()
if r < 0.4:
... |
params.py | #!/usr/bin/env python3
"""ROS has a parameter server, we have files.
The parameter store is a persistent key value store, implemented as a directory with a writer lock.
On Android, we store params under params_dir = /data/params. The writer lock is a file
"<params_dir>/.lock" taken using flock(), and data is stored in... |
train.py | import argparse
import logging
import math
import os
import random
import time
from copy import deepcopy
from pathlib import Path
from threading import Thread
import numpy as np
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.optim.lr_sche... |
bot.py | #!/usr/bin/python
import sys
import paho.mqtt.client as paho
import json
import threading
import Queue
import motion
import sensor
import os
from time import sleep
from time import time
from time import strftime
os.system("sntp -s 129.6.15.30 &>/dev/null")
# queue of commands for inter thread communication
command_q... |
api_test.py | import datetime
import json
import io
import os
import re
import shutil
import socket
import tempfile
import threading
import time
import unittest
import docker
from docker.api import APIClient
import requests
from requests.packages import urllib3
import six
from . import fake_api
import pytest
try:
from unitte... |
test_multiprocessing.py | #!/usr/bin/env python
from __future__ import absolute_import
#
# Unit tests for the multiprocessing package
#
import unittest
import Queue
import time
import sys
import os
import gc
import array
import random
import logging
from nose import SkipTest
from test import test_support
from StringIO import StringIO
try:
... |
vtk.py | # -*- coding: utf-8 -*-
"""
Created on Wed Aug 19 19:50:43 2020
@author: beck
"""
import cv2
import datetime
import dateparser
import os
import sys
import pandas as pd
import pytz
from hachoir.parser import createParser
from hachoir.metadata import extractMetadata
from PIL import Image
import numpy as... |
irc.py | # coding=utf8
"""
irc.py - An Utility IRC Bot
Copyright 2008, Sean B. Palmer, inamidst.com
Copyright 2012, Edward Powell, http://embolalia.net
Copyright © 2012, Elad Alfassa <elad@fedoraproject.org>
Licensed under the Eiffel Forum License 2.
Willie: http://willie.dftba.net/
When working on core IRC protocol related ... |
core.py | #!/usr/bin/env python
from Queue import Queue
from warnings import warn
import functools
import json
import os
import re
import struct
import subprocess
import sys
import threading
import traceback
import weakref
from sgactions.dispatch import dispatch as _dispatch
def log(*args):
sys.stderr.write('[SGActions]... |
base_events.py | """Base implementation of event loop.
The event loop can be broken up into a multiplexer (the part
responsible for notifying us of I/O events) and the event loop proper,
which wraps a multiplexer with functionality for scheduling callbacks,
immediately or at a given time in the future.
Whenever a public API takes a c... |
TestHarness.py | import re
import threading
import time
import automaton.lib.exceptions as exceptions
# Format:
# key: scriptname, value: list of tuples to check
# tuple[0]: argument string
# tuple[1]: expected response (as regexp or straight string)
def notmatch(s):
return "^((?!%s).)*$" % s
test_data ={"echo": [("hello", "he... |
volume_pa_status.py | # -*- coding: utf-8 -*-
"""
Pulse Audio Volume control.
@author <Vlad Vasiliu> <vladvasiliu@yahoo.fr>
@license BSD
"""
from __future__ import annotations
import logging
import math
from dataclasses import dataclass
import threading
from typing import Callable, Iterable, Optional, Union
from pulsectl import Pulse, P... |
viewer.py | # Copyright (c) 2018 Anki, 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 in the file LICENSE.txt or at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... |
test_operator.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_oauth.py | import unittest
import random
import time
import base64
import json
import requests
from flask import Flask, jsonify, make_response, request, redirect
from multiprocessing import Process
import jose
from server.common.app_config import AppConfig
from server.test import FIXTURES_ROOT, test_server
# This tests the oau... |
poc.py | #! /usr/bin/env python
import httplib
import sys
import threading
import subprocess
import random
def send_request(method, url):
try:
c = httplib.HTTPConnection('127.0.0.1', 80)
c.request(method,url);
if "foo" in url:
print c.getresponse().read()
... |
yolink_mqtt_class.py | import hashlib
import json
import os
import sys
import time
import threading
import logging
from datetime import datetime
from dateutil.tz import *
logging.basicConfig(level=logging.DEBUG)
import paho.mqtt.client as mqtt
#from logger import getLogger
#log = getLogger(__name__)
from queue import Queue
from yolink_d... |
main.py | import os
import geoip2.database
import re as ree
import time
import IP2Proxy
import custom_
from threading import Thread
from audio import WeebGen, WeebDel
from flask import Flask, request, render_template, jsonify
from config import home_dir, allowed_requests, clear_ban, error_emotes
db = IP2Proxy.IP2Proxy()
db.open... |
ChangeWaveRangeWidget.py | from PySide2.QtWidgets import (QHBoxLayout, QProgressBar, QLabel, QWidget)
from Assets.mathematical_scripts.util import createWaveFilePatientXSLX, createWaveFilePatientMAT
import threading
#wavesToUpdate is an array contains the wave which have new range, other will not change.
class ChangeWaveRangeWidget(QWi... |
plac_ext.py | # this module requires Python 2.6+
from __future__ import with_statement
from contextlib import contextmanager
from operator import attrgetter
from gettext import gettext as _
import inspect
import os
import sys
import cmd
import shlex
import subprocess
import argparse
import itertools
import traceback
import multiproc... |
firmware_manager.py | # Copyright 2019 Jetperch LLC
#
# 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,... |
Hiwin_RT605_ArmCommand_Socket_20190627203904.py | #!/usr/bin/env python3
# license removed for brevity
import rospy
import os
import socket
##多執行序
import threading
import time
import sys
import matplotlib as plot
import HiwinRA605_socket_TCPcmd as TCP
import HiwinRA605_socket_Taskcmd as Taskcmd
import numpy as np
from std_msgs.msg import String
from ROS_Socket.srv imp... |
rate_limiting_robust.py | import json
import time
import multiprocessing.dummy as mp
from restb.sdk import *
from restb.sdk.api import service
# set allotted number of requests per second
# this is defined here as it could be retrieved through some external mechanism
__requests_per_second = 4
__waiting_threads = 10
# lambda helper for gett... |
conftest.py | import atexit
from contextlib import contextmanager
import datetime
import logging
import os
import platform
import shutil
import subprocess
import sys
import tempfile
import time
import threading
from unittest import mock
from unittest.mock import MagicMock
import click
from click.testing import CliRunner
import git
... |
context.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_api.py | """
mbed SDK
Copyright (c) 2011-2014 ARM Limited
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 wr... |
__init__.py | import sys
import struct
import abc
import queue
import threading
#constants
RMF_CMD_START_ADDR = 0x3FFFFC00
RMF_FILE_TYPE_FIXED = 0
RMF_FILE_TYPE_DYNAMIC = 1
RMF_FILE_TYPE_STREAM = 2
RMF_CMD_ACK = 0 #reserved for future use
RMF_CMD_NACK = 1 #reserved for futur... |
test_enum.py | import enum
import inspect
import pydoc
import sys
import unittest
import threading
from collections import OrderedDict
from enum import Enum, IntEnum, StrEnum, EnumMeta, Flag, IntFlag, unique, auto
from io import StringIO
from pickle import dumps, loads, PicklingError, HIGHEST_PROTOCOL
from test import suppo... |
actuator_controller.py | #!/usr/bin/python3 -B
import time
import math
from aoyun_fdcanusb.moteusController import Controller
from aoyun_fdcanusb.moteusReg import MoteusReg
import rospy
from std_msgs.msg import String
from sensor_msgs.msg import JointState
import threading
def thread_job():
rospy.spin()
positions = [0 for _ in range(12... |
base_test_rqg.py | import paramiko
from basetestcase import BaseTestCase
import os
import zipfile
import queue
import json
import threading
from memcached.helper.data_helper import VBucketAwareMemcached
from .rqg_mysql_client import RQGMySQLClient
from membase.api.rest_client import RestConnection, Bucket
from couchbase_helper.tuq_helper... |
tdvt.py | """
Test driver script for the Tableau Datasource Verification Tool
"""
import sys
if sys.version_info[0] < 3:
raise EnvironmentError("TDVT requires Python 3 or greater.")
import argparse
import csv
import glob
import json
import pathlib
import queue
import shutil
import threading
import time
import zipfile... |
sensor.py | """Pushbullet platform for sensor component."""
import logging
import threading
from pushbullet import InvalidKeyError, Listener, PushBullet
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import CONF_API_KEY, CONF_MONITORED_CONDITIONS
import homeassistant... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.