source
stringlengths
3
86
python
stringlengths
75
1.04M
test_seg_scan_dsb.py
import sys import lasagne as nn import numpy as np import theano import pathfinder import utils from configuration import config, set_configuration import theano.tensor as T import blobs_detection import logger import time import multiprocessing as mp import buffering def extract_candidates(predictions_scan, tf_matri...
emails.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime from threading import Thread from watchlist import app, mail from flask import render_template from flask_mail import Message def _send_async_mail(message): with app.app_context(): mail.send(message) def send_message(to, subject, sender, ...
extract.py
#!/usr/bin/env python import pandas as pd import numpy as np import multiprocessing import argparse import operator import os import random import sys import time import random import subprocess import pysam import collections import warnings import math import re from Bio import SeqIO base_path = os.path.split(__fil...
leonbot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # leonbot.py: LeonBot trial # # Copyright 2015 Tennessee Carmel-Veilleux <veilleux@tentech.ca> # from threading import Thread import atexit import Queue import sys import pygame import time import smbus from Adafruit_MotorHAT import Adafruit_MotorHAT, Adafruit_DCMo...
environmental_kernel.py
import numpy as np from libmatch.chemical_kernel import Atoms2ChemicalKernelmat from libmatch.soap import get_Soaps from libmatch.utils import chunk_list, chunks1d_2_chuncks2d,is_notebook,dummy_queue from soap import get_Soaps import multiprocessing as mp import signal, psutil, os import threading import quippy as qp...
pdb-aggregator-server.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import logging import psutil import subprocess import os import yaml from threading import Thread import srvdb import requests as orig_requests import time from flask import Flask from flask import request from two1.commands.config import Config from two1.wa...
fy.py
import argparse import datetime import json import os import re import sys import threading import huepy import pangu import requests import xmltodict from googletrans import Translator from pony import orm __version__ = "1.6.0" HEADERS = { "X-Requested-With": "XMLHttpRequest", "User-Agent...
base.py
# mypy: allow-untyped-defs import base64 import hashlib import io import json import os import threading import traceback import socket import sys from abc import ABCMeta, abstractmethod from typing import Any, Callable, ClassVar, Tuple, Type from urllib.parse import urljoin, urlsplit, urlunsplit from . import pytest...
googlenet_resnet50.py
#!/usr/bin/env python # Copyright 2019 Xilinx 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 ...
bot.py
import os import youtube_dl import telepotpro from random import randint from multiprocessing import Process from youtubesearchpython import VideosSearch from dotenv import load_dotenv from os.path import join, dirname dotenv_path = join(dirname(__file__), '.env') load_dotenv(dotenv_path) TOKEN = os.environ.get("TOKE...
gdbclientutils.py
import ctypes import errno import io import threading import socket import traceback from lldbsuite.support import seven def checksum(message): """ Calculate the GDB server protocol checksum of the message. The GDB server protocol uses a simple modulo 256 sum. """ check = 0 for c in message: ...
tests.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import errno import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation, Suspicio...
build_operation.py
import logging import os import subprocess from craftbuildtools.operations import OperationPlugin from craftbuildtools.utils import ChangeDir logger = logging.getLogger("craft-buildtools") class MavenBuildOperation(OperationPlugin): def __init__(self): super(MavenBuildOperation, self).__init__() ...
testDriver.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: MIT-0 from flask import Flask, flash, request, redirect, url_for import threading import requests import time import boto3 app = Flask(__name__) currentrate = 0.1 # get list of s3 objects from file print("reading bucket li...
__init__.py
# -*- coding: utf-8 -*- # # This file is part of PyBuilder # # Copyright 2011-2020 PyBuilder Team # # 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/l...
s3op.py
from __future__ import print_function import json import time import math import sys import os import traceback from hashlib import sha1 from tempfile import NamedTemporaryFile from multiprocessing import Process, Queue from itertools import starmap, chain, islice try: # python2 from urlparse import urlparse ...
test_add_vectors.py
import time import pdb import threading import logging import threading from multiprocessing import Pool, Process import pytest from milvus import IndexType, MetricType from utils import * dim = 128 index_file_size = 10 collection_id = "test_add" ADD_TIMEOUT = 60 tag = "1970-01-01" add_interval_time = 1.5 nb = 6000 ...
ApiController_Mouse.py
from AirSimClient import * import inputs from threading import Thread, Event from time import sleep import signal import sys # Change if mouse has different absolute return values mouse_absolute_maximum = 2000 class Receiver: def __init__(self): self.recording_signal = Event() self.recording_Thr...
prueba.py
import threading import time import sys def cuenta(n, name): count = n while count < 10: print(count, name) count +=1 time.sleep(2) t = threading.Thread(target=cuenta, args=(1, '1')) t2 = threading.Thread(target=cuenta, args=(2, '2')) t3 = threading.Thread(target=cuenta, args=(3, '3'))...
_logger.py
""" .. References and links rendered by Sphinx are kept here as "module documentation" so that they can be used in the ``Logger`` docstrings but do not pollute ``help(logger)`` output. .. |Logger| replace:: :class:`~Logger` .. |add| replace:: :meth:`~Logger.add()` .. |remove| replace:: :meth:`~Logger.remove()` .. |...
test_p2p_grpform.py
# P2P group formation test cases # Copyright (c) 2013-2014, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import logging logger = logging.getLogger() import time import threading import Queue import os import hostapd import hwsim_utils ...
exit_sentinel.py
#!/usr/bin/env python3 # # Copyright (c) 2020 Two Sigma Open Source, LLC # # 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 ...
test_proxies.py
''' Modifier Date: 21/03/2021 Author: AlexxLy Description: Reads a file that contains a list of proxies and determines whether or not that list is good. Each line in the file must be in the format of ip:port ''' import platform from os import system from time import sleep from requests import Session from...
run_tests.py
# Adapted from a Karma test startup script # developebd by the Jupyter team here; # https://github.com/jupyter/jupyter-js-services/blob/master/test/run_test.py # # Also uses the flow where we assign a os process group id and shut down the # server based on that - since the subprocess actually executes the kbase-narrati...
client.py
import socket import threading import random import json import sys from RSA import RSA class Client: SERVER_UDP_IP_ADDRESS = "127.0.0.1" SERVER_UDP_PORT_NO = 6789 user = "" room = "geral" clientSock = None def __init__(self, ip): self.SERVER_UDP_IP_ADDRESS = ip self.room = 'l...
main.py
import wave import sys import sound from pynput.keyboard import KeyCode, Key, Controller, Listener import threading import time # keyboard = Controller() global play play = False global track track = 0 def on_press(key): global play global track # print('{0} press'.format(key)) try: if key ...
main.py
import pdb import time import os import subprocess import re import random import json import numpy as np import glob from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import socket import argparse import threading import _thread import signal from datetime import datetime parser = ar...
semihost.py
""" mbed CMSIS-DAP debugger Copyright (c) 2015 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law o...
__init__.py
import time import threading import math import arrow import click import pydash from jesse.models import Candle from jesse.exceptions import CandleNotFoundInExchange from jesse.modes.import_candles_mode.drivers.interface import CandleExchange from jesse.modes.import_candles_mode.drivers import drivers import jesse.he...
model_inference_server.py
""" model_inference_server.py Server side logic to handle model inference from client web_server.py Delivers frame by frame of model's playthrough to the web_server.py through TCP/IP connection. author: @justjoshtings created: 3/16/2022 """ import socket import threading import numpy as np import cv2 import pickle i...
test_remote.py
# -*- coding: utf-8 -*- import logging import os import socket import sys import time from copy import deepcopy from multiprocessing import Process, Queue import env import pytest import plumbum from plumbum import ( NOHUP, CommandNotFound, ProcessExecutionError, ProcessTimedOut, RemotePath, S...
opencachehttp.py
#!/usr/bin/env python2.7 """opencachehttp.py: HTTP Server - serves cached HTTP objects to requesting clients.""" import BaseHTTPServer import collections import hashlib import httplib import os import signal import SocketServer import sys import threading import opencache.lib.opencachelib as lib import opencache.nod...
eventrecorder.py
'''The MIT License (MIT) Copyright (c) 2021, Demetrius Almada 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, me...
fuse.py
from __future__ import print_function import os import stat import threading import time from errno import EIO, ENOENT from fuse import FUSE, FuseOSError, Operations class FUSEr(Operations): def __init__(self, fs, path): self.fs = fs self.cache = {} self.root = path.rstrip("/") + "/" ...
Analysis.py
""" This module contains the ``analysis`` class. It includes common classes for file management and messaging and all calls to AEDT modules like the modeler, mesh, postprocessing, and setup. """ from __future__ import absolute_import # noreorder import os import shutil import threading import warnings from collecti...
PH EC NEW GUI AJE.py
import RPi.GPIO as GPIO import tkinter as tk import time import threading from AtlasOEM_PH import AtlasOEM_PH from AtlasOEM_EC import AtlasOEM_EC import time from ATLAS_OEM_Calibration4 import main from tkinter import messagebox global fullscreen from PIL import ImageTk,Image from tkinter import * #c = Canvas(top, bg...
inference_worker.py
import collections import logging import threading import time from typing import Dict import torch from torch import nn from torch.distributed import rpc from hearthstone.training.pytorch.worker.distributed.tensorize_batch import _tensorize_batch, _untensorize_batch logger = logging.getLogger(__name__) class Infe...
test_xmlrpc.py
import base64 import datetime import decimal import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import http, http.server import socket import re import io import contextlib from test import support try: import gzip except Import...
server.py
# -*- coding: utf-8 -*- """Ironworks module""" import sys import os import subprocess import threading import keyring from cherrypy import wsgiserver from logger import IronworksLogger from lib.apscheduler.scheduler import Scheduler import serverTools class IronworksServer: def __init__(self, DAEMON, VERBOSE, ...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return "I'm playing Unital Ring" def run(): app.run(host="0.0.0.0") def keep_alive(): server = Thread(target=run) server.start()
lisp-rtr.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain...
util.py
#! /usr/bin/env jython # Copyright (C) 2011 Sun Ning<classicning@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 restriction, including without limitation the rights # to...
quantize_pvalite-CLN.py
#!/usr/bin/env python # -------------------------------------------------------- # Quantize Fast R-CNN based Network # Written by Chia-Chi Tsai # -------------------------------------------------------- """Quantize a Fast R-CNN network on an image database.""" import os os.environ['GLOG_minloglevel'] = '2' import _...
load.py
# -*- coding: utf-8 -*- # # Display the "habitable-zone" (i.e. the range of distances in which you might find an Earth-Like World) # from __future__ import print_function from collections import defaultdict import requests import sys import threading # Python 2 deprecated from urllib.parse import quote import tkinter...
installwizard.py
import sys import os from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import electrum from electrum import Wallet, WalletStorage from electrum.util import UserCancelled, InvalidPassword from electrum.base_wizard import BaseWizard from electrum.i18n import _ from seed_dialog import S...
server.py
#!/usr/bin/env python3 # python 3.6+ # Server for web component and state machine for expressions. import getopt import io import json import os import re import subprocess import sys import time import threading import traceback import webbrowser from collections import OrderedDict from http.server import HTTPServe...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import threading_helper from test.support import verbose, cpython_only, os_helper from test.support.import_helper import import_module from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys i...
remindmebot_search.py
#!/usr/bin/env python2.7 # ============================================================================= # IMPORTS # ============================================================================= import praw import re import MySQLdb import ConfigParser import time import urllib import parsedatetime.parsedatetime as pd...
__main__.py
# -*- coding: utf-8 -*- import multiprocessing as mp import sys import os import threading import cv2 import pims import PyQt5 from PyQt5 import QtCore, QtGui, QtWidgets from PyQt5.QtWidgets import QWidget, QFileDialog from video import VideoReader, linkTrajectories from interface import Ui_ventanaPrincipal # This li...
train.py
# -------------------------------------------------------- # FCN # Copyright (c) 2016 RSE at UW # Licensed under The MIT License [see LICENSE for details] # Written by Yu Xiang # -------------------------------------------------------- """Train a FCN""" from fcn.config import cfg from gt_data_layer.layer import GtDat...
audioeffects.py
# PyAudio - get volume off of the microphone. # We'll figure out what to do with it later... # This is the equivalent to recordTest.py with the alsadriver, only with pyAudio so I can # run it on the mac. import pyaudio import sys import struct import math from threading import Thread from threading import Lock impo...
bpytop.py
#!/usr/bin/env python3 # pylint: disable=not-callable, no-member, unsubscriptable-object # indent = tab # tab-size = 4 # Copyright 2021 Aristocratos (jakob@qvantnet.com) # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
force_align.py
#!/usr/bin/env python import os import subprocess import sys import threading from os.path import join, dirname PATH_FAST_ALIGN = join(dirname(__file__), 'fast_align', 'build') # Simplified, non-threadsafe version for force_align.py # Use the version in realtime for development class Aligner: def __init__(self...
bus_trans_py2.py
import socket import threading import time server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server_host = raw_input('server host: ') port1 = input('server port: ') server_port = int(port1) client_host = raw_input('client host: ') port2 = input('cl...
processes.py
from collections import abc from pathlib import Path import time import re from threading import Thread from api import audio from api import gui from init_phase import init_phase from viability_phase import viability_phase from evaluation_phase import create_datetime_subdir, evaluation_phase from evaluation_phase im...
dev_test_dex_print.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: dev_test_dex_print.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://www.lucit.tech/unicorn-binance-websocket-api.html # Github: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://unicor...
__init__.py
# -*- coding: utf-8 -*- """ :copyright: Copyright 2016-2022 Sphinx Confluence Builder Contributors (AUTHORS) :license: BSD-2-Clause (LICENSE) """ from bs4 import BeautifulSoup from contextlib import contextmanager from copy import deepcopy from pkg_resources import parse_version from sphinx.__init__ import __version__...
worker_handlers.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
adb_profile_chrome.py
#!/usr/bin/env python # # Copyright 2013 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 base64 import gzip import logging import optparse import os import re import select import shutil import sys import threading ...
main.py
import threading import time import bs4 import requests import StellarPlayer import re import urllib.parse dytt_url = 'http://www.dptkbs.com/' def concatUrl(url1, url2): splits = re.split(r'/+',url1) url = splits[0] + '//' if url2.startswith('/'): url = url + splits[1] + url2 el...
SentenceTransformer.py
import json import logging import os import shutil from collections import OrderedDict from typing import List, Dict, Tuple, Iterable, Type, Union, Callable from zipfile import ZipFile import requests import numpy as np from numpy import ndarray import transformers import torch from torch import nn, Tensor, device from...
http_server_node.py
#!/usr/bin/env python import http.server import socketserver import threading import rospy import robot_resource.robot_resource as rs from sensor_msgs.msg import Image from sensor_msgs.msg import NavSatFix class RequestHandler(http.server.SimpleHTTPRequestHandler): def do_GET(self): if self.path == "/robot...
LR1.py
""" This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recog...
wsdump.py
#!D:/WGU/Capstone/SpinalAbnormality/venv\python.exe import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding ...
application.py
import asyncio import os import re import signal import sys import threading import time from asyncio import ( AbstractEventLoop, CancelledError, Future, Task, ensure_future, get_event_loop, new_event_loop, set_event_loop, sleep, ) from contextlib import contextmanager from subproces...
dictation.py
# #機能: # 入力: # ○ ・大文字小文字関係なく入力できる 入力は小文字に統一 # △・スペース等はスキップ ひとまず2連続 後々固有名詞など長めでも対応できるように # ○ ・いい感じで自動改行する 単位ごとに改行 # ○ ・1文字ヒント機能 # ○ ・タイプミスの効果 # 音声: # △・wavファイルが再生できる 子プロセスが終了しても音声は止まらないから、pygame pyaudio等に変えたほうがいい # ○ ・繰り返し 一時停止 # ☓ ・数秒飛ばし戻し 3s 5s # ○ 変更 -> soundファイルを空白部分で分割 分割の調整が必要 # ○ キーボードとマウスの入力から再生箇所...
run_sweep.py
import sys import os import argparse import itertools from experiment_utils import config from experiment_utils.utils import query_yes_no import doodad as dd import doodad.mount as mount import doodad.easy_sweep.launcher as launcher from doodad.easy_sweep.hyper_sweep import run_sweep_doodad import multiprocessing imp...
download.py
#By Wang Haolong import requests as re import threading as th import os Max_Threads=5 class Crawler: '''To download a book''' def __init__(self, path, url): '''init''' self.path=path self.url=url self.url_list=[] self.headers = {"User-Agent": "Mozilla/5.0 (Windows NT 1...
job_manager.py
# Copyright Amazon.com, Inc. or its affiliates. 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 ...
websocket_client.py
# gdax/WebsocketClient.py # original author: Daniel Paquin # mongo "support" added by Drew Rice # # # Template object to receive messages from the gdax Websocket Feed from __future__ import print_function import json import base64 import hmac import hashlib import time from threading import Thread from websocket impor...
stepper_test_thread.py
#!/usr/bin/env python3 """ test example file for rpiMotorlib.py L298 stepper tests""" import time import pi_stepper as s import threading # from stepper_lib import RpiMotorLib max_speed = 0.002 min_speed = 0.06 GpioPins_MA = [13, 11, 15, 12] GpioPins_MB = [37, 33, 35, 16] # GpioPins_MA = [10, 10, 10, 10] # Declare a...
test_websocket.py
import asyncio import functools import threading import requests import pytest import websockets from contextlib import contextmanager from uvicorn.protocols.http import HttpToolsProtocol class WebSocketResponse: persist = False def __init__(self, scope): self.scope = scope async def __call__(s...
basic02.py
""" 多个进程之间的全局变量的共享问题 1- 多进程的执行顺序和线程一样是乱序的 2- 每个进程互相独立,各有自己的一份全局变量,所以worker1中修改全局变量,worker2不受影响 3- 进程之间变量独立不共享,这一点和thread完全不同 """ import multiprocessing,time g_num = 0 def worker1(num): global g_num print(g_num) # 这里修改全局变量 g_num += 99 while True: time.sleep(1) prin...
bot.py
import discord from discord.ext import commands from settings import Settings import statistics import embed_creator import json import os from decouple import config import time import threading def determine_prefixes(bot, message): return settings.get_prefix(message.guild.id) settings = Settings() client = di...
test_engine_py3k.py
import asyncio from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import delete from sqlalchemy import event from sqlalchemy import exc from sqlalchemy import func from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import select from sqlalchemy import String f...
collectd_extractor.py
# -*- coding: utf-8 -*- import argparse import sys import json import pdb import threading import traceback, logging import collectd_metrics from time import sleep from config import cfg from confluent_kafka import Producer, Consumer, KafkaError, TopicPartition from influxdb import InfluxDBClient format_str = '%(asc...
ip_lib.py
# Copyright 2012 OpenStack Foundation # 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 requ...
redis_lock.py
# -*- coding: utf-8 -*- # @Time : 2020/11/9 下午9:00 # @Author : 司云中 # @File : redis_lock.py # @Software: Pycharm import uuid import math import time from threading import Thread import redis from redis import WatchError def acquire_lock_with_timeout(conn, lock_name, acquire_timeout=3, lock_timeout=3, **kwargs): ...
emailServer.py
import os import json import time import smtplib import threading import firebase_admin from firebase_admin import credentials from firebase_admin import firestore from firebase_admin import auth from email.message import EmailMessage # Use the application default credentials jsonKey = json.load(open('ServiceAccountKe...
portscanhoneypot.py
#!/bin/env python3 """ portscanhoneypot: Simple honeypot to catch rogue port scans on the network for use as an early warning beacon of potential threat actors on the network. Author: Dana Epp (@danaepp) """ import os import os.path import sys import getopt import socket import threading import time from struct i...
mbase.py
""" mbase module This module contains the base model class from which all of the other models inherit from. """ from __future__ import print_function import sys import os import subprocess as sp import shutil import threading if sys.version_info > (3, 0): import queue as Queue else: impo...
run.py
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University # ServerlessBench is licensed under the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1. # You may obtain a copy of Mulan PSL v1 at: # http://license.coscl.org.cn/M...
Network_TF.py
""" Licensed under the Unlicense License; you may not use this file except in compliance with the License. You may obtain a copy of the License at https://unlicense.org Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BAS...
_support.py
"""Support functions for pyxmpp2 test suite.""" import os import sys import logging import unittest TEST_DIR = os.path.dirname(__file__) DATA_DIR = os.path.join(TEST_DIR, "data") RESOURCES = ['network', 'lo-network', 'gsasl'] if "TEST_USE" in os.environ: RESOURCES = os.environ["TEST_USE"].split() if "TEST_STAC...
send_recv.py
#!/usr/bin/python # -*- coding= utf-8 -*- import threading import socket class socket_manager(): def __init__(self,logger=None,host='0.0.0.0',port=30000,group='224.0.0.119'): self._be_multicast = False self._multicast_group = group self._multicast_port = port address = (host,port) self._cli_s =...
gym_gazeboros_ac.py
#!/usr/bin/env python from datetime import datetime import copy import traceback import os, subprocess, time, signal #from cv_bridge import CvBridge import gym import math import random # u import numpy as np import cv2 as cv import rospy # Brings in the SimpleActionClient import actionlib # Brings in the .actio...
wav_to_tfrecord.py
import tensorflow as tf import numpy as np from concurrent.futures import ProcessPoolExecutor from functools import partial import os import sys sys.path.append('../') from util import audio import re import json from hparams import hparams import time import os, numpy, argparse, random, time import multip...
clientDrone.py
import subprocess import socket import time import logging import urllib.request from utils import * from globals import * def start_video_stream(): logging.info('Starting video stream') cmd = "raspivid -g 24 -n -w 1280 -h 720 -b 1000000 -fps 24 -t 0 -o udp://{}:{}" cmd = cmd.format(server_ip, port_drone_...
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...
cluster.py
# Copyright (c) 2021 MIT # # Permission to use, copy, modify, and distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR(S) DISCLAIM ALL WARRANTIES ...
httpread.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import requests, random import moment import multiprocessing id_list = [] for i in range(0,1000): id_list.append(str(i)+"tao") post_url = "http://192.168.99.100:4000/user/" numprocess = 100 # r = requests.get(post_url+"10000tao") # print r.text def sendreadrequest()...
test_mp.py
from multiprocessing import Process, Queue from time import sleep def f(q): q.put([42, None, 'hello']) sleep(3) q.put([111]) if __name__ == '__main__': q = Queue() p = Process(target=f, args=(q,)) p.start() print(q.get()) print(q.get()) # prints "[42, None, 'hello']" p.join()
signals.py
from django.db.models.signals import post_save from News.models import News, NewsTag, Columns, Author, Article from django.conf import settings from task.models import Task from News.management.commands.scraper import run_news_scraper, get_news_links, \ run_articles_scraper, run_columns_scraper from threading impor...
test_internal.py
import os import random import threading from hks_pylib.logger.logger import Display from hks_pylib.logger.standard import StdUsers from hks_pynetwork.internal import LocalNode, ForwardNode from hks_pylib.logger import StandardLoggerGenerator from hks_pynetwork.external import STCPSocket from hks_pylib.cryptography.c...
quoteproviders.py
from collections import namedtuple import requests, pickle from abc import ABCMeta, abstractmethod from bs4 import BeautifulSoup from utilities import * from random import randint from threading import Thread # Tuple object Quote = namedtuple('Quote', ['text', 'author']) class QuoteException(Exception): def __...
camera.py
"""camera.py This code implements the Camera class, which encapsulates code to handle IP CAM, USB webcam or the Jetson onboard camera. In addition, this Camera class is further extended to take a video file or an image file as input. """ import logging import threading import numpy as np import cv2 def add_camer...
5.rlock_multi_thread.py
''' 说明: rlock在多线程之间是互斥的, 只有在同一个线程才能重入 ''' import logging import time from datetime import datetime from threading import RLock, Thread, current_thread from typing import List def req1(lock: RLock, flag: int, list: List): lock.acquire() if flag == 0: list.append(1) else: list.append(2) ...
multi_threading.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import time, threading #: def loop(): print("thread %s is running..." % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print("thread %s >>> %s" % (threading.current_thread().name, n)) time.sleep(1) print("thread %s e...
test_abstract_wrapper.py
import logging import pathlib import sys import xmlrpc.client from tempfile import TemporaryDirectory from threading import Thread from time import sleep from finorch.config.config import WrapperConfigManager from finorch.sessions.abstract_client import AbstractClient from finorch.sessions.abstract_session i...
STABLE Functional Pipeline 06132019.py
import sys import re import os import shutil from multiprocessing import Process #import pandas as pd #import numpy as np #from functools import reduce #from pandas import ExcelWriter #from pandas import ExcelFile #import matplotlib.pyplot as plt #from scipy.stats import ttest_ind ## init gets user input for paramate...