source
stringlengths
3
86
python
stringlengths
75
1.04M
server.py
import BaseHTTPServer import errno import os import re import socket from SocketServer import ThreadingMixIn import ssl import sys import threading import time import traceback import types import urlparse import routes as default_routes from logger import get_logger from request import Server, Request from response i...
MasterService.py
#!/usr/bin/env python # - encoding: utf-8 import win32serviceutil import win32service import win32event import sys import servicemanager import time import win32timezone import logging import traceback from master import main_master import threading from configparser import ConfigParser from pathlib i...
feature_extract.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2020 Patrick Lumban Tobing (Nagoya University) # based on PyTorch implementation for WaveNet vocoder by Tomoki Hayashi (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division from __future__ import print_...
test_serializer.py
import math import os import pickle import subprocess import sys from pathlib import Path import pytest import nni import torch import torch.nn as nn from torch.utils.data import DataLoader from torchvision import transforms from torchvision.datasets import MNIST from nni.common.serializer import is_traceable if Tru...
rally.py
import os from threading import Thread import logging import sys from rally.cli.commands.task import TaskCommands from rally.plugins import load as load_plugins from rally.api import API from rally.cli.commands.deployment import DeploymentCommands from rally.plugins import load as load_plugins from rally.exceptions im...
vci_outputFCNM.py
import numpy as np import math import itertools from collections import Counter import sys from numpy import linalg from numba import jit import time from multiprocessing import Process, Queue import csv from itertools import permutations #This function is obtained from pyvci plz see github resource code #this functio...
SocketClass.py
#!/usr/bin/python3 ''' Name: Sagnik Hajra ID: 1001851338 ''' import socket import time import os import json import threading import file_exchange_client import file_exchange_server class SocketClass: def __init__(self, add, port, server=False, clientLimit=10): self.ADDRESS = add self.PORT = port ...
test_utils_test.py
import asyncio import os import pathlib import socket import threading from contextlib import contextmanager from time import sleep import pytest import yaml from tornado import gen from distributed import Client, Nanny, Scheduler, Worker, config, default_client from distributed.core import Server, rpc from distribut...
humidity.py
# vim: set et sw=4 sts=4 fileencoding=utf-8: # # Raspberry Pi Sense HAT Emulator library for the Raspberry Pi # Copyright (c) 2016 Raspberry Pi Foundation <info@raspberrypi.org> # # This package is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as publ...
recipe-577212.py
import time, hashlib, base64 from array import array from SimpleCrypt import SimpleCrypt """ SimpleCryptSockeExt Author: AJ Mayorga Date: 4/30/2010 Having posted SimpleCrypt http://code.activestate.com/recipes/577174/ I wanted to follow with an implementation example, specifically for use in Client/Ser...
mapplot.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 use ...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test emircoind shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_framew...
hackserv.py
#!/usr/bin/env python3 # # HackServ IRC Bot # hackserv.py # # Copyright (c) 2018-2021 Stephen Harris <trackmastersteve@gmail.com> # # 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 res...
browser_base.py
#!/usr/bin/env python from __future__ import print_function, absolute_import # -*- coding: utf-8 -*- __author__ = "perfguru87@gmail.com" __copyright__ = "Copyright 2018, The PerfTracker project" __license__ = "MIT" """ Base browser library """ import sys import time import tempfile import re import logging import o...
tests.py
import errno import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation, SuspiciousOper...
__init__.py
# To avoid organizerImports and declarations, I created a pther file to initizalize from .__server_socket__ import app, socketio, render_template, send, requestFlask from app import views, api_views, socketio_views from threading import Thread task_coins = Thread(target=socketio_views.update_coins_from_api) task_coin...
directory_server.py
# =============================================================================== # Copyright 2012 Jake Ross # # 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/licens...
process_demo.py
from multiprocessing import Process import os def loop(): i = 0 while True: i += 1 def main(): print('start') for _ in range(os.cpu_count()): t = Process(target=loop) t.start() if __name__ == '__main__': main()
visual_cortex.py
# Python Modules from multiprocessing import Process import sys import pathlib import time # Web server Modules from aiohttp import web import aiohttp_jinja2 import jinja2 # Deeplodocus modules from deeplodocus.utils.notification import Notification from deeplodocus.brain.visual_cortex.routes import Routes from deepl...
workflow.py
from functools import wraps from datetime import datetime import time import sys import lttb import numpy as np import threading import os import warnings warnings.simplefilter(action='ignore', category=FutureWarning) import ipdb import scipy.io as io from copy import copy # from tranmission_Forge import MZCalibrate fr...
test_io.py
from __future__ import division, absolute_import, print_function import sys import gzip import os import threading import time import warnings import io import re import pytest from tempfile import NamedTemporaryFile from io import BytesIO, StringIO from datetime import datetime import locale import numpy as np impor...
_polling.py
# ------------------------------------ # Copyright (c) Microsoft Corporation. # Licensed under the MIT License. # ------------------------------------ import logging import time import threading import uuid from typing import TYPE_CHECKING from azure.core.polling import PollingMethod, LROPoller, NoPolling from azure.c...
client02c.py
import copy import logging import asyncio import threading import time from collections import deque from typing import Dict import zmq from zmq.asyncio import Context, Socket import arcade from pymunk.vec2d import Vec2d from demos.movement import KeysPressed, MOVE_MAP, apply_movement from .lib02 import PlayerEvent, P...
problem.py
r""" Module containing problem classes for SIS and LWE and their ring and module variants, as well as statistically secure variants, where applicable. In addition, the module contains estimate functions to estimate the security of parameter problems and estimate result classes to encapsulate return values for cost est...
mailing_list.py
import threading from mailchimp import Mailchimp, ListDoesNotExistError, EmailNotExistsError, ListAlreadySubscribedError, Error from django.conf import settings class SubscribeToMailingList(object): def __init__(self, email, first_name, last_name): self.email = email self.first_name = firs...
build_KEGG_db.py
from __future__ import print_function __author__ = 'Leanne Whitmore' __email__ = 'lwhitmo@sandia.gov' __description__ = 'Build metabolic db using KEGG db' from multiprocessing import Process, Queue import re import sqlite3 import urllib2 import httplib import pubchempy from tqdm import tqdm from Database import query ...
OpenStreamDeck.py
"""OpenStreamDeck""" from threading import Thread from interfaces import Interface import time class OpenStreamDeck(): def __init__(self, interface: Interface, components: list) -> None: self.interface = interface self.run_thread = Thread(target=self._run, args=(), daemon=True) self.c...
query_cache.py
import threading import time # Define a query cache. # ========================== class Entry: """An entry in a QueryCache. """ timestamp = None # The timestamp of the last query run [datetime.datetime] lock = None # Access control for this record [threading.Lock] exc = None ...
rabbitmq.py
import pika from time import sleep import json import amqpstorm from amqpstorm import Message from config import RABBIT_HOST, RABBIT_USERNAME, RABBIT_PASSWORD from logger import log class Consumer(object): """Asynchronous Rpc client.""" def __init__(self): log('rabbitmq-consumer:init', 'Creating clie...
database.py
import pymysql, re, time from threading import Thread from colorama import init, Fore, Style from urllib.parse import quote, unquote from sys import exit class Database(object): def __init__(self, user, password, database, host='127.0.0.1', port=3306): try: init() self.db = pymysql....
speechSpyGlobalPlugin.py
# A part of NonVisual Desktop Access (NVDA) # Copyright (C) 2018 NV Access Limited # This file may be used under the terms of the GNU General Public License, version 2 or later. # For more details see: https://www.gnu.org/licenses/gpl-2.0.html """This module provides an NVDA global plugin which creates a and robo...
Omegle.py
#! /usr/bin/python ############################################################ ############################################################ ## ## ## Copyright 2015 William Whitty ## will.whitty.arbeit@gmail.com ## ## Licensed under the Apache License, Version 2.0 (the "License"); ## you may not use this file except...
DAN.py
import time, random, threading, requests import csmapi # example profile = { # 'd_name': None, 'dm_name': 'MorSensor', 'u_name': 'yb', 'is_sim': False, 'df_list': ['Acceleration', 'Temperature'], } mac_addr = None state = 'SUSPEND' #for control channel #state = 'RESUME' SelectedDF = [] def Con...
JoshuaTree2.py
################# #### IMPORTS #### import click, os, pandas as pd, numpy as np, subprocess, sys, shutil from pybedtools import BedTool from pyfaidx import Fasta from itertools import combinations import scipy.sparse as sps import glob, re from random import randint from Bio import SeqIO, Phylo from Bio.Phylo.TreeCons...
data_utils.py
# Copyright 2018 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...
oplog_manager.py
# Copyright 2013-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
bspLinuxCoCoox.py
#!/usr/bin/python import wx import os import time import re import sys, os import os.path import subprocess import datetime import xml.etree.ElementTree as ET import threading from threading import Thread import wx.lib.newevent VERSION="1.0" ID_BUTTON=100 ID_LOAD=101 ID_RELOAD=102 ID_UNLOAD=103 ID_TOOLCHAIN=104 I...
dummyproxy.py
# ---------------------------------------------------------------------- # Author: yury.matveev@desy.de # ---------------------------------------------------------------------- """Dummy 2D data generator. """ import time import numpy as np import logging from threading import Thread from petra_camera.devices...
test_serialization.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...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
auto_test.py
"""Tests for letsencrypt-auto""" from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from contextlib import contextmanager from functools import partial from json import dumps from os import chmod, environ, makedirs from os.path import abspath, dirname, exists, join import re from shutil import copy, rmtree ...
test_concurrency.py
""" Copyright 2020 Taxamo, Ltd. 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...
test_random_hmac_sha1.py
import binascii import hashlib from hashlib import sha1 import hmac import os import random import string import subprocess import sys import time import threading import Queue BIN_PATH = "./build/test_hmac_sha1" NTHREADS = 2 NTESTS = 10 NBYTES = 20 global still_making_input still_making_input = True tests = Queue....
test_utils_test.py
import asyncio import pathlib import socket import threading from contextlib import contextmanager from time import sleep import pytest from tornado import gen from distributed import Client, Nanny, Scheduler, Worker, config, default_client from distributed.core import rpc from distributed.metrics import time from di...
mic.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
server.py
import struct import socket import sys from threading import Thread import random import copy #TEMP from time import sleep #TEMP from Queue import Queue import time STATES = 16 class Server: def loadResultLut(path): return 0 class RemoteServer(Server): def __init__(self, ip=None, seed=None, riport=None, rvport=N...
runner.py
#!/usr/bin/env python3 # Copyright 2020 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...
bottleneck_query.py
# Copyright 2017 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import datetime import json import os import pickle import Queue import re import sys import time from threading import Thread _APPENGINE_SDK_DIR = os.path....
multi_agent_match.py
import os import sys import time from multiprocessing import Process from os.path import join import numpy as np import torch from algorithms.appooc.learner import LearnerWorker from algorithms.appooc.model import create_actor_critic from algorithms.utils.arguments import parse_args, load_from_checkpoint from algorit...
QueuesExample.py
import time import queue import threading import pyxa1110 framesQueue = queue.Queue() runEvent = threading.Event() runEvent.set() def fetchData (): with pyxa1110.GPS() as gps: while runEvent.is_set(): gps.receiveData() framesQueue.put(gps.ascii()) def flushQueue (): while runE...
keytar.py
#!/usr/bin/env python # Copyright 2017 Google 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...
cifar100_to_mr.py
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
test_noisysine.py
import sys import time import logging import threading import GPy import numpy as np import matplotlib.pyplot as plt import pdb from GPhelpers import * from IPython.display import display from poap.strategy import FixedSampleStrategy from poap.strategy import InputStrategy from poap.tcpserve import ThreadedTCPServer fr...
road_speed_limiter.py
import json import os import select import threading import time import socket import fcntl import struct from threading import Thread from cereal import messaging from common.params import Params from common.numpy_fast import clip, mean from common.realtime import sec_since_boot from selfdrive.config import Conversion...
client.py
import socket import threading HOST = "127.0.0.1" PORT = 5052 ENCODING = "ascii" def handle_send(sock: socket.socket): try: while True: num1 = input() sock.send(num1.encode(ENCODING)) except: sock.close() def handle_receive(sock: socket.socket): try: whil...
robotfinder.py
import logging import socket import threading from robotpy_installer.utils import _resolve_addr logger = logging.getLogger("robotpy.installer") class RobotFinder: def __init__(self, *addrs): self.tried = 0 self.answer = None self.addrs = addrs self.cond = threading.Condition() ...
replay.py
from __future__ import print_function from future import standard_library standard_library.install_aliases() from builtins import zip from builtins import str from builtins import object # Copyright 2018 The TensorFlow Authors All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # yo...
check_update.py
import kivy kivy.require('1.0.9') from kivy.lang import Builder from kivy.uix.gridlayout import GridLayout from kivy.uix.popup import Popup from kivy.properties import * from kivy.uix.progressbar import ProgressBar from kivy.clock import Clock from jnius import autoclass, cast import urllib.request, urllib.parse, u...
__main__.py
import os import sys import time import requests import threading from InstagramAPI import InstagramAPI InstagramAPI = InstagramAPI(sys.argv[1], sys.argv[2]) tmp_path = os.path.dirname(os.path.realpath(__file__)) + '/tmp' def main(argv): InstagramAPI.login() threading.Thread(target=start).start() ...
writer.py
# stdlib import atexit import threading import random import os import time from . import api from .internal.logger import get_logger log = get_logger(__name__) MAX_TRACES = 1000 DEFAULT_TIMEOUT = 5 LOG_ERR_INTERVAL = 60 class AgentWriter(object): def __init__(self, hostname='localhost', port=8126, filters=...
main.py
#-*- coding:utf-8 -*- from detect_simple import detect from PIL import Image import paho.mqtt.client as mqtt import cv2 import argparse import time import threading import queue import datetime as dt from pprint import pprint import json import re import boto3 from botocore.exceptions import ClientError import os # ...
utils.py
# Copyright 2018 Open Source Robotics Foundation, 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...
utils.py
import asyncio import functools import html import importlib import inspect import json import logging import multiprocessing import os import pkgutil import re import shutil import socket import sys import tempfile import threading import warnings import weakref import xml.etree.ElementTree from asyncio import Timeout...
test_transaction.py
#!/usr/bin/env python import threading import unittest import psycopg2 from psycopg2.extensions import ( ISOLATION_LEVEL_SERIALIZABLE, STATUS_BEGIN, STATUS_READY) import tests class TransactionTests(unittest.TestCase): def setUp(self): self.conn = psycopg2.connect(tests.dsn) self.conn.set_is...
Audio.py
''' Audio player and controller from Automator ========================================== github: https://github.com/Davide255/Automator module from core.audio See Audio class fro docs MIT License Copyright (c) 2022 Davide Permission is hereby granted, free of charge, to any person obtaining a copy ...
malware_downloader.py
""" Malware dataset builder """ import time from requests import get from bs4 import BeautifulSoup from threading import Thread url_backdoor = 'https://malshare.com/search.php?query=backdoor' url_trojan = 'https://malshare.com/search.php?query=trojan' url_rootkit = 'https://malshare.com/search.php?query=rootkit' ur...
threading_simpleargs.py
import threading def worker(num): """thread worker function""" print('Worker: %s' % num) threads = [] for i in range(5): t = threading.Thread(target=worker, args=(i,)) threads.append(t) t.start()
StaleNewsProcedureMultiprocessing.py
""" This file should implement the procedures detailed in the stale news paper. Code originally by Christopher Gong, Optimized by Jonathan Bodine. Summary: The methods below apply the stale news procedure outline in the paper "When Can the Market Identify Stale News? " by Anasteesia Fedyk and James Hodson. The proc...
coref_model_ad.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function # -*-encoding:utf-8-*- import os import operator import random import math import json import threading import numpy as np import tensorflow as tf import tensorflow_hub as hub import h5py import util import co...
start.py
#!/usr/bin/python3 import os import glob import shutil import multiprocessing import logging as log import sys from podop import run_server from pwd import getpwnam from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(ge...
materialize_with_ddl.py
import time import pymysql.cursors import pytest from helpers.network import PartitionManager import pytest from helpers.client import QueryRuntimeException from helpers.cluster import get_docker_compose_path, run_and_check import random import threading from multiprocessing.dummy import Pool def check_query(clickho...
decrypter.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, division import os import sys import time from threading import Lock, Thread from Crypto.Cipher import AES from .python_queue import Queue from .util import crypto_key, epoc_plus_crypto_key, new_crypto_key class EmotivCrypto: def __init__(self, se...
node.py
from __future__ import print_function import time import socket import subprocess import argparse import uuid import base64 import threading import tornado.web import tornado.ioloop import tornado.options import tornado.httpserver # import tornado.httpclient # import tornado.websocket import tornado.gen import tornad...
event_based_scheduler_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 u...
writer.py
# stdlib import atexit import logging import threading import random import os import time from ddtrace import api log = logging.getLogger(__name__) MAX_TRACES = 1000 MAX_SERVICES = 1000 DEFAULT_TIMEOUT = 5 class AgentWriter(object): def __init__(self, hostname='localhost', port=8126): self._pid =...
conftest.py
from pytest import fixture from threading import Thread from mm_ide import ide @fixture(scope="function") def start_ui(): Thread(target=ide.main).start()
simple_text_generation.py
# Copyright 2021 Sony Group 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 ...
fast_api_test_server.py
import logging import threading import time from typing import Optional from fastapi import FastAPI from starlette.requests import Request from starlette.responses import Response from uvicorn.config import Config from pyctuator.pyctuator import Pyctuator from tests.conftest import PyctuatorServer, CustomServer cla...
io_utils.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding 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/LICENS...
raft_example.py
#!/usr/bin/env python3 import argparse import logging import socketserver import threading import time import random from raft_node import Node from raft_peer import Peer from raft_states import NodePersistentState from raft_state_machine import DummyStateMachine from raft_rpc_client import RpcClient from raft_message...
__init__.py
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs from __future__ import print_function import os import re import sys import time import errno import shutil import pprint import logging import tempfile import subprocess import multiprocessing from hashlib import md5 from dat...
index.py
# -*- coding: utf-8 -*- # # Copyright (C) 2013 Vinay Sajip. # Licensed to the Python Software Foundation under a contributor agreement. # See LICENSE.txt and CONTRIBUTORS.txt. # import hashlib import logging import os import shutil import subprocess import tempfile try: from threading import Thread except ImportErr...
bridgeClient.py
#! /usr/bin/python import socket import threading from time import sleep import sys import pygame class bridgeConnection(): def __init__(self): #self.HOST = raw_input("HOST IP : ") self.HOST = "143.248.12.189" self.PORT = 50000 self.DATA_SIZE = 128 # maximum data length which can be sent in once se...
client.py
import asyncio from threading import Thread import websocket import modules.logger as logger import modules.message as message_module logger = logger.get_logger(__name__) connected = False def send_message(websocket, msg): # msg = input("Message: ") if msg == '': return if msg == '/end': ...
broadcast_handler.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ######################################################################## # # Copyright (c) 2016 Baidu.com, Inc. All Rights Reserved # ######################################################################## """ File: broadcast_manager.py Author: haifeng(haifeng@baidu.com) ...
Barrier_studikasus.py
from random import randrange from threading import Barrier, Thread from time import ctime, sleep jmlh_org = 3 kota_tujuan = Barrier(jmlh_org) orangmudik = ['Asep Gokil', 'Udin Wazowski', 'Papope Cool'] def mudik(): name = orangmudik.pop() sleep(randrange(2, 5)) # Menunggu sesuai waktu antara 2 sampai 5 detik ...
talker.py
import rclpy import os import pyvcroid2 import simpleaudio import winsound import threading from ctypes import * from rclpy.node import Node import std_msgs.msg from rcl_interfaces.msg import ParameterType from rcl_interfaces.msg import SetParametersResult # Talker node class TalkerNode(Node): def __init__(self): ...
email.py
from threading import Thread from flask import render_template from flask_mail import Message from app import app, mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject, sender=sender, recipients=recip...
network_monitor_GA.py
# Copyright (C) 2016 Huang MaChi at Chongqing University # of Posts and Telecommunications, Chongqing, China. # Copyright (C) 2016 Li Cheng at Beijing University of Posts # and Telecommunications. www.muzixing.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file exce...
test_sys.py
# -*- coding: iso-8859-1 -*- import unittest, test.test_support import sys, cStringIO class SysModuleTest(unittest.TestCase): def test_original_displayhook(self): import __builtin__ savestdout = sys.stdout out = cStringIO.StringIO() sys.stdout = out dh = sys.__displayhook_...
datasets.py
# YOLOv5 🚀 by Ultralytics, GPL-3.0 license """ Dataloaders and dataset utils """ import glob import hashlib import json import logging import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool, Pool from pathlib import Path from threading import Thread ...
__init__.py
#!/usr/bin/env python # 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: # # * Redistributi...
overlayCommit.py
''' Created on Feb 15, 2016 @author: yunli ''' import traceback import logging from threading import Thread, Event, RLock import concurrent.futures import Queue from sqlalchemy.orm import exc from jnpr.openclos.overlay.overlayModel import OverlayDeployStatus from jnpr.openclos.dao import Dao from jnpr.openclos.loade...
test_sync_microphone.py
import logging import numpy as np import sys import threading import unittest from typing import Generator from cltl.backend.api.microphone import MIC_RESOURCE_NAME, AudioParameters from cltl.backend.impl.sync_microphone import SynchronizedMicrophone from cltl.backend.spi.audio import AudioSource from cltl.combot.infr...
host_exec.py
from flask import Blueprint, request from apps.assets.models import HostExecTemplate, Host from libs.tools import json_response, JsonParser, Argument, QueuePool from libs.ssh import ssh_exec_command_with_stream, get_ssh_client from public import db from libs.decorators import require_permission from threading import Th...
unlogger.py
#!/usr/bin/env python3 import argparse import os import sys import zmq import time import signal import multiprocessing from uuid import uuid4 from collections import namedtuple from collections import deque from datetime import datetime from cereal import log as capnp_log from cereal.services import service_list from...
lambda_executors.py
import base64 import contextlib import glob import json import logging import os import re import subprocess import sys import threading import time import traceback from multiprocessing import Process, Queue from typing import Any, Dict, List, Optional, Tuple, Union from localstack import config from localstack.servi...
subdomain.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ Script Created By: Cr4sHCoD3 Copyrights: Cr4sHCoD3 2018 Special Mentions: PureHackers PH Blood Security Hackers """ import os import sys import platform import time import datetime import argparse import socket from threading import Thread ...
feeder.py
from sklearn.model_selection import train_test_split from synthesizer.utils.text import text_to_sequence from synthesizer.infolog import log import tensorflow as tf import numpy as np import threading import time import os _batches_per_group = 64 class Feeder: """ Feeds batches of data into queue on a backgrou...
collect.py
from time import sleep, clock import simplejson as json from easysnmp import snmp_get import threading import os import datetime DELAY = 1 # seconds switches = {} ifSpeed32 = "1.3.6.1.2.1.2.2.1.5" inOctets32 = "1.3.6.1.2.1.2.2.1.10" outOctets32 = "1.3.6.1.2.1.2.2.1.16" ifSpeed64 = "1.3.6.1.2.1.31.1.1.1.15" inOctets6...