source
stringlengths
3
86
python
stringlengths
75
1.04M
cut_words_v4.py
#coding=utf-8 import os import sys import json sys.path.append("/home/minghaiyan/thirdparty/jieba-master") import re import time import datetime import pickle import jieba import jieba.analyse jieba.load_userdict("user.dict") from text_feature import TextFeature from get_label_words import LabelWords from multiprocess...
test_b2_command_line.py
#!/usr/bin/env python2 ###################################################################### # # File: test_b2_command_line.py # # Copyright 2019 Backblaze Inc. All Rights Reserved. # # License https://www.backblaze.com/using_b2_code.html # ###################################################################### from _...
core.py
# Copyright 2011-2013 James McCauley # # 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 ...
pitmSsrRelay.py
#!/usr/bin/python # piTempBuzzer import os import json import hashlib import json import struct import socket import syslog import sys import threading import time from pitmCfg import pitmCfg from pitmLCDisplay import * from gpiotools import gpiotools class pitmSsrRelay: def __init__(self): self.logging=3 ...
eyes.py
#!/usr/bin/python # This is a hasty port of the Teensy eyes code to Python...all kludgey with # an embarrassing number of globals in the frame() function and stuff. # Needed to get SOMETHING working, can focus on improvements next. import board import busio import serial import adafruit_tsl2591 import argparse import ...
common_utils.py
r"""Importing this file must **not** initialize CUDA context. test_distributed relies on this assumption to properly run. This means that when this is imported no CUDA calls shall be made, including torch.cuda.device_count(), etc. torch.testing._internal.common_cuda.py can freely initialize CUDA context when imported....
util.py
# -*- coding: utf-8 -*- # Licensed under a 3-clause BSD style license - see LICENSE.rst """ Various low-level utilities. """ from __future__ import (absolute_import, division, print_function, unicode_literals) import datetime import json import math import os import re import select import si...
index.py
import os import cv2 import time import imutils import threading import numpy as np from playsound import playsound from imutils.video import VideoStream from tensorflow.keras.models import load_model from tensorflow.keras.preprocessing.image import img_to_array from tensorflow.keras.applications.mobilenet_v2 import pr...
manager.py
import argparse # noqa import atexit # noqa import codecs # noqa import copy # noqa import errno # noqa import fnmatch # noqa import hashlib # noqa import os # noqa import shutil # noqa import signal # noqa import sys # noqa import threading # noqa import traceback # noqa from contextlib import contextmana...
gerbil.py
""" Gerbil - Copyright (c) 2015 Michael Franzl 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, merge, publish, di...
ray_dispatcher.py
# -*- coding: utf-8 -*- import os import time import random import string import signal import multiprocessing from datetime import datetime import psutil import ray from aw_nas.utils.exception import expect, ConfigException from aw_nas.trainer.async_trainer import BaseDispatcher class KillSignal(ray.experimental.s...
get_name_from_camera_feed.py
import face_recognition import numpy as np import cv2, queue, threading, time import requests, os, re # bufferless VideoCapture class VideoCapture: def __init__(self, name): self.cap = cv2.VideoCapture(name) self.q = queue.Queue() t = threading.Thread(target=self._reader) t.daemon =...
interface_info.py
# Copyright 2019 Anjali Thontakudi # 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 ...
joystick.py
import os import threading from picraftzero.utils import arduino_map from picraftzero.log import logger from picraftzero.zero import Button from picraftzero.config import get_config config = get_config() USE_EVENT = True USE_PYGAME = True USE_BLUEDOT = config.getboolean('joystick', 'use_bluedot', fallback=False) HA...
generate_tfrecord.py
# Copyright 2016 Google Inc. 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 applicable law or a...
main.py
from time import sleep,asctime,strftime from BeautifulSoup import BeautifulSoup import threading from threading import Thread import Queue from scapy.all import * import logging from plugins import * import sys import netifaces class CoreMitm(object): ''' core mitmkin main thread''' def __init__(self,options)...
install_models.py
# type: ignore import os import shutil import threading from pathlib import Path from typing import Optional import requests from pydeepspeech.paths import PATH_MODELS # AI model used for the application _VERSION = "v0.9.3" URL_PBMM = "https://github.com/mozilla/DeepSpeech/releases/download/v0.9.3/deepspeech-0.9.3...
omsagent.py
#!/usr/bin/env python # # OmsAgentForLinux Extension # # Copyright 2015 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....
Arlo.py
## # Copyright 2016 Jeffrey D. Walter # # 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 w...
ScInit.py
import sys, getopt, struct, time, termios, fcntl, sys, os, colorsys, threading, datetime, subprocess, json sys.path.append(os.path.dirname(os.path.abspath(__file__)) + '/fbtft') from RenderManager import RenderManager from WanemManager import WanemManager from HttpUtil import HttpUtil from LogReporter import LogReporte...
run_nvmf.py
#!/usr/bin/env python3 from json.decoder import JSONDecodeError import os import re import sys import argparse import json import zipfile import threading import subprocess import itertools import configparser import time import uuid from collections import OrderedDict import paramiko import pandas as pd import rpc ...
__main__.py
import sys from threading import Thread from .actions import ActionRegistry from .backends import BluetoothBackend, HidrawBackend from .config import load_options from .daemon import Daemon from .eventloop import EventLoop from .exceptions import BackendError class DS4Controller(object): def __init__(self, inde...
actor_factory.py
#!/usr/bin/env python # # Copyright (c) 2020 Intel Corporation # # This work is licensed under the terms of the MIT license. # For a copy, see <https://opensource.org/licenses/MIT>. # import time from threading import Thread, Lock import itertools from enum import Enum try: import queue except ImportError: im...
app_tests.py
# -*- encoding: utf8 -*- ''' Mantra - test selection page ''' import os import json import shutil import threading import time import csv from operator import attrgetter import logging import dash_html_components as html import dash.dependencies as dd import dash_core_components as dcc from app import app from config ...
video.py
""" This file contains routines to help dealing with processing streaming videos and reading frames and pixel locations Code written by Daiki Horiike and Robin Scheibler, 2018 """ import cv2 from threading import Thread import queue class FrameGrabber(object): def __init__(self): self.the_frame = None ...
__init__.py
#! /usr/bin/env python3 # Example wiring (LT-8900 on board to Raspberry Pi): # # LT-8900 # _--------------------------------------------------------_ # | VCC | RST | MISO | MOSI | SCK | CS | GND | # |-------+-------+----- -+-------+-------+-------+--------| # | 3.3v | Reset | SPI ...
logging_util.py
__package__ = 'archivebox' import re import os import sys import stat import time import argparse from math import log from multiprocessing import Process from pathlib import Path from datetime import datetime, timezone from dataclasses import dataclass from typing import Any, Optional, List, Dict, Union, IO, TYPE_CH...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
process_connection.py
from multiprocessing.connection import Listener, Client from multiprocessing import Process from array import array def server(): address = ('localhost', 6000) # family is deduced to be 'AF_INET' with Listener(address, authkey=b'secret password') as listener: with listener.accept() as conn: ...
sentence_extractor.py
import argparse import json import neuralcoref import wikipedia import spacy import sys import time import random import re from os.path import exists from multiprocessing import Lock from SPARQLWrapper import SPARQLWrapper, JSON from queue import Queue from threading import Thread from distant_supervision.es_client im...
HiyaCFW_Helper.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # HiyaCFW Helper # Version 3.4.1 # Author: mondul <mondul@huyzona.com> from tkinter import (Tk, Frame, LabelFrame, PhotoImage, Button, Entry, Checkbutton, Radiobutton, Label, Toplevel, Scrollbar, Text, StringVar, IntVar, RIGHT, W, X, Y, DISABLED, NORMAL, SUNKEN, ...
plot_from_pp_interp_p_levs_temp_geop_sp_hum_diff.py
""" Load pp, plot and save """ import os, sys #%matplotlib inline #%pylab inline import matplotlib matplotlib.use('Agg') # Must be before importing matplotlib.pyplot or pylab! from matplotlib import rc from matplotlib.font_manager import FontProperties from matplotlib import rcParams from mpl_toolkits.basemap...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
stats_store.py
#!/usr/bin/env python """Storage implementation for gathered statistics. Statistics collected by StatsCollector (see lib/stats.py) is stored in AFF4 space. Statistics data for different parts of the system is separated by process ids. For example, for the frontend, process id may be "frontend", for worker - "worker", ...
custom_widgets.py
import logging import os import subprocess import time import warnings from functools import partial from typing import Union import numpy as np from PySide2 import QtCore, QtGui, QtWidgets from PySide2.QtCore import Signal, Slot from deepethogram.file_io import VideoReader # these define the parameters of the deepet...
cluster.py
# Copyright (c) 2015-2020 Avere Systems, Inc. All Rights Reserved. # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root for license information. '''vFXT Cluster management Cookbook/examples: # A cluster is built with a service object (aws or gc...
objdetector.py
""" Object detector facade module. Run object detection in NN """ # pylint: disable=C0103,C0301,W0703,R0903 #import numpy as np from threading import Thread, Event, Lock from typing import List import datetime as dt import copy import queue as q import entities as e class QueueSeparator: """ Separator in queu...
nessus.py
import nessrest from nessrest import ness6rest import threading import Queue from threading import Semaphore import time from output import * #Dependencies: #git clone https://github.com/golismero/openvas_lib.git #python setup.by build #python setup.py install #or: #pip install openvas_lib class AutoNessus(): def ...
TFLite_cam_edge_gd.py
#Main_Author: Evan Juras # This code is based off the TensorFlow Lite image classification example at: # https://github.com/tensorflow/tensorflow/blob/master/tensorflow/lite/examples/python/label_image.py #Modification has done to implement our project.... # Import packages from tflite_runtime.interpreter import In...
power_monitoring.py
import random import threading import time from statistics import mean from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5.28 CAR_VOLTAGE_LOW_PASS_K =...
spectrum_dump.py
### GStreamer Spectrum Dump #### # Modified for hyperion effect and Gstreamer 1.0 by RanzQ # ranzq87 [(at)] gmail.com # # Original: # https://github.com/Wintervenom/gst-spectrumdump # V20111005-1 by Scott Garrett # Wintervenom [(at)] gmail.com ################################ # Dependencies: # PyGI (python-gi) # ######...
UdpChat.py
import logging from logging.config import fileConfig from os import path import os import sys import socket import threading from termcolor import cprint from time import sleep import datetime class Server(object): """docstring for Server.""" def __init__(self, port): """Constructor o...
serve.py
import http.server import json import logging import queue import threading import numpy as np import tensorflow as tf from .estimator import def_estimator from .flag import FLAGS, add_flag, add_output_dir_flag def def_serve(): """Define `serve()` function. See also `help(def_serve())`. - Returns ...
cam.py
## this captures the mjpeg stream from my panasonic camera and converts it into a video that is pushed to youtube. ## It will a # http://192.168.1.222/cam.cgi?mode=camcmd&value=capture this takes a photo # http://192.168.1.222/cam.cgi?mode=startstream&value=5555 ## you will need python, numpy, opencv, and pygi ## f...
benchmark.py
import argparse import sys,os,time import subprocess import collect_gpu_power as cgp from threading import Thread # Parse arguments parser = argparse.ArgumentParser(description='Benchmark deep learning tools') parser.add_argument('-config', type=str, help='Path to the config file') parser.add_argument('-post', type=b...
flaskwebgui.py
__version__ = "0.3.2" import os import sys import time from datetime import datetime import logging import tempfile import socketserver import subprocess as sps from inspect import isfunction from threading import Lock, Thread logging.basicConfig(level=logging.INFO, format='flaskwebgui - [%(levelname...
TestPersistentDB.py
"""Test the PersistentDB module. Note: We don't test performance here, so the test does not predicate whether PersistentDB actually will help in improving performance or not. We also assume that the underlying SteadyDB connections are tested. Copyright and credit info: * This test was contributed by Christoph Zwersc...
stockPredictor.py
''' TO DO: • add open • add high • add low • make it a function that returns a data fram of open, close, low, high, and growth rate of each since the day before • • fix the calender so you can add more data //DONE ''' DEBUG = True from time import * from sklearn.svm import SVR import numpy as n...
main.py
import pydlbot_ui as Ui import sys from PyQt5 import QtGui, QtCore, QtWidgets from PyQt5.QtGui import * from PyQt5.QtCore import * from PyQt5.QtWidgets import * import time import threading if __name__ == '__main__': p = threading.Thread(target=main) p.start() for i in range(3): t = th...
hypothesis_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import copy from functools import partial, reduce from hypothesis import assume, given, settings import hypothesis.strategies as st import unittest from caffe2.python import core, workspace,...
test_logging.py
#!/usr/bin/env python # # Copyright 2001-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copy...
api.py
#coding: utf8 import datetime import hashlib import logging import time from threading import Thread import pymysql import pymysql.cursors import requests import telebot import cache_worker import config import secret_config import text import ujson import utils bot = telebot.TeleBot(token = secret_config.token) c...
cp18_ascynio.py
# CP18 Concurrency with asyncio import threading import itertools import time import sys class Signal: go = True def spin(msg, signal): write, flush = sys.stdout.write, sys.stdout.flush for char in itertools.cycle('|/-\\'): status = char + ' ' + msg write(status) flush() ...
vectors.py
import math from typing import Tuple, Optional, Union import random import webbrowser import rlbot.utils.structures.game_data_struct as game_data_struct from utilities.utils import * VectorArgument = Union[float, game_data_struct.Vector3] class Vector2: def __init__(self, x: VectorArgument, y: Optional[float]...
resultserver.py
# Copyright (C) 2010-2013 Claudio Guarnieri. # Copyright (C) 2014-2016 Cuckoo Foundation. # Copyright (C) 2020-2021 PowerLZY. # This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org # See the file 'docs/LICENSE' for copying permission. from __future__ import print_function import errno import json import ...
HammerKlavier.py
""" HammerKlavier.py -- Hammer a server by using multiple threads or processes to submit many simultaneous requests. (HammerKlavier means 'hammer keyboard') """ from processing import Process from .pdict import PersistentDict def multiProcessTest(n, funcs): """Fork N processes and run a tes...
train_rl_object.py
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import h5py import time import argparse import numpy as np import os, sys, json import os.path as osp import tor...
train.py
import os import neat import gym, ppaquette_gym_super_mario import pickle import multiprocessing as mp import visualize gym.logger.set_level(40) class Train: def __init__(self, generations, parallel=2, level="1-1"): self.actions = [ [0, 0, 0, 1, 0, 1], [0, 0, 0, 1, 1, 1], ...
getting_current_thread.py
import threading def thread_target(): print("Current Thread: {}".format(threading.current_thread())) threads = [] for i in range(10): thread = threading.Thread(target=thread_target) thread.start() threads.append(thread) for thread in threads: thread.join()
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import _ from electrum.transaction im...
billingApi.py
# -- coding:utf-8 -- ''' Created on 2017. 3. 30. @author: sanghyun ''' import json import os import threading import zipfile import time import datetime import xlsxwriter from flask import Blueprint, request from flask.globals import current_app, session from werkzeug import secure_filename from ro...
funcs.py
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu" __license__ = "MIT" import os import stat import time import queue import threading as mt import subprocess import radical.utils as ru from ... import utils as rpu from ... import states as rps from ... import constants as rpc from .. ...
looking-glass-fusion.py
#Author-Brian Peiris #Description-A live viewer for the Looking Glass 3D display import adsk.core, adsk.fusion, adsk.cam, traceback, datetime import os from http import server from threading import Thread server_port = 3000 addin_path = os.path.dirname(os.path.abspath(__file__)) log_path = os.path.join(addin_path,...
wait.py
# based on example code from https://pymotw.com/2/multiprocessing/basics.html import multiprocessing def spawn(num): print('test!', num) if __name__ == '__main__': for i in range(5): p = multiprocessing.Process(target=spawn, args=(i,)) p.start() p.join()
conftest.py
import asyncio import functools import json import os import threading import time import typing import sys import pytest import trio import trustme from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import ( BestAvailableEncryption, Encoding, Private...
python_ls.py
# Copyright 2017 Palantir Technologies, Inc. import logging import socketserver import threading from multiprocessing import dummy as multiprocessing from pyls_jsonrpc.dispatchers import MethodDispatcher from pyls_jsonrpc.endpoint import Endpoint from pyls_jsonrpc.streams import JsonRpcStreamReader, JsonRpcStreamWrite...
helpers.py
""" Helper functions file for OCS QE """ import base64 import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time from concurrent.futures import ThreadPoolExecutor from subprocess import PIPE, TimeoutExpired, run from uuid import uuid4 i...
grab_huaban_board.py
#!/usr/bin/env python # -*- coding: utf8 -*- __version__ = "4.0" __author__ = "Mr.tao" __doc__ = "http://www.saintic.com/blog/204.html" import requests, re, os, logging, json from multiprocessing import cpu_count, Process from multiprocessing.dummy import Pool as ThreadPool logging.basicConfig(level=logging.DEB...
main.py
from service import mi2app_utils import os import sys import threading import time import traceback import logging import datetime as dt import signal from kivy.config import ConfigParser from service import GpsListener def receive_signal(signum, stack): print 'Received:', signum def alive_worker(secs): ...
_app.py
""" """ """ _app.py websocket - WebSocket client library for Python Copyright 2022 engn33r 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 ...
broadcast.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. import multiprocessing as mp from maro.communication import Proxy, SessionType def worker(group_name): """ The main worker logic includes initialize proxy and handle jobs from the master. Args: group_name (str): Identifie...
executor.py
#!/usr/bin/env python3 from gi.repository import GLib import subprocess import threading from nwg_panel.tools import check_key, update_image import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') from gi.repository import Gtk, Gdk, GdkPixbuf class Executor(Gtk.EventBox): def __init__(se...
test_sys.py
import unittest, test.support import sys, io, os import struct import subprocess import textwrap import warnings import operator import codecs import gc import sysconfig import platform # count the number of test runs, used to create unique # strings to intern in test_intern() numruns = 0 try: import threading ex...
integration_tests.py
from __future__ import print_function import filecmp from time import sleep import unittest import os import sys import urllib import subprocess sys.path.append(os.path.join(os.path.dirname(__file__), '..')) from openport.apps.keyhandling import get_or_create_public_key, create_new_key_pair from openport.apps.openpor...
example18_iot_chime_n.py
#!/usr/bin/env python3 # coding: utf-8 # Example 18 IoT チャイム WSGI 版 【チャイム音の排他処理対応】 port = 4 # GPIO ポート番号 ping_f = 554 # チャイム音の周波数1 pong_f = 440 # チャイム音の周波数2 from wsgiref.simple_server import make_server from R...
utils.py
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch, glob, os, numpy as np, math from .sparseConvNetTensor import SparseConvNetTensor from .metadata import Metada...
manager.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import vim import os import sys import json import time import operator import itertools import threading import multiprocessing from functools import partial from functools import wraps from .instance import LfInstance from .cli import LfCli from .utils import * from .fuz...
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(...
vk2tg.py
import html from threading import Thread import time from os import path import telebot import yaml import vk_api CONFIG_FILE = 'config.yaml' link_tmp = 'https://vk.com/club{group_id}?w=wall-{group_id}_{post_id}' reply_tmp = '_reply ->_\n*{owner}*\n{text}\n{reply}\n' post_tmp = '{text}\n{reply}\n_{owner...
mimic_tts.py
# Copyright 2017 Mycroft AI 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 writin...
main.py
from termcolor import colored from threading import Thread from pytube import YouTube from queue import Queue from tqdm import tqdm import soundfile import librosa import shutil import pysrt import os def time2millis(time): return ((time.hour * 60 + time.minute) * 60 + time.second) * 1000 + time.microsecond / 1000...
TwitchLinkPopcornEngine.py
import threading import subprocess import time from shutil import rmtree from Services.Twitch.TwitchPlaybackAccessTokens import * class TwitchDownloaderNetworkError(Exception): def __str__(self): return "\nNetwork Error" class TwitchDownloaderFileSystemError(Exception): def __str__(self): r...
ar_259_测试_上线域名确认脚本.py
import os import subprocess import time import easygui as g import re import threading import sys import requests import pprint """ 1.获取文件的路径 2.用路径获取到包名 3.卸载包名 4.安装app 新建日志开启文件 5.先开启日志抓取 5.打开app 6.分析日志文件抓取各个域名 通过包名抓取cf配置,再得到主域名 通过包名抓取mo配置 通过包名 """ def openLog(): add_debug_list = [ "adb sh...
Misc.py
## @file # Common routines used by all tools # # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## # Import Modules # from __future__ import absolute_import import sys import string import threading import time import re import ...
configure-aspen.py
from __future__ import division from decimal import Decimal as D import threading import time import traceback import gratipay import gratipay.wireup from gratipay import canonize, utils from gratipay.security import authentication, csrf, x_frame_options from gratipay.utils import cache_static, i18n, set_cookie, time...
test_external_step.py
import os import tempfile import time import uuid from threading import Thread import pytest from dagster import ( Field, ModeDefinition, RetryRequested, String, execute_pipeline, execute_pipeline_iterator, fs_io_manager, pipeline, reconstructable, resource, solid, ) from da...
routes.py
from threading import Thread from flask import Blueprint, request from .methods import (information_graphic, clear_string, information_filter, information_numbers, information_total, list_menu, select_menu_option, get_random_movie_or_series) from ..data.scrapping import get_data, get_day_image, ge...
ftclient.py
#!/usr/bin/python ########################################################################### # Program Filename: ftclient.py # Author: Jonathan Grocott # Date: 11/18/18 # CS_372_400_F2018 Project 2 # Description: Simple file transfer client implementation # requires ftserver.c on another host. # References -...
launcher.py
from tkinter import Button, Tk, Toplevel, Label from tkinter.messagebox import askyesno from tkinter.ttk import Progressbar from win32api import ShellExecute from PIL import Image, ImageTk from os import path, makedirs from threading import Thread from requests import get __version__ = '1.4' __author__ = "TerraBoii" #...
qcpump.py
import json import logging import sys import threading import wx import wx.adv import wx.grid import wx.lib.masked import wx.lib.scrolledpanel from qcpump import logs, utils from qcpump.pumps.base import ( EVT_PUMP_COMPLETE, EVT_PUMP_LOG, EVT_PUMP_PROGRESS, ) from qcpump.pumps.registry import get_pump_typ...
JogadorMinmax.py
# Jogador # Created on 11 de Junho de 2021 from __future__ import annotations from typing import List from Jogador import Jogador from Jogada import Jogada from Tabuleiro import Tabuleiro import time import threading from TabuleiroGoMoku import TabuleiroGoMoku import numpy as np class JogadorMinMax(Jogador): MAXN...
main.py
import myserial import threading import time t1 = threading.Thread(target = myserial.serial_port0.receivemsg) t1.start() while True: if myserial.serial_port0.recvmsg != "": print(myserial.serial_port0.recvmsg) myserial.serial_port0.recvmsg = ""
test_setup.py
"""Test component/platform setup.""" # pylint: disable=protected-access import asyncio import os from unittest import mock import threading import logging import voluptuous as vol from homeassistant.core import callback from homeassistant.const import ( EVENT_HOMEASSISTANT_START, EVENT_COMPONENT_LOADED) import ho...
logging.py
"""Logging utilities.""" import asyncio from asyncio.events import AbstractEventLoop from functools import partial, wraps import inspect import logging import threading import traceback from typing import Any, Callable, Optional from .async_ import run_coroutine_threadsafe class HideSensitiveDataFilter(logging.Filte...
gstreamer_rtsp_server.py
''' * Copyright (C) 2019-2020 Intel Corporation. * * SPDX-License-Identifier: BSD-3-Clause ''' from threading import Thread from collections import namedtuple import gi gi.require_version('GstRtspServer', '1.0') gi.require_version('Gst', '1.0') # pylint: disable=wrong-import-position from gi.repository import Gst, Gs...
test_StandardDiskBenchmark.py
# -*- coding: utf-8 -*- import threading from pip_benchmark_python.standardbenchmarks.StandardDiskBenchmark import StandardDiskBenchmark class TestStandardDiskBenchmark: benchmark = None def callback(self, arg=None): print('Is Done!') def setup_method(self): self.benchmark = StandardDi...
test_thread_local.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
handler.py
import json import threading from asgiref.sync import async_to_sync from channels.layers import get_channel_layer from bot.core.bot_service import InstagramBot from handlers.redis_handler import RedisQueue class BotHandler: bot_session = {} def read_queue(self): while True: queue = Red...
wdt_bad_server_test.py
#!/usr/bin/env python3 # In this test, a dummy python server is created which reads everything send to # it, but does not write anything back. When a WDT sender connects to it, it # should detect that the other side is making no progress and return with # NO_PROGRESS status. import socket import threading from common...
produceConsume.py
import threading import random import time fruit = [] def produce(): global fruit while True: try: tempfruit = random.randint(0, 100) fruit.append(tempfruit) print("I made fruit #{0}".format(tempfruit)) time.sleep(random.uniform(0.000000000000000000000000000000000000000000001, 0.05)) except: print(...