source
stringlengths
3
86
python
stringlengths
75
1.04M
check_appcenter_status.py
#!/usr/bin/env python #coding:utf-8 ''' Created on 2019-03-05 @author: yunify ''' import qingcloud.iaas import threading import time from optparse import OptionParser import sys import os import qingcloud.iaas.constants as const import common.common as Common def describe_apps(conn,user_id,app_ids): print("子线程启动...
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 testing pdb under do...
kitti_loader.py
#!/usr/bin/env python # -*- coding:UTF-8 -*- # File Name : kitti_loader.py # Purpose : # Creation Date : 09-12-2017 # Last Modified : Fri 19 Jan 2018 03:11:15 PM CST # Created By : Jeasine Ma [jeasinema[at]gmail[dot]com] import cv2 import numpy as np import os import sys import glob import threading import time impor...
processMongo.py
import sys import os import datetime import json import re import time import pandas as pd import numpy as np from tqdm import tqdm,trange import threading from multiprocessing import Process, Pool, freeze_support, RLock, cpu_count import multiprocessing as mp from pymongo import MongoClient import matplotlib.pyplot as...
train.py
import tensorflow as tf import numpy as np from model import Model import os import threading import matplotlib.pyplot as plt from ops import augment_data, add_features, Logger, plot_confusion_matrix import datetime import time import argparse from sklearn.model_selection import train_test_split from sklearn.utils impo...
lishogi-bot.py
import argparse import shogi import engine_wrapper import model import json import lishogi import logging import multiprocessing import logging_pool import signal import time import backoff import threading from config import load_config from conversation import Conversation, ChatLine from functools import partial from...
systemd.py
#!/usr/bin/env python3 #pylint: disable=W0105 # The MIT License # # Copyright (c) 2019-, Rick Lan, dragonpilot community, and a number of other of contributors. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to dea...
threading_utils.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. """Classes and functions related to threading.""" import functools import inspect import logging import os import Queue import sys import threadi...
mtprint6.py
import threading class MyClass: def __init__(self, a, b, c): self.a = a self.b = b self.c = c def __call__(self): print('Hello', self.a, self.b, self.c) if __name__ == '__main__': for i in range(3): t = threading.Thread(target=MyClass(10, 20, 30)) t.start()...
google_cloud_speech_v1.py
# coding: utf-8 from __future__ import division import re import sys import pyaudio import websocket import threading import time import functions.text_handling as text import functions.recordSound as rec_sound from google.cloud import speech from google.cloud.speech import enums from google.cloud.speech import type...
robustness_main_old.py
import argparse import copy import json import os import threading import time import sys from robustness import airsim import numpy as np import PIL import torch import torchvision.models as models import torchvision.transforms as transforms from IPython import embed import cv2 from tools.attacks import PGD, Normali...
downloader.py
import requests import os from bs4 import BeautifulSoup from PIL import Image import shutil import time import re import threading import sys def progress(): global x i=0 animation = "|/-\\" while x==0: sys.stdout.write("\rDowloading... %s" %animation[i % len(animation)]) sys.stdout.flush() i+=1 time.sleep...
tame.py
import time import threading import os import ujson import traceback import argparse import bottle import alsaaudio # has issue on the pi # import soundmeter # from soundmeter.monitor import Meter from math import log10 driver_shared_data = {'cycle_time': 3} def audio_meter(driver_shared_data): while True: ...
server.py
import socket import threading def client_thread(name, client_sock, clients): while True: try: msg = client_sock.recv(16384) if msg.decode('utf-8') == "bye": client_sock.close() delete_client_sock(client_sock, clients) for client in clients: client[1].send(b' --- ' + name + b' left the chat...
interactive.py
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com> # # This file is part of paramiko. # # Paramiko is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (a...
test_collection.py
import numpy import pandas as pd import pytest from pymilvus import DataType from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.utils import * from...
data_helper.py
import copy import hashlib import json import random import socket import threading import time import uuid import zlib from multiprocessing.process import BaseProcess as Process from multiprocessing.queues import Queue from queue import Queue from random import Random import crc32 import logger import memcacheConstan...
elastiqs.py
import logging import time import threading import sys from collections import deque import multiprocessing import logging from datetime import datetime import boto3 from exceptions import InvalidQueueError, EmptyProductionQueueError logging.basicConfig(stream=sys.stdout, level=logging.INFO) logger = logging.getLog...
server.py
import requests import schedule import threading import time import uvicorn from monitor import Monitor from fastapi import FastAPI, Response from pydantic import BaseModel app = FastAPI() monitor = Monitor() @app.get("/monitor/heart_beat") def heart_beat(response: Response): response_json = { "success":...
test_rsocket.py
import py, errno, sys from rpython.rlib import rsocket from rpython.rlib.rsocket import * import socket as cpy_socket from rpython.translator.c.test.test_genc import compile def setup_module(mod): rsocket_startup() def test_ipv4_addr(): a = INETAddress("localhost", 4000) assert a.get_host() == "127.0.0.1...
server.py
from dataclasses import dataclass from threading import Thread import unicodedata as ud import json import math import time from random import randint import eventlet from flask_socketio import SocketIO from flask import Flask, send_from_directory, render_template from ip import ip_address, port async_mode = None ap...
utils.py
# Copyright 2020 - 2021 MONAI Consortium # 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...
docker_log_watcher.py
#!/usr/bin/env python # Copyright (c) Microsoft. All rights reserved. # Licensed under the MIT license. See LICENSE file in the project root for # full license information. from multiprocessing import Process, Queue, Event from threading import Thread import uuid import docker try: # on Windows, we get a different...
test_testing_cli.py
# Copyright (c) The Diem Core Contributors # SPDX-License-Identifier: Apache-2.0 from click.testing import CliRunner, Result from diem.testing import cli from diem.testing.suites import envs from diem.testing.miniwallet import ServerConfig, RestClient from diem.testing import LocalAccount from diem import identifier, ...
1.py
# -*- coding: utf-8 -*- import KRIS from KRIS.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen import r...
build_image_data.py
"""Converts image data to TFRecords file format with Example protos. The image data set is expected to reside in JPEG files located in the following directory structure. data_dir/label_0/image0.jpeg data_dir/label_0/image1.jpg ... data_dir/label_1/weird-image.jpeg\\\ data_dir/label_1/my-image.jpeg ... where...
components.py
""" File that will hold the source code for hardware that will be controlled by the Pi. All of the servos, motors, sensors, LEDs, etc. will be here. """ import RPi.GPIO as GPIO try: import Adafruit_PCA9685 except: pass from time import sleep from threading import Thread import VL53L0X GPIO.setmode(GPIO...
learn.py
# # Unity ML-Agents Toolkit import logging from multiprocessing import Process, Queue import numpy as np from docopt import docopt from mlagents.trainers.trainer_controller import TrainerController from mlagents.trainers.exception import TrainerError def run_training(sub_id, run_seed, run_options, process_queue): ...
server.py
from socket import AF_INET, socket, SOCK_STREAM from threading import Thread def accept_incoming_connections(): """Sets up handling for incoming clients.""" while True: client, client_address = SERVER.accept() print("%s:%s has connected." % client_address) client.send(bytes("G...
agent_interacting_room.py
import mailbox import threading import src.multi_agent.elements.room as room from src import constants from src.multi_agent.agent.agent import Agent from src.multi_agent.agent.agent_interacting_room_camera_representation import AgentCamRepresentation from src.multi_agent.agent.agent_interacting_room_representation impo...
gdpr.py
import numpy import pyaudio import sys import threading import time from src.fft import getFFT class GDPR: """ The GDPR class is provides access to continuously recorded (and mathematically processed) microphone data. Arguments: device - the number of the sound card input to use. ra...
clientHandler.py
__author__ = 'Brent Berghmans 1334252' from threading import Thread import socket import time class ClientHandler: def doCommand(self, command): try: if 'IP' == command: print 'Command Valid: IP' self.mSocket.send(self.mAddress[0]) elif...
compute_pipe.py
""" Pipes provide a nice way to lazily queue steps for later execution and allow for a nice way to chain together sequential functions. They also provide many other benefits listed below along with their usage information Pipes can accept raw values at their tops but nowhere else in the pipe as that would break the fl...
keyboard.py
from multiprocessing import Process, Value from Xlib import X, display from Xlib.ext import record from Xlib.protocol import rq disp = display.Display() if not disp.has_extension("RECORD"): raise Exception("RECORD extension not found") # This function is run in its own process to allow it to gather keypresses ...
testSIO.py
import time from threading import Thread import socketIO_client class SIO: def __init__(self, host="localhost", port=80): print "SIO", host, port self.sio = socketIO_client.SocketIO(host, port) self.sio.on("periscope", self.onPeriscopeResponse) self.sio.on("chat", self.onChatRespon...
weather.py
import pygame import os import time import threading import json import requests class Forecast: forecast_mtime = 0 forecast_filename = None conditions_filename = None forecast_data = None conditions_data = None # how often to update the forecast by going to remote weather # API. in secon...
mw.py
#!/usr/bin/env python ############################################################################## # # $Id$ ############################################################################## ''' MW - Enstore File Cache Migration worker core functionality implementation implements everything what can work and ...
test_integration.py
# # Copyright 2014 Didip Kerabat # Copyright 2014 Infoxchange Australia # # 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 require...
main.py
#!/usr/bin/python3 from paramiko import SSHClient import time import threading import sys class OltSSH: def __init__(self, ip, authUsername, autPassword, file_name, difinePort = 22): self.client = SSHClient() self.f = open(file_name+".txt", "a") self.client.load_system_host_keys() ...
module.py
import os import importlib import logging import threading import core.config import core.input import core.widget import core.decorators import util.format try: error = ModuleNotFoundError("") except Exception as e: ModuleNotFoundError = Exception log = logging.getLogger(__name__) """Loads a module by na...
sv-daq-simu-pva.py
import time, threading,argparse import numpy as np import pvaccess as pva from multiprocessing import Queue import tensorrt as trt class daqSimuEPICS: def __init__(self, npy, daq_freq, nf, nx, ny, runtime, channel_name, start_delay): self.arraySize = None self.delta_t = 1.0/daq_freq self...
trainer_worker.py
# Copyright 2020 The FedLearner 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...
asyncppo.py
import multiprocessing import multiprocessing.connection import random import cv2 import gym import numpy as np import torch import time import matplotlib.pyplot as plt from typing import Dict, List from torch import nn from torch import optim from torch.distributions import Categorical from torch.nn import functional...
19-GreekToMe.py
import winappdbg import threading import time import winapputil global key, memory_snapshot, context_snapshot, first_time, memory_blob mylogger = winappdbg.Logger() # Takes a memory snapshot of the process and returns it def get_memory(event): myProcess = event.get_process() myProcess.suspend()...
ronda4.py
import threading import time mutex = threading.Semaphore(1) procesos = [['A', 'B', 'C', 'D', 'E'], [3, 7, 2, 9, 6], [0, 3, 7, 10, 14], [0, 0, 0, 0, 0], [3, 7, 2, 9, 6]] resultados = [['T', 'E', 'P'], [0, 0, 0], [0, 0, 0]] cola_ejecucion = [] tiempo_espera = procesos[2][0] tiempo_total = 0 quantum = 4 def proceso(proc...
installwizard.py
import sys import os from PyQt4.QtGui import * from PyQt4.QtCore import * import PyQt4.QtCore as QtCore import electrum from electrum.wallet import Wallet from electrum.util import UserCancelled from electrum.base_wizard import BaseWizard from electrum.i18n import _ from seed_dialog import SeedLayout, KeysLayout fro...
test_utils_test.py
from __future__ import print_function, division, absolute_import from contextlib import contextmanager import socket import threading from time import sleep import pytest from tornado import gen from distributed import Scheduler, Worker, Client from distributed.core import rpc from distributed.metrics import time fr...
test.py
import os.path as osp import sys import cv2 import numpy as np import torch.hub import os import utils.model from PIL import Image from torchvision import transforms from utils.grad_cam import BackPropagation, GradCAM,GuidedBackPropagation import threading import time import vlc from random import seed,random, randint ...
face2rec2.py
import os import sys import mxnet as mx import random import argparse import cv2 import time import traceback from easydict import EasyDict as edict sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'common')) import face_align import ipdb import numpy as np try: import multiprocessing except ImportErro...
fixtures.py
# coding: utf-8 # Original work Copyright Fabio Zadrozny (EPL 1.0) # See ThirdPartyNotices.txt in the project root for license information. # All modifications Copyright (c) Robocorp Technologies Inc. # All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License") # you may not use this file e...
trading.py
import queue as qu import threading import time from enviro import STREAM_DOMAIN, GrabToken, GrabID from strategytest import TestStrat from stream import GrabPrice def trade(events, strategy): while True: try: event = events.get(False) except qu.Empty: pass else: ...
test_thread_safety.py
from promise import Promise from promise.dataloader import DataLoader import threading def test_promise_thread_safety(): """ Promise tasks should never be executed in a different thread from the one they are scheduled from, unless the ThreadPoolExecutor is used. Here we assert that the pending promi...
TestRunnerAgent.py
# Copyright 2010 Orbitz WorldWide # # 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 writ...
transform_listener.py
# Copyright (c) 2008, Willow Garage, 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 co...
qsatype.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import os import datetime, weakref from PyQt4 import QtCore, QtGui # Cargar toda la API de Qt para que sea visible. from PyQt4.QtGui import * from PyQt4.QtCore import * from pineboolib import qsaglobals from pineboolib import flcontrols from pineboolib...
start_regtest.py
import os import time import sys import threading import subprocess from subprocess import PIPE class Node: def __init__(self, node_root, bin_path, port, rpc_port): self.node_root = node_root self.bin_path = bin_path self.conf = self.node_root + '/qtum.conf' self.port = port ...
ps_async_mp.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import sys import cPickle as pickle import socket from multiprocessing import Process, Queue, Value, Manager from ctypes import c_char_p from datetime import datetime import time import te...
ThreadProgramming.py
# 多线程 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 ended' % threading.current_thread().name) t ...
webstreaming.py
""" Webstreaming Supports: * 2x Ethernet RTP cameras In Development * 1x CAN 3-axis gyroscope * 4x Analog voltage sensor """ __author__ = "Trevor Stanhope" __copyright__ = "MIT" __date__ = "2021-08-19" # Import necessary packages from imutils.video import VideoStream from flask import Response from flask im...
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
# .-------------------. # | imports | # '-------------------' from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.metrics import dp from kivy.network.urlrequest import UrlRequest from kivy.properties import NumericProperty from kivy.uix.image import AsyncImage from k...
tests.py
from __future__ import unicode_literals import sys import time import unittest from django.conf import settings from django.db import transaction, connection, router from django.db.utils import ConnectionHandler, DEFAULT_DB_ALIAS, DatabaseError from django.test import (TransactionTestCase, skipIfDBFeature, skipUn...
intro_hilos.py
#!/usr/bin/python3 from threading import Thread, enumerate from time import sleep from random import randint ultimo = 0 def un_hilo(yo): global ultimo while True: print(' ' * yo, '%d%d' % (ultimo, yo) ) ultimo = yo sleep(randint(0,5)) hilos = [] for i in range(10): hilo = Thread...
curses_menu.py
import curses import os import platform import threading class CursesMenu(object): """ A class that displays a menu and allows the user to select an option :cvar CursesMenu cls.currently_active_menu: Class variable that holds the currently active menu or None if no menu\ is currently active (E.G. whe...
test_async_friendly_queue.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2022 Valory AG # Copyright 2018-2020 Fetch.AI Limited # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # ...
battery_data.py
# -*- coding: utf-8 -*- """This module contains a program for sending data to the battery simulation.""" # Copyright (c) TUT Tampere University of Technology 2015-2018. # This software has been developed in Procem-project funded by Business Finland. # This code is licensed under the MIT license. # See the LICENSE.txt ...
test_DialogueServer.py
############################################################################### # PyDial: Multi-domain Statistical Spoken Dialogue System Software ############################################################################### # # Copyright 2015 - 2019 # Cambridge University Engineering Department Dialogue Systems Grou...
petek.py
import sys from SQLper import * #from PyQt5 import uic from PyQt5 import QtWidgets as qtw from PyQt5 import QtCore as qtc from PyQt5 import QtGui as qtg from stylesheet import styleSheet from main_window import Ui_MainWindow from homepage_layout import Ui_homepage_layout from tab_window import Ui_TabWindow fr...
main.py
from threading import Thread try: from queue import Queue except: # noqa: E722 from Queue import Queue def main(): # global Queue, Thread, sqrt q = Queue() worker = [] for i in range(5): t = Thread(target=sqrt, args=(q, i)) t.start() worker.append(t) for w in wo...
zwave_plus_gateway_device.py
#!/usr/bin/env python3 import logging import threading import time import serial from gateway_devices.generic_gateway_device import GenericGatewayDevice logger = logging.getLogger(__name__) def get_class(): return ZWavePlusGatewayDevice class ZWavePlusGatewayDevice(GenericGatewayDevice): NAME = "Aeotec Z...
base_camera.py
import time import threading try: from greenlet import getcurrent as get_ident except ImportError: try: from thread import get_ident except ImportError: from _thread import get_ident class CameraEvent(object): """An Event-like class that signals all active clients when a new frame is ...
stats.py
# from __future__ import absolute_import import json import platform import subprocess import threading import time import psutil import wandb from wandb import util from wandb.vendor.pynvml import pynvml from . import tpu from ..lib import telemetry if wandb.TYPE_CHECKING: from typing import Dict, List, Optio...
webcam_detector.py
from itertools import count from threading import Thread from queue import Queue import cv2 import numpy as np import torch import torch.multiprocessing as mp from alphapose.utils.presets import SimpleTransform class WebCamDetectionLoader(): def __init__(self, input_source, detector, cfg, opt, queueSize=1): ...
test_parallel.py
from __future__ import absolute_import, unicode_literals import json import os import subprocess import sys import threading import pytest from flaky import flaky from tox._pytestplugin import RunResult def test_parallel(cmd, initproj): initproj( "pkg123-0.7", filedefs={ "tox.ini": ...
Run.py
import string, subprocess, random, re, psutil, threading, time, datetime from Read import getUser, getMessage from Socket import openSocket, sendMessage from Initialize import joinRoom from functions import * from Commands import * from threading import Thread #from commands import * # Connect to IRC/Channel an...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import argparse ...
utils.py
import asyncio from concurrent.futures import Future import functools import threading import typing as tp from pypeln import utils as pypeln_utils def Namespace(**kwargs) -> tp.Any: return pypeln_utils.Namespace(**kwargs) def get_running_loop() -> asyncio.AbstractEventLoop: try: loop = asyncio.ge...
runner.py
#!/usr/bin/env python3 # Copyright 2010 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. """This is the Emscripten test runner. To run ...
threads_no_callbacks_with_order.py
import urllib2 as u import json import time import threading as t import random SIZE = 3 def get_data(post_id, data): def __get_data(): site= "http://jsonplaceholder.typicode.com/posts/" + str(post_id+1) hdr = {'User-Agent': 'Mozilla/5.0'} req = u.Request(site,headers=hdr) raw_data...
main.py
from bot import Bot from game_recovery import GameRecovery from game_stats import GameStats from health_manager import HealthManager from death_manager import DeathManager from screen import Screen from logger import Logger import keyboard import os from config import Config from utils.graphic_debugger import run_graph...
challenge36.py
from __future__ import annotations from queue import Queue from threading import Thread from typing import Any from Crypto.Hash import HMAC, SHA256 from Crypto.Random import get_random_bytes from .challenge33 import diffie_hellman, generate_private, get_constants class ConnectionEndpoint: def __init__(self, se...
autotermheater.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import logging import serial import serial.tools.list_ports as list_ports import threading import time ################ versionMajor = 0 versionMinor = 1 versionPatch = 2 ################ status_text = {0: 'heater off', 1: 'starting', 2: 'warming up', 3: 'running', 4: 'shut...
test_ping_vms.py
#!/usr/bin/env python from credentials import get_keystone_creds from novaclient import client from keystoneclient import session from keystoneclient.auth import identity import subprocess import threading import time import re import sys import os import socket interval = 0.5 def downtime_info(downtime_servers, file...
keylime_agent.py
#!/usr/bin/python3 ''' SPDX-License-Identifier: BSD-2-Clause Copyright 2017 Massachusetts Institute of Technology. ''' import asyncio import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn import threading from urllib.parse import urlparse import base64 i...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import struct import operator import pickle import weakr...
compare_Walltoall_adam_1layers.py
import qiskit import numpy as np import sys sys.path.insert(1, '../') import qtm.base, qtm.constant, qtm.ansatz, qtm.fubini_study, qtm.encoding import importlib import multiprocessing importlib.reload(qtm.base) importlib.reload(qtm.constant) importlib.reload(qtm.ansatz) importlib.reload(qtm.fubini_study) def run_wall...
testSErver.py
from ery4z_toolbox import Server, Client import random import time, json from threading import Thread import tqdm def s_run(myServ): myServ.run() def c_run(): myClient = Client.Client() myClient.connect() time_elapsed = [] data = [] test_count = 10 data_count = 50000 data_range = 3...
ue_mac.py
""" Copyright (c) Facebook, Inc. and its affiliates. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. """ import threading from typing import List from ryu.controller import ofp_event from ryu.controller.handler import M...
publisher.py
# Sample code for CS6381 # Vanderbilt University # Instructor: Aniruddha Gokhale # # Code taken from ZeroMQ examples with additional # comments or extra statements added to make the code # more self-explanatory or tweak it for our purposes # # We are executing these samples on a Mininet-emulated environment # # # # ...
netcdf.py
#!/usr/bin/env pytest # -*- coding: utf-8 -*- ############################################################################### # $Id$ # # Project: GDAL/OGR Test Suite # Purpose: Test NetCDF driver support. # Author: Frank Warmerdam <warmerdam@pobox.com> # #############################################################...
testing.py
import argparse import csv import logging import os import shutil import threading import numpy as np import torch import torch.utils.data as data import yaml import mrf.data.dataset as ds import mrf.data.definition as defs import mrf.data.normalization as norm import mrf.loop.callback as clb import mrf.loop.context ...
integration.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...
test_selenium.py
#!/usr/bin/env python ''' Test for using selenium ''' __author__ = 'M@Campbell' import re import threading import unittest from selenium import webdriver from ooiservices.app import create_app, db class SeleniumTest(unittest.TestCase): client = None @classmethod def setUpClass(cls): # start Fir...
testipc.py
from unittest import TestCase, main from multiprocessing import Process, Queue from mypy.ipc import IPCClient, IPCServer import pytest import sys import time CONNECTION_NAME = 'dmypy-test-ipc' def server(msg: str, q: 'Queue[str]') -> None: server = IPCServer(CONNECTION_NAME) q.put(server.connection_name) ...
kb_BatchAppServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
socket_thread.py
from threading import Thread import socket, os, errno from time import sleep from express.request import Request from express.response import Response import keyboard class ServerSocketThread(Thread): socket: socket or None = None def __init__(self, app, host: str, port: int, timeout: int or floa...
test_dag_serialization.py
# -*- coding: utf-8 -*- # # 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 #...
shared.py
""" Shared library of functions used throughout Karen's various modules """ import time import json import threading from http.server import BaseHTTPRequestHandler from urllib.parse import parse_qs, urlparse, urlencode from cgi import parse_header, parse_multipart import socket import logging import urllib3 impor...
manager.py
#!/usr/bin/env python3.7 import os import time import sys import fcntl import errno import signal import shutil import subprocess import datetime from common.basedir import BASEDIR, PARAMS from common.android import ANDROID sys.path.append(os.path.join(BASEDIR, "pyextra")) os.environ['BASEDIR'] = BASEDIR TOTAL_SCONS_...
coap.py
import logging import logging.config import os import random import socket import struct import threading from coapthon.messages.message import Message from coapthon import defines from coapthon.messages.response import Response from coapthon.utils import Tree, create_logging from coapthon.layers.blocklayer import Blo...