source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
microsoftspeechapi.py | # -*- coding: utf-8 -*-
"""
https://github.com/Azure-Samples/cognitive-services-speech-sdk/tree/master/samples/python/console
"""
import threading
import queue
import azure.cognitiveservices.speech as speechsdk
import numpy as np
from logzero import logger
import model.key
def TranscodeFromFile(path, sample_rate):
... |
04-bouncing_image_v3.py | import pygame
import threading
import time
pygame.init()
width = 800
height = 600
screen = pygame.display.set_mode((width, height))
pygame.display.set_caption("A Bouncing Image")
# https://freeicons.io/
image = pygame.image.load("1169214951579330067-128.png")
pygame.display.set_icon(image)
initial_x_coordinate = w... |
get_auth_code_server.py | '''
------------------------------------------------------------------------------
Copyright (c) 2015 Microsoft Corporation
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 restr... |
controller.py | import logging
import time
import Queue
import threading
from models.event import Event
class Controller(object):
'''
A class to coordinate events
'''
def __init__(self, scheduler, io_adapter, observers=None):
'''
Constructor
Arguments:
scheduler: initialized object that can schedule feedi... |
training_isogr_flow.py | import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
import io
import sys
import numpy as np
import tensorflow as tf
slim = tf.contrib.slim
import tensorlayer as tl
import inputs as data
import c3d_biclstm as net
import time
from datetime import datetime
import threading
import cStringIO
seq_len = 32
batch_size = 8
n_e... |
test_serialization.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... |
labels.py | import hashlib
import requests
import threading
import json
import sys
import traceback
import base64
from bitcoinnano.bitcoin import aes_decrypt_with_iv, aes_encrypt_with_iv
from bitcoinnano.plugins import BasePlugin, hook
from bitcoinnano.i18n import _
class LabelsPlugin(BasePlugin):
def __init__(self, paren... |
datasets.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Dataloaders and dataset utils.
"""
from __future__ import annotations
import glob
import hashlib
import json
import math
import os
import random
import shutil
import time
from itertools import repeat
from multiprocessing.pool import Pool
from multiprocessing.pool impo... |
server_ping_pong_task.py | import csv
import json
import threading
import time
import psutil
import pygame
from common import record_metadata, request_clients_end
from config import CLIENT_WINDOW_HEIGHT, CLIENT_WINDOW_WIDTH, UPDATE_RATE
from network import receive, send
from .config_ping_pong_task import (COUNT_DOWN_MESSAGE, SECONDS_COUNT_DOWN... |
worker.py | import signal
import logging
from threading import Thread
from abc import ABC, abstractmethod
from servicelayer import settings
from servicelayer.jobs import Stage
from servicelayer.cache import get_redis
from servicelayer.util import unpack_int
log = logging.getLogger(__name__)
class Worker(ABC):
"""Workers of... |
hiking.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
# Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
# Copyright (C) 2010-2020 German Aerospace Center (DLR) and others.
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is availa... |
pycom.py | # -*- coding: utf-8 -*-
"""
Created on Mon Sep 13 11:35:57 2021
@author: Qui
"""
#import multiprocessing
import threading
from Pycom.pycomparse import PycomParse
import socket
import atexit
import time
import sys
#import asyncio
class Pycom(object):
def __init__(self, name, dtbot, sock=None, alivetime=None,... |
rabbit.py | # import json
# import pika
# import os
# import subprocess
# import sys
# import hashlib
# import time
# import logging
# import threading
# from functools import partial
# import functools
# from TPool.TPool import Pool
# # from threading import Lock
# from multiprocessing import Process, Pipe, Lock
# import multipro... |
benchmark_client.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... |
RabbitMQ.py | import json
import os
from enum import Enum
from functools import wraps
from hashlib import sha256
from threading import Thread
from typing import Callable
from uuid import uuid4
from flask.app import Flask
from flask.config import Config
from pika import BlockingConnection, URLParameters, spec
from pika.adapters.bloc... |
sensor.py | """Sensor to monitor incoming/outgoing phone calls on a Fritz!Box router."""
import logging
import socket
import threading
import datetime
import time
import re
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (CONF_HOST, CONF_PORT, CONF_NAME,
... |
tasks.py | from __future__ import with_statement
from functools import wraps
import sys
from fabric import state
from fabric.utils import abort, warn, error
from fabric.network import to_dict, normalize_to_string
from fabric.context_managers import settings
from fabric.job_queue import JobQueue
from fabric.task_utils import cra... |
WebSpider.py | import pathlib
import sys
APP_PATH = pathlib.Path(__file__).parent.resolve()
sys.path.append(APP_PATH)
from utils.threadutil import *
import subprocess
import re
import logging
import threading
import re
import inspect
import ipdb; trace=ipdb.set_trace
PATH={ "gospider":"/home/theia/tools/bin/gospider",
}... |
main.py | from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.properties import ObjectProperty, NumericProperty, ReferenceListProperty, StringProperty, ListProperty, BooleanProperty
from kivy.core.window import Window
from kivy.uix.image import Image
import json
import os
import s... |
server.py | from socket import *
from threading import Thread
from client import *
from message import *
class Server:
def __init__(self, port, listPath=None):
self.running = False
self.accepting = False
# This dict contains the users, to access a user
# we need to use it's username in upperca... |
mqtt_listener.py | #!/usr/bin/env python
import time
import json
import math
import rospy
import socket
import threading
import actionlib
import PyKDL
import tf
import socket
import fcntl
import struct
import uuid
# from black_maine_app.msg import DistributionAction
import geometry_msgs.msg
import diagnostic_msgs.msg
import paho.mqtt.... |
s3.py | #!/usr/bin/env python3
import boto3
import botocore
import collections
import hashlib
import os
from queue import Queue
import re
import signal
import socket
import sys
import threading
import urllib.request
import urllib.error
import urllib.parse
class Settings(object):
def __init__(self):
self.metadata_... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import os
from shutil import rmtree
import string
import tempfile
from typing import Any, Callable, List, Optional, Type, Union, cast
import warnings
import zipfile
imp... |
warp_generator.py | from multiprocessing import Process, Queue
from base.base_generator import BaseGenerator
import numpy as np
def generate_func(*args, **kwargs):
# generate a batch, multi-thread can jointly call this func
config = kwargs['config']
queue = kwargs['queue']
while True: # important
# mimic the pro... |
websockets.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... |
server_mode.py |
# Import all the modules necessary for server mode
from iemlav.lib.ids import iemlAVIDS
from iemlav.lib.log_monitor.system_log import engine
from iemlav.lib.log_monitor.server_log.iemlAVServerLog import IemlAVServerLog
from iemlav.lib.auto_server_patcher.iemlAVServerPatcher import IemlAVAutoServerPatcher
from iemlav.... |
session_test.py | import http
import os
import time
import signal
import multiprocessing
import contextlib
import logging
import tornado.web
import tornado.ioloop
import requests
import pytest
import PIL.Image
from jmm.utilities.session import Session
from jmm.utilities.timer import Timer
def start_tornado(api_path, port, method, resp... |
dirichlet.py | """Statistical Manifold of Dirichlet distributions with the Fisher metric."""
import logging
import math
import multiprocessing
from scipy.integrate import odeint, solve_bvp
from scipy.stats import dirichlet
import geomstats.backend as gs
import geomstats.errors
from geomstats.algebra_utils import from_vector_to_dia... |
search.py | from abc import ABC, abstractmethod
import threading
import heapq
class SearchDomain(ABC):
# construtor
@abstractmethod
def __init__(self):
pass
# lista de accoes possiveis num estado
@abstractmethod
def actions(self, state):
pass
# resultado de uma accao num estado, ou ... |
utils.py | # -*- coding: utf-8 -*-
'''
Created on Mar 3, 2017
@author: hustcc
'''
from functools import wraps
from threading import Thread
import json
import click
import datetime
import copy
from webhookit import app
try:
unicode # noqa
except NameError:
# py3
the_unicode = str # noqa
else: # noqa
# py2
... |
log.py | import datetime
import errno
import logging
import os
import subprocess
import sys
import tempfile
import threading
import uuid
from io import TextIOWrapper
from time import sleep
from typing import AnyStr, BinaryIO, List, Union
import pexpect.fdpexpect
from pexpect import EOF, TIMEOUT
from pexpect.utils import poll_i... |
scheduler.py | import time
from multiprocessing import Process
from .api import app
from Proxypool.proxypool.getter import Getter
from .tester import Tester
from .db import RedisClient
from .setting import *
class Scheduler():
def schedule_tester(self, cycle=TESTER_CYCLE):
"""
定时测试代理
"""
tester =... |
gdbclientutils.py | import errno
import os
import os.path
import threading
import socket
import lldb
import binascii
import traceback
from lldbsuite.support import seven
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbtest_config
def checksum(message):
"""
Calculate the GDB server protocol checksum of the me... |
mumbleBot.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import threading
import time
import sys
import math
import signal
import configparser
import audioop
import subprocess as sp
import argparse
import os
import os.path
import pymumble_py3 as pymumble
import pymumble_py3.constants
import variables as var
import logg... |
setup.py | # Copyright (c) 2005 Nokia 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... |
run_engine.py | import asyncio
from datetime import datetime
import sys
from warnings import warn
from inspect import Parameter, Signature
from itertools import count
from collections import deque, defaultdict, ChainMap
from enum import Enum
import functools
import inspect
from contextlib import ExitStack
import threading
import weakr... |
session.py | #
# Copyright (C) 2021 Vaticle
#
# 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... |
pydoc.py | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Generate Python documentation in HTML or text for interactive use.
In the Python interpreter, do "from pydoc import help" to provide online
help. Calling help(thing) on a Python object documents the object.
Or, at the shell command line outside of Python:
Run "pydo... |
processes.py | import logging
import multiprocessing
import os
import random
import signal
import sys
import threading
import traceback
import westpa.work_managers as work_managers
from .core import WorkManager, WMFuture
log = logging.getLogger(__name__)
# Tasks are tuples ('task', task_id, fn, args, kwargs).
# Results are tuples ... |
TiltControlOnlineDecoder.py | # TiltContol Online Decoder 12/13/2019 Working, check good / bad neurons to improve accuracy
import definitions
from definitions import *
import threading
from threading import Thread
from multiprocessing import *
import numpy as np
import xlwt
import csv
import TestRunwLoadCells
from TestRunwLoadCells import... |
footpedals.py |
import threading
from inputs import get_gamepad
LEFT = "BTN_WEST"
MIDDLE = "BTN_C"
RIGHT = "BTN_Z"
DOUBLE = "BTN_NORTH"
SCROLL = "BTN_SOUTH"
FINE = "BTN_EAST"
PRESS = "_PRESS"
RELEASE = "_RELEASE"
class PedalManager:
def __init__(self):
self.handlers = {}
threading.Thread(target = self.poller, daemon = True).s... |
test.py | import json
import logging
import multiprocessing
import os
import signal
import sys
import time
import unittest
import unittest.mock
from wrun import BaseConfig, Config, Proxy, client, daemon, executor, log_config
from tests.config import *
def ProcessFunc_target(q, f, args, kwargs):
q.put(f(*args, **kwargs))
... |
communication.py | from multiprocessing import Process, Queue as MPQueue
from queue import Queue, deque
import threading
from awrams.utils.messaging.general import message
import time
import pickle
class CommunicationManager:
def __init__(self,submission_q,reply_queues,subtask_ids):
self.submission_q = submission_q
... |
mpris.py | """
Display song/video and control MPRIS compatible players.
There are two ways to control the media player. Either by clicking with a mouse
button in the text information or by using buttons. For former you have
to define the button parameters in your config.
Configuration parameters:
button_next: mouse button t... |
base_camera.py | import time
import threading
import cv2
try:
from greenlet import getcurrent as get_ident
except ImportError:
try:
from thread import get_ident
except ImportError:
from _thread import get_ident
from piServices.piUtils import timePrint
class CameraEvent(object):
"""An Event-like class th... |
dfu.py | #!/usr/bin/env python
"""
Tool for flashing .hex files to the ODrive via the STM built-in USB DFU mode.
"""
from __future__ import print_function
import argparse
import sys
import time
import threading
import platform
import struct
import requests
import re
import io
import os
import usb.core
import fibre
import odriv... |
events.py | import queue
from threading import Thread
from pano.puppetdb.puppetdb import api_get as pdb_api_get, mk_puppetdb_query, get_server
__author__ = 'etaklar'
def summary_of_events(events_hash):
summary = {
'classes_failure': {},
'classes_noop': {},
'classes_success': {},
'classes_sk... |
thread_video_manager.py | # -*- coding: utf-8 -*-
"""
@date: 2020/10/22 上午9:22
@file: thread_video_manager.py
@author: zj
@description:
"""
import atexit
import copy
import queue
import threading
import time
import cv2
from tsn.visualization.task_info import TaskInfo
class ThreadVideoManager:
"""
VideoManager object for getting fr... |
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 socket
import os
import weakref
import time
import threa... |
util.py | # -*- coding: utf-8 -*-
#
# Tencent is pleased to support the open source community by making QT4W available.
# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
# Licensed under the BSD 3-Clause License (the "License");you may not use this
# file except in compliance with the License. You may... |
pserve.py | # (c) 2005 Ian Bicking and contributors; written for Paste
# (http://pythonpaste.org) Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license.php
#
# For discussion of daemonizing:
# http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731
#
# Code taken also from QP: http://www.mems-exch... |
spider.py | # -*- coding:utf-8 -*-
import gevent
from gevent import monkey; monkey.patch_all()
from bs4 import BeautifulSoup
import multiprocessing
from util.message import Message
from config.config import queue_todo,queue_responses,queue_results,coroutine_num,myclient
# 请求url,将响应写入队列 urf->response
def _fetch(message_urf):
... |
test_bmuf.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import argparse
import random
import unittest
from multiprocessing import Manager
import torch
import torch.nn as nn
from fairseq import dist... |
helper.py | "Some common routines that can be used throughout the code."
from __future__ import print_function, unicode_literals, with_statement, division
import hashlib
import os
import logging
import datetime
import threading
try:
import json
except ImportError:
from django.utils import simplejson as json
from django.u... |
utils.py | #!/usr/bin/env python
"""This file contains various utility classes used by GRR."""
import __builtin__
import base64
import os
import pipes
import Queue
import random
import re
import shlex
import socket
import shutil
import struct
import tarfile
import tempfile
import threading
import time
import zipfile
import zlib... |
server.py | from datetime import datetime
import socket
import threading
import logging
from config import LOCALHOST, PORT, BUFFER
logging.basicConfig(level=logging.DEBUG)
class Server:
def __init__(self):
self.clients = []
self.usernames = []
self.max_connections = 5
self.server_name = 'COO... |
operation_obj.py | import functools
import http.server
import threading
import socketserver
import ssl
import logging
from typing import List, Callable
from .. import interface as interface_module
from .. import event_logging
from ..engine.objects import Operation, ObservedRat, ActiveConnection
from ..commands.command import CommandLine... |
scene_layout_sensors.py |
import time
from threading import Thread
from srunner.scenariomanager.carla_data_provider import CarlaDataProvider
import scene_layout as scene_layout_parser # This should come from CARLA path
def threaded(fn):
def wrapper(*args, **kwargs):
thread = Thread(target=fn, args=args, kwargs=kwargs)
t... |
thread.py | # curio/thread.py
#
# Not your parent's threading
__all__ = [ 'AWAIT', 'async_thread', 'async_context', 'async_iter', 'AsyncThread' ]
# -- Standard Library
import threading
from concurrent.futures import Future
from functools import wraps
from inspect import iscoroutine
# -- Curio
from . import sync
from .task imp... |
aix_flrtvc.py | #!/usr/bin/python
#
# Copyright 2016, International Business Machines 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 req... |
terminal_agent.py | ''' Simple terminal agent '''
import logging
import time
import sys
import platform
import threading
import copy
import chess
class TerminalAgent:
def __init__(self, appque, prefs):
self.name = 'TerminalAgent'
self.prefs = prefs
self.log = logging.getLogger("TerminalAgent")
self.a... |
tube.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import re
import string
import subprocess
import sys
import threading
import time
from pwnlib import atexit
from pwnlib import term
from pwnlib.context import context
from pwnlib.log import Logger
from pwnlib.timeout import Timeout
from pwn... |
sql_isolation_testcase.py | """
Copyright (c) 2004-Present Pivotal Software, Inc.
This program and the accompanying materials are made available under
the terms of the 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.... |
pool-shards.py | # coding: utf-8
import sys
if sys.version_info[0:2] != (2, 6):
raise Exception("Must use python 2.6")
import logging
from multiprocessing import Pool
from multiprocessing import Process
from multiprocessing import cpu_count
# Other
from _code.octo_client_adapter import do_client
from inner_reuse.configurer impor... |
PickleViewer.py | print("Loading Modules...")
import pickle
import os.path
import pprint
import ast
import sys
import threading
import uuid
import urllib.request
import configparser
import hashlib
import subprocess
import ctypes
import json
import time
import tkinter as tk
from tkinter import *
from tkinter import messa... |
SquidBot.py |
import socket, threading, os, sys, urllib.request, random, time, shutil, subprocess, sqlite3
try:
from cryptography.fernet import Fernet
except:
pass
class DDoS:
def __init__(self, ip, delay):
self.ip = ip
self.delay = delay
self.stopatk = False
self.useragents = ... |
db.py | # -*- coding: utf-8 -*-
import logging
import threading
import rethinkdb as r
from functools import partial
from tornado.ioloop import IOLoop
from tornado.gen import coroutine
from .config import RETHINK_HOST, RETHINK_PORT, DB_NAME
log = logging.getLogger('mocha.db')
LISTENERS = []
def get_db_conn():
"""Yields ... |
__init__.py | from flask import Flask, render_template, make_response
from flask_restful import Api, Resource
from flask_pymongo import PyMongo
from flask_redis import FlaskRedis
from flask_login import LoginManager
# from flask_mongoengine import MongoEngine
# Globally accessible libraries
api = Api()
redis_store = FlaskRedis()
lo... |
test_suite.py | #!/usr/bin/env python
# Copyright 1996-2021 Cyberbotics 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 applica... |
__init__.py | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... |
bitvavo.py | from threading import Timer
import requests
import time
import hmac
import hashlib
import json
import websocket
import threading
import os
import signal
import sys
import datetime
debugging = False
def debugToConsole(message):
if(debugging):
print(str(datetime.datetime.now().time())[:-7] + " DEBUG: " + message)... |
createYoloDatabase.py | import json
import os
import sys
import shutil
import threading
def convertCocoYolo(jsonfile, classFilter=None, skipCrowd = False, balance = False):
if not os.path.exists(jsonfile):
print("Json-File does not exist {}".format(jsonfile))
return
jsonfile = os.path.abspath(jsonfil... |
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, skipUnless
from test import support as test_support
threading ... |
queue_exporter.py | from __future__ import annotations
import os
import pandas as pd
import dataclasses as dc
import multiprocessing as mp
from typing import Any, Dict, Optional, Sequence, Type
from types import TracebackType
from .logger import get_logger
from . import aws
logger = get_logger(__name__)
@dc.dataclass
class QueueItem... |
blynk_temp.py | import BlynkLib
from MCP230xx import MCP230XX
from lcddriver import lcd
from time import time
from time import sleep
from datetime import datetime
import smbus
from threading import Thread
import urllib2
BLYNK_AUTH = '71554af7a98b4535a7383f5be5d91ca3'
BLYNK_SERVER = '27.254.63.34'
hum = 0.0
tmp = 0.0
i2c = smbus.SMBu... |
RPN_FPN_data_multiprocess.py | import os
import sys
import cv2
import math
import numpy as np
import tensorflow as tf
from tqdm import tqdm
from multiprocessing import Process, Manager
class Data(object):
def __init__(self, dataset_root):
self.dataset_root = dataset_root
self.anchor_ratios = [1., 0.5, 2.]
self.anchor_scales = dict(level2 = ... |
framereader.py | # pylint: skip-file
import json
import os
import pickle
import queue
import struct
import subprocess
import tempfile
import threading
from functools import wraps
import numpy as np
from aenum import Enum
from lru import LRU
import _io
from tools.lib.cache import cache_path_for_file_path
from tools.lib.exceptions impo... |
driver.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
# Copyright (c) 2010 Citrix Systems, Inc.
# Copyright (c) 2011 Piston Cloud Computing, Inc
# Copyright (c) 2012 Univer... |
tests.py | # -*- coding: utf-8 -*-
# Unit and doctests for specific database backends.
from __future__ import unicode_literals
import copy
import datetime
from decimal import Decimal, Rounded
import re
import threading
import unittest
import warnings
from django.conf import settings
from django.core.exceptions import Improperly... |
bootloader.py | #
# LUOS CLI tool
# *******************************************************************************
# Import packages
# *******************************************************************************
import argparse
import sys
import time
from multiprocessing import Process, Value
import json
from pyluos import Device... |
keep_alive.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def home():
return "Estou vivo"
def run():
app.run(host = '0.0.0.0', port = 8080)
#app.run(debug=True,host = '0.0.0.0', port = 8080)
def keep_alive():
t = Thread(target = run)
t.start()
keep_alive() |
kafka.py | """
kafka.py
Client services used to support internal and external transactions.
Service instances are bound to data attributes and accessed through "get" functions.
"""
import asyncio
import logging
import time
from asyncio import get_running_loop
from confluent_kafka import (
Producer,
Consumer,
KafkaExc... |
legacysupport.py | '''
PyMOL Plugins Engine, Legacy Support
This module overloads PyMOLs PMGApp class which so far handles plugin support.
It also provides a get_pmgapp() function that either returns the actual PMGApp
instance, or a fake instance with "root" and "menuBar" properties which can be
used if PMGApp has retired.
(c) 2011-201... |
volumioTest.py | # Testing code to check update status on demand
from socketIO_client import SocketIO, LoggingNamespace
from threading import Thread
socketIO = SocketIO('localhost', 3000)
status = 'pause'
def on_push_state(*args):
print('state', args)
global status, position, duration, seek
status = args[0]['s... |
example_test.py | import multiprocessing
import os
import re
import socket
import ssl
import struct
from tiny_test_fw import DUT
import ttfw_idf
import random
import subprocess
try:
import BaseHTTPServer
from SimpleHTTPServer import SimpleHTTPRequestHandler
except ImportError:
import http.server as BaseHTTPServer
from ... |
test_zmq.py | import pytest
pytest.importorskip('zmq')
from partd.zmq import Server, keys_to_flush, File, Client
from partd import core, Dict
from threading import Thread
from time import sleep
from contextlib import contextmanager
import pickle
import os
import shutil
def test_server():
s = Server()
try:
s.start... |
fuzzer.py | # Copyright 2020 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, softw... |
plot_auv_segments.py | #!/usr/bin/env python3
# Copyright (c) 2020, Clyde McQueen.
# All rights reserved.
#
# Software License Agreement (BSD License 2.0)
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source cod... |
test_connector.py | import os
import time
import tempfile
import unittest
import json
import uuid
import threading
from subprocess import Popen
import psutil
import requests
import kafka
import pandas as pd
MINDSDB_HOST = os.getenv("MINDSDB_HOST")
MINDSDB_URL = f"http://{MINDSDB_HOST}:47334"
HTTP_API_ROOT = f"{MINDSDB_URL}/api"
INTEG... |
measure_methods.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... |
server.py | #!/usr/bin/env python
"""
Dummy server used for unit testing.
"""
from __future__ import print_function
import logging
import os
import socket
import ssl
import sys
import threading
import warnings
from datetime import datetime
import tornado.httpserver
import tornado.ioloop
import tornado.netutil
import tornado.web... |
concurrency_test.py | # Copyright The 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 in ... |
test_socket_relay.py | from threading import Thread
from socketIO_client_nexus import SocketIO
host = 'https://frozen-tundra-27407.herokuapp.com'
port = 443
class TwoWayClient(object):
def __init__(self):
self.socketIO = SocketIO(host, port)
def on_socket_open(*args):
print("on_socket_open: ", args... |
session_test.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... |
robotraconteur_camera_driver.py | import cv2
import RobotRaconteur as RR
RRN = RR.RobotRaconteurNode.s
import RobotRaconteurCompanion as RRC
import argparse
import sys
import platform
import threading
import numpy as np
from RobotRaconteurCompanion.Util.InfoFileLoader import InfoFileLoader
from RobotRaconteurCompanion.Util.DateTimeUtil import DateTimeU... |
threadedclient.py | # -*- coding: utf-8 -*-
import threading
from . import WebSocketBaseClient
__all__ = ['WebSocketClient']
class WebSocketClient(WebSocketBaseClient):
def __init__(self, url, protocols=None, extensions=None, heartbeat_freq=None,
ssl_options=None, headers=None, exclude_headers=None):
"""
... |
asr.py | # -*- coding: utf-8 -*-
"""
Created on Sun Feb 12 10:04:44 2018
@author: keding
"""
from __future__ import print_function
import time
import wave
import random
import base64
import threading
from utils import *
class BaseASR(object):
ext2idx = {'pcm': '1', 'wav': '2', 'amr': '3', 'slk': '4'... |
web.py | import hashlib
import json
import os
import threading
import time
from dbx import IsDirError
class Config(object):
def __init__(self, config_file):
self._raw = json.load(open(config_file))
def __getitem__(self, key):
return self._raw[key]
class ETagCache(object):
def __init__(self, dbx_f... |
test_failure.py | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.utils
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_uti... |
fifo_queue_test.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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.