source
stringlengths
3
86
python
stringlengths
75
1.04M
processes_netmiko_queue.py
#!/usr/bin/env python ''' Use processes and Netmiko to connect to each of the devices. Execute 'show version' on each device. Use a queue to pass the output back to the parent process. Record the amount of time required to do this. ''' from __future__ import print_function, unicode_literals from multiprocessing import ...
test_pool.py
# Copyright (c) 2011 Brian Beach # All rights reserved. # # 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, ...
buttontest(v2).py
from gpiozero import Button from time import sleep import tkinter as tk from threading import Thread button17 = Button("GPIO17") button22 = Button("GPIO22") button23 = Button("GPIO23") button27 = Button("GPIO27") #if button22.is_pressed: # print("button23 pressed") #if button23.is_pressed: # print("button23 pre...
verify.py
# -*- coding: utf-8 -*- import logging import socket import threading import time import coloredlogs from prettytable import PrettyTable from pytdx.config.hosts import hq_hosts logger = logging.getLogger(__name__) # coloredlogs.install(fmt='[%(asctime)s] %(levelname)s %(message)s') result = [] hosts = [] for x in h...
tgacli.py
import threading from time import sleep class TGACli: ''' The Galaxy Aces Discord Bot CLI Interface quit exit q - Closes the bots and exits the program. list - lists the avaiable bots. select <bot_id> - Selects the <bot_id> for further commands. help - Displays this help ''' def __init...
musicdata_mpd.py
#!/usr/bin/python # coding: UTF-8 # musicdata service to read from MPD # Written by: Ron Ritchey from __future__ import unicode_literals import json, mpd, threading, logging, Queue, time, sys, getopt import musicdata class musicdata_mpd(musicdata.musicdata): def __init__(self, q, server=u'localhost', port=6600, ...
pip_gui.py
import os import shutil import subprocess import tempfile import threading import tkinter as tk from tkinter import ttk, messagebox from typing import cast, Tuple from thonny import running, get_runner, get_workbench, ui_utils from thonny.common import InlineCommand from thonny.languages import tr from thonny.plugins....
ViewWinRenderedGrid.py
''' Created on Oct 5, 2010 @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. Note speed of using tkinter appears to be slow to render with tkinter (see profiling below) Typical example is an instance takes 3 secs for view() for an open table and subsequently after Python...
server.py
################################################################################ ## author: Lucas santos ## version: 1.0 ## Python 3.6.5 | UTF-8 import socket from threading import Thread from random import randint ################################################################################ class Server: de...
tuner.py
import threading import datetime from fHDHR.exceptions import TunerError from fHDHR.tools import humanized_time from .stream import Stream class Tuner(): """ fHDHR Tuner Object. """ def __init__(self, fhdhr, inum, epg, origin): self.fhdhr = fhdhr self.number = inum self.ori...
command_line.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- import os import sys import gettext import multiprocessing import time import datetime from ikabot.config import * from ikabot.web.session import * from ikabot.helpers.gui import * from ikabot.function.donate import donate from ikabot.function.update import update from i...
data_preprocessor_inference.py
import os import time from threading import Timer import multiprocessing from multiprocessing import Process, JoinableQueue import nibabel as nib from os import listdir, makedirs from os.path import join, exists, realpath from scipy import ndimage import numpy as np import traceback import argparse import sys import ...
threaddemos.py
''' 多线程 ''' import threading balance = 0 lock = threading.Lock() #添加锁的实例 def changbalance(n): global balance lock.acquire() #这里锁加在对balance进行操作的地方,而不是对整个方法枷锁 try: balance = balance + n balance = balance - n finally: lock.release() def run_thread(n): for i in range(1...
pyvenvex.py
#!/usr/bin/env python3 # # Copyright (C) 2013 Vinay Sajip. New BSD License. # import os import os.path from subprocess import Popen, PIPE import sys from threading import Thread from urllib.parse import urlparse from urllib.request import urlretrieve import venv class ExtendedEnvBuilder(venv.EnvBuilder): """ T...
io_interface.py
# Copyright (c) 2013-2018, Rethink Robotics 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 ag...
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...
main_confounding.py
#!/usr/bin/env python3 import threading import multiprocessing import numpy as np import tensorflow as tf import argparse from lib.confounding_envs import * from lib.networks import AC_Network_Confounding as AC_Network from lib.helper import * from sacred import Experiment from sacred.observers import MongoObserver e...
threaded_camera.py
from picamera import PiCamera import picamera.array import imageio from colorama import Fore import picamera import io from threading import Thread, Lock import time from slurm.rate import Rate import numpy as np rgb2g = np.array([0.2989, 0.5870, 0.1140]) bgr2g = np.array([0.1140, 0.5870, 0.2989]) rgb2gray = lambda ...
api_utils_test.py
# Copyright 2013 Google Inc. All Rights Reserved. """Tests for api_utils.py.""" import os import threading import time import unittest import mock from google.appengine.ext import ndb from google.appengine import runtime from google.appengine.api import apiproxy_stub_map from google.appengine.ext import testbed tr...
PseudoVols.py
from snappy import Manifold from cypari import * from multiprocessing import * import copy import sys from ManifoldIterators import * from VolumeUtilities import * def prepare_pvolume_file(maniter, ofilenm, append = False, engine = 'magma', max_secs = 20, sln = 2, retrieve = True, period = 100, separator = ';'): ...
java.py
import json import socketserver import socket import sys import re from threading import Thread import py4j import hail class FatalError(Exception): """:class:`.FatalError` is an error thrown by Hail method failures""" class Env: _jvm = None _gateway = None _hail_package = None _jutils = None ...
__init__.py
# -*- coding: UTF-8 -*- #virtualBuffers/__init__.py #A part of NonVisual Desktop Access (NVDA) #This file is covered by the GNU General Public License. #See the file COPYING for more details. #Copyright (C) 2007-2015 NV Access Limited, Peter Vágner import time import threading import ctypes import collection...
map.py
from functools import cached_property import math import threading from queue import Queue from .dimensions import Paper from .dimensions import TileGrid from .listmap import Layer, Tile from . import image class Sheet(Paper): MIN_PAPER_SIZE = 5 IMAGE_BLEED = 2 FOOTER_HEIGHT = 15 MARGIN = 6 def ...
main_widget.py
# -*- coding: utf-8 -*- import sys import os import time import torch if hasattr(sys, 'frozen'): os.environ['PATH'] = sys._MEIPASS + ";" + os.environ['PATH'] from PyQt5 import QtWidgets from PyQt5.QtWidgets import * from PyQt5 import QtCore, QtGui, uic from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5...
server.py
#-*- coding: utf8 -*- import pygame import socket, json, time, struct import sys, subprocess, pickle from PIL import Image from threading import Thread import cv2 # socket config CAR_IP = "192.168.1.118" SERVER_CMD_PORT = 9101 SERVER_IMAGE_PORT = 9102 SERVER_SENSOR_PORT = 9103 MSG_SENSOR_LENGTH = 1024 IMAGE_RESOLUTIO...
TFLite_detection_webcam.py
######## Webcam Object Detection Using Tensorflow-trained Classifier ######### # # Author: Evan Juras # Date: 10/27/19 # Description: # This program uses a TensorFlow Lite model to perform object detection on a live webcam # feed. It draws boxes and scores around the objects of interest in each frame from the # webcam...
main.py
#! /usr/bin/env python from enum import Enum import time import math import signal import threading import Adafruit_PCA9685 class ServoMotor: def __init__( self, pwm, channel, step_for_0deg, step_for_180deg ): self.__pwm = pwm self.__channel = channel self.__min_step = step_for_0deg ...
osa_online_reintegration.py
#!/usr/bin/python """ (C) Copyright 2020-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import time import random import threading from itertools import product from write_host_file import write_host_file from daos_racer_utils import DaosRacerCommand from osa_utils import OSAUtils from a...
database_heartbeat.py
import datetime import logging import os import socket import threading from galaxy.model import WorkerProcess from galaxy.model.orm.now import now log = logging.getLogger(__name__) class DatabaseHeartbeat: def __init__(self, application_stack, heartbeat_interval=60): self.application_stack = applicati...
blockchain_processor.py
#!/usr/bin/env python # Copyright(C) 2011-2016 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 to use, copy, ...
buildmd.py
# -*- coding: utf-8 -*- # @Author: gunjianpan # @Date: 2019-01-31 17:08:32 # @Last Modified by: gunjianpan # @Last Modified time: 2019-03-27 23:47:55 import codecs import threading import time import os import re import random from bs4 import BeautifulSoup from proxy.getproxy import GetFreeProxy from util.util im...
__init__.py
import sys import os import time from hoocron_plugin import HoocronHookBase from threading import Thread from queue import Queue, Empty import socketio # standard Python sio = socketio.Client() class WebsocketHook(HoocronHookBase): def __init__(self): self.th = None self.timeout = 2 self....
blaster_ssh.py
#!/usr/bin/env python2 # This is # # # by sn0wfa11 import sys try: import paramiko import os import multiprocessing import threading import argparse import time import subprocess from lib.common import * from lib.network import * except Exception, err: print >> sys.stderr, err sys.exit(1) us...
threadedclient.py
# -*- coding: utf-8 -*- import threading from ws4py.client import WebSocketBaseClient __all__ = ['WebSocketClient'] class WebSocketClient(WebSocketBaseClient): def __init__(self, url, protocols=None, extensions=None, heartbeat_freq=None, ssl_options=None, headers=None): """ .. co...
concurrent1.py
# # Copyright: Copyright (c) MOSEK ApS, Denmark. All rights reserved. # # File: concurrent1.py # # Purpose: Demonstrates a simple implementation of a concurrent optimizer. # # The concurrent optimizer starts a few parallel optimizations # of the same problem using different algori...
test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None imp...
q1_priority_eval.py
import time import threading import numpy import pyglet from flatland.utils.rendertools import RenderTool from flatland.utils.graphics_pgl import RailViewWindow from utils.environment_utils import create_multi_agent_environment from q1_priority_plan import genetic_algorithm,prioritized_planning # Evalua...
master.py
import sys import json import socket import time import random import numpy as np import pandas as pd import matplotlib.pyplot as plt import requests import threading import copy import trace def initConfig(): with open(sys.argv[1]) as f: conf = json.load(f) config = conf['workers'] worker_id_to_index = {} ...
miniterm.py
#!C:\Users\magnu\Documents\balancing_platform\venv\Scripts\python.exe # # Very simple serial terminal # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C)2002-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import codecs import os import sys import threading ...
LineBot.py
from multiprocessing import Process import config import tweepy from DataBase.timetimetime import DB_line from flask import Flask, request, abort from flask import redirect, render_template, flash from linebot import ( LineBotApi, WebhookHandler ) from linebot.exceptions import ( InvalidSignatureError ) from l...
bind_amqp.py
import functools import logging import threading from galaxy.util import asbool, mask_password_from_url from pulsar import manager_endpoint_util from pulsar.client import amqp_exchange_factory log = logging.getLogger(__name__) TYPED_PARAMS = { "amqp_consumer_timeout": lambda val: None if str(val) == "None" els...
jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
leo_cloud.py
""" leo_cloud.py - synchronize Leo subtrees with remote central server Terry N. Brown, terrynbrown@gmail.com, Fri Sep 22 10:34:10 2017 This plugin allows subtrees within a .leo file to be stored in the cloud. It should be possible to support various cloud platforms, currently git and systems like DropBox are supporte...
graph-size-degree-trim.py
#! /usr/bin/env python # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) Michigan State University, 2009-2013. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: khmer-project@idyll.org # import khmer import sys import screed import os.path import...
faf.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests cl = LINETCR.LINE() cl.login(qr=True) #cl.login(token='') cl.loginResult() print "===[Login Success]===" helpMessage =""" ====={...
boarddelete.py
import requests import json import threading from bs4 import BeautifulSoup from time import sleep def getUserid(user_id,user_pw): _url = "https://dcid.dcinside.com/join/mobile_app_login.php" _hd = { "User-agent" : "dcinside.app", "Referer" : "http://www.dcinside.com" } _data = { "user_...
dataset.py
import os import random import cv2 import numpy as np from Queue import Queue from threading import Thread from six.moves import cPickle as pickle from util.figs import imshow class DataSet(object): def __init__(self, dataset_params): #process params self.data_path = str(dataset_params['path']) ...
control.py
import threading import subprocess import json import csv from time import sleep from logger import Logger from mqtt import MqttClient from climate import Climate from state import HouseState from gpio import read_devices, toggle_device def trigger_alarm(): alarm_playback = threading.Thread(target=play_alarm) ...
segment.py
import argparse import json import logging import os import threading from os.path import exists, join, split, dirname import time import numpy as np import shutil import sys from PIL import Image import torch import torch.utils.data from torch import nn import torch.backends.cudnn as cudnn from torch.autograd 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...
sniffkin3.py
from wifipumpkin3.core.config.globalimport import * from wifipumpkin3.core.common.uimodel import * from threading import Thread import queue from scapy.all import * import wifipumpkin3.core.utility.constants as C from wifipumpkin3.core.utility.collection import SettingsINI from wifipumpkin3.plugins.sniffkin3 import * f...
air_queue.py
import multiprocessing from time import sleep import os, sys, time import logging import coloredlogs # Locals dirname = os.path.dirname(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) sys.path.append(dirname) from src.models.icestupaClass import Icestupa from src.utils.settings import config # define w...
manager.py
#!/usr/bin/env python3 import os import time import sys import fcntl import errno import signal #import shutil import subprocess import datetime import textwrap from typing import Dict, List from selfdrive.swaglog import cloudlog, add_logentries_handler from common.op_params import opParams traffic_lights = opParams()...
cc_websocket.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import time import utils import threading import websocket import json import copy class Websocket: def __init__(self, url="", product="", channels=[], api_key="", api_secret="", api_passphrase="",): # make sure we've got required argum...
highspeed_publisher.py
import rclpy import threading import time #ros imports from rclpy.node import Node from std_msgs.msg import String from std_msgs.msg import Int64 class SimplePublisher(Node): """ ros2relay NetworkSubscriber "subscribes" to the NetworkPublisher and publishes them on the local ros2 network expect...
main.py
# Copyright 2020 Google Research. 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...
test_client.py
#!/usr/bin/env python3 import argparse import http.server import json from pathlib import Path import socketserver import ssl import subprocess import sys import threading def create_root_certificate(stem): cert_path = stem + ".pem" key_path = stem + ".key" cmd = ( "openssl", "req", ...
day18_part2_mp.py
from __future__ import print_function, division, absolute_import from multiprocessing import Process, Queue, Manager try: from queue import Empty except: from Queue import Empty class Program(object): def __init__(self, inp, id): self.instructions = [] for line in inp: inst, ...
build_modelseed.py
import os import shutil import re import sqlite3 import urllib2 import httplib # from tqdm import tqdm from multiprocessing import Process, Queue from requests.exceptions import ConnectionError from cobra import io from copy import deepcopy import pubchempy import Database from Database import mackinac from Pubchem imp...
server.py
# PackedBerry Server from flask import Flask from threading import Thread import logging import time app = Flask('') log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) @app.route('/') def home(): start_file = open("web/start.html", "r") start = start_file.read() start_file.close() server_file = ope...
test_search_20.py
import threading import time import pytest import random import numpy as np from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.utils import * from ...
diskover.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """diskover - Elasticsearch file system crawler diskover is a file system crawler that index's your file metadata into Elasticsearch. See README.md or https://github.com/shirosaidev/diskover for more information. Copyright (C) Chris Park 2017-2019 diskover is released unde...
chooser.py
import argparse try: import Tkinter except ImportError: import tkinter as Tkinter import yaml import os import subprocess import re import time import threading if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument( "--configpath", type=str, default=os.path.join(os.path.dirname(os...
runner.py
# -*- coding: utf-8 -*- # version __version__ = '1.0.1.1' import logging import os import sys import yaml from multiprocessing import cpu_count, Process from os.path import isfile from twisted.internet import reactor from twisted.names import dns from . import server, monitor from .finder import Finder logger = log...
mouseup.py
import pyautogui as pg import multiprocessing import time print(pg.position()) def foo(): pg.moveTo(418,355) pg.mouseDown(button='left') # press the left button down if __name__ == '__main__': # Start foo as a process p = multiprocessing.Process(target=foo) p.start() # Wait 69 seconds for foo ...
server.py
import asyncio from multiprocessing import Process, cpu_count import socket from server.http import Request from utils.logger import Logger class Server: def __init__(self, config): self.host = config['host'] self.port = config['port'] self.process_num = Server.__get_process_num(config['p...
player.py
import threading import io import pyaudio is_playing = False thread = None def play(np_array, sampling_rate): global is_playing global thread if is_playing: stop() bytesio = io.BytesIO(np_array) is_playing = True thread = threading.Thread(target=lambda: play_thread(bytesio, sampling...
nn_test.py
# Copyright 2021 The Flax Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
async.py
#!/usr/bin/env python # encoding: utf-8 """ async.py - functions for asyncrounous code Created by Maximillian Dornseif on 2009-02-15. Copyright (c) 2009 HUDORA. All rights reserved. parts based on http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/84317 """ import copy import sys import threading class Future:...
dxl_reacher.py
# Copyright (c) 2018, The SenseAct Authors. # 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 time import copy import numpy as np import baselines.common.tf_util as U from baselines.trpo_mpi.trpo_mpi import...
test_advanced.py
# coding: utf-8 from concurrent.futures import ThreadPoolExecutor import json import logging import random import sys import threading import time import numpy as np import pytest import ray.cluster_utils import ray.test_utils from ray.test_utils import client_test_enabled from ray.test_utils import RayTestTimeoutEx...
multi_env.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Mar 14 09:54:26 2018 @author: anonymous Multiprocessing of the ViZDoom enviroment, uses pipes for communication """ import gc import time from itertools import islice from collections import deque import multiprocessing as mp import numpy as np from ...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
test_base.py
""" switchboard.tests.test_base ~~~~~~~~~~~~~~~ :copyright: (c) 2015 Kyle Adams. :license: Apache License 2.0, see LICENSE for more details. """ import time import threading from nose.tools import ( assert_equals, assert_true, assert_false, assert_raises ) from mock import Mock, patch from blinker im...
timestep_dataset_test.py
# Lint as: python3 # Copyright 2019 DeepMind Technologies Limited. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
test_index.py
import os import multiprocessing as mp import pytest import numpy as np from jina.flow import Flow from jina.proto import jina_pb2 from jina.parser import set_flow_parser from jina.enums import FlowOptimizeLevel from jina.executors.indexers.vector import NumpyIndexer from tests import random_docs cur_dir = os.path....
livestream.py
# -*- coding: utf-8 -*- ''' ROS module for Tobii Pro Glasses Copyright 2017 Carnegie Mellon University. All Rights Reserved. NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, EITHER EXPR...
docker_helper.py
#! /usr/bin/env python from typing import Dict, List, Any, Generator from datetime import datetime as dt from collections import deque import multiprocessing as mp import logging import signal import time import math import json import pdb import sys import plotext as plt import docker log = logging.getLogger(__file_...
tester.py
#This file sets up and runs the server. import Queue,time from databaseThread import * from threading import * from matchMakingThread import * import socket from userThread import * from gameplayThread import * from gameUtils import * from setup import * def main(): #Setup database setupDatabase() #Socke...
wui.py
# Copyright (c) 2019 Tamas Keri. # Copyright (c) 2019-2021 Renata Hodovan, Akos Kiss. # # Licensed under the BSD 3-Clause License # <LICENSE.rst or https://opensource.org/licenses/BSD-3-Clause>. # This file may not be copied, modified, or distributed except # according to those terms. import logging import os import s...
Multiprocessing_efficient_IDLE.py
import psycopg2 from datetime import datetime import pandas as pd import multiprocessing as mp import time from multiprocessing import Pool import psycopg2 from datetime import datetime import pandas as pd import multiprocessing as mp import time import psycopg2 from datetime import datetime import pandas as pd import ...
demo_timeserver.py
""" <Program Name> demo_timeserver.py <Purpose> Acts as an Uptane-compliant Timeserver: -Listens for requests from vehicles over XML-RPC. -Receives a list of nonces and responds with a signed time attestation that lists those nonces. Currently, this module contains both core and demo code. Use: ...
self.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests from gtts import gTTS cl = LINETCR.LINE() cl.login(qr=True) #cl.login(token='') cl.loginResult() print "===[Login Success]===" h...
shutit_util.py
#!/usr/bin/env pythen """ShutIt utility functions. """ # The MIT License (MIT) # # Copyright (C) 2014 OpenBet Limited # # 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, ...
before_experiment.py
import csv import os import sys import time import threading import logging from http.server import BaseHTTPRequestHandler, HTTPServer from AndroidRunner.Device import Device from multiprocessing import Process from AndroidRunner.Profilers import Profilers navigationTime = {'fetchTime': 0, 'workerTime': 0, 'totalTime'...
test.py
import time import uuid from threading import Thread import redis from redis import StrictRedis class RedisLock(object): """ 基于Redis实现分布式锁 """ def __init__(self, redis_conn, prefix='lock', sleeptime=1): self.redis_conn = redis_conn self.prefix = prefix self.identifier = str(u...
node.py
import socket import threading import os import hashlib import json from pathlib import Path import logging from peerList import PeerList import sys import time import math from watchdog.observers import Observer from watchdog.events import PatternMatchingEventHandler class Handler(PatternMatchingEventHandler): ...
nighthawk_grpc_service.py
"""Contains the NighthawkGrpcService class.""" import logging import socket import subprocess import tempfile import threading import time from test.integration.common import IpVersion # TODO(oschaaf): unify some of this code with the test server wrapper. class NighthawkGrpcService(object): """Class for running th...
importers.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE.txt file in the root directory of this source tree. import datetime import random import time import pandas as pd import threading, queue...
secsgem.py
# _*_ coding: utf-8 _*_ #@Time : 2020/7/29 上午 10:45 #@Author : cherish_peng #@Email : 1058386071@qq.com #@File : secsgem.py #@Software : PyCharm from .streamdecoder import Streamdecoder from .messagetype import MessageType from .secsmessage import SecsMessage from .errsecsmsg import ErrSecsMsg,ErrSecs...
ping.py
from threading import Thread import subprocess from Queue import Queue class pinger(): response = {} #wraps system ping command def pinger(self, i, q): """Pings subnet""" while True: host = q.get() print("\npinging %s" % host) ret = subprocess.call("pi...
base.py
import abc import time import threading import uuid try: import queue except ImportError: import Queue as queue from optinum import factory from optinum.common import config from optinum.common import utils from optinum.worker import base LOG = utils.get_logger(__name__) class Task(object): def __init_...
train_pg_multi_param.py
from train_pg_f18 import train_PG from multiprocessing import Process import os import time def main(): import argparse parser = argparse.ArgumentParser() parser.add_argument('--batch_size', '-b', type=int, nargs='*') parser.add_argument('--learning_rate', '-lr', type=float, nargs='*') parser.add...
launch.py
#!/usr/bin/env python # 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 # "L...
dynamodb_state_store.py
import logging import math import os import pickle import threading import time from collections import defaultdict from collections import OrderedDict import boto3 from tron.metrics import timer OBJECT_SIZE = 400000 MAX_SAVE_QUEUE = 500 log = logging.getLogger(__name__) class DynamoDBStateStore: def __init__(...
netcdf.py
#!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. # Author: Frank Warmerdam <warmerdam@pobox.com> # #############################################################...
mpd.py
#!/usr/bin/env python # # (C) 2001 by Argonne National Laboratory. # See COPYRIGHT in top-level directory. # """ usage: mpd [--host=<host> --port=<portnum>] [--noconsole] [--trace] [--echo] [--daemon] [--bulletproof] --ncpus=<ncpus> [--ifhn=<interface-hostname>] [--listenport=<listenport>...
TreeUtilsServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
test.py
import os from multiprocessing import Process # 子进程要执行的代码 def run_proc(name): print('Run child process %s (%s)...' % (name, os.getpid())) if __name__=='__main__': print('Parent process %s.' % os.getpid()) p = Process(target=run_proc, args=('test',)) print('Child process will start.') p.start() ...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from collections import OrderedDict import os import pickle import random import re import subprocess import sys import textwrap import threading import time import unitt...