source
stringlengths
3
86
python
stringlengths
75
1.04M
runner_wiki_trace.py
import pycurl, sys from StringIO import StringIO import multiprocessing as mp import time, requests from websim import handle_response FILE_URL = "localhost:8000" t_start = None def wikipedia_urls(wiki_file = "workloads/wikipedia/wiki.1190153705.processed.articleids"): url_root = "http://%s/" % FILE_URL ...
utils.py
from __future__ import print_function import collections import colorsys import inspect import json import math from motion.motion_planners.rrt import rrt import os import pickle import platform import signal import numpy as np import pybullet as p import random import sys import time import datetime import shutil imp...
UsePytdxImportToH5Thread.py
# coding:utf-8 # # The MIT License (MIT) # # Copyright (c) 2010-2017 fasiondog/hikyuu # # 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 r...
testing.py
from __future__ import division # pylint: disable-msg=W0402 import random import re import string import sys import tempfile import warnings import inspect import os import subprocess import locale import unittest import traceback from datetime import datetime from functools import wraps, partial from contextlib impo...
testsuite.py
# Copyright (c) 2009-2015 testtools developers. See LICENSE for details. """Test suites and related things.""" __all__ = [ 'ConcurrentTestSuite', 'ConcurrentStreamTestSuite', 'filter_by_ids', 'iterate_tests', 'sorted_tests', ] from collections import Counter from pprint import pformat from queue ...
ex08_emission.py
#!/usr/bin/env python3 ############################################################################### # Example 8 Heat Dissipation Mechanism for Raspberry Pi # # Copyright (c) 2021 Wataru KUNINO https://bokunimo.net/ ##############################################################################...
safaribooks.py
#!/usr/bin/env python3 # coding: utf-8 import pathlib import re import os import sys import json import shutil import getpass import logging import argparse import requests import traceback from html import escape from random import random from lxml import html, etree from multiprocessing import Process, Queue, Value f...
tsproxy.py
#!/usr/bin/python """ 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 l...
images.py
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import, division from future.builtins import * from future import standard_library standard_library.install_aliases() # Copyright 2017 Autodesk Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exc...
__init__.py
__author__ = 'sukrit' import os import SimpleHTTPServer import SocketServer import etcd import requests from threading import Thread ETCD_PROXY_BASE = os.environ.get('ETCD_PROXY_BASE', '/yoda') ETCD_HOST = os.environ.get('ETCD_HOST', 'localhost') ETCD_PORT = int(os.environ.get('ETCD_PORT', '4001')) MOCK_TCP_PORT = i...
strategy.py
""" Definition of base strategy and related types. """ from abc import ABC from datetime import datetime from threading import Thread from constants import * from utils import get_number_of_decimal, if_market_open from events import EVENT_MARKETDATA, EVENT_BUY, EVENT_SELL, EVENT_CANCEL, EVENT_TRADE, EVENT_STATUS, EVE...
AddMeta.py
#!/opt/local/bin/python3 # encoding: utf-8 import sys from subprocess import PIPE from threading import Thread from queue import Queue from com.camding.plexpostprocess.Metadata import Metadata from com.camding.plexpostprocess.PlexPostProcessState import PlexPostProcessState from com.camding.plexpostprocess.steps.Det...
job_deployment_state_push.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import logging import requests import threading import time from nuvla.job.actions.deployment_state import DeploymentStateJob from nuvla.api.resources import Deployment from nuvla.api import Api deployment_id = os.getenv('NUVLA_DEPLOYMENT_ID') apikey = os.getenv...
server.py
#!/usr/bin/env/python # File name : server.py # Production : RaspTank # Website : www.adeept.com # E-mail : support@adeept.com # Author : William # Date : 2018/08/22 import socket import time import threading import move import Adafruit_PCA9685 pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(...
__main__.py
# -*- coding: utf-8 -*- # Questo è Sensorberry # File principale # È stato costruito da Alessandro Massarenti # V 2.0 import threading import time import serial from telepot.loop import MessageLoop from telepot.namedtuple import ReplyKeyboardMarkup, KeyboardButton from config import * from funzioni import * from pl...
DTFinder.py
# The Leginon software is Copyright 2004 # The Scripps Research Institute, La Jolla, CA # For terms of the license agreement # see http://ami.scripps.edu/software/leginon-license # import wx import wx.lib.filebrowsebutton as filebrowse import threading import leginon.gui.wx.TargetPanel import leginon.gui.wx.Settings ...
__init__.py
import re import argparse from abc import ABCMeta, abstractmethod from ..support.arepl import * from ..gateware.clockgen import * __all__ = ["GlasgowAppletError", "GlasgowApplet", "GlasgowAppletTool"] class GlasgowAppletError(Exception): """An exception raised when an applet encounters an error.""" class Gla...
importio.py
''' import.io client library - client classes This file contains the main classes required to connect to and query import.io APIs Dependencies: Python 2.7 @author: dev@import.io @source: https://github.com/import-io/importio-client-libs/tree/master/python ''' import threading, logging, uuid, json, urllib, urllib2, coo...
test_distributed_sampling.py
import dgl import unittest import os from dgl.data import CitationGraphDataset from dgl.distributed import sample_neighbors from dgl.distributed import partition_graph, load_partition, load_partition_book import sys import multiprocessing as mp import numpy as np import backend as F import time from utils import get_lo...
test_gauge.py
"""Unit tests for gauge""" import json import random import re import tempfile import threading import time import os import unittest from unittest import mock import urllib from http.server import HTTPServer, BaseHTTPRequestHandler import yaml import requests from faucet import gauge_prom, gauge_influx, gauge_pol...
jobcontrol.py
# Copyright (C) 2008 Mark Seaborn # # This program 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 2 of the License, or # (at your option) any later version. # # This program is distributed in ...
__init__.py
# coding=utf-8 from __future__ import (absolute_import, division, print_function, unicode_literals) import base64 import logging import os import random import string import sys import threading import time import urllib import uuid from builtins import int import requests import octoprint.pl...
gui.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- from typing import List, Optional import os import sys import time import threading import itertools from .case import Test, TestState from .suite import TestSuiteMode from .runner import TestRunner from .utils import TermColor, logger from .editform import TestEditForm...
websocket_client.py
# cbpro/WebsocketClient.py # original author: Daniel Paquin # mongo "support" added by Drew Rice # # # Template object to receive messages from the Coinbase Websocket Feed from __future__ import print_function import json import base64 import hmac import hashlib import time from threading import Thread from websocket ...
pick.py
import multiprocessing from multiprocessing import Barrier, Lock, Process import time from datetime import datetime import pickle from numpy.lib.function_base import percentile import obspy import numpy as np import math import os import obspy import scipy.signal as signal import datetime from obspy.geodetics....
variable_scope.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
frontendcomm.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ In addition to the remote_call mechanism implemented in CommBase: - Implements _wait_reply, so blocking calls can be made. """ import pickle import socket import...
ThreadingVsMultiprocessing.py
import sched, time, threading, multiprocessing stopThread = False threadCounts = [] processCounts = [] s = sched.scheduler(time.time, time.sleep) #%% Handle Thread def thread_handle(args): ''' Used global stopThread variable to stop all threads at the same time ''' global threadCounts print ('In ...
archiver.py
import argparse import errno import io import json import logging import os import pstats import random import re import shutil import socket import stat import subprocess import sys import tempfile import time import unittest from binascii import unhexlify, b2a_base64 from configparser import ConfigParser from datetim...
os_cmd.py
# coding: utf-8 from __future__ import annotations import logging import os import sys import traceback from subprocess import PIPE, Popen from threading import Thread from queue import Queue from typing import Any from io import TextIOWrapper ON_POSIX = 'posix' in sys.builtin_module_names logger = logging.getLogger(_...
mnist_multiprocess.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...
CartPole.py
import matplotlib.pyplot as plt import shutil import os import gym import numpy as np import threading # import tensorflow as tf import tensorflow.compat.v1 as tf tf.disable_v2_behavior() GAME = 'CartPole-v0' OUTPUT_GRAPH = True LOG_DIR = './log' N_WORKERS = 3 MAX_GLOBAL_EP = 3000 GLOBAL_NET_SCOPE = 'Global_Net' UPDA...
zombie.py
import base64, socket, threading import time class Zombie: def __init__(self): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def connect_socket(self): self.sock.connect(('127.0.0.1', 56255)) def send_packet(self, content: str): try: self.sock.send(c...
demo_client.py
import bson import click import logging import select import struct import time from threading import Semaphore, Thread from circum.utils.network import ServiceListener from matplotlib import pyplot as plt from matplotlib import animation from mpl_toolkits import mplot3d import numpy as np from zeroconf import Zer...
webserver.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "ok I'm alive" def run(): app.run(host='0.0.0.0',port=8080) def keep_alive(): t = Thread(target=run) t.start()
__init__.py
""" XVM (c) www.modxvm.com 2013-2017 """ ##################################################################### # MOD INFO XFW_MOD_INFO = { # mandatory 'VERSION': '0.9.19.0.1', 'URL': 'http://www.modxvm.com/', 'UPDATE_URL': 'http://www.modxvm.com/en/download-xvm/', 'GAME_VERSIONS...
pokemon.py
#!/usr/bin/env python # pokemon-master from __future__ import division from __future__ import print_function import os import random import json import pyttsx import vlc # package python-vlc import serial from threading import Thread from kivy.app import App from kivy.clock import Clock from kivy.uix.boxlayout imp...
impala_lite.py
# Copyright 2019 DeepMind Technologies Limited. 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 ...
eventlet_mysql_pool_util.py
import os import eventlet import pymysql eventlet.monkey_patch(thread=True, pymysql=True) from eventlet.db_pool import ConnectionPool import traceback import threading class EventletMySQLPoolUtil(object): """ - .bashrc 또는 .bashprofile 에 MYSQL_PASSWD 를 설정해야 함. """ def __init__(self, host, user, passw...
startServer.py
""" MIT License Copyright (c) 2021 Meme Studios 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, ...
Modelo.py
# -*- coding: utf-8 -*- from src.Modelo import Personaje as p from src.Lexers import CreaDict as cd from src.Lexers import PosPersonajes as pp from src.LecturaFicheros import Lectorcsv from src.LecturaFicheros import LecturaEpub from src.Guiones import CrearDiccionario as cdguion from src.PredictorEtniaSexo impo...
frontend.py
from mopidy import audio, core import pykka import logging import threading import os import time from .ws_client import WSClient from mopidy_jellyfin import Extension logger = logging.getLogger(__name__) class EventMonitorFrontend( pykka.ThreadingActor, core.CoreListener, audio.AudioListener...
ASN1.py
import socket import threading import time import sys, getopt import string name='Computer 1' # -n <Name of current chatter> ipv6addr='::1' # -a <ipv6 address to be used by this program> portno=11111 # -p <port number on which this program will receive chat msgs from others> ipv6party=['::1','::1'] # -d <ipv6...
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 - ...
__init__.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """A watchdog process for debuggee processes spawned by tests. Interacts with the...
tiny-thread-pool.py
# This is some very messy notes on how we might implement a thread cache import threading import Queue # idea: # # unbounded thread pool; tracks how many threads are "available" and how much # work there is to do; if work > available threads, spawn a new thread # # if a thread sits idle for >N ms, exit # # we don't n...
test_callback.py
import math import textwrap import sys import pytest import threading import traceback import time import random import numpy as np from numpy.testing import assert_, assert_equal, IS_PYPY from . import util class TestF77Callback(util.F2PyTest): code = """ subroutine t(fun,a) integer a cf2py inten...
terminal_jtag2updi.py
import serial import sys import crcmod import time import threading import msvcrt CMND_SIGN_OFF = b'\x00' CMND_GET_SIGN_ON = b'\x01' CMND_SET_PARAMETER = b'\x02' CMND_GET_PARAMETER = b'\x03' CMND_WRITE_MEMORY = b'\x04' CMND_READ_MEMORY = b'\x05' CMND_GO = b'\x08' CMND_RESET = b'\x0b...
workspace.py
from . import workspace_pb2 as w from .utils import get_logger from .dir import * import os import os.path as osp from threading import Thread import traceback import platform import configparser import time import shutil import copy class Workspace(): def __init__(self, workspace, dirname, logger): self....
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including witho...
zoomrec.py
import csv import logging import os import psutil import pyautogui import random import schedule import signal import subprocess import threading import time import atexit from datetime import datetime, timedelta global ONGOING_MEETING global VIDEO_PANEL_HIDED logging.basicConfig( format='%(asctime)s %(levelname)...
health_manager.py
from inventory import belt from pather import Location import cv2 import time import keyboard from utils.custom_mouse import mouse from utils.misc import wait from logger import Logger from screen import grab import time from config import Config from inventory import common from ui import view, meters from ui_manager ...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
test_thread_bidirectional.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Thu Jul 19 07:05:09 2018 @author: afar """ import threading import socket import logging import json class Broker(): IP, PORT = "127.0.0.1", 4247 def __init__(self): logging.info('Initializing Broker') self.sock = socket.soc...
quoine.py
from bitfeeds.socket.restful import RESTfulApiSocket from bitfeeds.exchange import ExchangeGateway from bitfeeds.market import L2Depth, Trade from bitfeeds.util import Logger from bitfeeds.instrument import Instrument from bitfeeds.storage.sql_template import SqlStorageTemplate import time import threading import rando...
handlers.py
from tornado import gen, web, locks from tornado.escape import url_escape, url_unescape import traceback from urllib.parse import urljoin from notebook.base.handlers import IPythonHandler import threading import json import os from queue import Queue, Empty import jinja2 from hs_restclient import HydroShare, HydroShare...
fft.py
import os # os.environ["KIVY_NO_CONSOLELOG"] = "1" from win32api import GetSystemMetrics from sudio import Sudio, Pipeline import numpy as np from scipy.fft import fft from scipy.signal import lfilter, iirfilter import queue import threading import time from kivy.garden.knob import Knob from kivy.graphics import Colo...
engine.py
""" """ import logging from logging import Logger import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Type, Dict, List, Optional from vnpy.event import Event, EventEngine f...
main.py
""" The main module which spawns a gui and a effect thread and opens a socket connection to the specified host. The effect algorithm is in the effect module. Change this file to develop your effect. Change the host and port to your needs in this main file and also the values representing your led configuration. Create...
service.py
# -*- coding: utf-8 -*- # Copyright (C) 2015 Cyan, Inc. from datetime import datetime, timedelta import logging from pprint import pformat import re import select import subprocess import threading import time import errno import os log = logging.getLogger(__name__) log.addHandler(logging.NullHandler()) __all__ = [ ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
queue_thread.py
#!/usr/bin/env python #-*- coding:utf-8 -*- # Author: He Ye (Alex) # Date: 2019-11-13 import argparse import cv2 import queue import time from threading import Thread VDEV = "/dev/video0" _stop = object() def showVideoInfo(vhandle): try: fps = vhandle.get(cv2.CAP_PROP_FPS) #count = vhandle.get(c...
run.py
import os import time from copy import deepcopy import torch import numpy as np import numpy.random as rd from agent import ReplayBuffer, ReplayBufferMP '''DEMO''' class Arguments: def __init__(self, agent_rl=None, env=None, gpu_id=None, if_on_policy=False): self.agent_rl = agent_rl # Deep Reinforceme...
meraki_captive_portal_simulator.py
""" Cisco Meraki Captive Portal simulator Default port: 5003 Matt DeNapoli 2018 https://developer.cisco.com/site/Meraki """ # Libraries from flask import Flask, request, render_template, redirect, url_for import random import datetime import time import requests import webview import netifaces as nif import dateti...
import_logs.py
#!/usr/bin/python # vim: et sw=4 ts=4: # -*- coding: utf-8 -*- # # Piwik - free/libre analytics platform # # @link http://piwik.org # @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later # @version $Id$ # # For more info see: http://piwik.org/log-analytics/ and http://piwik.org/docs/log-analytics-tool-how-...
final - Copy.py
import pyautogui from imutils import face_utils from scipy.spatial import distance as dist import cv2 from Camera import camera import imutils import dlib import numpy as np import time import os from get_key import k_check from Feature import contour from modelsNN import inceptionv3 as gnet from random ...
client.py
import apps.streetdownloader.pkg.streetview as streetview import logging import subprocess import multiprocessing import sys from socketIO_client import SocketIO, LoggingNamespace, BaseNamespace class app_client(BaseNamespace): def on_ask_init(self,*args): self.emit("free", None) def on_conne...
LANs.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ''' Description: ARP poisons a LAN victim and prints all the interesting unencrypted info like usernames, passwords and messages. Asynchronous multithreaded arp spoofing packet parser. Prerequisites: Linux nmap (optional) nbtscan (optional) ...
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...
test_postgresql.py
import mock # for the mock.call method, importing it without a namespace breaks python3 import os import psutil import psycopg2 import re import subprocess import time from mock import Mock, MagicMock, PropertyMock, patch, mock_open from patroni.async_executor import CriticalTask from patroni.dcs import Cluster, Clus...
bot.py
from requests import post, Response from time import sleep from re import search import random as rnd from base64 import b64encode from uuid import uuid4 from typing import * from datetime import datetime from re import match from multiprocessing import Process from configReader import config, de__json from os import e...
ContentFrame.py
""" Sous fichier de client.py : Contient la frame, qui séra séparée en un cadre pour afficher les message et un cadre en bas pour écrire TODO """ from tkinter import * from tkinter import ttk from EventFrame import * import time from threading import Thread #Permet de faire tourner des fonctions en meme temps (async) ...
__init__.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 app...
bot.py
import os import time import threading class info(): def __init__(self): self.start_time = time.time() self.round = 0 self.round_total = 0 self.round_begin = 0 self.round_end = 0 self.room_number = None self.info = list() def ouput(self, message: str, s...
datarecorder.py
import time import gc from threading import Thread import wrapt import numpy as np import optotrak.ndiapiconstants import optotrak.databuffer as db from utils.realtimeclock import rtc import logging import utils.logger as ulog import gp.equations as gpe ndi = optotrak.ndiapiconstants.NDI class OptotrakRealtimeData(...
test_agent.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the ...
transaction.py
#!/usr/bin/env python3 #-*- coding: iso-8859-1 -*- ################################################################################ # # This module implements the only existing facility for accessing resources # from Pythomnic3k application - best effort distributed transaction where # each participating resource is ac...
computer.py
from typing import List from queue import Queue import threading class intcode_computer(object): def start_computer(self, program: List[int] = None): """ Starts the computer to run a program """ self.pointer = 0 self.relative_base = 0 self.execution_finished = Fals...
callbacks_test.py
# Copyright 2016 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...
__init__.py
import os import sys import logging import math import numpy as np from threading import Thread from multiprocessing import Process from scipy.io.wavfile import read from kaldi.matrix import Matrix, Vector, SubVector, DoubleVector from kaldi.feat.mfcc import Mfcc, MfccOptions from kaldi.feat.functions import compute_...
chat.py
class Bot: """ A class to make a Twitch Bot. register method is used to add a trigger response. """ def __init__( self, username: str, token: str, channel: str, callback, debug: bool = False, ): """ username: Twitch username of the...
touch.py
#!/usr/bin/env python import matplotlib.pyplot as plt import numpy as np import time import cv2 from robot import Robot import threading import os import utils from logger import Logger # TODO(adit98) put this in utils/get from somewhere else? from generate_sim_stacking_demo import get_and_save_images import argparse ...
image_inference.py
# -*- coding: utf-8 -*- # Inception-v3 모델을 이용한 Image Classification from __future__ import absolute_import from __future__ import division from __future__ import print_function import os.path import re import sys import tarfile import requests from multiprocessing import Process, Pipe import numpy as np from six.move...
general.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ General utils """ import contextlib import glob import inspect import logging import math import os import platform import random import re import shutil import signal import threading import time import urllib from datetime import datetime from itertools import repeat f...
threads.py
#!/bin/python3 """ Ejercicio hilos en python Lee el valor de aceleración de cada uno de los ejes del acelerómetro ADXL345 en el primer hilo, en un segundo hilo se envía un dato por puerto serial desde el computador y en un tercer hilo se lee el valor del sensor y se utiliza el dato por el puert...
main.py
import os import numpy as np import tkinter as tk import threading import multiprocessing from tkinter import scrolledtext, messagebox from tkinter.constants import END, INSERT, DISABLED, NORMAL from CurveGUI import Curve from utils import Data import serial from time import sleep helpstr = ''' 作者:赵泓珏 时间:2021.10.28 邮...
boot.py
from threading import Thread from queue import Queue # Python 3 import import Filter import speech_recognition as sr import ThreadMain import Plugins #PL = Utils.PluginLoader() r = sr.Recognizer() audio_queue = Queue() # start a new thread to recognize audio, while this thread focuses on listening recognize_thread...
main2.py
from flask import Flask, jsonify, request from flask_cors import CORS import threading import SpotifyPlayer import HolePuncher import qrcode if __name__ == '__main__': # Configure and Start Flask app = Flask(__name__) app.config['JSONIFY_PRETTYPRINT_REGULAR'] = True CORS(app) threading.Thread(targ...
test_transaction.py
#!/usr/bin/env python # test_transaction - unit test on transaction behaviour # # Copyright (C) 2007-2011 Federico Di Gregorio <fog@debian.org> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by the Free Software Foundat...
base_test.py
# -*- coding: utf-8 -*- import copy import datetime import json import threading import elasticsearch from unittest import mock import pytest from elasticsearch.exceptions import ConnectionError from elasticsearch.exceptions import ElasticsearchException from elastalert.enhancements import BaseEnhancement from elasta...
server.py
# -*- coding: utf-8 -*- # @Author: TD21forever # @Date: 2019-12-07 15:07:41 # @Last Modified by: TD21forever # @Last Modified time: 2019-12-07 17:54:34 #!/usr/bin/env python3 """Server for multithreaded (asynchronous) chat application.""" from socket import AF_INET, socket, SOCK_STREAM from threading import...
Node.py
from abc import ABC, abstractmethod from core.NodeType import NodeType import logging import math import threading import time from library.TimeUtils import TimeUtils class Node(ABC): def __init__(self, id, nodeType, timeResolutionUnit, transmissionDelayPerByte, m...
api_server.py
#!/usr/bin/env python3 """ API server to run the JSON-RPC and REST API. Uses neo.api.JSONRPC.JsonRpcApi or neo.api.JSONRPC.ExtendedJsonRpcApi and neo.api.REST.RestApi Print the help and all possible arguments: ./api-server.py -h Run using TestNet with JSON-RPC API at port 10332 and REST API at port 8080: ....
utils.py
import time import librosa import threading import regex as re import numpy as np from tqdm import tqdm from typing import List, overload from playsound import playsound def play_audio_file(filepath, step=1): duration = round(librosa.get_duration(filename=filepath), 2) ret = [None] def my_runner(playsoun...
build.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...
event.py
# -*- coding: utf-8 -*- # pylint: disable=missing-docstring, invalid-name ############################################################################## # # Copyright (c) 2011, Martín Raúl Villalba # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documen...
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...
webpagetest.py
# Copyright 2017 Google Inc. All rights reserved. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Main entry point for interfacing with WebPageTest server""" from datetime import datetime import gzip import logging import multiprocessing import os import platf...
XMLRPCPlugin.py
""" XML-RPC plugin for SpamBayes core server. This plugin opens an XML-RPC server in a separate thread listening to the given host and port (default localhost:5001), on a path (default /sbrpc). SECURITY NOTE: The XML-RPC plugin provide *NO SECURITY*. It would be unwise to listen to anything besides 'localhost'. Si...
usb_session.py
import time import datetime import serial import threading import json import traceback import queue import os import pty import subprocess from multiprocessing import Process import glob from elasticsearch import Elasticsearch from .data_consumers import Datastore, Logger from .http_cmd import create_usb_session_endp...