source
stringlengths
3
86
python
stringlengths
75
1.04M
multi_nodes.py
#!/usr/bin/env python import os import sys import time import logging from multiprocessing import Process, current_process from plow.rndaemon.main import RndFormatter from plow.rndaemon import conf class RndProcessHandler(object): def runTask(self, rtc): logger = logging.getLogger(__name__) lo...
benchmark02_int_arithmetic.py
#!/usr/bin/python import os import sys import threading import time from multiprocessing import Pool sys.path.append("./benchmark_cython_module") import benchmark_cython_module NUM_ITERATIONS = 1000000 NUM_TASKS = 50 def my_function1(in_value, out_value): out_value[in_value] = sum([(((z * z) + (z * z * 9)) /...
6-queued-threads.py
from threading import Thread import time import random import queue counter = 0 job_queue = queue.Queue() counter_queue = queue.Queue() def increment_manager(): global counter while True: increment = counter_queue.get() # this waits until an item is available and locks the queue time.sleep(...
server.py
#!/usr/bin/env python import sys import io import os import shutil from subprocess import Popen, PIPE from string import Template from struct import Struct from threading import Thread from time import sleep, time from http.server import HTTPServer, BaseHTTPRequestHandler from wsgiref.simple_server import make_server ...
team_manager.py
# -*- coding: utf-8 -*- """ This file is covered by the LICENSING file in the root of this project. """ import sys from werkzeug.exceptions import Forbidden sys.path.append("..") import uuid import time from flask import g import threading from mongoengine import Q, ValidationError from os.path import realpath, absp...
study_loader.py
import logging import os from psg_utils.errors import CouldNotLoadError from threading import Thread from threading import Event as ThreadEvent from multiprocessing import JoinableQueue, Process, Lock, Event, cpu_count from time import sleep logger = logging.getLogger(__name__) def _load_func(load_queue, results_que...
__init__.py
# -*- coding: utf-8 -*- """ Set up the Salt integration test suite """ # Import Python libs from __future__ import absolute_import, print_function import atexit import copy import errno import logging import multiprocessing import os import pprint import re import shutil import signal import socket import stat impor...
BridgeConnection.py
import threading from connections.Routine import Routine from connections.SyncConnection import SyncConnection import socket from data_base.Routines import Routines from utils import Networking from utils.DH_Encryption import Encryption from utils.SmartThread import SmartThread class BridgeConnection: """ A...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import threading import time import random from test import support from test.support import script_helper # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None # Used by Fi...
app_gui.py
# # 支持 CLI 和 GUI 执行方式 # 可通过输入 -h 参数查看帮助 # Author: Xiaohei # Updatetime: 2021-12-01 # import argparse from pathlib import Path import sys import subprocess import shlex import threading import tkinter as tk from tkinter import messagebox as mb from tkinter import filedialog as fd from tkinter import simpledialog as sd...
multithread2.py
''' 使用多线程的情况 - 模拟多个下载任务 ''' from random import randint from threading import Thread from time import time, sleep def download_task(filename): print('开始下载%s...' % filename) time_to_download = randint(5, 10) sleep(time_to_download) print('%s下载完成!耗费了%d秒' % (filename, time_to_download)) def main(): s...
threading_support.py
# -*- coding: utf-8 -*- from threading import Event, Thread def call_repeatedly(intervalSec, func, *args): stopped = Event() def loop(): while not stopped.wait(intervalSec): # the first call is in `interval` secs func(*args) Thread(target=loop).start() return stopped.set from...
__main__.py
##################################################################### # # # /main.pyw # # # # Copyright 2014, Monash University ...
meetAppServer.py
#!/usr/bin/python ''' * Copyright (c) 2017. * Author: Pranjal P. Joshi * Application: MeetApp * All rights reserved. ''' import tornado.httpserver import tornado.websocket import tornado.ioloop import tornado.web import socket import os import json import time import sys import ast import MySQLdb as mdb import p...
task_thread.py
import os import json import threading import time from time import sleep from xml.dom.minidom import parse from backend.settings import BASE_DIR from app_api.models import TestCase, TestTask, TaskCaseRelevance, TestResult from app_api.tasks import running # 测试数据文件 DATA_FILE_PATH = os.path.join(BASE_DIR, "app_api", "d...
threading.py
"""Synchronous IO wrappers with thread safety """ from concurrent.futures import Future from contextlib import contextmanager import functools import os from selectors import EVENT_READ import socket from queue import Queue, Full as QueueFull from threading import Lock, Thread from typing import Optional from jeepney ...
stress.py
import sys, random, optparse, time, json from itertools import islice from threading import Thread from collections import Counter from queue import Queue import requests from .utils import SplashServer, MockServer class StressTest(): def __init__(self, reqs, host="localhost:8050", requests=1000, concurrency=5...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
launcher.py
""" Simple experiment implementation """ from hops.experiment_impl.util import experiment_utils from hops import devices, tensorboard, hdfs import pydoop.hdfs import threading import time import json import os import six def _run(sc, map_fun, run_id, args_dict=None, local_logdir=False, name="no-name"): """ ...
simulator.py
import config as con import gates as gt import construct_circuit as cc import read_code as rc import plot_data as pd import error_handle as eh import arducom as ad import subcircuit_definition as sd import functional_node_sort as fns import analysis_data as analyd import time import thread import threading ...
rdd.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...
remote_logging.py
import logging import threading import zmq from zmq.log.handlers import PUBHandler from context import get_context logger = logging.getLogger("LoggingConfig") __log_context__ = {} class CustomFormatter(logging.Formatter): """Logging Formatter to add colors and count warning / errors""" grey = "\x1b[38;21...
test_socket.py
import inspect import multiprocessing import select import socket import unittest import pexpect import six import sdb HOST = '127.0.0.1' class TestSocketTrace(unittest.TestCase): def setUp(self): # call set_trace() in a child process so we can connect to it p = multiprocessing.Process(target=...
tests.py
import threading import time from unittest import mock from multiple_database.routers import TestRouter from django.core.exceptions import FieldError from django.db import ( DatabaseError, NotSupportedError, connection, connections, router, transaction, ) from django.test import ( TransactionTestCase, ove...
test_monitors.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import multiprocessing import os import pytest import subprocess import time import ray from ray.tests.utils import run_and_get_output def _test_cleanup_on_driver_exit(num_redis_shards): stdout = run_an...
keyboard_ctrl.py
""" 使用键盘控制机器人 - a/s/d/f: 移动 - q/e: 转向 """ import sys import os import numpy as np import pygame import time import threading # add parent directory to import path sys.path.append(os.path.split(os.path.abspath(os.path.dirname(__file__)))[0]) import rmepy MOVE_SPEED = 1.5 ROTATE_SPEED = 600 CMD_SEND_FREQ = 60...
process.py
""" Functions for daemonizing and otherwise modifying running processes """ import contextlib import copy import errno import functools import inspect import io import json import logging import multiprocessing import multiprocessing.util import os import queue import signal import socket import subprocess import sys i...
scripts.py
import time import functools import redis from flask import Flask, request, jsonify from threading import Thread from multiprocessing import Process # from multiprocessing import Pool pool = redis.ConnectionPool(host='127.0.0.1', port='6379', db=6, encoding...
agent_test.py
""" This file contains test cases to verify the correct implementation of the functions required for this project including minimax, alphabeta, and iterative deepening. The heuristic function is tested for conformance to the expected interface, but cannot be automatically assessed for correctness. STUDENTS SHOULD NOT...
test_tcp.py
import asyncio import asyncio.sslproto import gc import os import select import socket import unittest.mock import ssl import sys import threading import time import weakref from OpenSSL import SSL as openssl_ssl from uvloop import _testbase as tb SSL_HANDSHAKE_TIMEOUT = 15.0 class MyBaseProto(asyncio.Protocol): ...
local.py
import os import shutil from subprocess import Popen, PIPE # , STDOUT from contextlib import contextmanager import logging from threading import Thread from atomic_hpc.context_folder.abstract import VirtualDir from atomic_hpc.utils import splitall # python 3 to 2 compatibility try: basestring except NameError: ...
led-controller.py
#!/usr/bin/env python3 #vim: ts=4:et:ai:smartindent # Copyright 2022 Josh Harding # licensed under the terms of the MIT license, see LICENSE file # TODO: # - Allow remote config (e.g. from Hubitat) # - Save config changes to file # - Consider other functions like blink(), pulse(), strobe() from threading import Time...
backtester_stock_vc.py
import os import sys import sqlite3 import pandas as pd from matplotlib import pyplot as plt from multiprocessing import Process, Queue sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import DB_SETTING, DB_BACKTEST, DB_STOCK_TICK, GRAPH_PATH from utility.static import n...
test_controller.py
from threading import Thread, Event from mock import Mock from mitmproxy import controller from six.moves import queue from mitmproxy.exceptions import Kill from mitmproxy.proxy import DummyServer from netlib.tutils import raises class TMsg: pass class TestMaster(object): def test_simple(self): c...
qt.py
#!/usr/bin/env python3 # # 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 withou...
variantCallingLib.py
#!/usr/bin/env python """Library for calling variants """ import sys import os import glob import pandas as pd import numpy as np from random import shuffle from .signalAlignLib import SignalAlignment from .alignmentAnalysisLib import CallMethylation from multiprocessing import Process, Queue, current_process, Manager...
config_reader.py
import copy import multiprocessing as mp def process_configs(target, arg_parser, train_path=None, valid_path=None, log_path = None, save_path=None, seed=None): args, _ = arg_parser.parse_known_args() ctx = mp.get_context('spawn') for run_args, _run_config, _run_repeat in _yield_configs(arg_parser, args):...
commands.py
import re from argparse import ArgumentParser from multiprocessing import Pool, Manager, Process from pathlib import Path from .utils import UnityDocument YAML_HEADER = '%YAML' class UnityProjectTester: """ Class to run tests on a given Unity project folder """ AVAILABLE_COMMANDS = ('test_no_yaml_is...
toolbox_opencv.py
# -*- coding: utf-8 -*- import remi import remi.gui as gui import cv2 from threading import Timer, Thread import traceback import time def default_icon(name, view_w=1, view_h=0.6): icon = gui.Svg(50,30) icon.set_viewbox(-view_w/2,-view_h/2,view_w,view_h) text = gui.SvgText(0,0,name) text.style['font-s...
wsbticker.py
import praw import json import pprint from datetime import datetime import time import threading import tkinter as tk from yahoofinancials import YahooFinancials from tkinter import * import webbrowser import configparser import os from os import path import tkinter.messagebox config = configparser.Co...
test_capture.py
import contextlib import io import os import pickle import subprocess import sys import textwrap from io import StringIO from io import UnsupportedOperation from typing import List from typing import TextIO import pytest from _pytest import capture from _pytest.capture import CaptureManager from _pytest.main import Ex...
train.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import tensorflow as tf import threading import numpy as np import signal import random import os from network import ActorCriticFFNetwork from training_thread import A3CTrainingThread from utils.ops import log_uniform from utils.rmsprop_applier import RMSPropApplier fr...
_coreg_gui.py
"""Traits-based GUI for head-MRI coregistration""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) import os from ..externals.six.moves import queue import re from threading import Thread import warnings import numpy as np from scipy.spatial.distance import cdist # allow import...
backfinder.py
import os import sys import sqlite3 import pandas as pd from multiprocessing import Process, Queue sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) from utility.setting import db_tick, db_backfind from utility.static import now, strf_time, timedelta_sec, strp_time class BackFinder: def...
voasst.py
#!/bin/zsh # Description: Voice Assistant that could search the web and query Wolfram Alpha. # importing speech recognition package from google api import speech_recognition as sr import playsound # to play saved mp3 file from gtts import gTTS # google text to speech import os # to save/open files import wolframalpha...
logging_server.py
######## # Copyright (c) 2015 GigaSpaces Technologies Ltd. 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...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance logging.getLogger().setLevel(logging.INFO) logging.getLogger().addHandler(logging.StreamHandler()) SCRIPT_DIR = o...
plotmodel.py
from ast import literal_eval from collections import defaultdict import copy import itertools import threading from PySide2.QtWidgets import QItemDelegate, QColorDialog, QLineEdit, QMessageBox from PySide2.QtCore import QAbstractTableModel, QModelIndex, Qt, QSize, QEvent from PySide2.QtGui import QColor import openmc ...
server.py
#!/usr/bin/env python # Copyright (c) 2003-2006 ActiveState Software Inc. # # The MIT License # # 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 limita...
miner.py
import time import hashlib import json import requests import base64 from flask import Flask, request from multiprocessing import Process, Pipe import ecdsa from miner_config import MINER_ADDRESS, MINER_NODE_URL, PEER_NODES node = Flask(__name__) class Block: def __init__(self, index, timestamp, data, previous_...
executor.py
import time import threading import traceback import pickle import numpy as np from ..logger import create_null_logger from .utils import ( fetch_historical_predictions, fetch_current_predictions, df_weight_to_purchase_params_list, blend_predictions, floor_to_execution_start_at, calc_target_posi...
student_agent.py
# Student agent: Add your own agent here from collections import defaultdict, namedtuple from importlib.resources import path from random import random, choice, randint from shutil import move from agents.agent import Agent from store import register_agent from threading import Thread @register_agent("student_agent")...
spawn_a_process.py
#Spawn a Process – Section 3: Process Based Parallelism import multiprocessing """ Paralelismo de um objeto processo em três etapas: 1. criar o objeto processo 2. obj_process.start() -> inicia o processo 3 obj_process.join() -> espera até que o processo termine para ir para a próxima instrução da thread q...
minicap.py
import logging import socket import subprocess import time import os from datetime import datetime from .adapter import Adapter MINICAP_REMOTE_ADDR = "localabstract:minicap" ROTATION_CHECK_INTERVAL_S = 1 # Check rotation once per second class MinicapException(Exception): """ Exception in minicap connection ...
rat.py
from colorama import Fore import time, sys, os, ctypes, shutil def discordrat(): def spinner(): l = ['|', '/', '-', '\\'] for i in l+l: sys.stdout.write(f"""\r{y}[{b}#{y}]{w} Creating File... {i}""") sys.stdout.flush() time.sleep(0.2) print('\n'...
GUI.py
from PyQt5 import QtCore, QtGui, uic, QtWidgets from teachablerobots.src.GridSpace import * from teachablerobots.src.RobotTracker import * import sys import cv2 import numpy as np import threading from multiprocessing import Process, Queue, Event import time import socket import subprocess formXML = uic.loadUiType("/h...
manSpyV1.py
#!/usr/bin/python # -*- coding: utf-8 -*- # ____ # __ _ ___ ____ / __/__ __ __ # / ' \/ _ `/ _ \_\ \/ _ \/ // / #/_/_/_/\_,_/_//_/___/ .__/\_, / # /_/ /___/ # # Auteur : Mansour eddih # Outil : ManSpy # Usage : ./manspy.py 'exemple.com' (ou) python manspy.py 'exe...
watcher.py
import time import threading import logging class Monitor(object): def __init__(self): self.handlers = {} def file_changed(self, filename): logging.getLogger(__name__).info('File changed %s', filename) for v in self.handlers[filename]: v[0](filename, *v[1:]) def monito...
vision.py
#!/usr/bin/env python3 # R-pi computer vision # Credit to Screaming Chickens 3997 # This is meant to be used in conjuction with WPILib Raspberry Pi image: https://github.com/wpilibsuite/FRCVision-pi-gen import json import time import sys from threading import Thread from cscore import CameraServer, VideoSource from...
http500.py
import socketserver import threading from datetime import datetime from hpotter.env import http500_server, write_db from hpotter import tables # remember to put name in __init__.py Header = ''' HTTP/1.0 500 Internal Server Error Date: {now} Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips mod_fcgi...
xml_reporter_test.py
# Copyright 2017 The Abseil 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 ...
singleton.py
import threading import time class Single: _INSTANCE = None _LOCK = threading.RLock() def __init__(self, _new=False): if not _new: raise Exception("Don't instancing it direct") @classmethod def instance(cls): if cls._INSTANCE is None: with cls._...
report_server.py
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
main.py
import threading from __init__ import app, configuration import database.database_connection as database if database.connect_if_required(): database.database_engine.init_app(app) database.database_engine.create_all() def run_schedulers(): import time import schedule while True: schedule...
__init__.py
#python3 setup.py sdist bdist_wheel #twine upload --repository pypi dist/* import pandas as pd from PIL import Image import geopandas as gpd from pyproj import Proj, transform import base64 import numpy as np from io import BytesIO import time import requests import rasterio from datetime import datetime import math i...
UltrasonikSensor.py
import RPi.GPIO as GPIO from time import sleep, time from threading import Thread class UltrasonicSensor: def __init__(self, echo, trig, setup=GPIO.BOARD): self.echo = echo self.trig = trig self.Time = 0 self.currentValue = 0 GPIO.setmode(setup) GPIO.setup(self...
tool_debug_if.py
''' Debugging interface for the OBC firmware. ''' import argparse import subprocess import sys from threading import Thread from queue import Queue, Empty import signal import re import time from pathlib import Path from blessed import Terminal # Whether or not we're running on a POSIX system (linux, mac etc.) ON_POS...
spider_gui_mode.pyw
# -*- coding: UTF-8 -*- from bilispider import spider import os import sys import time import queue import requests import threading import tkinter as tk import tkinter.ttk as ttk import tkinter.font as tkFont import tkinter.messagebox as tkmsgbox from tkinter.filedialog import askdirectory class spider_gui_mode(spider...
inplace_upgrade.py
#!/usr/bin/env python import json import logging import os import psutil import psycopg2 import shlex import shutil import subprocess import sys import time import yaml from collections import defaultdict from threading import Thread from multiprocessing.pool import ThreadPool logger = logging.getLogger(__name__) RS...
triggers.py
from functools import partial import multiprocessing import os import re import setproctitle import signal import time from shakenfist import baseobject from shakenfist.config import config from shakenfist.daemons import daemon from shakenfist import db from shakenfist import etcd from shakenfist import logutil from s...
events.py
# Event managing. # # Allows catching events with functions instead of classes. # Tracks registered events and allows clean-up with one function call. # All event callbacks are also wrapped in an error.ErrorCatcher(). # # This file is part of thomasa88lib, a library of useful Fusion 360 # add-in/script functions. # # ...
greenenv.py
# -*- coding: utf-8 -*- """ Run scripts in a clean virtual environment. Useful for testing, building, and deploying. :author: Andrew B Godbehere :date: 4/21/16 """ import venv import sys import os from urllib.parse import urlparse from urllib.request import urlretrieve from threading import Thread from subprocess im...
Triggerwithcommandcenter.py
from WhatsappTrigger import whatsapp,WhatsappBot # import all required modules ( main modules ) from whatsappCommandExcutor.CommandExcutor import WpReciverCommand # this module will reciver msg aka command from whatsapp { main modules } from whatsappCommandExcutor.hook import CommandHook # this modules this hook whats...
multi_thread.py
import requests import time from threading import Thread urls = [ f'https://www.cnblogs.com/#p{page}' for page in range(1, 51) ] def craw(url): response = requests.get(url).text # 单线程 def single_thread(urls): start = time.time() print('单线程 开始') for url in urls: craw(url) print('...
commands.py
# Copyright (c) 2013-2014 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # DESCRIPTION # This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest # It provides a class and methods for running commands on the host in a convienent way for tests. import os import s...
AudioServerStream.py
import errno import threading from six.moves import queue import socket import time # Audio recording parameters RATE = 44100 CHUNK = 1600 class AudioServerStream(object): """Opens a recording stream as a generator yielding the audio chunks.""" def __init__(self, rate=RATE, chunk=CHUNK, server_name='127.0.0....
coin_database.py
# Copyright (c) 2021, coincell # 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 the foll...
async.py
import argparse import asyncio import collections import cProfile import gc import random import socket from statistics import stdev, mean, median import string import sys from multiprocessing import Process, set_start_method, Barrier import aiohttp def find_port(): s = socket.socket(socket.AF_INET, socket.SOCK_...
bot.py
import logging import time import getpass import tinybot log = logging.getLogger(__name__) def main(): room_name = raw_input('Enter room name: ').strip() if tinybot.pinylib.CONFIG.ACCOUNT and tinybot.pinylib.CONFIG.PASSWORD: bot = tinybot.TinychatBot(roomname=room_name, account=tinybot.pinylib.CONFIG...
Chap10_Example10.3.py
from threading import * def my_msgprint(): print("The above line is executed by: ", current_thread().getName()) print("Main Thread creating child object") mthread = Thread(target = my_msgprint, name = 'MyChildThread') print("Main Thread starting child thread") mthread.start()
calsoft.py
import os import time import sys import subprocess import threading import json CALSOFT_BIN_PATH = "/usr/local/calsoft/iscsi-pcts-v1.5/bin" ''' 11/26/2015 disable tc_login_11_2 and tc_login_11_4 RFC 7143 6.3 Neither the initiator nor the target should attempt to declare or negotiate a parameter more than once during ...
run.py
# -*- coding: utf-8 -*- __author__ = "苦叶子" """ 公众号: 开源优测 Email: lymking@foxmail.com """ import sys import codecs from flask import current_app, session, url_for, g from flask_mail import Mail, Message import threading from threading import Thread import multiprocessing import time import smtplib from email.mime....
_threads.py
import threading import queue as stdlib_queue from itertools import count import attr import outcome import trio from ._sync import CapacityLimiter from ._core import enable_ki_protection, disable_ki_protection, RunVar, TrioToken # Global due to Threading API, thread local storage for trio token TOKEN_LOCAL = threa...
email.py
from flask import current_app, render_template from . import mail from flask_mail import Message from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_mail(to, subject, template, **kwargs): app = current_app._get_current_object() msg = Messa...
acs_host.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from itertools import chain from signal import signal, SIGINT, SIG_DFL from socket import SOL_SOCKET, SO_BROADCAST from subprocess import Popen, PIPE from sys import argv, exit from time import time, sleep from threading import Thread import SocketServer from PyQt5 import...
sgf2score.py
#!/usr/bin/env python3 # Copyright 2017 Karl Sundequist Blomdahl <karl.sundequist.blomdahl@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICE...
lambda_executors.py
import base64 import contextlib import glob import json import logging import os import re import subprocess import sys import threading import time import traceback from multiprocessing import Process, Queue from typing import Any, Dict, List, Optional, Tuple, Union from localstack import config from localstack.servi...
moviescreen.py
import cfg from kivy.uix.screenmanager import Screen from kivy.lang import Builder from kivy.properties import * import ytvApi as ytv from threading import Thread Builder.load_string(''' <MovieScreen>: name:'moviescreen' MDBoxLayout: orientation:'vertical' spacing:dp(10) MDBoxLayout: size_...
train_A3C.py
import argparse import itertools import os import threading import time import tensorflow as tf from atari_env import A_DIM from atari_env import S_DIM from atari_env import make_env from evaluate import Evaluate from net import Net from utils import print_params_nums from worker import Worker def main(args): i...
Main.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from multiprocessing import Process from init import Settings def utilityThread(settings, sess, saver, globalEpisodes, coord): import time lastSave = sess.run(globalEpisodes) while not coord.shou...
SimBA.py
import warnings warnings.filterwarnings('ignore',category=FutureWarning) warnings.filterwarnings('ignore',category=DeprecationWarning) import os import time import subprocess import itertools #import deeplabcut import csv import sys from tkinter import * from tkinter.filedialog import askopenfilename,askdirectory from ...
_roi.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ | `@purpose`: Generate regions of interest that can be used for data processing and analysis. | `@date`: Created on Sat May 1 15:12:38 2019 | `@author`: Semeon Risom | `@email`: semeon.risom@gmail.com | `@url`: https://semeon.io/d/imhr """ # allowed imports __a...
BROKEN with Music.py
''' Doc_String ''' #################################################################### #################################################################### def main_loop( App ): "Create QUEUE and start progress_bar process" queue = Queue() "Start a process that listens for the nex...
test_failure.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import pyarrow.plasma as plasma import pytest import sys import tempfile import threading import time import numpy as np import redis import ray import ray.ray_constants as ray_constants...
monitor_response_times.py
import argparse import csv import functools import json import logging import os import psutil import threading import time from abc import ABC, abstractmethod from dataclasses import dataclass from datetime import datetime, timezone from enum import Enum from pathlib import Path from threading import Thread from typi...
watchers.py
from threading import Thread, Event from invoke.vendor.six.moves.queue import Queue, Empty from invoke import Responder, FailingResponder, ResponseNotAccepted # NOTE: StreamWatcher is basically just an interface/protocol; no behavior to # test of its own. So this file tests Responder primarily, and some subclasses....
simulation_2.py
''' Created on Oct 12, 2016 @author: mwitt_000 ''' from src.Network import network_2 from src.Link import link_2 import threading from time import sleep ##configuration parameters router_queue_size = 0 #0 means unlimited simulation_time = 1 #give the network sufficient time to transfer all packets before quitting if...
request_contract_details.py
# Copyright (C) 2019 LYNX B.V. All rights reserved. # Import ibapi deps from ibapi import wrapper from ibapi.client import EClient from ibapi.contract import * from threading import Thread from datetime import datetime from time import sleep CONTRACT_ID = 4001 class Wrapper(wrapper.EWrapper): def __init__(sel...
hauptlogik.py
# -*- coding: utf-8 -*- import displayController, sensorenController, ledController, schalterController, speicherung import time, math from apscheduler.schedulers.blocking import BlockingScheduler from threading import Thread versionNummer = "1.0" displayModus = 0 #0 = Backlight aus + LED an; 1 = Backlight aus + LED a...
test.py
from Country.Poland.News.WiadomosciGazetaPl.NewsScraper import NewsScraper from LanguageProcessing.Translation.GoogleTranslator import GoogleTranslator from Scraper.Writters.FileWritter import FileWriter from Requests.Requester import Requester from threading import Thread translator = GoogleTranslator() # today news ...