source
stringlengths
3
86
python
stringlengths
75
1.04M
map_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...
sync_rl.py
import multiprocessing as mp import time import torch.distributed from collections import namedtuple from rlpyt.runners.minibatch_rl import MinibatchRl, MinibatchRlEval from rlpyt.utils.seed import make_seed from rlpyt.utils.synchronize import drain_queue, find_port Par = namedtuple('Par', ['barrier', 'traj_infos_q...
TaskPool.py
# --------------------------------------------------------------------------- # | # | TaskPool.py # | # | David Brownell (db@DavidBrownell.com) # | # | 09/05/2015 09:50:45 PM # | # --------------------------------------------------------------------------- # | # | Copyright David Brownell 2015-...
rebalancetests.py
import time import unittest from TestInput import TestInputSingleton import logger from membase.api.rest_client import RestConnection, RestHelper from membase.helper.bucket_helper import BucketOperationHelper from membase.helper.cluster_helper import ClusterOperationHelper from membase.helper.rebalance_helper import Re...
__main__.py
from shmooze.modules import JSONParentPoller import musicazoo.lib.graphics import musicazoo.lib.vlc import threading import socket import Tkinter import time import text2speech import text2screen import preprocessing text2speech_engines = { 'google':text2speech.google, } text2screen_engines = { 'splash':text...
testing.py
import os, platform, multiprocessing, subprocess as sp from multiprocessing import Process from utilities import clear def process(command, name): try: sp.run(f"{command} {name}.py", stdout = sp.DEVNULL, stderr = sp.DEVNULL) except: pass if __name__ == "__main__": clear() command = "python" ...
RandomStateServer.py
import http.server import socketserver import os from time import sleep from threading import Thread import socket from contextlib import closing import json from random import random from statistics import mean # This script will create and run a server that will randomly timeout. The probability of a timeout is set ...
plot.py
import logging import os import threading from flask import Flask, render_template from flask_socketio import SocketIO, emit from poker_ai.games.short_deck.state import ShortDeckPokerState from backend import convert logging.getLogger("werkzeug").setLevel(logging.ERROR) logging.getLogger("socketio").setLevel(loggin...
trustedcoin.py
#!/usr/bin/env python # # 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...
messaging.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """An implementation of the session and presentation layers as used in the D...
batcher.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # Modifications Copyright 2017 Abigail See # # 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...
lisp-rtr.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain...
test_unstable_connection.py
# encoding: utf-8 import os import time import threading import socket import os from tornado import gen from tormysql.pool import ConnectionNotFoundError from pymysql import OperationalError from tornado.testing import gen_test from tormysql import Connection, ConnectionPool import sevent from tests import BaseTestCa...
test_pdb.py
# -*- coding: utf-8 -*- from __future__ import print_function import bdb import inspect import os.path import re import sys import traceback from io import BytesIO import py import pytest try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest # Make sure...
keep_alive.py
# to make it live in in replit use uptime robot # and don't for get to make the flow lines of code in bot.py # from keep_alive import keep_alive # and in befor the api keys insert keep_alive() from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return "Hello. I am a...
main.py
#!/usr/bin/env python3 # Problem description import os, sys sys.path.append(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..')) from utils.decorators import * from vm.vm import ElfMachine def execute_amps(program, amps): global res, idx, flip res = 0 idx = -1 flip = True def receive(...
test_restserver.py
""" Unit tests for the procedure REST API module. """ import copy import threading import time import types from collections import OrderedDict from http import HTTPStatus from unittest import mock import flask import pytest from pubsub import pub import oet.procedure.domain as domain from oet.event import topics fro...
develop_utils.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...
processing_queue.py
import multiprocessing, time class ProcessingQueue(object): """Summary Attributes: finish (list): Description nbProcess (TYPE): Description processes (list): Description queue (list): Description running (list): Description """ def __init__(self, nbPro...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum import Wallet, WalletStorage from electrum.util import UserCancelled, InvalidPassword from electrum.base_wizard import BaseWizard, HWD_SETUP_DECRYPT_WALLET from elec...
threading_demo.py
# -*- coding: utf-8 -*- from time import ctime, sleep import threading def music(info = ''): for i in range(2): print("I was listening to music.%s %s" % (info, ctime())) sleep(1) def coding(info = ''): for i in range(2): print("I was coding %s %s" % (info, ctime())) sleep(...
daemon_mqtt_client.py
#!/usr/bin/env python3 import datetime import os import re import ssl import subprocess import time from threading import * import inotify.adapters import paho.mqtt.client as mqtt # ---------------------------------------------------------- # Prerequisites # ---------------------------------------------------------...
utils_test.py
from __future__ import print_function, division, absolute_import import collections from contextlib import contextmanager import copy from datetime import timedelta import functools import gc from glob import glob import itertools import logging import logging.config import os import re import shutil import signal imp...
FBTools.py
#!/usr/bin/python2 # coding=utf-8 import os,sys,time,datetime,random,hashlib,re,threading,json,getpass,urllib,cookielib from multiprocessing.pool import ThreadPool try: import mechanize except ImportError: os.system("pip2 install mechanize") try: import requests except ImportError: os.system("pip2 inst...
wifi_app.py
#!/usr/bin/env python """ Copyright 2017 Raphael "rGunti" Guntersweiler Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,...
test_ITransE_lan_mapping_15k_fk.py
import sys import os new_path = os.path.join(os.path.dirname(__file__), '../../src/ITransE') sys.path.append(new_path) from ITransE import ITransE import time import multiprocessing from multiprocessing import Process, Value, Lock, Manager, Array import numpy as np from numpy import linalg as LA fmap = os...
arduport.py
#!/usr/bin/python # coding: utf8 # ==================================================== # MMM-ArduPort Copyright(C) 2019 Furkan Türkal # // This program comes with ABSOLUTELY NO WARRANTY; This is free software, # and you are welcome to redistribute it under certain conditions; See # file LICENSE, which is part of this...
rpc.py
# Copyright 2020 The Pigweed 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
trick.py
# -*- coding: utf-8 -*- # ░░░░░░░░░░░░░░░░░░░░░░░░▄░░ # ░░░░░░░░░▐█░░░░░░░░░░░▄▀▒▌░ # ░░░░░░░░▐▀▒█░░░░░░░░▄▀▒▒▒▐ # ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐ # ░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐ # ░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌ # ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒ # ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐ # ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄ # ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒ #...
http_server.py
#!/usr/bin/env python # Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. # Many tests expect there to be an http server on port 4545 servering the deno # root directory. from collections import namedtuple from contextlib import contextmanager import os import SimpleHTTPServer import SocketServer ...
__init__.py
""" S3 Binding Module with logging handler and stream object """ __author__ = 'Omri Eival' import atexit import signal import threading import queue import gzip import codecs from logging import StreamHandler from io import BufferedIOBase, BytesIO from boto3 import Session from datetime import datetime from aws_logg...
__init__.py
""" homeassistant.components.httpinterface ~~~~~~~~~~~~~~~~~~~~~~~~~~~ This module provides an API and a HTTP interface for debug purposes. By default it will run on port 8123. All API calls have to be accompanied by an 'api_password' parameter and will return JSON. If successful calls will return status code 200 or...
rtu_slave.py
#!/usr/bin/env python ''' Pymodbus Asynchronous Server Example -------------------------------------------------------------------------- The asynchronous server is a high performance implementation using the twisted library as its backend. This allows it to scale to many thousands of nodes which can be helpful for ...
server_launcher.py
import argparse import logging from multiprocessing import Process from pyschieber.player.greedy_player.greedy_player import GreedyPlayer from pyschieber.player.server_player.server_player import ServerPlayer logging.basicConfig(level=logging.INFO, format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s', ) def...
models.py
import threading import json from datetime import timedelta, datetime from typing import Tuple, TypeVar from django.core.exceptions import ValidationError from django.db import models, transaction from django.db.models import SET_NULL from django.utils.timezone import now as django_now from django.utils.translation im...
test_pantsd_integration.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import itertools import os import signal import threading import time import unittest fro...
pref_rps.py
from threading import Thread import socket import time sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.connect(('localhost', 1234)) #sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1) n = 0 status = True def monitor(): global n, status while status: time.sleep(1) print(n...
naming_processes.py
import multiprocessing import time def myFunc(): name = multiprocessing.current_process().name print ("Starting process name = %s \n" %name) time.sleep(3) print ("Exiting process name = %s \n" %name) if __name__ == '__main__': process_with_name = multiprocessing.Process(name='Ini Mah Iseng aja', t...
test_win_runas.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, unicode_literals import textwrap import subprocess import socket import inspect import io # Service manager imports import sys import os import logging import threading import traceback import time import yaml from tests.support.case import ModuleCase fr...
TwitchLinkPopcornEngine.py
import threading import subprocess import time from shutil import rmtree from Services.Twitch.TwitchPlaybackAccessTokens import * class TwitchDownloaderNetworkError(Exception): def __str__(self): return "\nNetwork Error" class TwitchDownloaderFileSystemError(Exception): def __str__(self): r...
__init__.py
import json import logging import os import re import requests import socketIO_client import sys import time import threading from base64 import b64encode from json import dumps from os.path import basename __all__ = ['Client', 'ClientError'] __build__ = [3, 2, 0] try: # noinspection PyUnresolvedReferences,PyUnb...
TSocketTest.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 ...
coach.py
from src.referee import Referee from src.games.reversi.reversi_game import ReversiGame as Game from src.games.reversi.reversi_player import * from src.config import * from src.lib.utils import * from collections import deque from src.games.reversi.reversi_nnet import NNetWrapper as NNet import multiprocessing import os...
experiment_queue.py
##################################################################### # # # /experiment_queue.py # # # # Copyright 2013, Monash Univ...
util.py
#!/usr/bin/python3 #-*- encode:utf-8 -*- import cv2 import sys, os, time import skvideo.io import subprocess import pathlib import hashlib from PIL import ImageFont from PIL import Image from PIL import ImageDraw from threading import Thread from queue import Queue import datetime import io import numpy as np import p...
test_bmuf.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import argparse import random import unittest from multiprocessing import Manager import torch import torch.nn as nn from fairseq import dist...
lisp-etr.py
#----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain ...
client.py
# Copyright 2019 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
random_shuffle_queue_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
smc.py
''' Implements the often needed split, map, combine paradigm ''' from __future__ import division from multiprocessing import Pool, cpu_count, TimeoutError from threading import Thread, Event from collections import deque import dill import numpy as np import tables as tb from beam_telescope_analysis.tools import ana...
udp.py
#!/usr/bin/env python3 # Software Name: pyngsild # SPDX-FileCopyrightText: Copyright (c) 2021 Orange # SPDX-License-Identifier: Apache 2.0 # # This software is distributed under the Apache 2.0; # see the NOTICE file for more details. # # Author: Fabien BATTELLO <fabien.battello@orange.com> et al. import anyio import ...
tact.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2015 NXEZ.COM. # http://www.nxez.com # # Licensed under the GNU General Public 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.gnu.org/licen...
playing_with_redis.py
# Redis job queue q = Queue(connection=conn) @data_set_routes.route('/data-sets') @login_required def data(): curr_user = current_user.to_dict() if curr_user["type_id"] == 1: data = db.session.query(DataSet).all() return jsonify([data_set.to_dict() for data_set in data]) else: retu...
general_functions.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import os import time import socket from threading import Thread import configparser from atomize.main.client import LivePlotClient #from liveplot import LivePlotClient # Test run parameters if len(sys.argv) > 1: test_flag = sys.argv[1] else: test_flag...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. versionadded:: 2014.7.0 .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Version 3.2.3 is currently recommended when SSL is enabled, since this version worked the best with SSL in internal testing....
utils.py
# # Copyright 2018 PyWren Team # (C) Copyright IBM Corp. 2020 # (C) Copyright Cloudlab URV 2020 # # 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-...
iot.py
import os, sys, socket, random, time, threading, xtelnet from bane.payloads import * from bane.vulns import adb_exploit, exposed_telnet from ftplib import FTP import mysqlcp from bane.bruteforcer import * from bane.extrafun import write_file def getip(): """ this function was inspired by the scanning file in...
test_windows_cluster.py
from .common import TEST_IMAGE from .common import TEST_IMAGE_NGINX from .common import TEST_IMAGE_OS_BASE from .common import cluster_cleanup from .common import get_user_client from .common import random_test_name from .test_rke_cluster_provisioning import create_custom_host_from_nodes from .test_rke_cluster_provisi...
tests.py
"""Tests related to django.db.backends that haven't been organized.""" import datetime import threading import unittest import warnings from django.core.management.color import no_style from django.db import ( DEFAULT_DB_ALIAS, DatabaseError, IntegrityError, connection, connections, reset_queries, transaction,...
rpc.py
#!/usr/bin/env python3 ''' DMLC submission script by gRPC ../../../dmlc-core/tracker/dmlc-submit --num-workers 3 --cluster rpc --host-file hosts.config ''' from multiprocessing import Pool, Process import os, subprocess, logging from threading import Thread import sys import grpc sys.path.insert(0,'../../../dmlc-cor...
Exchange2domain.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- import ssl import argparse import logging import sys import getpass import base64 import re import binascii import time import config import xml.etree.ElementTree as ET from httplib import HTTPConnection, HTTPSConnection, ResponseNotReady from impacket import ntlm from comm...
wsdump.py
#!D:\python37\python.exe import argparse import code import sys import threading import time import ssl import gzip import zlib import six from six.moves.urllib.parse import urlparse import websocket try: import readline except ImportError: pass def get_encoding(): encoding = getattr(sys.stdin, "encod...
parallel_map.py
# Copyright (c) 2016 MIT Probabilistic Computing Project. # # This file is part of Venture. # # Venture 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 3 of the License, or # (at your option) an...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
lisp-itr.py
# ----------------------------------------------------------------------------- # # Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@gmail.com> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain...
tpu.py
# from __future__ import absolute_import import logging import os import threading import time logger = logging.getLogger(__name__) class TPUProfiler(object): def __init__( self, service_addr=None, tpu=None, tpu_zone=None, gcp_project=None, duration_ms=1000, ...
predict.py
import numpy as np import tensorflow as tf from sklearn.model_selection import train_test_split from sklearn.preprocessing import normalize import glob import CNN_utils as cnn import pickle import time import datetime import functools from PIL import ImageGrab import cv2 from Controller import Controller from threading...
run_multi.py
import sys,os,argparse,time import numpy as np from multiprocessing import Process tstart=time.time() # Arguments parser=argparse.ArgumentParser(description='xxx') parser.add_argument('--experiments',default='',type=str,required=True) parser.add_argument('--approaches',default='',type=str,required=True) par...
Process_Queue.py
import multiprocessing as mp import time #Multiprocessing job queue class class Process_Queue: def __init__(self, Num_Process = 4, debug=True, proc_wait_time = 0.1): self.Num_Process = Num_Process #Current Work Queue self.Queue = mp.Queue() #Queue of finished work to communicate back...
torso_node.py
#!/usr/bin/env python import time import threading from math import pi, sin, cos #import numpy as np import rospy import tf # import tf2_ros #http://docs.ros.org/api/sensor_msgs/html/msg/Imu.html from sensor_msgs.msg import Imu from std_msgs.msg import Header from std_srvs.srv import Empty, EmptyResponse from nav_msgs...
main.py
__author__ = 'Ahmad Syarif' import Data from Data import DataHandler import Command from pydispatch import dispatcher from Command import CommandHandler from multiprocessing import Process import welcoming from welcoming import startWelcomingBehavior def testData(): Data = DataHandler() Data.start() pass de...
test_system.py
# Copyright 2016 Google LLC All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or ag...
fetch_papers_arxiv.py
""" Queries arxiv API and downloads papers (the query is a parameter). The script is intended to enrich an existing database pickle (by default db.p), so this file will be loaded first, and then new results will be added to it. """ import os import time import pickle import random import argparse import feedparser imp...
test_client.py
import unittest import threading import time import os from unittest import mock import tempfile import subprocess import shutil from sqlflow.client import Client from tests.mock_servicer import _server, MockServicer, MockWorkflowServicer from google.protobuf.timestamp_pb2 import Timestamp from google.protobuf.any_pb...
recipe-465531.py
import socket; socket.setdefaulttimeout(60) import queue # 2.5 module required import random, time, sys, threading, posixpath, traceback, os import ftplib DEFNUMWORKERS = 20 # max active connections DEFMAXSIZE = 32*1024*1024 # for splitting file DEFBLOCKSIZE = 32*1024 # for downloading class JobQueue(...
Misc.py
## @file # Common routines used by all tools # # Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License # which accompanies this distribution. The full text of the license m...
_cancel_many_calls_test.py
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
util.py
import os import re import sys import time from urllib.request import Request, urlopen from urllib.parse import urlparse, quote from decimal import Decimal from datetime import datetime from multiprocessing import Process from subprocess import ( Popen, PIPE, DEVNULL, CompletedProcess, TimeoutExpi...
Matrix.py
import pickle import random import time from threading import Thread import multiprocessing from datetime import date, datetime, timedelta import math import backtrader as bt import backtrader.analyzers as btanalyze import matplotlib from cashier import cache from utility import constant, util from tqdm import tqdm f...
CatBot_Selfbot.py
# -*- coding: utf-8 -*- import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime import time,random,sys,json,codecs,threading,glob,re,ast,os,subprocess,requests from gtts import gTTS cl = LINETCR.LINE() cl.login(token='Em8Uj1MRqCDmBO5XiYu5.T2Obu6kd2POuq9/WqXGtnq.Eaqof4oV8GKOTFkpRESnEuh0odD3...
executor.py
# Based off of https://github.com/getninjas/celery-executor/ # # Apache Software License 2.0 # # Copyright (c) 2018, Alan Justino da Silva # # 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 # # ...
_poller.py
# -------------------------------------------------------------------------- # # Copyright (c) Microsoft Corporation. All rights reserved. # # The MIT License (MIT) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ""Software""), ...
dynamic_pool.py
from ...lib import ( Queue, Connection, EndOfQueue, push, pull, pull_map, sink_map, thread_counter) from ..messages import ( JobMessage, ResultMessage, EndOfWork) import threading import sys from collections import namedtuple from .xenon import (Machine) import grpc def xenon_interactive_worker( ...
training_tracker_server.py
import asyncio, websockets, socket, multiprocessing, copy, time def run_server(queue): async def send_message(websocket, path): while True: try: incoming = await websocket.recv() # Get the latest internal state while not queue.empty(): server_sta...
video_file_saver.py
from aiohttp import web import asyncio import subprocess as sp import requests import uuid import datetime import os import threading from loguru import logger from datetime import date import glob import ffmpeg routes = web.RouteTableDef() headers = {'Content-type': 'application/json'} @routes.post("/record/interval...
webcam.py
import threading import time import cv2 import config # Rate at which the webcam will be polled for new images. CAPTURE_HZ = 30.0 class OpenCVCapture(object): def __init__(self, device_id=0): """Create an OpenCV capture object associated with the provided webcam device ID. """ # Open the camera. self....
train_abstractive.py
#!/usr/bin/env python """ Main training workflow """ from __future__ import division import argparse import glob import os import random import signal import time import torch from pytorch_transformers import BertTokenizer import distributed from models import data_loader, model_builder from models.data_loader i...
debbit.py
#!/usr/bin/env python3 import base64 import logging import os import platform import random import smtplib import sys import time import traceback import urllib.request import zipfile from datetime import datetime from datetime import timedelta from email import encoders from email.mime.base import MIMEBase from email....
test_scripts.py
# Copyright (c) Microsoft Corporation # All rights reserved. # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated # documentation files (the "Software"), to deal in the Software without restriction, including without limitation # the rights to ...
crawler.py
import requests from lib.helper.Log import * from lib.helper.helper import * from lib.core import * from bs4 import BeautifulSoup from urllib.parse import urljoin from multiprocessing import Process class crawler: visited=[] @classmethod def getLinks(self,base,proxy,headers): lst=[] conn=session(proxy,he...
auto_rep.py
from requests_html import HTMLSession from selenium import webdriver from selenium.webdriver.firefox.options import Options from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.supp...
xbox_gamepad.py
#!/usr/bin/env python # https://github.com/kevinhughes27/TensorKart/blob/master/utils.py import sys import array from typing import NamedTuple from ..thirdparties.inputs import get_gamepad, devices, UnpluggedError from ..dev_mode import is_dev_mode from ..utils.math import map_float import math import threading cl...
pipeline.py
# Copyright (c) 2016-2020, The Bifrost Authors. 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 conditi...
tsp_dqn_main.py
#!/usr/bin/env python3 import time import torch import torch.multiprocessing as mp from torch import optim import os from codes.f_utils.common_utils import make_or_gym_env from config.names import EnvironmentName, PROJECT_HOME print(torch.__version__) from common.fast_rl import actions, value_based_model, rl_agent, ...
test_local_configuration.py
import multiprocessing import os import sys import unittest from needy.filesystem import TempDir from needy.local_configuration import LocalConfiguration def try_locking_local_config(path): with LocalConfiguration(path, blocking=False) as config: sys.exit(0 if config is not None else 1) class LocalConf...
thread_delegating_executor.py
# Copyright 2019, The TensorFlow Federated 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 o...
job_status_listener.py
__author__ = 'Bohdan Mushkevych' from threading import Thread from amqp import AMQPError from synergy.db.model.mq_transmission import MqTransmission from synergy.db.dao.job_dao import JobDao from synergy.scheduler.scheduler_constants import QUEUE_JOB_STATUS from synergy.scheduler.thread_handler import ManagedThreadH...
test_wr_inner_hashing_lag.py
import logging import threading import pytest import random import allure from datetime import datetime from tests.common import reboot from tests.ecmp.inner_hashing.conftest import get_src_dst_ip_range, FIB_INFO_FILE_DST, VXLAN_PORT,\ PTF_QLEN, OUTER_ENCAP_FORMATS, NVGRE_TNI from tests.ptf_runner import ptf_runne...
client.py
import json import os import tempfile import threading import time import fedn.common.net.grpc.fedn_pb2 as fedn import fedn.common.net.grpc.fedn_pb2_grpc as rpc import grpc # TODO Remove from this level. Abstract to unified non implementation specific client. from fedn.utils.dispatcher import Dispatcher CHUNK_SIZE = ...