source
stringlengths
3
86
python
stringlengths
75
1.04M
http-proxy.py
import socket import re import threading import time pl = 80 #printing length for debugging cache_map = {} def validate(buffer): temp = buffer.split(b'\r\n') request_line = temp[0].decode() request_headers = [] for item in temp[1:]: if len(item) != 0: request_head...
threading_event.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Lyon import threading import time import random def conn_mysql(): count = 1 while not event.is_set(): if count > 3: raise TimeoutError('Connection timeout...') print('%s %sth attempt to connect' % (threading.current_thread().getNa...
launcher.py
#/usr/bin/env python3 # Launcher for depthai_demo.py which provides updating capabilities # Standard imports import os, sys, subprocess, time, threading, argparse, datetime import re from pathlib import Path # Import splash screen from splash_screen import SplashScreen # Import version parser from packaging import ve...
test_connection.py
# Copyright DataStax, 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 writing, softwa...
manager.py
# Date: 05/10/2018 # Author: Pure-L0G1C # Description: Manages bots from .bot import Bot from .list import List from .spyder import Spyder from threading import Thread from .const import MAX_REQUESTS class Manager(object): def __init__(self, threads, url): self.threads = threads self.spyder ...
test_nmc.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2019 tecnovert # Distributed under the MIT software license, see the accompanying # file LICENSE.txt or http://www.opensource.org/licenses/mit-license.php. """ basicswap]$ python tests/test_nmc.py """ import os import sys import unittest import json imp...
supervised_popen.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # 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 mus...
client.py
""" Web socket client mixins. | Copyright 2017-2020, Voxel51, Inc. | `voxel51.com <https://voxel51.com/>`_ | """ from collections import defaultdict import logging import signal import threading from retrying import retry import socketio import fiftyone.constants as foc logging.getLogger("socketio").setLevel(loggin...
Hiwin_RT605_ArmCommand_Socket_20190627180655.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd as TCP import HiwinRA605_socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv imp...
runBioWordVec.py
from helper import * import multiprocessing import sys import time from gensim.models.wrappers import FastText numKeywords = int(sys.argv[1]) vectorSize = int(sys.argv[2]) maxCandidateArticles = int(sys.argv[3]) reducedSet = str(sys.argv[4]) print(f"REDUCE SET VALUE == {reducedSet}") printTimestamp("Getting candidate...
optimal_args_hashbits.py
#! /usr/bin/env python # This file is part of khmer, https://github.com/dib-lab/khmer/, and is # Copyright (C) 2015, Michigan State University. # Copyright (C) 2015, The Regents of the University of California. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided...
state_signals_responder.py
import sys import state_signals from multiprocessing import Process import argparse import subprocess class StateSignalsResponder: """ This class runs state signals responder """ def __init__(self, redis_host: str, run_workload_method: str, timeout: int): self.__redis_host = redis_host ...
main.py
import requests import redis import brotli import queue import threading import os from multiprocessing.dummy import Pool base = 'http://23.95.221.108' cores = 8 pool = Pool(cores) limit = 1290 redis_queue = queue.LifoQueue() client = redis.StrictRedis() cache = client.hgetall("ebooks") dir_name = './txt/' def get(p...
system_profiler.py
# Copyright 2021 MosaicML. All Rights Reserved. """Profiler to record system level metrics.""" from __future__ import annotations import threading import time from typing import TYPE_CHECKING, Dict, cast import psutil from composer.callbacks import memory_monitor from composer.core.callback import Callback if TYP...
processing.py
import logging from multiprocessing import Process, Queue from pathlib import Path from typing import Iterator, Sequence from configargparse import Namespace from gray.formatters import FORMATTERS, BaseFormatter, CompositeFormatter log = logging.getLogger(__name__) class FormattingError(Exception): exit_code ...
test_runner.py
from threading import Thread import datetime import logging import time import pytest from freezegun import freeze_time from logrotor.runner import Runner UDP_PORT = 1024 @pytest.fixture def runner(tmpdir): config = { 'flush_every_seconds': 5, 'rotate_every_seconds': 3600, 'storage': {...
sonar_non443.py
import argparse import sys from multiprocessing import cpu_count, Process, Queue import logging from datetime import datetime from elasticsearch import Elasticsearch from elasticsearch.helpers import bulk, scan import hashlib import gzip import requests import os from helpers.certparser import process_cert from helpers...
pyusb_backend.py
# pyOCD debugger # Copyright (c) 2006-2021 Arm Limited # Copyright (c) 2020 Patrick Huesmann # Copyright (c) 2021 mentha # Copyright (c) Chris Reed # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
NOPE.py
from tda.auth import easy_client from tda import auth import pandas as pd import numpy as np import os from datetime import datetime import atexit import json import itertools import threading import pandas_market_calendars as mcal from pprint import pprint from sqlalchemy import create_engine import psyco...
tenet_stun.py
from threading import Thread from time import sleep, time from Tenet.sock_stun import udpSocket ''' #### Tenet库,网络传输库,实现连入互联网的客户端点对点传输。 // 使用时可能需要关闭电脑的防火墙 // #### ''' ###### Tenet ##### class Tenet_stun: def __init__(self, server_addr=('127.0.0.1', 9084), group='A'): self.group = group ...
train.py
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentParser def main(opt): ArgumentParser.validate_train_op...
__init__.py
import subprocess import os, sys, threading, time from datetime import datetime CURRENT_DIR = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, os.path.join(CURRENT_DIR, "..", "..")) import constants APT_GET_UPDATES = "apt-get upgrade -s" PIP_UPDATES = "pip list -o" OUTDATED_NOTIFICATION = "There are %d ...
sb-wa-stt.py
# # K9 Conversation by Richard Hopkins using - # # Kitt-AI Snowboy for hotword recognition # Watson Speech to Text (streaming to sockets) # Watson Assistant for Conversation # eSpeak Text to Speech # Robot status displayed with Adafruit PWM Servo Driver driving LED brightness # # Snowboy elements derived from # Kitt-AI...
test_autograd.py
import gc import io import math import os import random import sys import tempfile import threading import time import unittest import uuid import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, par...
eval.py
import argparse import logging import os import pickle import time import torch.multiprocessing as mp from dataloader import EvalDataset, TrainDataset, get_dataset backend = os.environ.get("DGLBACKEND") if backend.lower() == "mxnet": from train_mxnet import load_model_from_checkpoint, test else: from train_py...
inkscape_control.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import paste import subprocess from multiprocessing import Process from pathlib import Path import tkinter.messagebox as messagebox from shutil import copy from appdirs import user_config_dir import logging as log from globe import Globe as globe from util impo...
generate_trajectories.py
import os import sys sys.path.append(os.path.join('/Users/jiasenl/Code/alfred')) sys.path.append(os.path.join('/Users/jiasenl/Code/alfred', 'gen')) import time import multiprocessing as mp import json import random import shutil import argparse import numpy as np import pandas as pd from collections import OrderedDict...
models.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from scheduled_job_client.notification import ( notify_job_start, notify_job_status) from scheduled_job_client.job import start_background_job from django.db import models from django.utils.timezone import localtime, now import threading # Models supp...
Thread3.py
from threading import Thread import time """ 多线程中使用全局变量 """ # 注意线程与进程不同的是,多线程间是可以共享全局变量的 g_num = 100 def work1(): global g_num for i in range(3): g_num += 1 print('--- in work1, g_num is %d ---' % g_num) def work2(): global g_num print('--- in work2, g_num is %d ---' % g_num) print('-...
config_reader.py
import copy import multiprocessing as mp def process_configs(target, arg_parser): print('2') args, _ = arg_parser.parse_known_args() print('args in process_configs:', args) ctx = mp.get_context('spawn') for run_args, _run_config, _run_repeat in _yield_configs(arg_parser, args): p = ctx.Pr...
test_remote_datatypes.py
import itertools import time from threading import Thread from assemblyline.common.uid import get_random_id # noinspection PyShadowingNames def test_hash(redis_connection): if redis_connection: from assemblyline.remote.datatypes.hash import Hash with Hash('test-hashmap') as h: assert...
flight_manager.py
"""Reusable controller for starting flight processes""" import argparse import logging from multiprocessing import Process, Queue from multiprocessing.managers import BaseManager from logger import init_logger, worker_configurer from communication import Communication from flight.flight import flight from flight.sta...
ctp_gateway.py
""" """ import sys import traceback import json from datetime import datetime, timedelta from time import time from copy import copy, deepcopy from functools import lru_cache from typing import List import pandas as pd from vnpy.api.ctp import ( MdApi, TdApi, THOST_FTDC_OAS_Submitted, THOST_FTDC_OAS_Ac...
ServiceController.py
from honeygrove import log from honeygrove.config import Config from honeygrove.services import ServiceBaseModel # from honeygrove.tests.testresources import serviceControllerTestPkg # Actually used import threading from twisted.internet import reactor class ServiceController(): def __init__(self): """...
test_websocket_integration.py
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2018, 2019. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any...
TCP_echo_server.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 # ...
via_app_data.py
"""Bootstrap""" from __future__ import absolute_import, unicode_literals import logging from contextlib import contextmanager from threading import Lock, Thread from virtualenv.info import fs_supports_symlink from virtualenv.seed.embed.base_embed import BaseEmbed from virtualenv.seed.embed.wheels.acquire import get_w...
close_poet.py
# Re-implmenetation of POET with ARS instead of ES and with A1 robot on # procedurally generated environments import numpy as np import multiprocessing as mp from multiprocessing import Process, Pipe import argparse from scenes.poet_env import create_poet_env from copy import deepcopy import random import time from e...
skycam.py
#!/usr/bin/env python3 import os import time import zwoasi as asi from threading import Thread from queue import Queue from PIL import Image from glob import glob class SkyCam: """ SkyCam is an abstraction layer for zwoasi Python bindings """ @staticmethod def initialize(_library=None): """ ...
rpc.py
from enum import Enum import time import logging import threading import select from msgpackio.client import Client from msgpackio.future import Future class LostFuture(Exception): pass REQUEST = 0 RESPONSE = 1 NOTIFY = 2 def _seq(): value = 0 while True: yield value value += 1 ...
tpu_estimator.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.py
from flask import Flask, Blueprint, redirect, url_for, render_template, request, json, jsonify from werkzeug.utils import secure_filename from threading import Thread import os from configuration import CommonConfigurations, Configuration from piece import CommonPieces, Piece configurations_bp = Blueprint( 'config...
maya.py
from __future__ import absolute_import import functools import threading import time from maya import cmds import mayatools.shelf from mayatools.geocache import utils as geocache_utils from uitools.threads import defer_to_main_thread, call_in_main_thread from .core import check_paths _check_lock = threading.Lock(...
worker_thread.py
from petronia.util.rwlock import RWLock import threading import queue import traceback _STOP_THREAD_NOTICE = "STOP" _RUNNING_THREAD_QUEUES = [] def stop_all_threads(): # Create a copy of the queues, so we don't get # into a weird state mid-processing for q in list(_RUNNING_THREAD_QUEUES): q.put...
service.py
# -*- coding: utf-8 -*- """ Created on Thu Apr 9 17:20:43 2020 @author: niklas """ import re import os import sys import pwd import secrets import argparse import logging from logging.handlers import SysLogHandler from subprocess import Popen, PIPE from multiprocessing import Process, Pipe import pamela import tor...
proxy.pyw
# -*- coding: utf-8 -*- # socket proxy to run shell commands from Pharo # mainly for Windows, because ProcessWrapper is just broken and I am tired from subprocess import Popen,PIPE,STARTUPINFO,STARTF_USESHOWWINDOW import os import sys import json import socket from base64 import b64encode, b64decode import t...
test_operator.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...
adb_touch_sampler.py
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making GameAISDK available. This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright...
EDL.py
import demistomock as demisto from CommonServerPython import * from CommonServerUserPython import * import re from copy import deepcopy from base64 import b64decode from multiprocessing import Process from gevent.pywsgi import WSGIServer from tempfile import NamedTemporaryFile from flask import Flask, Response, reque...
common.py
# Copyright (C) 2008 The Android Open Source Project # # 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 ...
xla_client_test.py
# Lint as: python3 # 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 ...
clone_seven_eval_mini_srcgame_add_map_bn.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function USED_DEVICES = "2,3" import os os.environ["CUDA_DEVICE_ORDER"] = "PCI_BUS_ID" os.environ["CUDA_VISIBLE_DEVICES"] = USED_DEVICES import sys import threading import time import tensorflow as tf from absl import...
eventing_rqg.py
import os, re import zipfile import datetime import logging from threading import Thread from lib.membase.api.rest_client import RestConnection from lib.testconstants import STANDARD_BUCKET_PORT from pytests.eventing.eventing_constants import HANDLER_CODE, HANDLER_CODE_ERROR from pytests.eventing.eventing_base import E...
line_reader.py
""" Created on 14 Jul 2017 @author: Bruno Beloff (bruno.beloff@southcoastscience.com) A portable, non-blocking Python line reader. Yes, such a thing exists. And this is it... """ import os from multiprocessing import Process, Queue # --------------------------------------------------------------------------------...
parser.py
import logging import queue import threading import requests import cfg from .app_constants import * class FileParser: """ Description: FileParser class contains methods which collectively work together to parse a document. \ This document contains image URLs, one per line. FileParser parse...
latency.py
import argparse import logging import os import sys import time import requests import threading from bitstring import BitArray from datetime import datetime, timedelta from npi import get_correct_utc_time from npi.config import Config from npi.rtcm import RTCM3 MESSAGE = 100 logging.addLevelName(MESSAGE, "MESSAG...
ddns.py
"""Module of utilities to update the IP address of an URL via DDNS.""" import os import time from threading import Thread import requests from extutils.logger import LoggerSkeleton __all__ = ("activate_ddns_update",) LOGGER = LoggerSkeleton("sys.ddnsupdate", logger_name_env="DDNS_UPDATE") ENABLED = True DDNS_PASSW...
test_util.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...
main.py
from flask import Flask, request, jsonify from utils.nodefinder import node_finder from utils.simulator import car_mover, simulator from entities.carpool import Carpool from entities.user import User from entities.car import Car from threading import Thread from utils.bluetooth.serial_connection import SerialConnection...
afhmm.py
from collections import Counter, OrderedDict import math import pandas as pd import numpy as np from nilmtk.disaggregate import Disaggregator import cvxpy as cvx from hmmlearn import hmm from multiprocessing import Process, Manager class AFHMM(Disaggregator): def __init__(self, params): self.model = [] ...
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Tidecoin Client # Copyright (C) 2015 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 withou...
autostep_node.py
#!/usr/bin/env python from __future__ import print_function import json import threading import roslib import rospy import std_msgs.msg import scipy import scipy.interpolate from autostep import Autostep from autostep import AutostepException from autostep_ros.msg import MotionData from autostep_ros.msg import Trac...
test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, temp_dir, requires_type_collecting, TESTFN, unlink, import_module) from test.support.script_helper import assert...
gui.py
from tkinter import * import time import tkinter.messagebox from bot import chat import pyttsx3 import threading saved_username = ["You"] #ans=["PyBot"] window_size="400x400" class ChatInterface(Frame): # Window def __init__(self, master=None): Frame.__init__(self, master) self...
test.py
import subprocess, threading #import os import time EXE_NAME = 'compiled' EXIT_SUCCESS = 0 TIMEOUT = -15 SEGFAULT = 139 class Command(object): def __init__(self, cmd): self.cmd = cmd self.process = None def runTest(self, timeout): def target(): self.process = subprocess....
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
test_realworld_ros_final.py
#!/usr/bin/env python # -------------------------------------------------------- # Licensed under The MIT License [see LICENSE for details] # -------------------------------------------------------- # for testing import argparse import datetime import numpy as np import itertools from core.bc import BC from cor...
utils.py
import itertools import re import subprocess from threading import Thread from six.moves import queue def run_spark_subprocess(cmd, logger): """See https://bit.ly/2OpksJC for source of the subprocess stdout/stderr capture pattern in this function. """ # Spark sometimes logs in log4j format. In those...
_a4c_create.py
from cloudify import ctx from cloudify import utils from cloudify.exceptions import NonRecoverableError from StringIO import StringIO import base64 import os import platform import re import subprocess import sys import time import threading import platform import json def convert_env_value_to_string(envDict): ...
train_a3c.py
import argparse import os import re import numpy as np import torch import torch.multiprocessing as _mp from torch import nn from torch.nn import functional as F from torch.utils.tensorboard import SummaryWriter import environment import tpu from models import A3C from optim import SharedAdam from utils.helper import...
test_submit_handlers.py
# Copyright 2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
heartbeat.py
from threading import Thread, Timer from requests import get, post from requests.exceptions import ConnectionError, ConnectTimeout from document.agent.catalog import AgentCatalogDocument from document.exec_env import ExecEnvDocument from lib.http import HTTP_Status from lib.token import create_token from reader.arg i...
main.py
# -*- coding: utf-8 -*- # Pomito - Pomodoro timer on steroids """Main interaction class.""" import logging import os import sys import threading from queue import Queue from peewee import SqliteDatabase import pomito.plugins from pomito.config import Configuration PACKAGE_NAME = "pomito" DATA_HOME = CONFIG_HOME = o...
catchFrog.py
#!/usr/bin/env python # coding=utf-8 from __future__ import division import cv2 import Adafruit_PCA9685 import time import numpy as np import threading import math pwm = Adafruit_PCA9685.PCA9685() pwm.set_pwm_freq(60) cap = cv2.VideoCapture(0) hsv_min = np.array([45,83,86]) hsv_max = np.array([77,2...
create_gtsdb_tf_records.py
# Copyright 2018 Changan Wang # 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, so...
save_events.py
#!/usr/bin/env python """Extracts messages from CAN Bus interface and save to file""" import os import time import threading import queue import zipfile import can from can import Message # List of OBD-II parameter Ids to query PIDS = { "vehicle_speed": Message( arbitration_id=0x7DF, extended_id=...
streaming.py
# Tweepy # Copyright 2009-2010 Joshua Roesslein # See LICENSE for details. # Appengine users: https://developers.google.com/appengine/docs/python/sockets/#making_httplib_use_sockets from __future__ import absolute_import, print_function import logging import re import requests import sys from requests.exceptions imp...
danmu_controller.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2017/12/7 # @Author : wangmengcn # @Email : eclipse_sv@163.com from time import sleep from threading import Thread from .danmu_factory import DouyuDM from . import r def create_danmu_pool(): newroom_pubsub = r.pubsub() newroom_pubsub.subscribe('dan...
lazy_list.py
class lazy_list(): """ Convert input into a list like object in the background or on demand. Useful when processing data that is going to take time to load, but we want to start processing immediately, and are able to process the input mostly linearly (accessing the last element would defeat this). Note: ...
helpers.py
"""Supporting functions for polydata and grid objects.""" import collections.abc import enum import logging import os import signal import sys import threading from threading import Thread import traceback from typing import Optional import warnings import numpy as np import pyvista from pyvista import _vtk from . ...
duplex.py
import gc import multiprocessing import os import random import sys import threading import unittest from buffered_pipe import Generic_Pipe, Static_Pipe CTX = ["fork", "spawn", "forkserver"] CTX = [multiprocessing.get_context(I) for I in CTX] TYPE = ["Generic_Pipe", "Static_Pipe"] PIPE = [lambda: Generic_Pipe(1024, 6...
mqtt_server.py
import socket import threading import json from .compat import b from .mqtt import MQTT from .const import ( LOGGER, SHELLY_TYPES ) from .utils import exception_log class MQTT_connection: def __init__(self, mqtt, connection, client_address): self._mqtt_server = mqtt self._connection = c...
identi.py
#!/usr/bin/env python3 # zeroex00.com # rfc1413 import argparse import socket import sys import threading master_results = [] master_banners = {} master_errors = [] def main(args): if not args.query_port and not args.all_ports: print("[!] you must specify at least one port or -a") exit(2) ...
testTreeViewerInterface.py
import director import os import subprocess import json import threading import time import math import sys import numpy as np import lcm import robotlocomotion as lcmrl def comms_msg(timestamp, data): msg = lcmrl.viewer2_comms_t() msg.format = "treeviewer_json" msg.format_version_major = 1 msg.format...
test_socket.py
import unittest from test import support from test.support import os_helper from test.support import socket_helper from test.support import threading_helper import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import platform...
monobeast.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
fallHandler.py
import double import sys import paho.mqtt.client as mqtt import time import json import datetime import re import toml import threading from notify_run import Notify from navigate import navigate from webpage.changeConfig import ChangeConfig #CONFIG = toml.load('config.toml') f = open('config.json') CONFIG = json.lo...
cb-command_r.py
#!/usr/env python # CB-Command_R # Carbon Black Response - Mass Command Line Data Extractor # gfoss[at]carbonblack.com # March, 2019 import sys, time, argparse, requests, json, threading, thread from config import active global_lock = threading.Lock() file_contents = [] def parse_all_things(): parser = argparse.A...
restore_coordinator.py
# Copyright (c) 2019 Aiven, Helsinki, Finland. https://aiven.io/ import contextlib import enum import json import logging import multiprocessing import os import queue import pymysql import threading import time from contextlib import suppress from pghoard.rohmu import errors as rohmu_errors from pghoard.rohmu import ...
test_daemon.py
import datetime import multiprocessing import os import os.path import time import iso8601 import pytest from edera import Condition from edera import Parameter from edera import Parameterizable from edera import Task from edera import Timer from edera.daemon import Daemon from edera.daemon import DaemonAutoTester fr...
node.py
from uuid import uuid4 import requests import json from random import sample from os.path import exists from gzip import GzipFile import time import threading import logging logger = logging.getLogger(__name__) # number of node that each node send the message to in the P2P network ADJENCENT_NODES=3 from block impor...
translator.py
# -*- coding: utf-8 -*- import re import threading import socket import sys import time import os import random import copy import json import argparse import codecs if sys.version_info.major < 3: is_py3 = False reload(sys) sys.setdefaultencoding("utf-8") sys.stdout = codecs.getwriter("utf-8")(sys.stdo...
main.py
import sounddevice as sd import soundfile as sf from scipy.io.wavfile import write import re, queue, sys, tempfile, numpy, threading from os import system, path, remove, listdir TRANSCRIPT = "transcript.txt" AUDIO_PATH = "wavs" TEXT_FILE = path.join("text", "natgeo.txt") LOG_FILE = "log.txt" q = queue.Queue() def ca...
TServer.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...
parallel_util.py
#!/usr/bin/python # -*- coding: utf-8 -*- from multiprocessing.pool import Pool from typing import Dict, Tuple, List, Set, Union, Optional, Callable, Generic, TypeVar from multiprocessing import Process, Queue, get_start_method, set_start_method import time import os from nose.tools import eq_ from pyutils.progress_...
test_ncpapi.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # ------------------------------------------------------------------- # Purpose: Naver Cloud Platform APIs Test # Author: Ho-Jung Kim (godmode2k@hotmail.com) # Filename: test_ncpapi.py # Date: Since October 25, 2021 # # # Reference: # - https://api.ncloud-docs.com/beta/docs...
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 from common.basedir import ...
ircthread.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, m...
presence_adapter.py
"""Presence Detection adapter for WebThings Gateway.""" import os import re import sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'lib')) import json import time import socket from datetime import datetime, timedelta import threading import subprocess from gateway_addon import Adapter, ...
pyPadWormbk1.py
# for monster data of puzzle and dragon 下载战友网图片和资料 import os from queue import Queue import re import time import threading import urllib.request import urllib.error import bs4 import lxml #replace url to start your own download url = "http://pad.skyozora.com/pets/" typestr = ["龍","神","惡魔","機械", "平衡","攻擊","...