source
stringlengths
3
86
python
stringlengths
75
1.04M
models.py
#!/usr/bin/env python3 '''Contains necessary functions, routines, and data recording for DEC model initialization, training, validation, and inference. William Jenkins, wjenkins [at] ucsd [dot] edu Scripps Institution of Oceanography, UC San Diego May 2021 ''' from datetime import datetime import threading import os...
__init__.py
# -*- coding: utf-8 -*- """ Create ssh executor system """ # Import python libs from __future__ import absolute_import, print_function, unicode_literals import base64 import binascii import copy import datetime import getpass import hashlib import logging import multiprocessing import os import re import subprocess im...
run.py
import tiebalib import logging import math import threading import queue import re import time import itertools import jieba from collections import Counter def judge_thread(thread_list): for thread in thread_list: thread["result"] = [0,0] thread["reason"] = [] #------处理首页相同作者贴子情况------------------...
Bot.py
from threading import Thread import sqlite3 from time import sleep import subprocess from inspect import signature from inspect import getmembers from inspect import ismethod from importlib import import_module from .Message import Message, MessageSent from .User import User from .Image import Image from .Errors impor...
test_baker_operations_cli_options.py
"""Simple tests to check support for the following operations-related options for baking - --ignore-node-mempool - --operations-pool [file|uri] """ import os import os.path import json import time from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing import Process from typing import L...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
speedtest-cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2013 Matt Martz # 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/lic...
pod.py
""" Pod related functionalities and context info Each pod in the openshift cluster will have a corresponding pod object """ import logging import os import re import yaml import tempfile import time import calendar from threading import Thread import base64 from ocs_ci.ocs.bucket_utils import craft_s3_command from oc...
analyzer.py
# -*- coding: UTF-8 -*- import math import time import queue import threading from multiprocessing import Pool, TimeoutError from optionstrader.database import Database from optionstrader.config import Config from optionstrader.customlogging import CustomLog from optionstrader.customlogging import Analyzed_Ticker_St...
test_main.py
#!/usr/bin/python import subprocess import os import json import pytest import uuid import time import sys import threading import shutil from convoy import VolumeManager TEST_ROOT = "/tmp/convoy_test/" CFG_ROOT = os.path.join(TEST_ROOT, "convoy") PID_FILE = os.path.join(TEST_ROOT, "convoy.pid") LOG_FILE= os.path.jo...
engine.py
# encoding: UTF-8 # 通达信指数行情发布器 # 华富资产 import copy import json import traceback from threading import Thread from datetime import datetime, timedelta from time import sleep from logging import ERROR from pytdx.exhq import TdxExHq_API from vnpy.event import EventEngine from vnpy.trader.constant import Exchange from vn...
main.py
import os import eel from pygame import mixer from mutagen.mp3 import MP3 import threading print('') print(r'example:- C:\Users\Admin\Desktop\music') dir = input('ENTER YOUR MUSIC DIRECTORY:- ') print('') eel.init("web") # initialises eel arr = [] #array keeps track of all songs i = 0 o = 0 #counte...
engine.py
import logging import threading import time from cct.common.enums import case_running_status logger = logging.getLogger(__file__) class Engine(object): def __init__(self, *keys, **kwargs): self.__testset = kwargs.get('test_set') self.__case_thread_list = [] def start(self): # execut...
audio_reader.py
import fnmatch import os import random import re import threading import librosa import numpy as np import tensorflow as tf FILE_PATTERN = r'p([0-9]+)_([0-9]+)\.wav' def get_category_cardinality(files): id_reg_expression = re.compile(FILE_PATTERN) min_id = None max_id = None for filename in files: ...
test_main.py
# -*- coding: utf-8 -*- """ Test module for poseidon.py Created on 28 June 2016 @author: Charlie Lewis, dgrossman, MShel """ import json import logging import os import time import redis from prometheus_client import Gauge from poseidon.constants import NO_DATA from poseidon.helpers.config import Config from poseido...
MonitorThread.py
from __future__ import division from __future__ import absolute_import import simplejson import random import time import math import docker import docker.utils import docker.errors import psutil from threading import Thread import six import aetros.cuda_gpu import numpy as np class MonitoringThread(Thread): ...
emails.py
# -*- coding: utf-8 -*- from threading import Thread from flask import current_app, render_template from flask_mail import Message from flaskholo.extensions import mail def _send_async_mail(app, message): with app.app_context(): mail.send(message) def send_mail(to, subject, template, **kwargs): m...
pjit_test.py
# Copyright 2021 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
deltaproxy.py
# # Proxy minion metaproxy modules # import copy import logging import os import sys import threading import traceback import types import salt import salt.beacons import salt.cli.daemons import salt.client import salt.config import salt.crypt import salt.defaults.exitcodes import salt.engines import salt.loader im...
pool_static.py
import json, requests, urllib3 from flask import Flask, request, jsonify from datetime import datetime import time import traceback import os import redis import cPickle as pickle from multiprocessing import Process def avi_request(avi_api,tenant,api_version='17.2.1'): cookies=dict() if 'avi-sessionid' in l...
env.py
# Microsoft Azure Linux Agent # # 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 b...
__main__.py
# coding: utf-8 from logging import info import logging; logging.basicConfig(level=logging.DEBUG) from json import dumps from multiprocessing import Process from tentacle.sensor import discover from tentacle.client import publish sensors = discover() payload = {} for sensor in sensors: payload = {**payload, *...
poc_ws_client.py
#!/usr/bin/env python import asyncio import websockets from threading import Thread from uuid import uuid4 from theia.comm import Client from theia.model import Event loop = asyncio.get_event_loop() loop.set_debug(True) print('1') def recv(msg): print('RECEIVED: ', msg) cl = Client(loop, host='localhost', p...
subproc_vec_env.py
import multiprocessing as mp import numpy as np from .vec_env import VecEnv, CloudpickleWrapper, clear_mpi_env_vars def worker(remote, parent_remote, env_fn_wrappers): def step_env(env, action): ob, reward, done, info = env.step(action) if done: ob = env.reset() return ob, rew...
LiveDetect.py
# -*- coding: utf-8 -*- """ Created on Fri Oct 30 14:46:44 2020 @author: Ayman Al Jabri This script multithreads face detection on webcam . I Tried it on 16' MacPro and it works smoothly If you wanna run it in faceRecognition mode, make sure to train the model first and save it in results directory along with classes....
task.py
import time import threading class TaskResult(object): DONE = 0 CONT = 1 WAIT = 2 class TaskError(RuntimeError): """ A task specific runtime error """ class Task(object): def __init__(self, id): self.id = id self.name = 'Task-%d' % id self.function = None ...
wallet.py
import copy, hashlib, json, logging, os import time from hwilib.descriptor import AddChecksum from .device import Device from .key import Key from .util.merkleblock import is_valid_merkle_proof from .helpers import der_to_bytes, sort_descriptor, fslock, parse_utxo from .util.base58 import decode_base58 from .util.xpub ...
thread.py
# Copyright (C) 2011 Victor Semionov # 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 conditions and t...
slycat-timeseries-model.py
# Copyright (c) 2013, 2018 National Technology and Engineering Solutions of Sandia, LLC . Under the terms of Contract # DE-NA0003525 with National Technology and Engineering Solutions of Sandia, LLC, the U.S. Government # retains certain rights in this software. def register_slycat_plugin(context): """Called durin...
lisp-core.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain...
upload.py
from __future__ import absolute_import, print_function, division import h5py import logging import numpy as np import os import pandas as pd import re import time import yaml from io import BytesIO, StringIO from six.moves import xrange from superman.file_io import parse_spectrum from threading import Thread from torna...
smoke_test_plugins.py
# Licensed to Elasticsearch under one or more contributor # license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright # ownership. Elasticsearch licenses this file to you under # the Apache License, Version 2.0 (the "License"); you may # not use this file except...
utils.py
import json import time import unittest from threading import Thread from http.server import SimpleHTTPRequestHandler, HTTPServer import bugsnag class MissingRequestError(Exception): pass class IntegrationTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.server = FakeBugsnagServe...
driverview.py
#!/usr/bin/env python3 import os import subprocess import multiprocessing import signal import time import cereal.messaging as messaging from common.params import Params from common.basedir import BASEDIR KILL_TIMEOUT = 15 def send_controls_packet(pm): while True: dat = messaging.new_message('controlsState') ...
dumping_callback_test.py
# Copyright 2019 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...
process.py
# -*- coding: utf-8 -*- # Import python libs from __future__ import absolute_import, with_statement import os import sys import time import types import signal import logging import threading import contextlib import subprocess import multiprocessing import multiprocessing.util # Import salt libs import salt.default...
dynamodump.py
#!/usr/bin/env python """ Simple backup and restore script for Amazon DynamoDB using boto to work similarly to mysqldump. Suitable for DynamoDB usages of smaller data volume which do not warrant the usage of AWS Data Pipeline for backup/restores/empty. dynamodump supports local DynamoDB instances as w...
portable_runner.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock from weakref import proxy import contextlib imp...
server.py
# import threading # import time # import zmq # from tornado.ioloop import IOLoop # from .zhelpers import zpipe # from .agent import NodeAgent # from ..data.models import Device, DeviceRequest # class NodeServer(object): # ctx = None # Our Context # pipe = None # Pipe through to flciapi agent # ...
ui.py
from cefpython3 import cefpython as cef import base64 import platform import sys import threading import subprocess import glob import time import queue import re import pickle from Abstract import Parser parser = Parser() wd = parser.getWD() outF = parser.getOutF() #parser.saveConfig() # parser.fromTexttoXML('./doss...
cv2_eventloop.py
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
unittests.py
# vim: set fileencoding=utf-8 : # Copyright 2012 Alexander Else <aelse@else.id.au>. # # This file is part of the python-crowd library. # # python-crowd 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 ve...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD Li...
java.py
# -*- coding: utf-8 -*- """ :copyright: (C) 2010-2013 by Contrail Consortium. """ from threading import Thread from xml.dom import minidom from tempfile import mkdtemp from shutil import rmtree import zipfile, tempfile, stat, os.path from conpaas.services.webservers.manager.config import CodeVersion, JavaService...
__init__.py
import asyncio import sys import traceback from asyncio import CancelledError, Event, Semaphore from asyncio.events import AbstractEventLoop from collections import defaultdict from threading import Thread from typing import Coroutine, Dict from uuid import uuid4 from ...logging import UltestLogger class JobManager:...
log_analysis.py
#!/usr/bin/env python #coding:utf-8 import commands import threading import sys import json commands.getoutput("for i in `awk '{acc[$1]++}END{for (i in acc) {print acc[i], i}}' bitbidaccess.log|sort -nr|head -50|cut -d ' ' -f 2` ; do sed -i /$i/d bitbidaccess.log; done") patter="cat bitbidaccess.log |egrep 'HTTP/1.1\" ...
Bombard.py
#!/usr/bin/python import argparse, time, sys, os import subprocess, multiprocessing class Bombard(object): def __init__(self): self.banner() self.parseArgs() self.paramStrings=['1.3.6.1.2.1.25.1.6.0', '1.3.6.1.2.1.25.4.2.1.2', '1.3.6.1.2.1.25.4.2.1.4', '1.3.6.1.2.1.25.2.3.1.4', '1.3.6.1.2....
optimiser.py
from typing import List from random import random from dealer.main import run_game_for_n_players from player.base_player import PokerPlayer from player.basic_heuristic_player import high_card_player from player.basic_heuristic_player import partial_score_player from player.random_player import random_player from thre...
litex_term.py
#!/usr/bin/env python3 # # This file is part of LiteX. # # Copyright (c) 2015-2020 Florent Kermarrec <florent@enjoy-digital.fr> # Copyright (c) 2015 Sebastien Bourdeauducq <sb@m-labs.hk> # Copyright (c) 2016 whitequark <whitequark@whitequark.org> # SPDX-License-Identifier: BSD-2-Clause import sys import signal import...
chatcommunicate.py
from ChatExchange.chatexchange import events from ChatExchange.chatexchange.messages import Message from chatexchange_extension import Client import collections import itertools import os.path import pickle import queue import regex import requests import sys import threading import time import yaml import datahandlin...
videowriter.py
""" Copyright 2018-2021 Accenture Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software...
test_threaded_import.py
# This is a variant of the very old (early 90's) file # Demo/threads/bug.py. It simply provokes a number of threads into # trying to import the same module "at the same time". # There are no pleasant failure modes -- most likely is that Python # complains several times about module random having no attribute # randran...
stress_test_index_mp.py
"""Stress test diskcache.persistent.Index.""" from __future__ import print_function import itertools as it import multiprocessing as mp import os import random import time import diskcache as dc KEYS = 100 OPERATIONS = 10000 SEED = 0 functions = [] def register(function): functions.append(function) retur...
train.py
# -------------------------------------------------------- # FCN # Copyright (c) 2016 RSE at UW # Licensed under The MIT License [see LICENSE for details] # Written by Yu Xiang # -------------------------------------------------------- """Train a FCN""" from fcn.config import cfg from gt_data_layer.layer import GtDat...
pyusb_backend.py
""" mbed CMSIS-DAP debugger Copyright (c) 2006-2013 ARM 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 applicable ...
client.py
# Copyright 2017 D-Wave Systems 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 wri...
liffylights.py
''' liffylights by TangoAlpha - LIFX Python library https://github.com/TangoAlpha/liffylights Published under the MIT license - See LICENSE file for more details. Not associated with or endorsed by LiFi Labs, Inc. (http://www.lifx.com/) ''' # pylint: disable=missing-docstring import threading import time import queu...
git_trojan.py
import json import base64 import sys import time import imp import random import threading import Queue import os from github3 import login trojan_id = "abc" trojan_config = "%s.json" % trojan_id data_path = "data/%s/" % trojan_id trojan_modules= [] task_queue = Queue.Queue() configured = False class Git...
decode.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2017 Tomoki Hayashi (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division import argparse import logging import math import os import sys import numpy as np from sklearn.preprocessing import StandardS...
application.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...
main_part.py
# -- coding: utf-8 -- import requests import time import re import json import copy import threading import tkinter import tkinter.messagebox login_header = { 'Host': 'drrr.com', 'Connection': 'keep-alive', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; W...
asana_burndown.py
#!/usr/bin/env python """Convert Asana data into a day-by-day CSV file to generate a burndown chart. Usage: asana_burndown.py <API_KEY> Reads Asana's exported JSON from stdin. Writes CSV data to stdout that can be imported into a spreadsheet (e.g. Google Sheets) to generate a burndown chart. Inspired by https://gith...
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...
hl7fuzz.py
#Hl7 message fuzzer #twitter: 0xRaindrop import argparse import socket import queue from os import listdir, urandom from random import randrange, choice from sqlalchemy import create_engine, Table, Column, String, MetaData from time import time_ns,sleep import numpy import re import threading import _thre...
repocache.py
# repocache.py - in-memory repository cache for long-running services # # Copyright 2018 Yuya Nishihara <yuya@tcha.org> # # This software may be used and distributed according to the terms of the # GNU General Public License version 2 or any later version. from __future__ import absolute_import import collections imp...
04_queue1.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from multiprocessing import Queue, Process import time, random def write(q): if not q.full(): for value in ["a", "b", "c", "d"]: print("向队列中添加消息 %s" % value) q.put(value) time.sleep(random.random()) def read(q): while...
pwm.py
import RPi.GPIO as GPIO from time import sleep from threading import Thread class pwm_control(): def __init__(self): self.right_pwm_pin = 32 #Select Pin self.left_pwm_pin = 33 self.right_pwm_en_1 = 11 self.left_pwm_en_1 = 13 self.right_pwm_en_2 = 15...
funcs.py
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu" __license__ = "MIT" import os import copy import stat import time import Queue import signal import tempfile import threading import traceback import subprocess import radical.utils as ru from .... import pilot as rp from ... import utils ...
VidLambdaFaceMatch.py
""" Code and comments derived from: https://aws.amazon.com/blogs/machine-learning/find-distinct-people-in-a-video-with-amazon-rekognition/ Accessed 2018-09-10 """ """ LAMBDA ONE: Processes video into thumbnail frames for AWS Rekognition index_faces command """ # Retrieve the key for the S3 object that caused this fun...
linux_recorder.py
from sneakysnek.recorder import Recorder from sneakysnek.keyboard_keys import KeyboardKey from sneakysnek.mouse_buttons import MouseButton from sneakysnek.keyboard_event import KeyboardEvent, KeyboardEvents from sneakysnek.mouse_event import MouseEvent, MouseEvents import threading import Xlib.display import Xlib.e...
jenkins_monitor.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys import json import requests from datetime import datetime import pymysql import csv import codecs import time import threading from abc import abstractmethod from mysql import Pymysql from jenkins_common import JenkinsJob # pylint: disable=E0401 root ...
netcdf.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. # Author: Frank Warmerdam <warmerdam@pobox.com> # #############################################################...
keylogger.py
import requests import time from threading import Thread import pythoncom import pyHook import utils from random import randint from time import sleep started = False keylog = "" current_window = "" def OnKeyboardEvent(event): global current_window global keylog if current_window != event.WindowName: ...
test_local_task_job.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...
trainer_factory.py
# Copyright (c) 2019 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...
Browser.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # execute in production with: nohup python3 Browser.py &> browser.log < /dev/null & ########### # Imports # ########### import re import sys import os import traceback import json from time import sleep from multiprocessing import Process from rpc_client import get_acct...
default.py
""" Default Runner & Worker components Local Runner Memmap Interface (numpy) Template Preprocessor JSON Postprocessor NumpytxtPostprocessor HDF5Postprocessor """ from .runner import Runner, RunnerInterface from .worker import Interface, Preprocessor, Postprocessor, Worker import subprocess from multiprocessing impor...
wxStocks_scrapers.py
import config, inspect, threading, time, logging, sys, ast, datetime, os, json import pprint as pp import zipfile as zf import xml.etree.ElementTree as ET from urllib.request import urlopen, Request import urllib.error from bs4 import BeautifulSoup import requests from modules.pyql import pyql from wxStocks_modules i...
main.py
#!/usr/bin/python # -*- coding: utf-8 -*- from datetime import datetime from time import sleep from analysis import Analysis from BaseHTTPServer import BaseHTTPRequestHandler from BaseHTTPServer import HTTPServer from logs import Logs from threading import Event from threading import Thread from trading import Tradin...
download.py
from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException, TimeoutException import time import json import re # import sys # sys.path.append('/remote-ho...
loggingconsole.py
""" @copyright: 2013 Single D Software - All Rights Reserved @summary: Debugging console interface for Light Maestro. """ # Standard library imports import logging import threading import time # Application imports import console # Named logger for this module _logger = logging.getLogger(__name__) class LoggingCo...
handlers_oneway.py
# -*- coding: utf-8 -*- import logging import threading from copy import copy import pika from pika import credentials from .compat import Queue from .filters import FieldFilter from .formatters import JSONFormatter from .compat import ExceptionReporter class RabbitMQHandlerOneWay(logging.Handler): """ Pyth...
RegionMatching.py
from PIL import Image, ImageTk from numbers import Number try: import Tkinter as tk import tkMessageBox as tkmb except ImportError: import tkinter as tk import tkinter.messagebox as tkmb import multiprocessing import subprocess import pyperclip import tempfile import platform import numpy import time im...
hot_pi_d.py
import sqlite3 import threading import time class TemperatureRecorder: thread_stop_event = threading.Event() last_temp = 0 last_commit_time = time.time() def start(self): threading.Thread(target=self.record, args=(self.thread_stop_event,)).start() def stop(self): self.thread_stop_event.set() def recor...
redirect_streams.py
import os import sys import subprocess import threading from .mflog import decorate # This script runs another process and captures stderr and stdout to a file, decorating # lines with mflog metadata. # # Usage: redirect_streams SOURCE STDOUT_FILE STDERR_FILE PROGRAM ARG1 ARG2 ... def reader_thread(SOURCE, dest_fil...
12.py
# -*- coding: utf-8 -*- import LINEPY from LINEPY import * from akad.ttypes import * from multiprocessing import Pool, Process from time import sleep import pytz, datetime, pafy, time, timeit, random, sys, ast, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, wikipedia from dateti...
http.py
from __future__ import print_function import base64 import copy import json import logging import os import random import ssl import string import sys import threading import time from builtins import object from builtins import str from flask import Flask, request, make_response, send_from_directory from werkzeug.se...
server.py
#! /usr/bin/python import socket import SocketServer import threading import sys import os import logging import struct import time # Custom Imports import world from commands import * from shared_functions import * HOST = '' PORT = 6699 CURRENT_VERSION = 0x100 logging.basicConfig( level = logging.DEBUG ) logger...
util.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2011 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights t...
multitester.py
""" Certbot Integration Test Tool - Configures (canned) boulder server - Launches EC2 instances with a given list of AMIs for different distros - Copies certbot repo and puts it on the instances - Runs certbot tests (bash scripts) on all of these - Logs execution and success/fail for debugging Notes: - Some AWS ima...
fuchsia.py
# Copyright (C) 2018 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
main.py
import copy import json import logging import os import re import signal import sys import threading import time import traceback import warnings import webbrowser from distutils.version import StrictVersion import numpy as np import pyqtgraph as pg from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import pyqtSig...
markerSets.py
############################################################################### # # markerSet.py - Calculate and process marker sets. # ############################################################################### # # # This program ...
delete-projects.py
import threading import time import os from collections import namedtuple from kubernetes.client.rest import ApiException from kubernetes.client.configuration import Configuration from kubernetes.config.incluster_config import load_incluster_config from kubernetes.client.api_client import ApiClient from openshift.dy...
Main.py
import random import time from FPSDetect import * from ctypes import * # 加载相关工具函数 from utils.FPSUtils import * dll = cdll.LoadLibrary(r'lib/Dll.dll') # 加载用C语言封装过的“易键鼠”dll def shoot_screen(): while True: img = pyautogui.screenshot(region=[LEFT, TOP, 640, 640]) # region为屏幕截取区域格式为(left,top,w,h) ...
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 json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
dev.py
from __future__ import absolute_import from __future__ import division import collections import json import re import itertools import string import sys from builtins import range from builtins import str from pydub import AudioSegment from pydub.playback import play from fuzzywuzzy import fuzz import pyspeedtest...
vtFunction.py
# encoding: UTF-8 """ 包含一些开发中常用的函数 """ import os import decimal import json import datetime as dt import time from datetime import datetime,time import threading import multiprocessing.pool import functools from math import isnan MAX_NUMBER = 10000000000000 MAX_DECIMAL = 4 #------------------------------------------...
power_monitoring.py
import random import threading import time from statistics import mean from typing import Optional 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 from selfdrive.statsd imp...