source
stringlengths
3
86
python
stringlengths
75
1.04M
test_target_codegen_vulkan.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...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
NewSentenceTransformer.py
import json import logging import os import shutil import stat import warnings from collections import OrderedDict from functools import partial from typing import List, Dict, Tuple, Iterable, Type, Union, Callable, Optional import requests import numpy as np from numpy import ndarray import transformers from huggingfa...
test_parallel_backend.py
# -*- coding: utf-8 -*- from __future__ import print_function, absolute_import """ Tests the parallel backend """ import threading import multiprocessing import random import os import sys import subprocess import numpy as np from numba import config, utils from numba import unittest_support as unittest from numba ...
bulk_operation.py
# coding=utf8 """ @author:Administrator @file: bulk_operation.py @time: 2018/08/27 三大数据库的更简单的批次操作,自动聚合一定时间内的离散任务为批次任务。免除手工数组切片的烦恼。 """ import atexit import re from elasticsearch import helpers from threading import Thread from typing import Union import abc import time from queue import Queue, Empty import unittest # ...
EventMsgWorker.py
#! /usr/bin/python # ArtCM OMQS Event Worker Class # # (C) ArtCM 2015 # # Date: 2015.9.22 __author__ = 'dennis' from multiprocessing import Queue import threading import os, signal, time, logging, platform import pika from pika.exceptions import * from ConfigReader import ConfigReader from MsgWorker import MsgWork...
threadlatch.py
""" Java の CountDownLatch 風なクラス (マルチスレッド処理用) REFERENCES:: https://stackoverflow.com/questions/10236947/does-python-have-a-similar-control-mechanism-to-javas-countdownlatch https://qiita.com/shinkiro/items/75f3561d6bc96694ce30 """ import threading as th import typing as ty class CountDownLatch: """\ Java の Co...
machine_motion.py
# File name: MachineMotion.py # # Version: 4.3 # # Note: Information about all the g-Code # # commands supported are available at # # the following lo...
EnvironmentManager.py
# -*- coding: utf-8 -*- import threading from ..config.ConfigurationManager import ConfigurationManager from ..results.ResultsManager import ResultsManager from ..execution.ExecutionManager import ExecutionManager from .EnvironmentProperties import EnvironmentProperties from ..benchmarks.BenchmarkSuiteInstance import...
halperf.py
#!/usr/bin/python3 import argparse import os import signal import sys import time from ctypes import * from threading import Thread, Timer, Lock verbose = False # Open C shared libs to the datatypes; TODO: make spec-driven xdc_so = None gma_so = None plock = Lock() DATA_TYP_POS = 1 DATA_TYP_DIS = 2 DATA_TYP_HB_ORAN...
shutdown.pyw
from PyQt5.QtWidgets import (QMainWindow, QApplication, QPushButton, QWidget, QGroupBox, QLabel, QCheckBox, QAction, QTabWidget, QVBoxLayout, QHBoxLayout, QGridLayout, QLineEdit, QTextEdit, QShortcut, QMessageBox) from PyQt5.QtGui import QIcon, QFont, QKeySequen...
common.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import json import yaml import logging import os import re import subprocess import stat import urllib.parse import threading import contextlib import tempfile import psutil from functools import reduce, wraps from decimal import Decimal # Django fro...
mk_rxc.py
# IO options for loading pathway data. # Zilin Song, 20 AUG 2021 # import iomisc, numpy, multiprocessing, dist_compute def extract_rxc(mda_universe, mda_universe_label, pathname, nrep=50, ): '''Extract all reaction coordinates in one RPM coordinate of nrep replicas.. ''' rep_distlabel = [] # L...
DataGen_Transformer_mapRanking.py
import csv import os import sys import shutil import time import numpy as np import scipy.io as sio import yaml import argparse from easydict import EasyDict from os.path import dirname, realpath, pardir from hashids import Hashids import hashlib sys.path.append(os.path.join(dirname(realpath(__file__)), pardir)) imp...
translator.py
from collections import deque import threading def execute_block(session, args): try: env = session.env except: session.env = Environment(session) env = session.env env.deque.append(args) class Environment(object): def __init__(self, session): self.t = threa...
subprocess42.py
# Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """subprocess42 is the answer to life the universe and everything. It has the particularity of having a Popen implementation that can yield output...
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...
sim.py
#-------------------------------------------------------------# import timeit import time # Use for time calls from subprocess import call # Use for turning off the Pi from multiprocessing import Process import os start=timeit.default_timer() # Creating the function generator os.chdir("/home/pi/PiBits/ServoBlaster/use...
image_logger.py
# # This file is part of KwarqsDashboard. # # KwarqsDashboard 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 Foundation, version 3. # # KwarqsDashboard is distributed in the hope that it will be useful, # but...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testin...
ixnutils.py
# ixnutils.py import asyncio import datetime import json import time import types from threading import Lock, Thread import logging import snappi from google.protobuf.any_pb2 import Any from ..autogen import gnmi_pb2 from snappi import otg_pb2 from .client_session import ClientSession from .utils import (RequestPath...
dump_frames.py
import time import signal import json from os import makedirs, listdir from os.path import exists, join, isfile, basename from shutil import rmtree from argparse import ArgumentParser from multiprocessing import Process, Queue import cv2 from tqdm import tqdm def ensure_dir_exists(dir_path): if not exists(dir_pa...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Vadercoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test vadercoind shutdown.""" from test_framework.test_framework import VadercoinTestFramework from t...
safaribooks.py
#!/usr/bin/env python3 # coding: utf-8 import pathlib import re import os import sys import json import shutil import getpass import logging import argparse import requests import traceback from html import escape from random import random from lxml import html, etree from multiprocessing import Process, Queue, Value f...
igv.py
### This script was written by Brent Pedersen ### https://github.com/brentp/bio-playground/blob/master/igv/igv.py import socket import os.path as op import os import sys class IGV(object): r""" Simple wrapper to the IGV (http://www.broadinstitute.org/software/igv/home) socket interface (http://www.broadin...
coach.py
# Copyright (c) 2017 Intel Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
test_decimal.py
# Copyright (c) 2004 Python Software Foundation. # All rights reserved. # Written by Eric Price <eprice at tjhsst.edu> # and Facundo Batista <facundo at taniquetil.com.ar> # and Raymond Hettinger <python at rcn.com> # and Aahz (aahz at pobox.com) # and Tim Peters """ These are the test cases for the Decim...
filter.py
#! /usr/bin/python3 import errno, socket import threading from queue import Queue import time import random _port_from = 27020 _port_to = 27036 _ip = 'csko.cz' _mod = 'cstrike' _threads = 10 # lock to serialize console output lock = threading.Lock() def prefix(): return "[pFilter message]: " def parsing(data...
tests.py
# -*- coding: utf-8 -*- # Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. from __future__ import unicode_literals import os import re import copy import shutil import tempfile import threading import time import unittest import warnings from django.conf import settings ...
self_test.py
# -*- coding: utf-8 -*- """ This action performs internal hardware & software tests of the system to confirm things work as expected. Functions with prefix `test_` are ran, and any exception thrown means the test failed. Outputs from each test go into MQTT, and return to the command line. """ from __future__ import a...
task.py
from __future__ import absolute_import, unicode_literals import logging import functools import threading import ast import time from django.http import HttpResponse from libs import send_email, util from libs import call_inception from .models import ( Usermessage, DatabaseList, Account, globalpermissi...
server.py
""" This code is taken from PyPi stream_service package https://github.com/BR1py/stream_service Stream Buffer Server main module The naming in this module is always from the perspective of the server! client writer -> transport data to the client client reader -> read data from the client The address_size can be def...
manage.py
#!/usr/bin/env python3 import multiprocessing import os import signal import sys import click from sqlalchemy import create_engine try: from enjoliver import configs, gunicorn_conf from enjoliver.model import Base except ModuleNotFoundError: click.echo('please install enjoliver first: cd enjoliver-api && ...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # # Imports # import sys import threading import ar...
control.py
# Modified by Microsoft Corporation. # Licensed under the MIT license. # The control module # Creates and runs control loops at levels: Experiment, Trial, Session from copy import deepcopy import pydash as ps import torch.multiprocessing as mp from convlab import agent as agent_module from convlab.agent import Body ...
gui.pyw
import re from prettytable import PrettyTable from requests.exceptions import ConnectTimeout, ConnectionError from utils import download from cover import Cover from change import Change import pyperclip import time import re import os import json import signal import threading import tkinter import tkinter.font as tf...
command.py
# Copyright (c) 2016-present, Facebook, Inc. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import enum import json import logging import os import re import resource import signal import subprocess import sys import thread...
count people with magnetic sensor.py
# Import standard python modules import time import sys import threading import datetime # Import Raspberry Hardware import board import busio # Import ADS1115 module import adafruit_ads1x15.ads1115 as ADS from adafruit_ads1x15.analog_in import AnalogIn # Import RPi.GPIO Module import RPi.GPIO as GPIO # Define glo...
test_aioimport.py
import asyncio import threading import pytest import aioimport @pytest.mark.asyncio async def test_import_module() -> None: import tests.helper_test_import_module_event_source as event_source task = asyncio.create_task( aioimport.import_module("tests.helper_test_import_module_long_import") ) ...
DelegateCall.py
"""Provides a multiprocessing-safe way to aggregate results from multiple function calls. In multi-process programs, it is oft often useful to delegate a function call - e.g., writing a log message to a file - to another process to avoid conflicts. :class:`pyexperiment.utils.DelegateCall` implements a functor that, wh...
slack.py
import json import logging import random import re import requests import sys import time import traceback from websocket import WebSocketConnectionClosedException from markdownify import MarkdownConverter from will import settings from .base import IOBackend from will.utils import Bunch, UNSURE_REPLIES, clean_for_pi...
logbeaver.py
#!/usr/bin/env python #coding: utf-8 from sys import stdin import re import socket from urlparse import urlsplit, parse_qs import argparse import logging import threading import Queue def main (): parser = argparse.ArgumentParser() parser.add_argument('--host', default = '127.0.0.1') parser.add_argument('--port', ...
runner.py
#!/usr/bin/env python2 # Copyright 2013-present Barefoot Networks, Inc. # Copyright 2018-present Open Networking Foundation # # 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.a...
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold for showing...
supervisor.py
from dataclasses import dataclass import multiprocessing import threading import time import typing as tp from pypeln import utils as pypeln_utils from .worker import Worker from .queue import IterableQueue @dataclass class Supervisor: workers: tp.List[Worker] main_queue: IterableQueue done: bool = Fals...
sensor.py
import pandas as pd import serial import time import datetime import numpy as np import threading import os from serial import SerialException from queue import Queue from threading import Thread from datetime import timedelta from datetime import datetime class CT4319(): def __init__(self): self.ser = se...
callbacks_test.py
# Copyright 2016 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...
launch_dataset_dynamic.py
import random import numpy as np import time import pickle from multiprocessing import Process, Manager from .instance_mcnf import generate_instance, mutate_instance from .mcnf_dynamic import * def launch_dataset(global_path, dataset_name, algorithm_list, nb_repetitions, nb_workers, duration_before_timeout): # La...
__init__.py
"""Hermes MQTT server for Rhasspy wakeword with pocketsphinx""" import asyncio import logging import queue import socket import tempfile import threading import typing from pathlib import Path import pocketsphinx from rhasspyhermes.audioserver import AudioFrame from rhasspyhermes.base import Message from rhasspyherme...
tello-stream.py
#!/usr/bin/python3 """ @brief This is program for stream video from Tello camera. @author Murtadha Bazli Tukimat @date 17-Nov-2020 """ import threading import socket import cv2 """ Welcome note """ print("\nTello Video Stream Program\n") class Tello: def __init__(self): self._running = ...
finder.py
# Copyright (C) [2015-2017] [Thomson Reuters LLC] # Copyright (C) [2015-2017] [Panos Kittenis] # 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...
dataengine_reconfigure_spark.py
#!/usr/bin/python3 # ***************************************************************************** # # 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 ...
b.py
# Dancing Dron - CrazyFly dancing for music beat # Cnaan Aviv 2013-10-05 import time, sys import usb from threading import Thread import logging import cflib from cflib.crazyflie import Crazyflie from cfclient.utils.logconfigreader import LogConfig from cfclient.utils.logconfigreader import LogVariable lo...
test_interactions_aiohttp.py
import asyncio import logging import time import unittest from random import randint from threading import Thread from aiohttp import WSMessage from slack_sdk.socket_mode.request import SocketModeRequest from slack_sdk.socket_mode.async_client import AsyncBaseSocketModeClient from slack_sdk.socket_mode.aiohttp impor...
testing.py
############################################################################# # # Copyright (c) 2004-2009 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS...
main.py
from byj.stepper import * from picamcd.colorcam import * import sys import time from servo.servo import * from motor.motor import * from stepper.stepper import * import pygame from pygame.locals import * from config import * from beadsort.hexcolor import * from beadsort.bead import * from beadsort.colorbin import * imp...
bridge.py
#!/usr/bin/env python3 import argparse import carla # pylint: disable=import-error import math import numpy as np import time import threading from cereal import log from multiprocessing import Process, Queue from typing import Any import cereal.messaging as messaging from common.params import Params from common.realt...
ViewWinRenderedGrid.py
''' Created on Oct 5, 2010 @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. Note speed of using tkinter appears to be slow to render with tkinter (see profiling below) Typical example is an instance takes 3 secs for view() for an open table and subsequently after Python...
dnschef.py
#!/usr/bin/env python # # DNSChef is a highly configurable DNS Proxy for Penetration Testers # and Malware Analysts. Please visit http://thesprawl.org/projects/dnschef/ # for the latest version and documentation. Please forward all issues and # concerns to iphelix [at] thesprawl.org. DNSCHEF_VERSION = "0.3" # Copyri...
train.py
#!/usr/bin/env python """Train models.""" import os import glob import numpy as np import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentParser def main(opt): ...
master.py
from builtins import str from builtins import range # 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/...
event2.py
import random import threading import time fila = [] resultado = [] evento = threading.Event() def Consumidor(): global fila, resultado while True: try: if len(fila)<2: evento.set() else: evento.clear() x = fila.pop(0) ...
threading_server.py
import threading import socket import json from .Shared import tcp_recv, tcp_send, recv_task, send_task from itertools import chain from queue import Queue, Empty try: import SharedData except ImportError: from os import getcwd from sys import path path.append(getcwd() + "/..") import SharedData ...
mininet_tests.py
#!/usr/bin/env python3 """Mininet tests for FAUCET.""" # pylint: disable=too-many-lines # pylint: disable=missing-docstring # pylint: disable=too-many-arguments # pylint: disable=unbalanced-tuple-unpacking from functools import partial import binascii import collections import copy import itertools import ipaddress ...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import csv from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob # See https://en.wikipedia.org/wiki/ISO_4217 CCY_PRECISIONS = {'BHD': 3, 'BIF':...
test_execute.py
import asyncio import time from threading import Thread import dagster_pandas as dagster_pd import pytest from dagster import ( DagsterUnmetExecutorRequirementsError, InputDefinition, ModeDefinition, execute_pipeline, execute_pipeline_iterator, file_relative_path, pipeline, reconstructa...
test_event_log.py
import os import sys import time import traceback from contextlib import contextmanager import pytest import sqlalchemy from dagster import seven from dagster.core.definitions import AssetMaterialization, ExpectationResult from dagster.core.errors import DagsterEventLogInvalidForRun from dagster.core.events import ( ...
main.py
import argparse from multiprocessing import Process from pathlib import Path import yaml from stable_baselines3.common.logger import configure from demac.src.demac.demac_agent_env_wrapper import AgentEnvWrapper from demac.src.demac.demac_coordinator import Coordinator from sample_envs.gridnav.grid import Grid from sa...
websocket_manager.py
import json import time from threading import Thread, Lock from queue import Queue from typing import Callable from gzip import decompress from websocket import WebSocketApp from confluent_kafka import Producer class WebsocketManager(): _CONNECT_TIMEOUT_S = 5 def __init__(self, url: str, subscribe: Callable, ...
lichessbot.py
import argparse import chess from chess import engine from chess import variant import chess.polyglot import model import json import lichess import logging import multiprocessing from multiprocessing import Process import signal import backoff from config import load_config from requests.exceptions import HTTPError, R...
softvolume_test.py
# -*- coding: utf-8 -*- import vaex.dataset as dataset import numpy as np import numpy import math import vaex.utils import matplotlib.pyplot as plt import scipy.ndimage import matplotlib.animation as animation import matplotlib import time def rotz(angle): matrix = np.identity(4) matrix[0,0] = np.cos(angle) matr...
eval_runner.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...
schedular.py
""" Copyright (c) 2020 OneUpPotato Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softwar...
manager.py
import sys import signal import threading import logging.config from pathlib import Path from yaml import safe_load from pmu.sensor import PMUSensor from pmu.controller import PMUController from pmu.connection import PMUConnection from pmu.bridge import PMUBridge class PMUManager(): def __init__(self,arguments={...
bot.py
# -*- coding: utf-8 -*- from .core.data import * from .core.olap import * from .core.oltp import * from .core.test import * from multiprocessing import Process def operation(market): """ todo :param market: :return: """ try: logg(spacer, market) while market in setup()[...
proxy.py
'''Proxy Server''' import os import socket import sys import threading import time import ipaddress BUFFER_SIZE = 1024 MAX_CONNECTION = 25 ALLOWED_ACTIONS = ['GET', 'POST'] CACHE_SIZE = 3 TIMEOUT = 300 PORT = 20100 HOST = '' BLACK_LIST = [] blocked = [] blocked_ips = [] admins = [] BLACKLIST_FILE = "blacklist.txt" U...
__init__.py
""" objectstore package, abstraction for storing blobs of data for use in Galaxy. all providers ensure that data can be accessed on the filesystem for running tools """ import abc import logging import os import random import shutil import threading import time import yaml from galaxy.exceptions import ObjectInvali...
device.py
""" Code for interacting with OpenVizsla devices. """ import time import threading from enum import Enum from . import OVCaptureUSBSpeed, find_openvizsla_asset from .ftdi import FTDIDevice from .memory import OVMemoryWindow, USB334xMemoryWindow from .sniffer import USBSniffer from .firmware import OVFirmwarePackag...
smooth_reset.py
from functools import partial from threading import Thread import wx from spacq.iteration.variables import OutputVariable from spacq.tool.box import sift from ..tool.box import MessageDialog class SmoothResetPanel(wx.Panel): """ A panel to change variables smoothly to and from preset values. """ def __init__(s...
env.py
# Microsoft Azure Linux Agent # # Copyright 2018 Microsoft 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 b...
keep_alive.py
from flask import Flask from threading import Thread app = Flask("") @app.route("/") def home(): return "The bot is online now!" def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): t = Thread(target=run) t.start()
app.py
from flask import Flask, render_template, request import subprocess import os import time from threading import Thread import fileinput app = Flask(__name__) app.debug = True @app.route('/') def index(): wifi_ap_array = scan_wifi_networks() config_hash = config_file_hash() return render_template('app.ht...
test_gc.py
import unittest import unittest.mock from test.support import (verbose, refcount_test, run_unittest, cpython_only, temp_dir, TESTFN, unlink, import_module) from test.support.script_helper import assert_python_ok, make_script from test.support import threading_helper ...
ssd_model.py
# coding=utf-8 # Copyright 2019 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...
d2.py
''' * The MIT License (MIT) * Copyright (c) Arturo Rodriguez All rights reserved. * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights t...
server_11.py
import socket import sys import time import os import argparse global proto import multiprocessing as mp from multiprocessing import * import subprocess import multiprocessing.reduction import threading loc = [] global dump auth = [] with open("auth.f", 'r') as ass: for lin in ass: ips = lin.strip()...
conftest.py
# Copyright (c) 2011 Florian Mounier # Copyright (c) 2011 Anshuman Bhaduri # Copyright (c) 2014 Sean Vig # Copyright (c) 2014-2015 Tycho Andersen # # 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 Soft...
ws.py
#!/usr/bin/env python3 # coding=utf-8 # requires https://pypi.python.org/pypi/websocket-client/ from excepthook import uncaught_exception, install_thread_excepthook import sys sys.excepthook = uncaught_exception install_thread_excepthook() # !! Important! Be careful when adding code/imports before this point. # Our e...
configure_and_test_integration_instances.py
from __future__ import print_function import argparse import ast import json import os import subprocess import sys import uuid import zipfile from datetime import datetime from distutils.version import LooseVersion from enum import IntEnum from pprint import pformat from threading import Thread from time import sleep...
test_capture.py
# -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function import contextlib import io import os import pickle import subprocess import sys import textwrap from io import UnsupportedOperation import py from six import text_type import pytest f...
__init__.py
# vim: sw=4:ts=4:et # # ACE Collectors # These objects collect things for remote ACE nodes to analyze. # import logging import os, os.path import pickle import shutil import socket import threading import uuid import ace_api import saq from saq.database import use_db, \ execute_with_retry, \...
serverThreading.py
import os from threading import Lock, Thread from execution import Executor import logging import socket from pathlib import Path import os executor = Executor() lock = Lock() thread_being_runned = 0 port = 1234 absolute_path = Path().absolute() tempResultFile = os.path.join(absolute_path, "threads/tempResult.txt")...
graph.py
import asyncio import sys from threading import Thread from ..base import StreamEnd, StreamNone, StreamRepeat, TributaryException # noqa: F401 class StreamingGraph(object): """internal representation of the entire graph state""" def __init__(self, node): self._stop = False self._starting_no...
runner.py
#!/usr/bin/env python ''' Simple test runner See settings.py file for options&params. Edit as needed. These tests can be run in parallel using nose, for example nosetests --processes=4 -v -s tests/runner.py will use 4 processes. To install nose do something like |pip install nose| or |sudo apt-get install python...
gdaltest_python2.py
# -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Python Library supporting GDAL/OGR Test Suite # Author: Even Rouault, <even dot rouault at mines dash paris dot org> # ##########################################...
execute.py
""" Once state information has been calculated, handle actually executing tools from various states, tracking results, and building implicit dataset collections from matched collections. """ import collections import logging from threading import Thread from six.moves.queue import Queue from galaxy.tools.actions impo...
test_client_reconnect.py
from concurrent import futures import contextlib import os import threading import sys import grpc import time import random import pytest from typing import Any, Callable, Optional from unittest.mock import patch import ray import ray.core.generated.ray_client_pb2 as ray_client_pb2 import ray.core.generated.ray_clie...
BasicStorage.py
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
synchronous_functions.py
import pandas as pd from ibapi.client import EClient from ibapi.common import OrderId from ibapi.wrapper import EWrapper import threading import time from datetime import datetime import os APP_DATA_PATH = f"{os.getenv('TESTAPP_DATA_PATH')}\submitted_orders.csv" default_hostname = '127.0.0.1' default_port = 7497 defau...
isp_renode.py
import socket import select import threading import time import sys import subprocess import os import logging import isp_utils logger = logging.getLogger() # set timeout seconds timeout_seconds = 60 # configure the test log files uart_port = 4444 uart_log_file = "uart.log" status_port = 3344 status_log_file = "pex...