source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
stock_button.py | from PyQt5.QtWidgets import QPushButton
from threading import Thread
__author__ = 'kdedow'
class StockButton(QPushButton):
def __init__(self, name, widget):
super().__init__(name, widget)
self.resize(self.sizeHint())
self.setMaximumWidth(150)
def setClickAction(self, method):
... |
__init__.py | #####################################################################
# #
# /plugins/progress_bar/__init__.py #
# #
# Copyright 2018, Christopher Billin... |
dirbrute.py | #!/usr/bin/python3
import argparse
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
import sys
import threading
def parsefile(files1):
http_hosts = []
for file1 in files1:
with open(file1, 'r') as... |
requestinvoice.py | #!/usr/bin/env python3
from flask import Flask
from flask_limiter import Limiter
from flask_limiter.util import get_remote_address
from pathlib import Path
from pyln.client import Plugin
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
from tornado.wsgi import WSGIContainer
import asyncio
... |
echo_dialog.py | # Software License Agreement (BSD License)
#
# Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko
# 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 mus... |
MainRunner.py | import json
import os
import datetime
import logging
import threading
import time
import traceback
from multiprocessing import Process, Value
import utils
from BiliLive import BiliLive
from BiliLiveRecorder import BiliLiveRecorder
from BiliVideoChecker import BiliVideoChecker
from DanmuRecorder import BiliDanmuRecorde... |
classifier.py | from pathlib import Path
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
from threading import Thread, Lock
import random
import scipy
import logging
import fire
import uuid
import shutil
import os
import tqdm
import spacy
import numpy as np
import pickle
from sklearn_crfsuite import... |
base_hub_connection.py | import logging
import websocket
import threading
import uuid
import time
from signalrcore.messages.message_type import MessageType
from signalrcore.messages.stream_invocation_message\
import StreamInvocationMessage
from signalrcore.messages.ping_message import PingMessage
from .reconnection import ConnectionStat... |
device_simulator.py | '''
Device Simulator
Generates and sends signals to Azure IoT backend.
'''
# Module Importations
from azure.iot.device import IoTHubDeviceClient, Message, MethodResponse
import random
import threading
import time
# The device connection string to authenticate the device with your IoT hub.
connection_string = "Host... |
test_util.py | <<<<<<< HEAD
# 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 requir... |
updater.py | import threading
import copy
import math
import time
from icm20948 import ICM20948
from smbus import SMBus
from madgwick_py.madgwickahrs import MadgwickAHRS
from madgwick_py.quaternion import Quaternion
class ImuUpdater:
"""Asynchronously get IMU state and pass to filter
"""
def __init__(self, init_stat... |
test_vizdoom_multiplayer.py | import time
import unittest
from multiprocessing import Process
from unittest import TestCase
from envs.env_utils import vizdoom_available
from utils.utils import log, AttrDict
@unittest.skipUnless(vizdoom_available(), 'Please install VizDoom to run a full test suite')
class TestDoom(TestCase):
@staticmethod
... |
few_warehouses_experiment_take_two.py | from multiprocessing.context import Process
from experiment_utils import experiment_runner
import numpy as np
import tensorflow.compat.v1 as tf
import random
"""
Experiment with only a few warehouses but a lot of customers, which would be a more realistic scenario.
"""
# for i in reversed(list(range(num_experimen... |
train_ac_f18.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn
Adapted for pytorch version by Ning Dai
"""
import numpy as np
import torch
import gym... |
federated_learning_keras_consensus_FL_threads_MNIST_crossentropy_gradients_exchange.py | from DataSets import MnistData
from DataSets_task import MnistData_task
from consensus.consensus_v4 import CFA_process
from consensus.parameter_server_v2 import Parameter_Server
# use only for consensus , PS only for energy efficiency
# from ReplayMemory import ReplayMemory
import numpy as np
import os
import tensorflo... |
nevigation.py | import time
import cv2
import numpy as np
import rospy
import torch
from geometry_msgs.msg import Twist
from sensor_msgs.msg import Joy
from nav_msgs.msg import Odometry
from std_msgs.msg import Int16
import pointselectionscript
from roscomm import *
from mmseg.apis import inference_segmentor, init_segmentor
from fla... |
server.py | import os
import sys
import pwd
import grp
import asyncio
import logging
import typing
from multiprocessing import Process, Queue
def drop_privileges(uid_name='nobody'):
if os.getuid() != 0:
# We're not root so, like, whatever dude
return
# Get the uid/gid from the name
running_uid = pwd... |
conftest.py | # encoding: utf-8
import pytest
import mongoengine
from functools import partial
from marrow.task.message import Message
from marrow.task.runner import Runner
@pytest.fixture(scope="module", autouse=True)
def connection(request):
"""Automatically connect before testing and discard data after testing."""
connecti... |
walman.py | import logging
import os
import time
import queue
import threading
LOG_STORE_LOCATION = os.environ["DATA_STORE_LOCATION"] + "/log/"
LOG_CHUNK_LEN = int(os.environ["LOG_CHUNK_LEN"])
PROCESS_TIMEOUT = int(os.environ["THREAD_SLEEP"])
MAX_Q_LEN = int(os.environ["FIXED_Q_LEN"])
process_flag = True
pipeline = None
process... |
fn_pp_threat_polling.py | # -*- coding: utf-8 -*-
# pragma pylint: disable=unused-argument, no-self-use
# (c) Copyright IBM Corp. 2010, 2019. All Rights Reserved.
"""Polling implementation"""
import calendar
import logging
import os
import time
from datetime import datetime
from threading import Thread
import jinja2
from resilient_circuits i... |
dbpool.py | import threading
import time
from . import asynpsycopg2, asynredis, synsqlite3, asynmongo, syndbi
from ..client import socketpool
from . import DB_PGSQL, DB_SQLITE3, DB_REDIS, DB_MONGODB, DB_SYN_PGSQL, DB_SYN_MONGODB, DB_SYN_REDIS
class DBPool (socketpool.SocketPool):
class_map = {
DB_SQLITE3: synsqlite3.SynC... |
launcher.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... |
mapviewer.py | #!/usr/bin/env python
"""
GUI for displaying maps from HDF5 files
Needed Visualizations:
2x2 grid:
+-------------+--------------+
| map1 | 2-color map |
+-------------+--------------+
| correlation | map2 |
+-------------+--------------+
All subplots "live" so that sele... |
RPFrameworkDevice.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
#/////////////////////////////////////////////////////////////////////////////////////////
#/////////////////////////////////////////////////////////////////////////////////////////
# RPFrameworkDevice by RogueProeliator <adam.d.ashe@gmail.com>
# Base class for all RogueP... |
main_window.py | #!/usr/bin/env python3
#
# Electrum ABC - lightweight eCash client
# Copyright (C) 2020 The Electrum ABC developers
# 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... |
red_detector_node.py | #!/usr/bin/env python
import rospy
import numpy as np
import math
from duckietown_msgs.msg import Twist2DStamped, LanePose
from sensor_msgs.msg import CompressedImage, Image
from cv_bridge import CvBridge, CvBridgeError
import cv2
import sys
from duckietown_utils.jpg import image_cv_from_jpg
import time
import threadi... |
h1.py | #1.创建3个任务进程,分别统计"/etc/passwd" “/etc/group” “/etc/bashrc”文件有多少行
from multiprocessing import Process
import os
def job1(arg):
f = open(arg,'r')
for line in f.readlines():
l.append(line)
print(len(l))
def job2(arg):
f = open(arg,'r')
for line in f.readlines():
l.append(line)
pr... |
util.py | # -*- coding: utf-8 -*-
# author: @RShirohara
from queue import Queue, Empty
from threading import Event, Thread
from typing import NamedTuple
import cv2
class CapParams(NamedTuple):
"""Capture device params."""
source: str
width: int
height: int
class EventThread(Thread):
"""threading.Thread... |
play10.py | import multiprocessing
import time
import os
start0 = time.time()
def slow_worker():
cnt_req = 0
print('Starting worker')
print('{}s passed...(pid:{})'.format(int(time.time() - start0), os.getpid()))
time.sleep(1)
cnt_req += 1
print('Finished worker')
def manager():
cnt_req = 0
while ... |
test_conveyor.py | # -*- coding: utf-8 -*-
# Copyright 2015-2021 CERN
#
# 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... |
automating_all_users.py | """
'Automated ALL' Program v2.0, Copyright 2017 Sam Suri, all rights reserved. Only use with permission.
This program uses live data from BSD and updates it in VAN's My Campaign universe. Use only after running
"'Automated ALL' CSV Test Program," which ensures that corrupted data is not being passed into VAN.
... |
test_debug.py | import importlib
import inspect
import os
import re
import sys
import tempfile
import threading
from io import StringIO
from pathlib import Path
from unittest import mock
from django.core import mail
from django.core.files.uploadedfile import SimpleUploadedFile
from django.db import DatabaseError, connection
from djan... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
# See https://en.wikipedia.org/wiki/ISO_42... |
test_memusage.py | import decimal
import gc
import itertools
import multiprocessing
import weakref
import sqlalchemy as sa
from sqlalchemy import ForeignKey
from sqlalchemy import inspect
from sqlalchemy import Integer
from sqlalchemy import MetaData
from sqlalchemy import select
from sqlalchemy import String
from sqlalchemy import test... |
threaded_image_capture.py |
import cv2
import time
import threading
class ThreadedImageCapture:
def __init__(self, cam_width=1280, cam_height=720):
self.cam_width = cam_width
self.cam_height = cam_height
# Set up video capture object
self.vidcap = cv2.VideoCapture(0)
self.vidcap.set(cv2.CAP_PROP_FRA... |
ColdDataRetriever.py | import logging
import os, glob
import signal
import csv
import time
import shutil
import subprocess
import datetime
import json
import sys
import schedule
import pickle
import threading
import argparse
import random
import string
from collections import defaultdict
def initialize_config_and_execute(valuesDict):
... |
fase_client.py | import os
import pickle
import uuid
import queue
import threading
from fase_lib import fase
from fase_lib.fase_model import fase_model
COUNTRY_CODE = 'US'
DEVICE_TYPE = 'Python'
PIXEL_DENSITY = 1.0
def LoadSessionInfoIfExists(session_info_filepath):
if session_info_filepath is None or not os.path.exists(session_... |
utils.py | import asyncore
import base64
import cherrypy
import contextlib
import email
import errno
import io
import json
import os
import queue
import smtpd
import socket
import threading
import time
import urllib.parse
_startPort = 31000
_maxTries = 100
class MockSmtpServer(smtpd.SMTPServer):
mailQueue = queue.Queue()
... |
action.py | from __future__ import absolute_import, unicode_literals
import os
import pipes
import signal
import subprocess
import sys
import time
from contextlib import contextmanager
from threading import Thread
import py
from tox import reporter
from tox.constants import INFO
from tox.exception import InvocationError
from to... |
feature_shutdown.py | #!/usr/bin/env python3
# Copyright (c) 2020-2021 The Eleccoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test eleccoind shutdown."""
from test_framework.test_framework import EleccoinTestFramework
from test... |
test_video_orig.py | import sys
import os
os.environ["CUDA_VISIBLE_DEVICES"]="0"
import threading
import datetime
import glob
import cv2
import time
import face_detection
#from face_detection.retinaface.tensorrt_wrap import TensorRTRetinaFace
import datetime
import http.client
def split(a, n):
k, m = divmod(len(a), n)
return (a[i *... |
meta.py | from abc import ABC, abstractmethod
import ast
from collections import ChainMap
from contextlib import contextmanager, redirect_stdout
from copy import copy, deepcopy
from functools import wraps, partial, update_wrapper
import inspect
from inspect import Parameter, signature, _empty
import io
import json
import logging... |
mavlink_tests2.py | # mavlink_camera_tests.py
#
# Air Cam Pro 2021
# This is tests for python mavlink for camera control
# It uses snippets and code from the sources given below
# REV 1.1 23-12-2021 1700
#
# Mark Jacobsen
# mark@syriaairlift.org
#
# example mavlink GUI
# https://github.com/markdjacobsen/hellomav
#
# Joystick readers and ... |
a3c.py | # -*- coding: utf-8 -*-
import gym
import numpy as np
from itertools import count
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
import visdom
from libs import replay_memory, utils, optimizers, wrapped_env
vis = visdom.Visdom()
class ActorCritic(nn.Module):
def __in... |
ue_mac.py | """
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
"""
import threading
from typing import List
from ryu.controller import ofp_event
from ryu.controller.handler import M... |
__init__.py | __author__ = "Johannes Köster"
__copyright__ = "Copyright 2015-2019, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os
import sys
import contextlib
import time
import datetime
import json
import textwrap
import stat
import shutil
import shlex
import threading
import concurrent.futu... |
main.py | def exit(exit_code):
global drivers,locks
try:
with locks[3]:
try:drivers
except NameError:pass
else:
for driver in drivers:
try:Process(driver).terminate()
except:pass
except:pass
finally:
if exit_code:
print_exc()
stdout.write('\r[INFO] Exitting with exit code %d\n'%exit_code)
_e... |
determine_vacant_spectrum_CODE_PIECES.py | '''modus operandi:) 29 June 2019
1)create table in sqlite [done]
2)connect to sqlite db and display table contents [done]
3) create another table, say table2 [done]
4) do some computation on table 1 and overwrite table 2 with computation output
5)
'''
import sqlite3
from sqlite3 import Error
#from interval import Int... |
adbcore.py | #!/usr/bin/env python2
import struct
import threading
from time import sleep
from typing import Optional
from future import standard_library
import datetime
import socket
import queue as queue2k
import random
from ppadb.device import Device
from ppadb.connection import Connection
from ppadb.client import Client as A... |
test_asyncprocess.py | import asyncio
import gc
import os
import signal
import sys
import threading
import weakref
from datetime import timedelta
from time import sleep
import psutil
import pytest
from tornado import gen
from tornado.locks import Event
from distributed.compatibility import WINDOWS
from distributed.metrics import time
from ... |
test_aio.py | # -*- coding: utf-8 -*-
import os
import asyncio
# import uvloop
import threading
import random
from unittest.mock import patch
# asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
import time
import pytest
import thriftpy2
from thriftpy2.contrib.aio.transport import (
TAsyncBufferedTransportFactory,
... |
test_gbkviz_webapp.py | import multiprocessing
import platform
import sys
import time
from gbkviz import gbkviz_webapp
from streamlit.cli import main as stcli_main
def test_gbkviz_webapp_launch():
"""test gbkviz webapp launch propery"""
# TODO: Test only Linux now. This test method is not applicable to MacOS.
# Test MacOS... |
d.py | import sys, socket, struct, serial
from threading import Thread
sock = socket.socket()
sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
#sock.bind(('192.168.0.123', 5000))
sock.bind(('', 5000))
#ser = serial.Serial('/dev/ttyACM0',9600)
DUE_PORT = 'COM7' #'/dev/ttyACM0'
DUE_BAUDS = 9600
ser = serial.Serial(... |
conftest.py | import threading
from http.server import HTTPServer, BaseHTTPRequestHandler
import pytest
class ParameterServerMock(BaseHTTPRequestHandler):
""" mock server for unittest
Parameter Server API: http://wiki.ros.org/ROS/Parameter%20Server%20API
Master Slave APIs: http://wiki.ros.org/ROS/Master_Slave_APIs
... |
tensor_models.py | # -*- coding: utf-8 -*-
#
# tensor_models.py
#
# Copyright 2020 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.
# You may obtain a copy of the License at
#
# http://www.apa... |
zookeeper_cluster_tests.py | # Copyright 2015 LinkedIn Corp.
#
# 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.... |
job.py | """
**job** module handles all the job running logic:
- consistent exception handling and logging
- currently 2 job runners are implemented:
- SimpleJobRunner runs the jobs sequentially.
- ParallelJobRunner queues the jobs and run them in a dedicated thread
"""
from concurrent.futures import ThreadPoolExecutor, Pr... |
__init__.py | # coding=utf-8
# encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from octoprint.util.version import get_octoprint_version_string
from tempfile import mkstemp
from datetime import timedelta
from slacker import Slacker, IncomingWebhook
from imgurpython import ImgurClient... |
play_with_yinxin.py | #
# 采用Yixin Engine作为联系对手进行对局:
#
# @author: Eric Li
# 与Gomocup Protoc协议兼容,通过管道Pipe与AI引擎进行通讯,协议可参考:http://petr.lastovicka.sweb.cz/protocl2en.htm
#
from subprocess import *
import time, string
import threading
# shell=True, bufsize=10
p = Popen('C:/Program Files/Yixin/engine.exe', stdin=PIPE, stdout=PIPE)
# 接收返回结果的线程:... |
mothership.py | # -*- coding: utf-8 -*-
"""
模块说明:主程序启动模块
"""
import bluetooth
import threading
import logging
import BtConnector
import BaseHTTPServer
import SocketServer
def runbc(server_socket, bc):
running = True
while running:
try:
#等待有人来连接,如果没人来,就阻塞线程等待(这本来要搞个会话池,以方便给不同的设备发送数据)
sock,info=... |
test_util.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... |
test_http.py | # -*- encoding: utf-8 -*-
import collections
import errno
import email.parser
import platform
import socket
import threading
import time
import pytest
from ddtrace import compat
from ddtrace.vendor import six
from ddtrace.vendor.six.moves import BaseHTTPServer
from ddtrace.vendor.six.moves import http_client
from ddt... |
main.py | import threading
import msvcrt
from wheel import reel
from game import *
# parameters............................................
mode = 'game'
number_of_reels = 5
number_of_symbols = 4
f_payout = lambda x: ((1/x) * number_of_reels*number_of_symbols)
number_of_runs = 10000
number_of_simulations = 1
# paramet... |
Main.py | import asyncio, time, threading, queue, discord, sys, os, json
client = discord.Client()
@client.event
async def on_ready():
print('Debate Module: Logged in as:\n{0} (ID: {0.id})'.format(client.user))
class Vote:
def __init__(self, message):
self.timeToWait = 60
self.minConverter = {"h": 3... |
fork_wait.py | """This test case provides support for checking forking and wait behavior.
To test different wait behavior, override the wait_impl method.
We want fork1() semantics -- only the forking thread survives in the
child after a fork().
On some systems (e.g. Solaris without posix threads) we find that all
active threads su... |
listener.py | from bluepy import btle
import sys
import dbm
import threading
import logging as log
import time
import struct
from rbb import scanner
from rbb import devices
from rbb import messenger
_message_queue = None
_abort = False
# Built in Characteristics, without interesting measurement data.
ignore_list = [
"00002a... |
server.py | import threading
import queue
from werkzeug.wrappers import Request, Response
from werkzeug.serving import run_simple
from jsonrpc import JSONRPCResponseManager, dispatcher
import polly.core
speech_queue = queue.Queue()
def speech_worker():
while True:
item = speech_queue.get()
polly.core.say... |
conftest.py | import os
import sys
import datetime
import time
import json
import requests
import pytest
from mock import patch
from psqlgraph import PsqlGraphDriver
from flask.testing import make_test_environ_builder
from signpost import Signpost
from cdispyutils.hmac4 import get_auth
from cdispyutils.hmac4.hmac4_auth_utils impor... |
main.py | #!/usr/bin/env python
import time
import os
import random
import threading
import argparse
import matplotlib.pyplot as plt
import numpy as np
import scipy as sc
import cv2
from collections import namedtuple
import torch
from torch.autograd import Variable
from robot import Robot
from trainer import Trainer
from logg... |
ws.py | import os
import socket
import websocket
import sys
if sys.version_info >= (3, 0):
import queue
else:
import Queue as queue
from threading import Event, Thread
from . import IOHandler
def resolve_hostname(hostname, port):
# We do our own mDNS resolution
# to enforce we only search for IPV4 address
... |
nci_stitcher_worker.py | """NCI NDR Stitcher Worker.
This script will create 1 degree stitches of NDR results.
"""
import argparse
import datetime
import glob
import logging
import os
import pathlib
import queue
import subprocess
import sys
import threading
import time
import traceback
import zipfile
from osgeo import gdal
from osgeo import ... |
whisperconnection.py | import json
import logging
import random
import threading
import time
from queue import Queue
import requests
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import String
from pajbot.managers.connection import CustomServerConnection
from pajbot.managers.db import Base
from pajbot.manager... |
main.py | import threading
import time
import cv2
import sys
import traceback
import numpy as np
import json
from SimpleWebSocketServer import SimpleWebSocketServer, WebSocket
from frame_processor import FrameProcessor
clients = []
server = None
server_running = False
debug = False
cam_index = 1
def send_transforms(clients, ... |
ping.py | # pylint: disable=C0111,R0903
"""Periodically checks the RTT of a configurable host using ICMP echos
Requires the following executable:
* ping
Parameters:
* ping.interval: Time in seconds between two RTT checks (defaults to 60)
* ping.address : IP address to check
* ping.timeout : Timeout for waiting... |
mail.py | import logging
import settings
import smtplib
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from threading import Thread
def send_email_raw(subject, message, recipients=settings.RECIPIENTS):
"""
:subject: string,
:message: string,
:recipient: list of string email ... |
test_helm.py | import os
import os.path
import sys
import threading
import unittest
from functools import partial
import shutil
import urllib.request
from click.testing import CliRunner
from unfurl.job import JobOptions, Runner
from unfurl.yamlmanifest import YamlManifest
from unfurl.localenv import LocalEnv
from .utils import init_... |
test_worker.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
import shutil
import signal
import subprocess
import sys
import time
import zlib
from datetime import datetime, timedelta
from multiprocessing import Process
from time import ... |
test_DesignPatterns.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for design pattern utilities"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
# Copyright 2006 St James Software
from future import standard_library
standard_l... |
reservation.py | # Copyright 2017 Yahoo Inc.
# Licensed under the terms of the Apache 2.0 license.
# Please see LICENSE file in the project root for terms.
"""This module contains client/server methods to manage node reservations during TFCluster startup."""
from __future__ import absolute_import
from __future__ import division
from _... |
BCI.py | import importlib
import multiprocessing
from robot import config, logging
from datetime import datetime, timedelta
logger = logging.getLogger(__name__)
class MuseBCI(object):
def __init__(self, event):
self._wakeup_event = event
self.last_blink = datetime.now() - timedelta(days=1.5)
self.... |
load_data.py | import numpy as np
from scipy import ndimage
import glob
import itertools
import threading
import time
import skimage.transform
import skimage.io
import skimage.filter
import gzip
import os
import Queue
import multiprocessing as mp
num_train = 61578 # 70948
num_test = 79975 # 79971
train_ids = np.load("data/train_... |
capture.py | import promap
import cv2
import logging
import threading
import time
class CaptureError(promap.PromapError):
pass
def open_camera(camera):
if camera is None:
cap = cv2.VideoCapture()
if not cap.isOpened():
raise CaptureError("Could not open default capture device")
else:
... |
parallel_manager.py | import sys
import errno
import os
import signal
import subprocess
import time
import logbook
import threading
from tempfile import mkdtemp
from six.moves import xmlrpc_client
from .. import log
from ..exceptions import INTERRUPTION_EXCEPTIONS, ParallelServerIsDown, ParallelTimeout
from ..conf import config
from ..ctx ... |
OQMD2PyChemia.py | #!/usr/bin/env python
import os
import sys
import time
import logging
import itertools
import argparse
from multiprocessing import Pool, cpu_count, Process
import pychemia
from pychemia.utils.periodic import atomic_symbol
try:
from qmpy import Entry
except ImportError:
Entry = None
print("Could not import... |
GUI_multiple_threads_thread_in_method.py | '''
May 2017
@author: Burkhard A. Meier
'''
#======================
# imports
#======================
import tkinter as tk
from tkinter import ttk
from tkinter import scrolledtext
from tkinter import Menu
from tkinter import messagebox as msg
from tkinter import Spinbox
from time import sleep
import Ch04_Code... |
test_regr1.py | import asyncio
import queue
import multiprocessing
import signal
import threading
from uvloop import _testbase as tb
class EchoServerProtocol(asyncio.Protocol):
def connection_made(self, transport):
transport.write(b'z')
class EchoClientProtocol(asyncio.Protocol):
def __init__(self, loop):
... |
map_dataset_op_test.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... |
knob.py | import sys
import threading
import time
import qwiic_twist
from .common import DO_NOTHING, NOT_SUPPLIED
class Knob:
def __init__(self, addr, max_=None, default=0, on_update=None,
on_press=None, on_release=None):
self._twist = qwiic_twist.QwiicTwist(addr)
self.configure(default,... |
health-server.py | #!/usr/bin/env python2
#
# Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# Author: Erwan Velu <erwan.velu@enovance.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
# a copy of the License at
#
# h... |
test_psutil.py | #!/usr/bin/env python3
# Programm : test_psutil.py
# Version : 1.02
# SW-Stand : 17.02.2022
# Autor : Kanopus1958
# Beschreibung : Test von psutil Funktionalitäten
from time import sleep
import psutil
import threading
from rwm_mod01 import show_header, aktuelle_uhrzeit, aktuelles_datum, getch
from... |
VoiceRoDoKu.pyw | import threading
import requests
import webview
from app.application import CMD_SHUTDOWN, app
from app.lib.www import *
# GUIのURL
ROOT_URL = "http://" + app.config["SERVER_IP"] + ":" + app.config["SERVER_PORT"] + "/"
def start_flask():
"""
Flaskのサーバを起動
"""
app.run(host=app.config["SERVER_IP"], port... |
minitouch.py | # -*- coding: utf-8 -*-
import os
import re
import socket
import sys
import threading
import time
import warnings
import six
from six.moves import queue
from airtest.core.android.constant import STFLIB
from airtest.utils.logger import get_logger
from airtest.utils.nbsp import NonBlockingStreamReader
from airtest.utils... |
smmx-search.py | #!/usr/bin/env python3
import os
import tkinter as tk
from fast_autocomplete import AutoComplete
from scanners.smmx import scan
from pathlib import Path
import subprocess
import platform
from pynput import keyboard
import threading
import copy
rootdir = 'C:/Users/xxx/Dropbox/SimpleMind'
words, paths = scan(rootdir)
w... |
gamemanager.py | import urllib.request
import json
import platform
import os
import threading
import io
class GameManager():
def __init__(self, server_address, game_directory):
self.server_address = server_address
self.game_directory = game_directory
self.server_active = self.ping_server()
if self... |
monitor.py | # -*- coding: utf-8 -*-
"""
Created on Wed Jun 19 19:07:04 2019
@author: Branson
"""
from threading import Thread
import pprint
import queue as queue
import zmq
import argparse
from time import sleep
import talib as ta
import BATrader as ba
from BATrader.market.MarketReader import currentTime, currentTimeSecond, s... |
document_toolkit_function.py | #System variable and io handling
import os
from posixpath import basename
import sys
import configparser
#Regular expression handlings
import multiprocessing
from multiprocessing import Process , Queue, Manager
import queue
import subprocess
#Get timestamp
import time
from datetime import datetime
#func... |
sync.py | # -*- coding:utf-8 -*-
#
# Copyright (C) 2008 The Android Open Source Project
#
# 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 re... |
test_pdb.py | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import os
import pdb
import sys
import types
import codecs
import unittest
import subprocess
import textwrap
from contextlib import ExitStack
from io import StringIO
from test import support
# This little helper class is essential for testin... |
tester.py | # Copyright (c) 2014-2015 Dropbox, 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... |
base_test.py | import copy
import datetime
import logging
import threading
import elasticsearch
import mock
import pytest
from elastalert import config
from elastalert.enhancements.drop_match_exception import DropMatchException
from elastalert.enhancements.test_enhancement import TestEnhancement
from elastalert.queries.elasticsearch... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.