source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
register.py | import logging, traceback, sys, threading
try:
import Queue
except ImportError:
import queue as Queue
from ..log import set_logging
from ..utils import test_connect
from ..storage import templates
logger = logging.getLogger('itchat')
def load_register(core):
core.auto_login = auto_logi... |
analyse.py | from .trend import trend
from .volume import volume
from .macd import macd
from .sr import sr
from .candle import candle
from home.models import stock
import requests
import threading
import pandas as pd
from queue import Queue
import time
th = Queue(maxsize = 4000)
def analyse(sym):
#network calls check with t... |
run.py | import os
import gym
import time
import torch
import numpy as np
import numpy.random as rd
from copy import deepcopy
from elegantrl.replay import ReplayBuffer, ReplayBufferMP
from elegantrl.env import PreprocessEnv
"""[ElegantRL](https://github.com/AI4Finance-LLC/ElegantRL)"""
class Arguments:
def __init__(self,... |
conftest.py | import logging
import os
import random
import time
import tempfile
import threading
from concurrent.futures.thread import ThreadPoolExecutor
from datetime import datetime
from math import floor
from shutil import copyfile
from functools import partial
from botocore.exceptions import ClientError
import pytest
from ocs... |
locusts.py | # encoding: utf-8
import io
import multiprocessing
import os
import sys
from httprunner.logger import color_print
from httprunner.testcase import TestcaseLoader
from locust.main import main
def parse_locustfile(file_path):
""" parse testcase file and return locustfile path.
if file_path is a Python file... |
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... |
core_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... |
Purchase_details.py | from src.dependencies.imports import *
class Purchase_details(LabelFrame):
def __init__(self,master,db,flag):
super(Purchase_details,self).__init__(master)
self.grid()
labelfont=('times',16,'bold')
self.canvas = Canvas(self,bg="#bdc3c7")
self.frame = LabelFrame(sel... |
camera.py | import time
from picamera import PiCamera
from threading import Thread
from uploader import upload_file, has_network_connection
class ConfigurableCamera(PiCamera):
def __init__(self, job):
super(ConfigurableCamera, self).__init__()
self.__job = job
self.__configure()
self.__test_n... |
CopyRequestResponse.py | from burp import IBurpExtender, IContextMenuFactory, IHttpRequestResponse
from java.io import PrintWriter
from java.util import ArrayList
from javax.swing import JMenuItem
from java.awt import Toolkit
from java.awt.datatransfer import StringSelection
from javax.swing import JOptionPane
import subprocess
import tempfile... |
data_model_manager_runner.py | """Data Model Manager Runner.
This script is responsible for running the Data Model Manager in its own
thread, separate from the web application that will most likely have
multiple workers.
"""
from threading import Thread
from data_resource_api import DataModelManager, MigrationFileWatcher
migration_file_watcher ... |
printer.py | import socket
import requests
from lxml.html import fromstring
import datetime
import sys
import ipaddress
import threading
import os
BLUE, RED, WHITE, YELLOW, MAGENTA, GREEN, END = '\33[1;94m', '\033[1;91m', '\33[1;97m', '\33[1;93m', '\033[1;35m', '\033[1;32m', '\033[0m'
class ThreadManager(object):
i = 0
d... |
measure-parallel.py | import argparse
import os
import time
from multiprocessing import Event, Manager, Process, Queue
from operator import itemgetter
import geopandas as gpd
import matplotlib.pyplot as plt
import networkx as nx
import numpy as np
import pandas as pd
import seaborn as sns
from gerrychain import Graph, MarkovChain, Partitio... |
test_base_events.py | """Tests for base_events.py"""
import errno
import logging
import math
import os
import socket
import sys
import threading
import time
import unittest
from unittest import mock
import asyncio
from asyncio import base_events
from asyncio import constants
from asyncio import events
from test.test_asyncio import utils a... |
main.py | import requests
import sqlite3
import threading
import sys
import xml.etree.cElementTree as ET
from flask import Flask
import flask
import webbrowser
import logging
from tqdm import tqdm
import lxml.etree as ET
log = logging.getLogger('werkzeug')
log.setLevel(logging.ERROR)
app = Flask("Yu-Gi-Oh! - Webinterface")
d... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 2.7.3 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
from multiprocessing import ... |
smoothen.py | import re
import fileinput
import sys
import tempfile
import time
import multiprocessing as mp
from gpxpy import geo as mod_geo
from . import functions
from datetime import datetime
import copy
def getgpxstring(filename,algo=2):
with open(filename, 'r') as f:
gpx_file_data=f.read()
return gpx_file_data
... |
main.py | # NOTE: must run " pip install -U selenium "
import msvcrt
import threading
import time
import pickle
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
driver = webdriv... |
email.py | from threading import Thread
from flask import render_template
from flaski import app
from flask_mail import Message
from flaski import mail
from werkzeug.utils import secure_filename
import io
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipient... |
__init__.py | import sys
import io
import time
import json
import threading
import traceback
import collections
import bisect
try:
import Queue as queue
except ImportError:
import queue
# Patch urllib3 for sending unicode filename
from . import hack
from . import exception
__version_info__ = (1, 0)
__version__ = '.'.join... |
ledclock.py | #!/usr/bin/python3
""" Test Bed for Diyhas System Status class """
import time
import datetime
from threading import Thread
import socket
from Adafruit_Python_LED_Backpack.Adafruit_LED_Backpack import SevenSegment
TIME_MODE = 0
WHO_MODE = 1
COUNT_MODE = 2
MAXIMUM_COUNT = 9999
class TimeDisplay:
""" display tim... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_ltc.util import bfh, bh2u, UserCancelled
from electrum_ltc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from e... |
keepkey.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_axe.util import bfh, bh2u, UserCancelled
from electrum_axe.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT)
from electrum_axe import constants
from electrum_axe.i18n ... |
testlib.py | #!/usr/bin/python
#################
#
# testlib.py - regression test library
#
# all reusable code goes here
#
# Copyright (C) 2013-2015 Intel Corporation All Rights Reserved.
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# Li... |
_process_win32.py | """Windows-specific implementation of process utilities.
This file is only meant to be imported by process.py, not by end-users.
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2011 The IPython Development Team
#
# Distributed under the terms of the BSD Licen... |
test_socket.py | import unittest
from test import support
import errno
import io
import itertools
import socket
import select
import tempfile
import time
import traceback
import queue
import sys
import os
import array
import contextlib
from weakref import proxy
import signal
import math
import pickle
import struct
import random
import... |
pydevd.py | '''
Entry point module (keep at root):
This module starts the debugger.
'''
import sys # @NoMove
if sys.version_info[:2] < (2, 6):
raise RuntimeError('The PyDev.Debugger requires Python 2.6 onwards to be run. If you need to use an older Python version, use an older version of the debugger.')
import os
try:
#... |
case.py | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2022 Valory AG
# Copyright 2018-2021 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... |
cli.py | # coding:utf-8
import sys
import logging
import argparse
import threading
import time
from six.moves import queue
from captain_comeback.index import CgroupIndex
from captain_comeback.restart.engine import RestartEngine
logger = logging.getLogger()
DEFAULT_ROOT_CG = "/sys/fs/cgroup/memory/docker"
DEFAULT_SYNC_TARGE... |
worker_handlers.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... |
ledserver.py | import board
import digitalio
import neopixel
import blinkled
import time
import sys
import logging
import json
from random import *
from queue import Queue
from threading import Thread
#log = logging.getLogger("webserver")
farben = {
"off": (0,0,0),
"white": (255,255,255),
"yellow": (180,180,0),
"orange... |
TWCManager.py | #! /usr/bin/python3
################################################################################
# Code and TWC protocol reverse engineering by Chris Dragon.
#
# Additional logs and hints provided by Teslamotorsclub.com users:
# TheNoOne, IanAmber, and twc.
# Thank you!
#
# For support and information, please re... |
trainer_controller.py | # # Unity ML-Agents Toolkit
# ## ML-Agent Learning
"""Launches trainers for each External Brains in a Unity Environment."""
import os
import threading
from typing import Dict, Optional, Set, List
from collections import defaultdict
import numpy as np
from mlagents.tf_utils import tf
from mlagents_envs.logging_util i... |
pexpect_runner.py | #!/usr/bin/env python3
import Queue
import signal
import sys
import threading
import time
import pexpect
import PexpectRunnerConsolImpl
import wx
def sighandler(signum, frame):
# print "Signaled: %d" %signum
if signum == signal.SIGCHLD:
sys.exit(1)
else:
text_queue.put("SIGQUIT")
d... |
run_unittests.py | #!/usr/bin/env python3
# Copyright 2016-2017 The Meson development team
# 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 ... |
main.py | import os
import sys
import time
import argparse
import signal
from typing import List, Optional
from enum import Enum
import subprocess
from multiprocessing import Queue, Process
from bottle import request, response, post, run, get, delete
class Status(Enum):
PENDING = 'PENDING'
RUNNING = 'RUNNING'
FAILE... |
stream2albula.py | """
"""
from fileWriter import FileWriter
import tifffile
import threading
import numpy as np
import json
import os
from dectris import albula
__author__ = "SasG"
__date__ = "17/01/26"
__version__ = "0.0.1"
__reviewer__ = ""
class Stream2Albula(FileWriter):
def __init__(self, basename, path, verbose=False):
... |
main.py | import pdb
import time
import os
import subprocess
import re
import random
import json
import numpy as np
import glob
from tensorboard.backend.event_processing.event_accumulator import EventAccumulator
import socket
import argparse
import threading
import _thread
import signal
from datetime import datetime
parser = ar... |
02_tiyan_GIL.py | # -*- encoding=utf-8 -*-
import threading
cnt = 100000000
def countdown():
global cnt
while cnt > 0:
cnt -= 1
if __name__ == '__main__':
# countdown()
t1 = threading.Thread(target=countdown)
t2 = threading.Thread(target=countdown)
t1.start()
t2.start()
# time python 02_tiyan... |
presubmit_support.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Enables directory-specific presubmit checks to run at upload and/or commit.
"""
__version__ = '1.8.0'
# TODO(joi) Add caching ... |
tracker.py | """
Tracker script for DMLC
Implements the tracker control protocol
- start dmlc jobs
- start ps scheduler and rabit tracker
- help nodes to establish links with each other
Tianqi Chen
"""
# pylint: disable=invalid-name, missing-docstring, too-many-arguments, too-many-locals
# pylint: disable=too-many-branches, too... |
twitter_crawler.py | import threading
import tweepy
import json
from pymongo import MongoClient
import pandas as pd
from datetime import datetime
import time
import re
#Set up Twitter API authentication and access token
CONSUMER_KEY = "CONSUMER_KEY"
CONSUMER_SECRET = "CONSUMER_SECRET"
ACCESS_TOKEN = "ACCESS_TOKEN"
ACCESS_TOKEN_SECRET = "A... |
togglemute_button.py | import logging
import shlex
import subprocess
import time
from multiprocessing import Process
import RPi.GPIO as GPIO
def togglemute(logger: logging.Logger) -> None:
"""A physical button to toggle mumble client mute and unmute states
Mumble client unmute when button is pressed and held down (LED light also
... |
test_requests.py | #!/usr/bin/env python
"""
Test the RequestsClient with actual HTTP requests.
:author: Doug Skrypa
"""
import asyncio
import logging
import os
import socket
import sys
import unittest
from concurrent.futures import as_completed, ThreadPoolExecutor
from contextlib import contextmanager
from pathlib import Path
from thr... |
back.py | from threading import Thread
from traits.api import Bool
from traits.api import Instance
from traitsui.handler import Handler
from traitsui.ui_info import UIInfo
import os
import time
import traceback
class BackgroundHandler (Handler):
# The UIInfo object associated with the UI:
info = Instance(UIInfo)
... |
pyshell.py | #! /usr/bin/env python3
import sys
if __name__ == "__main__":
sys.modules['idlelib.pyshell'] = sys.modules['__main__']
try:
from tkinter import *
except ImportError:
print("** IDLE can't import Tkinter.\n"
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
raise SystemExit(... |
litebook.py | #!/usr/bin/env py32
# -*- coding: utf-8 -*-
#This is the source file of LiteBook (for all Windows/Linux/OSX)
#see Readme.txt for module dependcy
#
#
#
import locale
SYSENC=locale.getdefaultlocale()[1]
import sys
FullVersion=False
if len(sys.argv)>1:
if sys.argv[1]=='-full':
FullVersion=True
if FullVersio... |
device.py | from multiprocessing import Process, Queue
import serial
import time
class DeviceProcess:
def __init__(self, serial_queue, port='/dev/ttyUSB0', baudrate=9600, send_rate_s=0.25):
self._ser = serial.Serial(port, baudrate)
# self._ser = FakeSerialConsole()
self.serial_queue = serial_queue
... |
upnp.py | import logging
import threading
from queue import Queue
from typing import Optional
try:
import miniupnpc
except ImportError:
pass
log = logging.getLogger(__name__)
class UPnP:
thread: Optional[threading.Thread] = None
queue: Queue = Queue()
def __init__(self):
def run():
t... |
view.py | # Copyright (c) 2018 TechNexion,Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and t... |
gui.py | """main: Kivy GUI application for renaming files"""
import threading
from pathlib import Path
from typing import Optional
import kivy
from kivy.app import App
from kivy.clock import Clock
from kivy.config import Config
from kivy.core.window import Window
from kivy.lang import Builder
from kivy.uix.button import Button... |
xtotha01_para.py | #!/usr/bin/env python3
from multiprocessing import Process
def count(n):
while n > 0:
n -= 1
t1 = Process(target=count,args=(10**8,))
t1.start()
t2 = Process(target=count,args=(10**8,))
t2.start()
t1.join(); t2.join()
|
mp_classify.py | #!/usr/bin/env python
#
# // SPDX-License-Identifier: BSD-3-CLAUSE
#
# (C) Copyright 2018, Xilinx, Inc.
#
import sys
import timeit
import numpy as np
import multiprocessing as mp
import ctypes
import signal
import threading
from xfdnn.rt import xdnn, xdnn_io
import time
##############################################... |
database_test.py | # Copyright 2018 Braxton Mckee
#
# 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 t... |
wsdump.py | #!/Users/guozichen/Documents/github/vnpy/venv/bin/python
import argparse
import code
import sys
import threading
import time
import ssl
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding():
encoding = getattr(sys.stdin... |
dvrk_latency_test.py | #!/usr/bin/env python
# Author: Adnan Munawar
# Testing Robot IO Loading with varying ROS Communication Load
from __future__ import print_function
from dvrk import arm, psm, mtm, ecm
import rospy
import time
from threading import Thread
from cisst_msgs.msg import mtsIntervalStatistics as StatsMsg
import sys
import ro... |
webmail.py | from flask_mail import Message
from app import mail, app
from flask import render_template
from threading import Thread
# Email async function
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
# Main email function (calls async function)
def send_email(subject, sender, recipients, t... |
daemon.py | # -*- coding: utf-8 -*-
import threading
import queue
from functools import wraps
from collections import defaultdict
import jedi
from jedi.api import environment
import sublime
from .facade import JediFacade
from .console_logging import getLogger
from .utils import get_settings
logger = getLogger(__name__)
DAEMO... |
log.py | # Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
"""Utility classes for logging the output of blocks of code.
"""
from __future__ import unicode_literals
import multiproc... |
interpolation.py | """Trajectory interpolation utility module.
This module defines various interpolation technique (linear, minimum jerk).
They can be used in all goto functions.
"""
import time
import numpy as np
from threading import Thread, Event
from scipy.interpolate import interp1d
class TrajectoryInterpolation(object):
"""... |
slmservice.py | """ Provides access to an SLM device via Pyro.
Copyright 2014-2015 Mick Phillips (mick.phillips at gmail dot 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
http://www.apache.org/license... |
monitor_gui.py | #!/usr/bin/env python3
from threading import Thread
import math
import socket
import pickle
import time
from PyQt5.QtWidgets import *
from PyQt5.QtGui import *
from PyQt5.QtCore import Qt, QCoreApplication, QTimer
import rospy
from sensor_msgs.msg import LaserScan
from rospy.exceptions import ROSException
from rviz... |
artefacts_receiver.py | #!/usr/bin/env python3
#
# Copyright (c) 2019-2020 Arm Limited. All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
#
# This is a server that accepts PUT requests that's primary used to receive
# artefacts from Jenkins. Received files are placed under the output directory
# under the same path mentioned in ... |
relaymontest.py | #! /usr/bin/env python
# netifaces and netaddr modules required
import logging
import multiprocessing
import sys
import os
import re
import tempfile
import time
import traceback
import select
import signal
import socket
import subprocess
import netifaces as ni
from netaddr import IPAddress
from string import Template... |
ThreadWork.py |
import threading
import queue
import time
try:
from util import Log
except:
class Log:
def printDetailln(*args):
print(*args, flush="True")
class Task():
"""
Task
"""
def __init__(self, target=None, args=(), empty=False):
self.target = target
... |
networkServer.py | import p2prp.network.networkStation as netst
import p2prp.util.utilStation as util
from p2prp.network.packet import packetBase as pkbase, packets as packs
import socket, threading, time
def printLog(station, *args):
LOG_MARK = '[networkServer] '
station.console.addLog(util.toStr(LOG_MARK, *args))
# Network Server
... |
ServeAll.py | #!/usr/bin/env python3
import base64
from gevent.pywsgi import WSGIServer
import io
import os
import signal
import sys
import shutil
from threading import Thread
def get_parent_dir(n=1):
""" returns the n-th parent dicrectory of the current
working directory """
current_path = os.path.dirname(os.path.abs... |
worker.py | from helpers.hubspot import create_client
from helpers.oauth import is_authorized
from services.logger import logger
from hubspot.crm.contacts import ApiException
from multiprocessing import Process
import os
import time
import sys
def call_api():
# Pay attention on create_client.
# It generates a client with... |
test_proxy_scale.py | import multiprocessing
import pytest
from customize.milvus_operator import MilvusOperator
from common import common_func as cf
from common.common_type import CaseLabel
from scale import scale_common as sc, constants
from utils.util_log import test_log as log
from utils.util_k8s import wait_pods_ready
prefix = "proxy_... |
fly_tello.py | import time
import threading
from typing import Union, Optional
from contextlib import contextmanager
from comms_manager import CommsManager
class FlyTello:
""" Abstract class providing a simpler, user-friendly interface to CommsManager and Tello classes.
FlyTello is dependent on CommsManager, which itse... |
dev_test_dex.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# File: dev_test_dex.py
#
# Part of ‘UNICORN Binance WebSocket API’
# Project website: https://github.com/oliver-zehentleitner/unicorn-binance-websocket-api
# Documentation: https://oliver-zehentleitner.github.io/unicorn-binance-websocket-api
# PyPI: https://pypi.org/pro... |
localhost.py | #
# (C) Copyright Cloudlab URV 2021
#
# 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... |
test_local.py | # Copyright 1999-2021 Alibaba Group Holding Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... |
apps.py | from django.apps import AppConfig
import time, threading
from croniter import croniter
from datetime import datetime, timedelta
import os
import logging
import pytz
logger = logging.getLogger('ci')
class scheduleConfig(AppConfig):
name = "test"
def schedulePinger():
logger.debug("SCHEDULER: Starting... |
async_client.py | import json
import base64
import aiohttp
import asyncio
import threading
from uuid import uuid4
from time import timezone, sleep
from typing import BinaryIO, Union
from time import time as timestamp
from locale import getdefaultlocale as locale
from .lib.util import exceptions, headers, device, objects, helpers
from ... |
_server.py | import sys
import threading
import webbrowser
import socket
import itertools
import random
import os
import mimetypes
from http import server
def generate_handler(html, files = None):
if files is None:
files = {}
class MyHandler(server.BaseHTTPRequestHandler):
def do_GET(self):
se... |
gaofenbisai_9436.py | # -*- coding: utf-8 -*-
from PIL import Image,ImagePalette
import numpy as np
import yaml
from skimage import io
from torchvision import transforms
import os
import logging
# import functools
import torch
import torch.nn as nn
# import torch._utils
import torch.nn.functional as F
import torch.optim as optim
import xm... |
player_plain.py | import os
import psutil
import subprocess
import threading
import sys
from threading import Timer
import select
from player_abstract import AbstractPlayer
class PlainPlayer(AbstractPlayer):
def __init__(self, socket_file, working_dir, local_dir=None,
player_key="", player_mem_limit=... |
entry.py | from tkinter import *
from tkinter import ttk
from typing import ClassVar, Dict, List
from tkinter.filedialog import askdirectory
from os import chdir, listdir
from re import findall
from threading import Thread
root: ClassVar = Tk()
root.geometry("400x700")
root.title("Entry test")
root.configure(background="#fff")
... |
sasiostdio.py | #
# Copyright SAS Institute
#
# 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... |
server.py | import client
import load_data
import logging
import numpy as np
import pickle
import random
import sys
from threading import Thread
import torch
import utils.dists as dists # pylint: disable=no-name-in-module
class Server(object):
"""Basic federated learning server."""
def __init__(self, config):
s... |
grab_2camera_multi.py | from __future__ import print_function
import mil as MIL
import os
import sys
import serial
from multiprocessing import Process, Queue, Event
## Setup Multi thread
def MGrab(id, ScannerID, nImage, DeviceID):
## Directory Check
rootdir = "Scanner/{}".format(ScannerID)
try:
if not os.path.exists(root... |
test_threaded_server.py | import rpyc
import time
from rpyc.utils.server import ThreadedServer
from rpyc import SlaveService
import threading
import unittest
class Test_ThreadedServer(unittest.TestCase):
def setUp(self):
self.server = ThreadedServer(SlaveService, port=18878, auto_register=False)
self.server.logger.quiet = ... |
test_events.py | # Copyright (C) The Arvados Authors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
from future import standard_library
standard_library.install_aliases()
from builtins import range
from builtins ... |
app.py | # Dependencies
from time import sleep
import os
import sys
from apscheduler.schedulers.background import BackgroundScheduler
import logging
from logging.handlers import RotatingFileHandler
import threading
from datetime import datetime
from Adafruit_IO import Client, Feed, RequestError
# Sensor connections
from weath... |
sb.py | # -*- coding: utf-8 -*-
import LINETCR
import wikipedia
import urllib
import subprocess
import profile
import requests
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re
from bs4 import BeautifulSoup
from threading import Thread
from gtts import gT... |
guestsnapshotter.py | #!/usr/bin/env python
#
# VM Backup extension
#
# Copyright 2014 Microsoft 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
#
# U... |
run.py | import threading
from api import api
from heartBeat import HeartBeat
from config import API_port
def RunFlask(f, port):
f(host='0.0.0.0', port=port)
from config import Path
import os
os.chdir(Path)
if os.path.exists('BusyFlag'):
os.remove('BusyFlag')
global api
t1 = threading.Thread(target=RunFlask, args=(a... |
main.py | import argparse
import ctypes
import json
import time
import os
from pathlib import Path
import cv2
from modules import PeopleCounter
from depthai_utils import DepthAI
from multiprocessing import Process, Manager
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--model', default='person_detection_retail_... |
drop-graph.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" file ac... |
test_tuco.py | """FSM Base tests."""
import os
import threading
from datetime import timedelta
from unittest import mock
import pytest
import pytz
from tests.example_fsm import ExampleCreditCardFSM, StateHolder
from tuco import FSM, properties
from tuco.decorators import on_change, on_error
from tuco.exceptions import TucoAlreadyL... |
sh.py | #===============================================================================
# Copyright (C) 2011-2012 by Andrew Moffat
#
# 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 res... |
httpsrvreaper.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# -----------------
# title : HTTPsrvREAPER
# description : HTTP Server Header Scanner.
# author : Patryk 'agresor' Krawaczynski
# date : 01.08.2014
# version : 0.2
# usage : python3 httpsrvreaper.py [start net] [end... |
event.py | # -*- coding: utf-8 -*-
# pylint: disable=missing-docstring
##############################################################################
#
# Copyright (c) 2011, Martín Raúl Villalba
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (... |
etcd.py | """
etcd config implementation.
"""
import logging
from threading import Event, Thread
from ..compat import string_types
from ..exceptions import LibraryRequiredError
from ..structures import IgnoreCaseDict
from .core import BaseDataConfig
try:
import etcd
except:
etcd = None
__all__ = [
'EtcdConfig',
... |
utils.py | #!/usr/bin/env python
# Copyright (c) 2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2 License
# The full license information can be found in LICENSE.txt
# in the root directory of this project.
import logging
from six.moves import queue as Queue
import sys
import threading
import time
from ax... |
auto.py | # This file is part of Androguard.
#
# Copyright (C) 2012, Anthony Desnos <desnos at t0t0.fr>
# All rights reserved.
#
# Androguard is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of th... |
generate.py | # Each of these imports, besides the AlgoSDK are part of the Python Standard Library
import argparse # Handles the command line inputs
from multiprocessing import \
Process, Queue, Value, cpu_count # For running on multiple CPU cores
from queue import Empty # For helping r... |
test_random.py | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
TestCase, run_module_suite, assert_, assert_raises, assert_equal,
assert_warns, assert_no_warnings, assert_array_equal,
assert_array_almost_equal, suppress_warnings)
f... |
engine.py | """
Main BZT classes
Copyright 2015 BlazeMeter 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.