source
stringlengths
3
86
python
stringlengths
75
1.04M
GUI Super Wonder Captain V4.2.py
# GUI Super Wonder Captain.py # import io # Provides to use IO import datetime # Provides datetime access. import hashlib # Provides to use hash codes import json # Provides to use json import os # Provi...
twitter_sentiment_election.py
import threading import json from time import sleep import twitter from nltk.sentiment.vader import SentimentIntensityAnalyzer # Define Twitter OAuth credentials. CONSUMER_KEY = "CONSUMER_KEY" CONSUMER_SECRET = "CONSUMER_SECRET" ACCESS_TOKEN = "ACCESS_TOKEN" ACCESS_TOKEN_SECRET = "ACCESS_TOKEN_SECRET" # D...
main.py
""" TODO: """ import time import logging import os from os.path import join import sys import configparser import threading import argparse from . import methods from . import args from . import focus # Global int to track # of errors d...
chat_client.py
#!/usr/bin/env python # -*- coding: utf-8 -*- "Tkinter GUI chat client""" import socket #Biblioteca para socket import threading #Bibiioteca para manejar hilos. import Tkinter #biblioteca para GUI #----Construimos socket---- HOST = input('Host: ') PORT = input('Port: ') if not PORT: PORT = 9999 else: PORT = ...
wifijammer.py
#!/usr/bin/env python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy from scapy.all import * conf.verb = 0 # Scapy I thought I told you to shut up import os import sys import time from threading import Thread, Lock from subprocess import Popen, PIPE from signal import SIGINT,...
miniterm.py
#!/usr/bin/env python # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import threading import serial from serial.tools.list_ports impo...
mainwindow.py
"""The Qt MainWindow for the QtConsole This is a tabbed pseudo-terminal of IPython sessions, with a menu bar for common actions. Authors: * Evan Patterson * Min RK * Erik Tollerud * Fernando Perez * Bussonnier Matthias * Thomas Kluyver * Paul Ivanov """ #------------------------------------------------------------...
main.py
import requests import json import pyttsx3 import speech_recognition as sr import re import threading import time API_KEY= "t1zcRzKZR3q3" PROJECT_TOKEN= "t1Oa2KH2oM0N" RUN_TOKEN="txCLmJmi8FwO" class Data: def __init__(self, api_key, project_token): self.api_key = api_key self.project_token = p...
threading_join.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Lyon # import threading # import time # class MyThread(threading.Thread): # def __init__(self,name): # threading.Thread.__init__(self) # self.name = name # # def run(self): # print("I am %s" % self.name) # time.sleep(2) # # if...
TestE2EScenarios.py
# # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # import logging from threading import Thread import time import unittest from mlos.Logger import create_logger from mlos.Examples.SmartCache import SmartCacheWorkloadGenerator, SmartCache from mlos.Examples.SmartCache.TelemetryAgg...
houseList.py
import random import threading import joblib from flask import Blueprint, render_template, session, flash, redirect, request, url_for from src.extension import db from src.Models.Houses import House from src.Models.Targets import Targets from src.Models.Users import User from src.Utility import enumMachine import math ...
py_ad_1_3.py
""" Section 1 Multithreading - Thread (1) - Basic Keyword - Threading basic """ import logging import threading import time # 스레드 실행 함수 def thread_func(name): logging.info("Sub-Thread %s: starting", name) time.sleep(3) logging.info("Sub-Thread %s: finishing", name) # 메인 영역 if __name__ == "__main__": ...
log.py
import json import sys import time from pathlib2 import Path from logging import LogRecord, getLogger, basicConfig, getLevelName, INFO, WARNING, Formatter, makeLogRecord, warning from logging.handlers import BufferingHandler from threading import Thread, Event from six.moves.queue import Queue from ...backend_api.serv...
utils.py
# -*- coding: utf-8 -*- # Stdlib imports import base64 import datetime import hashlib import json import jwt import logging import re import threading from io import BytesIO # Imports from your apps from operator import add # Third-party app imports from codicefiscale import codicefiscale from dateutil import tz fro...
main.py
# /* # * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with # * this work for additional information regarding copyright ownership. # * The OpenAirInterface Software Alliance licenses this file to You under # * the OAI Pub...
crawling-scrap.py
from urllib import urlopen import re import threading from multiprocessing import Queue def findkeywordlvl(strwebsiteinp, strmatch, queueget): if strmatch.startswith("src="): strmatch = strmatch[5:len(strmatch)] elif strmatch.startswith("href="): strmatch = strmatch[6:len(strmatch)] if n...
admin_lib.py
# Copyright (c) 2006-2007 Open Source Applications Foundation # Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com> # Copyright (c) 2009 Canonical 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...
stress.py
import sys, os from threading import Thread def stress(name): os.system('python whole_user_test.py ' + name) for i in range(int(sys.argv[1])): t = Thread(target=stress, args=( ('user' + str(i),) )) t.start()
pants_daemon.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
bot.py
import asyncio import logging import threading import unicodedata import discord from decouple import config from discord.utils import get from django.core.validators import validate_email from django.core.exceptions import ValidationError from pyfiglet import figlet_format from .utils import send_verify_mail from . ...
handlers.py
# Copyright (c) 2017 Mark D. Hill and David A. Wood # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must retain the above copyright # notice, this list of conditio...
broom.py
#!/usr/bin/env import random from collections import namedtuple from typing import List from itertools import combinations from functools import reduce import threading import time import simple_app from .simple_app import playround thread = threading.Thread(target=simple_app.playround) thread.start() result_availabl...
Device.py
import abc from prometheus_client import Gauge from threading import Thread import time import signal class PromVar: def __init__(self, name, description=""): self.name = name self.value = None self.description = description self.lastUpdate_ms = int(time.time() * 1000) self...
module.py
#!/usr/bin/env python # # Copyright 2007 Google 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 o...
batcher_process.py
import logging import os import pickle import time import json import cv2 import copy import numpy as np from abc import ABC, abstractmethod from typing import Dict from configs import NXS_CONFIG from nxs_libs.interface.backend.input import ( BackendInputInterfaceFactory, ) from nxs_libs.interface.backend.output im...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional from PyQt5.QtCore i...
CO2Meter.py
import sys import fcntl import threading import weakref CO2METER_CO2 = 0x50 CO2METER_TEMP = 0x42 CO2METER_HUM = 0x44 HIDIOCSFEATURE_9 = 0xC0094806 def _co2_worker(weak_self): while True: self = weak_self() if self is None: break self._read_data() if not self._running: ...
test_rsocket.py
from __future__ import print_function import pytest import errno, os, sys from rpython.rlib import rsocket from rpython.rlib.rsocket import * import socket as cpy_socket from rpython.translator.c.test.test_genc import compile from rpython.rlib.buffer import RawByteBuffer try: import fcntl except ImportError: f...
iCopy.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os, sys, logging from telegram import Bot from telegram.utils.request import Request as TGRequest from utils import load from telegram.ext import ( Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, ConversationHandler, ) fr...
bldc_control.py
from tuw.Serial import * from tuw.Figure import * from matplotlib import pyplot as plt import string default_port='/dev/ttyACM0' ser = MySerial(default_port) def readPort(fig): last = MyParam() last.target = np.NaN last.steering = 0 last.kp = np.NaN last.ki = np.NaN last.kd = np.NaN while T...
garmin_sync.py
# -*- coding: utf-8 -*- """ Python 3 API wrapper for Garmin Connect to get your statistics. Copy most code from https://github.com/cyberjunky/python-garminconnect """ import argparse import json import logging import os import time import re from threading import Thread from enum import Enum, auto import requests fro...
client.py
import socket import threading import os import signal from sys import platform import sys import base64 class clientType: PORT = 5050 DISCONNECT_MESSAGE = "exit" passkey = '' IP = '' username = '' client = '' def __init__(self): if platform == "linux" or platform == "linux2" or p...
client.py
import threading from datetime import datetime from functools import lru_cache from typing import Any import zmq from zmq.backend.cython.constants import NOBLOCK from .common import HEARTBEAT_TOPIC, HEARTBEAT_TOLERANCE class RemoteException(Exception): """ RPC remote exception """ def __init__(self...
recipe-576910.py
#! /usr/bin/python import threading import queue import time import sys Instance = None def getInstance(): global Instance if not Instance: Instance = ThreadPool() return Instance class ThreadPool: def __init__(self,maxWorkers = 10): self.tasks = queue.Queue() self.workers ...
_entry.py
from tkinter import * from center_tk import Center_root from tkinter.scrolledtext import ScrolledText import os , threading from tkinter import ttk class _entry(Entry) : def __init__(self , perent , *args , **kwargs): Entry.__init__(self , perent , *args , **kwargs) self.pop = Menu(self ,tearoff =0 ...
windows.py
from ...third_party import WebsocketServer # type: ignore from .configurations import ConfigManager from .configurations import WindowConfigManager from .diagnostics import ensure_diagnostics_panel from .logging import debug from .logging import exception_log from .message_request_handler import MessageRequestHandler ...
zmq_robot_interface.py
# # MIT License # # Copyright (c) 2020-2021 NVIDIA CORPORATION. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), # to deal in the Software without restriction, including without limitation # the rights to use, copy, ...
local-send-recv.py
""" Benchmark send receive on one machine """ import argparse import asyncio import multiprocessing as mp from time import perf_counter as clock from distributed.utils import format_bytes, parse_bytes import numpy import ucp mp = mp.get_context("spawn") def server(queue, args): ucp.init() if args.object_ty...
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. All rights reserved. # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # noti...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import copy import io import os import re import shutil import tempfile import threading import time import unittest import warnings from django.conf import...
main.py
# ---------------------------------------------------------------------# # Name - IR&NECDataCollect.py # Description - Reads data from the IR sensor but uses the official NEC Protocol (command line version) # Author - Lime Parallelogram # Licence - Attribution Lime # Date - 06/07/19 - 18/08/19 # -----------------------...
test_notificationlog.py
from math import ceil from threading import Thread from uuid import uuid4 from eventsourcing.application.notificationlog import ( BigArrayNotificationLog, NotificationLogReader, RecordManagerNotificationLog, ) from eventsourcing.domain.model.events import DomainEvent from eventsourcing.infrastructure.repos...
test_daemon.py
# Copyright 2018 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 # # Unless required by applicable law or agreed to in...
stable_radical_opt_from_initial_center.py
import argparse import logging import os import pathlib import sys from typing import Tuple import numpy as np import pandas as pd import rdkit from rdkit import Chem from sqlalchemy import create_engine logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) run_id = 'stable_radical_optimizatio...
lerp_finger_from_myo.py
import multiprocessing import re from pyomyo import Myo, emg_mode import numpy as np import matplotlib.pyplot as plt from matplotlib import animation import bone import serial_utils as s # Use device manager to find the Arduino's serial port. COM_PORT = "COM9" RESET_SCALE = True LEGACY_DECODE = False # If false, will...
core.py
# -*- coding: utf-8 -*- # # 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 #...
timestep_dataset_test.py
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
managers.py
# # Module providing manager classes for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token', 'SharedMemoryManager' ] # # Imports # import sys...
depass.py
#-*- coding: utf-8 -*- from pykeyboard import PyKeyboard import itertools import time import tkinter as tk import tkinter.messagebox import threading import inspect import ctypes import win32con import ctypes.wintypes import pygame,os,sys from tkinter import ttk global T1,T2 ...
real_time_big_deal.py
# -*-coding=utf-8-*- __author__ = 'Rocky' ''' http://30daydo.com Contact: weigesysu@qq.com ''' import datetime import tushare as ts import pandas as pd import time,os,threading import numpy as np from toolkit import Toolkit pd.set_option('display.max_rows',None) class BigMonitor(): def __init__(self): path=...
mp10manager.py
#!/usr/bin/env python """mp10manager.py: Use multiprocessing.Manager. Usage: mp10manager.py """ import multiprocessing as mp def f(d, l): d[1] = '1' d['2'] = 2 d[0.25] = None l.reverse() def main(): with mp.Manager() as mgr: d = mgr.dict() l = mgr.list(range(10)) p = mp....
dataloader_iter.py
# Copyright (c) 2020 PaddlePaddle 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 appli...
run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ fMRI preprocessing workflow ===== """ import os import os.path as op from pathlib import Path import logging import sys import gc import re import uuid import json import tempfile import psutil import warnings import subprocess from argparse import ArgumentParser from...
demo1.py
from os import system import threading import pandas as pd import numpy as np import matplotlib.pyplot as plt from datetime import datetime as dt import time global info info = {} def extract_data(pid,refreshRate): system("top -H -p "+pid+" -d "+refreshRate+" -b | grep "+pid+" >> "+pid+refreshRate+".txt") de...
detector.py
import os import sys from threading import Thread from queue import Queue import cv2 import scipy.misc import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.presets import SimpleTransform class DetectionLoader(): def __init__(self, input_source, detector, cfg, opt, mode='image...
dvt.py
import enum import queue import typing from collections import defaultdict from threading import Thread, Event from ..util import logging, Log from ..util.dtx_msg import DTXMessage, MessageAux, dtx_message_header, object_to_aux from ..util.exceptions import MuxError from ..util.variables import LOG log = Log.getLogge...
test_sne.py
# SPDX-License-Identifier: GPL-2.0 """Validate SNE implementation for TCP-AO""" import logging import socket import subprocess from contextlib import ExitStack from ipaddress import ip_address from threading import Thread import pytest import waiting from scapy.layers.inet import TCP from scapy.packet import Packet, ...
test_index.py
import pytest from base.client_base import TestcaseBase from base.index_wrapper import ApiIndexWrapper from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from common.code_mapping import CollectionErro...
results_watcher.py
#!/usr/bin/python3 ''' * Copyright (C) 2019-2020 Intel Corporation. * * SPDX-License-Identifier: BSD-3-Clause ''' import json import time from threading import Thread WATCHER_POLL_TIME = 0.01 class ResultsWatcher: def __init__(self, filename, sleep_time=WATCHER_POLL_TIME): self.filename = filename ...
manager.py
#!/usr/bin/env python3 import datetime import importlib import os import sys import fcntl import errno import signal import shutil import subprocess import textwrap import time import traceback from multiprocessing import Process from typing import Dict from common.basedir import BASEDIR from common.spinner import Sp...
multiprocess_utils.py
import logging from multiprocessing import Process from time import time import numpy as np import tensorflow as tf from multiprocessing.sharedctypes import RawArray def split_share_data(rows, cols, coocs, split_n): """ This method takes the rows, cols and cooc(currence) from the glove co-occurrence sparse m...
mesh_pool.py
import torch import torch.nn as nn from threading import Thread from models.layers.mesh_union import MeshUnion import numpy as np from heapq import heappop, heapify import pdb class MeshPool(nn.Module): def __init__(self, target, multi_thread=False): print(f'target edges: {target}') super(Mes...
loadBalancerPrimary.py
# receives request from the clients and forwards it to appropriate edgeServer/originServer import sys import socket from threading import Timer, Thread, Lock import time sys.path.insert(0, "../") from config import * from messages.dns_request_message import * from messages.lb_heartbeat_message import * from messages...
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...
keep_alive.py
#***************************************************************************# # # # MCDramaBot - A Discord Bot That Causes Drama # # https://github.com/CrankySupertoon/MCDramaBot # # Copyri...
map_reduce.py
# -*- coding: utf-8 -*- r""" Parallel computations using RecursivelyEnumeratedSet and Map-Reduce There is an efficient way to distribute computations on a set `S` of objects defined by :func:`RecursivelyEnumeratedSet` (see :mod:`sage.sets.recursively_enumerated_set` for more details) over which one would like to perfo...
emails.py
from threading import Thread from flask import url_for, current_app from flask_mail import Message from bluelog.extensions import mail def _send_async_mail(app, message): with app.app_context(): mail.send(message) def send_mail(subject, to, html): app = current_app._get_current_object() messag...
test_server.py
from unittest import TestCase import asyncio import websockets import threading as th import time from server.server import Server from server import event as e class TestServer(TestCase): def test_server_can_be_instantiated(self): Server() def test_msg_handlers_are_annotated_and_found_correctly(...
druid.py
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
utils.py
import re import json import requests import hashlib from app import app from distutils.version import StrictVersion from urllib.parse import urlparse from datetime import datetime, timedelta from threading import Thread from .certutil import KEY_FILE, CERT_FILE if app.config['SAML_ENABLED']: from onelogin.saml2...
main.py
import random import sys import time from threading import Thread, Lock, Event mutex = Lock() # Barbershop class # Initialized with attributes such as the barber object # As well as the number of seats, time interval for customers to arrive, number of customers, and the range for the duration of a haircut...
__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...
__init__.py
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) an...
utils.py
import threading def create_thread(obj): obj_thread = threading.Thread(target=obj.run, daemon=True) obj_thread.start() while obj_thread.isAlive(): obj_thread.join(1) obj_response = obj.get_response() return obj_response
test.py
# Copyright 2012 Mozilla Foundation # # 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...
mdocker.py
#!/usr/bin/env python #-*- encoding: utf-8 -*- from datetime import datetime from config import * from . import mdb, apush dclient = variant.dclient def get_dkinfo(): try: dclient.ping() except Exception as e: return {"errmsg": str(e)} dkinfo = dclient.info() cpu_usage, mem_usage = ...
deployment.py
import os import wasm3, base64, time, traceback, os from multiprocessing import Process from fastapi import FastAPI, Request from gpiozero import LED data_dir = f"{os.getcwd()}/../data" wasm_process_handler = None def update_partial(file, sha256hash, deployment_id): inactive_deployment = get_inactive_deployment(...
custom.py
# pylint: disable=too-many-lines # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -----------------------------------...
silverstone.py
import requests import tempfile import shutil import pysftp import os import threading import time import re import logging import paramiko from urllib3.connection import ConnectTimeoutError from dct.util.model import ModelMetadata, Model class DeepRacerCar: def __init__(self, ip, ssh_password=None, name="Car", ...
node_test.py
import time from pyvent.node import Node import nose.tools as nt from multiprocessing import Process, Value S = Value('i', 0) def send_fn(signal='event', delay=0.25, **kargs): n = Node(id='process', server=False) time.sleep(delay) n.send(signal, **kargs) time.sleep(delay) def listen_fn(signal='e...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import struct import operator import pickle import weakr...
popen_spawn.py
"""Provides an interface like pexpect.spawn interface using subprocess.Popen """ import os import threading import subprocess import sys import time import signal import shlex try: from queue import Queue, Empty # Python 3 except ImportError: from Queue import Queue, Empty # Python 2 from .spawnbase import ...
videoCapture.py
import cv2 import queue import threading class VideoCapture(object): def __init__(self, video_stream): self.cap = cv2.VideoCapture(video_stream) self.q = queue.Queue() self.video_stream = video_stream self.t = threading.Thread(target=self._reader) self.t.daemon = True ...
Line-dul.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from LINETCR import server from datetime import datetime import time,random,sys,json,codecs,threading,glob,requests,urllib import re,string,os,shutil,urllib2,urllib3,subprocess from urllib import urlopen import requests,tempfile #kk = LINET...
pcaspy_server.py
import numpy as np import time from pcaspy import Driver, SimpleServer, Severity import threading as th import queue import thm1176MFusbtmc as thm1176MF from usbtmc.usbtmc import find_device prefix = 'METROLAB:' pvdb = { 'Block' : {'type': 'int', 'value': 1}, 'Average' : {'type': 'int', 'value': 200...
runtests.py
#!/usr/bin/env python from __future__ import print_function import atexit import os import sys import re import gc import heapq import locale import shutil import time import unittest import doctest import operator import subprocess import tempfile import traceback import warnings import zlib import glob from context...
loader.py
from itertools import cycle from shutil import get_terminal_size from threading import Thread from time import sleep class Loader: def __init__(self, desc="Loading...", end="Done!", timeout=0.1): """ A loader-like context manager Args: desc (str, optional): The loa...
data_utils.py
# Lint as python3 # Copyright 2018 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 r...
screens.py
import asyncio from decimal import Decimal import threading from typing import TYPE_CHECKING, List, Optional, Dict, Any from kivy.app import App from kivy.clock import Clock from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.factory import Factory from kivy.uix.recycleview import Recycl...
irdc_v3.py
# import serial from flask import Flask from flask import json from flask import Response from flask import request import logging import os import threading import time import datetime import signal from flask_cors import CORS from pyfirmata import Arduino, util from time import sleep up_relay_p...
worker.py
import logging import os import shutil from subprocess import PIPE, Popen import threading import time import traceback import socket import http.client import sys from typing import Optional, Set, Dict import psutil import docker from codalab.lib.telemetry_util import capture_exception, using_sentry import codalab.w...
cassandra_class.py
""" The MIT License (MIT) Copyright (c) Datos IO, Inc. 2015. 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 limitation the rights to use, copy, modify, merg...
test_pastebin_plugin.py
import logging import re import socket import threading import time import tkinter import traceback from http.client import RemoteDisconnected import pytest import requests from pygments.lexers import PythonLexer, TextLexer, get_lexer_by_name from porcupine import get_main_window, utils from porcupine.plugins.pastebi...
5min_alert_host_disk_read_iops.py
''' Test about monitor trigger on host disk reading iops in five minutes @author: Songtao,Haochen ''' import os import test_stub import random import time import threading import zstacklib.utils.ssh as ssh import zstackwoodpecker.test_util as test_util import zstackwoodpecker.operations.resource_oper...
vulClassTester.py
#! /usr/bin/env python3 """ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # This file has the custom PPAC methods to run tests on qemu|fpga. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # """ import sys, os from besspin.cwesEvaluation.compat import cwesEvaluationCompatibi...
Engine.py
# coding: utf-8 # Author: Lyderic LEFEBVRE # Twitter: @lydericlefebvre # Mail: lylefebvre.infosec@gmail.com # LinkedIn: https://www.linkedin.com/in/lydericlefebvre # Imports import logging, traceback from core.User import * from core.Resources import * from core.Targets import * from core.SprayLove import * from co...
main.py
# /usr/bin/env python # -*- coding:utf-8 -*- # author: Handsome Lu time:2020/4/30 import shutil import os import cv2 from glob import glob from PIL import Image from openpyxl import Workbook from openpyxl import utils from openpyxl.styles import PatternFill from PyQt5.QtWidgets import QApplication, QMain...
smarthome.py
# -*- coding: utf-8 -*- import hashlib import os import re import subprocess import sys import threading from collections.abc import Mapping from itertools import product from pid import PidFile import requests import trait from auth import * from const import (DOMOTICZ_TO_GOOGLE_TYPES, ERR_FUNCTION_NOT_SUPPORTED, E...
conftest.py
try: from http import server except ImportError: import BaseHTTPServer as server import socket import threading import pytest from tests.servers import login_server as login_mock from tests.servers import api_server as api_mock @pytest.fixture(scope="session") def login_server_port(): s = socket.socket(...
login.py
import uuid as _uuid from threading import Thread import importlib.util from pathlib import Path import rpy2 import rpy2.rinterface import rpy2.rinterface_lib from rpy2.robjects.packages import importr from rpy2.robjects import r import fdrtd.server from fdrtd.server.microservice import Microservice try: from fdr...