source
stringlengths
3
86
python
stringlengths
75
1.04M
frozen_agent_time.py
#!/usr/bin/env python3 import math from time import sleep import threading import rospy from pedsim_msgs.msg import AgentStates from dynamic_reconfigure.msg import Config from std_msgs.msg import Float64 class FrozenAgentTime: """This class checks and publishes wether an agent is stuck or not""" def __init_...
dx_update_env.py
#!/usr/bin/env python # Corey Brune - Feb 2017 #Description: # Update Environment # #Requirements #pip install docopt delphixpy.v1_8_0 #The below doc follows the POSIX compliant standards and allows us to use #this doc to also define our arguments for the script. """Description Usage: dx_update_env.py (--pw <name> -...
manager_coexecution_test.py
import subprocess import threading from .test_utils import ( BaseManagerTestCase, ) from pulsar.managers.unqueued import CoexecutionManager class Coexecutor: """Mimic shell script in other container of coexecutor pod-like environment.""" def __init__(self, manager): self.manager = manager ...
globle_key_listener.py
from tkinter import EXCEPTION from tracemalloc import stop from turtle import st from pynput.keyboard import Key, Listener import pynput import audio import voice_mode_ui import re import struct import binascii import threading from PyQt5.QtCore import QSettings from plyer.utils import platform from plyer ...
test_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from collections import OrderedDict import _thread import importlib.machinery import importlib.util import os import pickle import random import re import subprocess impo...
httpd.py
import hashlib import os import sys import threading from http import HTTPStatus from http.server import HTTPServer from RangeHTTPServer import RangeRequestHandler class TestRequestHandler(RangeRequestHandler): def __init__(self, *args, **kwargs): # NOTE: `directory` was introduced in 3.7 if sys....
runFastTextSKIPGRAM.py
from helper import * import multiprocessing import sys import time numKeywords = int(sys.argv[1]) vectorSize = int(sys.argv[2]) maxCandidateArticles = int(sys.argv[3]) reducedSet = str(sys.argv[4]) printTimestamp("Getting candidate articles") if reducedSet=='true': candidate_articles = getCandidateArticles(maxCand...
connect4.py
from multiprocessing import Process from os import mkdir from pickle import dump, load from random import randint from ann.ann import ANN class Connect4(object): def __init__(self, anns=None, increments=None): self.pieces = [[] for _ in xrange(7)] self.anns = anns or [None, None] self.inc...
__init__.py
import enum import socket import threading from socket import AF_INET, SO_REUSEADDR, SOCK_STREAM, SOCK_DGRAM, SOL_SOCKET from pydatanet.server.client import Client from pydatanet.data import encode, decode class ServerType(enum.Enum): TCP = 0 UDP = 1 class ServerStatus(enum.Enum): NOINIT = 0 INIT = 1...
main.py
import os import sys import time import warnings import logging from dotenv import load_dotenv from utils.GraphThread import GraphThread from utils.ServerUtil import ServerUtil from multiprocessing import Process # Suppress complex numbers warnings.filterwarnings('ignore') load_dotenv() if __name__ != "__main__": ...
sockets.py
import socket from packet_parser import Parser import threading parser = Parser() def server_program(): # get the hostname host = '' port = 8888 # initiate port no above 1024 server_socket = socket.socket() # get instance # look closely. The bind() function takes tuple as argument server_so...
Mail Access Checker.py
import random import requests from requests import Session from bs4 import BeautifulSoup from concurrent.futures import ThreadPoolExecutor from threading import Thread import PySimpleGUI as sg from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(In...
deepblaster_object_detection_node.py
################################################################################# # Copyright Cloud Brigade, ScratchSpace, Inc. or its affiliates. All Rights Reserved. # # # # Licensed under the Apache License, Version 2.0 (the "...
test_pvc_creation_deletion_performance.py
""" Test to verify PVC deletion performance """ import logging import datetime import pytest import ocs_ci.ocs.exceptions as ex import threading import statistics from concurrent.futures import ThreadPoolExecutor from ocs_ci.framework.testlib import performance from ocs_ci.ocs.perftests import PASTest from ocs_ci.help...
blinkDetect.py
""" TODO: - Improve face landmark detection. Probably caused due to lighting changes. Eliminate the effect of lightinh with minimal computation. Solved by histogram equalization - Stabilize face landmark points - Gaze direction - Bug Fixes """ import dlib import sys import cv2 import time import ...
spear_server.py
# coding = utf-8 # @time : 2019/6/4 10:02 AM # @author : alchemistlee # @fileName: spear_server.py # @abstract: import threading from queue import Queue from connect import ConnectManager import config import hashlib from multiprocessing import freeze_support import fire import Spear import time import asyncio i...
nettesting.py
# Released under the MIT License. See LICENSE for details. # """Provides ui for network related testing.""" from __future__ import annotations import time import copy import weakref from threading import Thread from typing import TYPE_CHECKING import _ba import ba from bastd.ui.settings.testing import TestingWindow ...
application_test.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_threading.py
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose, cpython_only from test.script_helper import assert_python_ok import random import re import sys thread = test.test_support.import_module('thread') threading = test.test_support.import_module('threading') import...
yumi_test_gripper.py
from threading import Thread import itertools as it import numpy as np import gym from gym.envs.yumi.yumi_env import YumiEnv from playground.utils import wait_for_key SAMPLE_ACTIONS = True # ENV = 'YumiTwoArms-v0' ENV = 'YumiRightArm-v0' def action_thread(selected_action, has_two_arms): def safe_int(x): ...
lj_get_data.py
#!/bin/python #coding=utf-8 from bs4 import BeautifulSoup as bs from multiprocessing import Process, Queue, Pool, Manager from threading import Thread import urllib2,MySQLdb,time,re # put url_data to queue def put_data(plate_id,plate_name,tmp_queue): for i in xrange(1,111): url = '%s/%s/d%s' % (lj_ershou_u...
notifier.py
#!/usr/bin/python3 -OO # Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org> # # 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 Foundation; either version 2 # of the License, or (at your option) any late...
test_gcs_pubsub.py
import sys import threading from ray._private.gcs_pubsub import ( GcsPublisher, GcsErrorSubscriber, GcsLogSubscriber, GcsFunctionKeySubscriber, GcsAioPublisher, GcsAioErrorSubscriber, GcsAioLogSubscriber, GcsAioResourceUsageSubscriber, ) from ray.core.generated.gcs_pb2 import ErrorTable...
test_dag_serialization.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
tenant_node_monitor.py
#!/usr/bin/python ''' DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusion...
monobeast.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
conftest.py
# Copyright The PyTorch Lightning team. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
dummy_client.py
import socket, threading def service_socket(): s = socket.socket() host = socket.gethostname() port = 12345 s.bind(('', port)) # f = open('torecv.png','wb') s.listen(5) # Now wait for client connection. while True: c, addr = s.accept() w...
driver_util.py
"""Scripts for drivers of Galaxy functional tests.""" import http.client import logging import os import random import re import shlex import shutil import signal import socket import string import subprocess import sys import tempfile import threading import time from typing import Optional from urllib.parse import u...
snippet.py
"""Example of barrier implementation using TensorFlow shared variables. All workers synchronize on barrier, copy global parameters to local versions and increment global parameter variable asynchronously. Should see something like this: bash> killall python bash> python simple_barrier.py --num_workers=4 worker 0, lo...
ai4e_service.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. from threading import Thread from os import getenv from opencensus.trace.ext.flask.flask_middleware import FlaskMiddleware from opencensus.trace.tracer import Tracer from opencensus.trace.exporters.ocagent import trace_exporte...
__init__.py
from abc import ABC, abstractmethod import queue from threading import Thread import numpy as np from scipy.io import wavfile import librosa import noisereduce as nr from utils import class_with_path @class_with_path(delete_file_extension="wav") class Recorder(ABC): def __init__(self, sr=None, chunk_duration=1, ...
main.py
# import webview import platform if platform.system() == 'Darwin': import webview else: from cefpython3 import cefpython as cef if platform.system() == 'Windows': cef.DpiAware.EnableHighDpiSupport() import sys import ctypes from time import sleep from threading import Thread, Lock impo...
test_storage_pool.py
import time import threading from pyramid import testing from .support import unittest, skip_if_no_postgresql @skip_if_no_postgresql class QueuePoolWithMaxBacklogTest(unittest.TestCase): def setUp(self): from cliquet.storage.postgresql.client import create_from_config self.connections = [] ...
server.py
# coding=utf-8 from __future__ import print_function import os import signal import traceback import logging import time import json import socket from threading import Thread, Event from six import b as bytes from tantale.utils import load_class from tantale import sources try: from Queue import Queue except:...
WeaveDeviceMgr.py
# # Copyright (c) 2013-2017 Nest Labs, Inc. # 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 # # ...
test_context.py
# # Copyright (c) 2015-2018 Canonical, Ltd. # # This file is part of Talisker # (see http://github.com/canonical-ols/talisker). # # 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 # regardin...
google_colab.py
#google colab selenium setup, run once and then remove !pip install selenium !apt-get update !apt install chromium-chromedriver !cp /usr/lib/chromium-browser/chromedriver /usr/bin !pip install discord #end of setup import sys import discord import asyncio import json import random import threading import codecs from di...
test_solr.py
# (C) Datadog, Inc. 2010-2017 # All rights reserved # Licensed under Simplified BSD License (see LICENSE) # stdlib import threading import time from types import ListType import unittest import mock import os # 3p from nose.plugins.attrib import attr import logging # project from aggregator import MetricsAggregator ...
main.py
# -*- coding: utf-8 -*- # Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the terms of the MIT License. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the...
main.py
from classes.stream_analyzer import StreamAnalyzer from classes.config import Config from classes.dialog import Dialog from classes.window_selector import WindowSelector from classes.hue_setup import HueSetup from classes.event_handler import EventHandler from classes.hue_lights import HueLights from phue import Bridge...
periodic_update.py
""" Periodically update bundled versions. """ from __future__ import absolute_import, unicode_literals import json import logging import os import ssl import subprocess import sys from datetime import datetime, timedelta from itertools import groupby from shutil import copy2 from textwrap import dedent from threading...
dispatcher_local.py
from dispatcher import * class DispatcherLocal(Dispatcher): def executeDispatchment(self, json_object): dispatchment_thread = threading.Thread(target=self.localDispatchment, args=(json_object, )) dispatchment_thread.start() # this should run in a different thread def localDispatchment(self, json_object): ...
Stage3_ContrAdjust.py
from __future__ import division import numpy.random as rnd import RPi.GPIO as GPIO import csv import requests as req import sys import pygame from pygame.locals import * import numpy as np import random import os import time import multiprocessing as billiard print "Im online :)" # Data sending functio...
rfc2217_server.py
#!/usr/bin/env python # # redirect data from a TCP/IP connection to a serial port and vice versa # using RFC 2217 # # (C) 2009-2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause import logging import socket import sys import time import threading import serial import serial.rfc2217 cl...
lesson2.py
# import threading # import time # # # def music(): # print("begin to listen %s"%time.ctime()) # time.sleep(3) # print("stop to listen %s" % time.ctime()) # # # def game(): # time.sleep(4) # t3=threading.Thread(target=music) # t3.start() # # print("begin to play game %s"%time.ctime()) # ...
cli.py
# -*- coding: utf-8 -*- """ flask.cli ~~~~~~~~~ A simple command line application to run flask apps. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from threading import Lock, Thread from functools import update_wrapper import click ...
trainer.py
# from .config import config # from .feature import * # from .data_format import * # from .toolbox import * import os import time from multiprocessing import Process, Queue from . import res_summarize # from .inference import * # from .config import Config from .config import Config, config from .data import DataSet ...
pi_camera_sensor.py
import numpy as np from picamera import PiCamera from threading import Thread from sensors.sensor import Sensor class PiCameraSensor(Sensor): def __init__(self, resolution=(640, 480), internal_framerate=10): self.exited = False self.resolution = resolution self.internal_framerate = intern...
test_io.py
"""Unit tests for the io module.""" # Tests of io are scattered over the test suite: # * test_bufio - tests file buffering # * test_memoryio - tests BytesIO and StringIO # * test_fileio - tests FileIO # * test_file - tests the file interface # * test_io - tests everything else in the io module # * test_univnewlines - ...
ib_gateway.py
""" Please install ibapi from Interactive Brokers github page. """ from copy import copy from datetime import datetime from queue import Empty from threading import Thread, Condition from ibapi import comm from ibapi.client import EClient from ibapi.common import MAX_MSG_LEN, NO_VALID_ID, OrderId, TickAttrib, TickerId...
main.py
import pdb import time import os import subprocess import re import random import json import numpy as np import glob from tensorboard.backend.event_processing.event_accumulator import EventAccumulator import socket import argparse import threading import _thread import signal from datetime import datetime import csv ...
main.py
from flask import Flask, jsonify, request app = Flask(__name__) import re import os import json from threading import Thread # for production, use the below imports from commands.describe_helper import describe, describe_reply_message from commands.idenfity_helper import identify, identify_reply_message from command...
weather_forecaster.py
#!/usr/bin/python # @tweeting_dipa # All imports here import threading import json import time import sys import urllib2, urllib ####### GLOBALS Section ####### # SHELL ENV SHELL_ICON = ">>> " # Shell commands HELP = "help" HYPHEN_HELP = "-h" SHOW = "show" WEATHER = "weather" QUIT = "quit" Q = ...
MdnsListener.py
# Copyright (C) 2018 Riedel Communications GmbH & Co. KG # # Modifications Copyright 2018 British Broadcasting 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.a...
binpickingcontrollerclient.py
# -*- coding: utf-8 -*- # Copyright (C) 2013-2015 MUJIN Inc. # Mujin controller client for bin picking task # mujin imports from . import realtimerobotclient # logging import logging log = logging.getLogger(__name__) class BinpickingControllerClient(realtimerobotclient.RealtimeRobotControllerClient): """mujin c...
test_ssl.py
import asyncio import asyncio.sslproto import contextlib import gc import logging import select import socket import tempfile import threading import time import weakref import unittest try: import ssl except ImportError: ssl = None from test import support from test.test_asyncio import utils as test_utils ...
TESTE_Extração MagMax COVID - STARLAB.py
from opentrons.types import Point import json import os import math import threading from time import sleep metadata = { 'protocolName': 'USO_v6_station_b_M300_Pool_magmax', 'author': 'Nick <ndiehl@opentrons.com', 'apiLevel': '2.3' } NUM_SAMPLES = 8 # start with 8 samples, slowly increase to 48, then 94 (...
ex8_threaded_gui.py
print('Python module loaded') import threading import time import numpy as np gui_lock = threading.RLock() gui_message = '' def gui_loop(): import tkinter as tk window = tk.Tk() label_text = tk.StringVar() label = tk.Label(textvariable=label_text) label.pack() while window.state() == "norma...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test umkoind shutdown.""" from test_framework.test_framework import UmkoinTestFramework from test_fram...
grapl_provision.py
import json import threading import time import os from typing import Any, Dict from hashlib import sha256, pbkdf2_hmac from hmac import compare_digest from random import uniform import botocore import boto3 import pydgraph from uuid import uuid4 from grapl_analyzerlib.grapl_client import MasterGraphClient from grap...
runner.py
#!/usr/bin/env python2 """Simple test runner. """ # This Python file uses the following encoding: utf-8 # XXX Use EMTEST_ALL_ENGINES=1 in the env to test all engines! from __future__ import print_function from subprocess import Popen, PIPE, STDOUT import atexit import difflib import fnmatch import functools import gl...
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...
process.py
from __future__ import print_function, division, absolute_import import atexit from datetime import timedelta import logging import os import re import threading import weakref from .compatibility import finalize, Queue as PyQueue from .utils import mp_context from tornado import gen from tornado.concurrent import F...
monitored_session_test.py
# pylint: disable=g-bad-file-header # 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/LICENS...
policy_server_input.py
from http.server import HTTPServer, SimpleHTTPRequestHandler import logging import queue from socketserver import ThreadingMixIn import threading import time import traceback from typing import List import ray.cloudpickle as pickle from ray.rllib.env.policy_client import ( _create_embedded_rollout_worker, Comm...
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.hardware i...
test_random.py
from __future__ import division, absolute_import, print_function import numpy as np from numpy.testing import ( TestCase, run_module_suite, assert_, assert_raises, assert_equal, assert_warns) from numpy import random from numpy.compat import asbytes import sys class TestSeed(TestCase): def test_sc...
terminal.py
import sublime import os import time import base64 import logging import tempfile import threading from queue import Queue, Empty from .ptty import TerminalPtyProcess, TerminalScreen, TerminalStream from .utils import responsive, intermission from .view import panel_window, view_size from .key import get_key_code fro...
StreamingTools.py
# ! /usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under NVIDIA Simple Streamer License import multiprocessing as mp import numpy as np import time import socket import cv2 import sys if sys.version_info[0] < 3: raise Exception("Only Python 3 s...
inventory.py
from __future__ import absolute_import, division, print_function __metaclass__ = type DOCUMENTATION = """ name: inventory plugin_type: inventory author: - Remy Leone (@sieben) - Anthony Ruhier (@Anthony25) - Nikhil Singh Baliyan (@nikkytub) - Sander Steffann (@steffann) ...
train.py
# Author: Bichen Wu (bichen@berkeley.edu) 08/25/2016 # --encoding=utf8-- """Train""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from datetime import datetime import os.path import sys import time import math import numpy as np from six.moves import ...
wallet.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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...
_read_some_but_not_all_responses_test.py
# Copyright 2016 gRPC 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 applicable law or agreed to in writing...
app.py
from flask import Flask from flask_restful import Api from flask_cors import CORS from ros.models import db from ros.resources.hosts import Hosts, HostDetails from ros.resources.status import Status from ros.config import DB_URI import threading app = Flask(__name__) CORS(app) api = Api(app) # Initalize database conn...
main.py
from threading import Thread from bot import scheduler from API import app from waitress import serve import socket import redis redis = redis.Redis( host='barakis_redis', port=6379 ) hostname = socket.gethostname() if __name__ == '__main__': BOT = Thread(target=scheduler) API = Thread(target=lambd...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
ad_tests.py
import sys import os import platform system = platform.system() current_dir = os.getcwd() if system == 'Windows': path_dir = current_dir.split("\\Neurons")[0] + "\\Neurons" else: path_dir = a.split("/Neurons")[0] + "/Neurons" sys.path.append(path_dir) from model import NGraph, PCC import numpy as np import ...
06_kapitel_15_repetitionsfragen.py
# 06_kapitel_15_repetitionsfragen.py import re max_text_length=70 max_text_delta=24 def output(title, string): print('╔'+''.center(max_text_length+8, '═')+'╗') print('║ '+title.center(max_text_length+7).upper()+'║') print('╠'+''.center(max_text_length+8, '═')+'╣') string=string+' '*max_text_length ...
compute_threaded.py
import math import datetime import threading import multiprocessing def main(): do_math(1) t0 = datetime.datetime.now() # do_math(num=30000000) processor_count = multiprocessing.cpu_count() print('Doing math on {:,} processors.'.format(multiprocessing.cpu_count())) threads = [] for n in r...
ws_api_socket.py
from api_socket import ApiSocket from util import Logger import websocket import threading import json import time import zlib class WebSocketApiClient(ApiSocket): """ Generic REST API call """ def __init__(self, id, received_data_compressed=False): """ Constructor :param id: So...
rtspconnection.py
""" Simple connection class which listens for incoming messages and allows sending requests. """ import re import socket from select import select from threading import Thread try: from Queue import Queue except ImportError: from queue import Queue from .rtspresponse import RTSPResponse class RTSPConnection...
concurrent.py
from __future__ import absolute_import import logging import sys import threading from six.moves.queue import Full, PriorityQueue from concurrent.futures import Future from concurrent.futures._base import RUNNING, FINISHED from time import time from six.moves import xrange logger = logging.getLogger(__name__) def...
validate.py
#!/usr/bin/env python3 import argparse import os, atexit import textwrap import time import tempfile import threading, subprocess import barrier, finishedSignal import signal import random import time from enum import Enum from collections import defaultdict, OrderedDict BARRIER_IP = 'localhost' BARRIER_PORT = ...
local_run_state.py
from collections import namedtuple import logging import os import threading import time import traceback import docker import codalabworker.docker_utils as docker_utils from codalabworker.file_util import remove_path, get_path_size from codalabworker.formatting import size_str, duration_str from codalabworker.bundle...
sound.py
import os import pygame from app.utilities import utils from app.resources.resources import RESOURCES from app.engine import engine import logging class Song(): def __init__(self, prefab): self.nid = prefab.nid self.song = pygame.mixer.Sound(prefab.full_path) self.battle = py...
server_heartbeat.py
import logging import socket import time from threading import Thread from autouri import AutoURI logger = logging.getLogger(__name__) class ServerHeartbeatTimeoutError(Exception): pass class ServerHeartbeat: DEFAULT_SERVER_HEARTBEAT_FILE = '~/.caper/default_server_heartbeat' DEFAULT_HEARTBEAT_TIMEOUT...
stats_server.py
#!/usr/bin/env python # Lint as: python3 """Stats server implementation.""" import errno from http import server as http_server import logging import socket import threading import prometheus_client from grr_response_core import config from grr_response_core.lib import utils from grr_response_server import base_stat...
streaming.py
""" Streaming Parallel Data Processing =================================================================== Neuraxle steps for streaming data in parallel in the pipeline .. Copyright 2019, Neuraxio Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in com...
base_master.py
# Note that `__name__ == '__main__'` is mostly for Windows compatibility # We do not use it because most expected users shall use Ubuntu. from multiprocessing import Process from multiprocessing import Pipe # TODO: consider support of torch.multiprocessing, for its own SimpleQueue or Queue """ from torch.multiproces...
calibrate.py
# Standard python imports import sys, os, logging, threading, argparse import numpy as np # Gstreamer related import gi gi.require_version('Gst', '1.0') gi.require_version('GstBase', '1.0') gi.require_version('Gtk', '3.0') from gi.repository import GLib, Gst, Gtk from gstreamer import GstPipeline, Gst import gstreame...
w2c_enhance.py
import os import sys import threading import time from six.moves import xrange # pylint: disable=redefined-builtin import numpy as np import tensorflow as tf from tensorflow.models.embedding import gen_word2vec as word2vec flags = tf.app.flags flags.DEFINE_string("save_path", None, "Directory to write the model a...
test.py
# -*- coding: utf-8 -*- import redis import unittest from hotels import hotels import random import time from RLTest import Env def testAdd(env): if env.is_cluster(): raise unittest.SkipTest() r = env env.assertOk(r.execute_command( 'ft.create', 'idx', 'schema', 'title', 'text', 'body', ...
main.py
#!/usr/bin/env python import paho.mqtt.client as paho import psutil import pywapi import signal import sys import time from threading import Thread def functionApiWeather(): data = pywapi.get_weather_from_weather_com('MXJO0043', 'metric') message = data['location']['name'] message = message + ", Temperat...
test_http.py
# -*- encoding: utf-8 -*- import collections import errno import email.parser import platform import socket import threading import time import pytest from ddtrace import compat from ddtrace.vendor import six from ddtrace.vendor.six.moves import BaseHTTPServer from ddtrace.vendor.six.moves import http_client import ...
client.py
import sys import random import struct from argparse import ArgumentParser from enum import Enum from threading import Condition, Thread from socket import socket, IPPROTO_UDP, SOCK_DGRAM, AF_INET, SocketType, timeout as timeout_error from ctypes import cdll, create_string_buffer from typing import Dict, Optional from ...
qtoscillo.py
""" Copyright (c) 2020-2021, Chubu University and Firmlogics All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of co...
dataset_ipu.py
# Copyright (c) 2022 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 appli...
cross_validate.py
from collections import Counter from threading import Thread from time import time import numpy as np import pandas as pd from sklearn.model_selection import cross_validate from sklearn.preprocessing import LabelEncoder from timeflux.core.exceptions import WorkerInterrupt from timeflux.core.node import Node from timef...
core_test.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...