source
stringlengths
3
86
python
stringlengths
75
1.04M
assistant_library_with_button_demo.py
#!/usr/bin/env python3 # Copyright 2017 Google 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 applicab...
New_Data_Extractor.py
from collections import Counter import numpy as np import heapq import csv import time as time import multiprocessing as mp import os import sys def TransData(NumCustomer): #Pull Data from Retail CSV TransDict = {} TransList= {} #2011 Retail Data for TrainX with open('C:\Users\Luke Farrell\Google Drive\L...
introspection_container.py
import roslib; import rospy from std_msgs.msg import Header import pickle import threading import rostopic from smacc_msgs.msg import SmaccContainerStatus,SmaccContainerInitialStatusCmd,SmaccContainerStructure __all__ = ['IntrospectionClient'] # Topic names STATUS_TOPIC = '/smacc/status' INIT_TOPIC = '/smacc/cont...
q2_single_agent_eval.py
import time import threading import pyglet from argparse import Namespace from reinforcement_learning.dddqn_policy import DDDQNPolicy import numpy as np import torch from flatland.utils.rendertools import RenderTool from flatland.utils.graphics_pgl import RailViewWindow from utils.observation_utils import ...
buzzlevel.py
# -*- coding: utf-8 -*- # buzzlevel.py # Source: https://github.com/DrGFreeman/MineField # # MIT License # # Copyright (c) 2017 Julien de la Bruere-Terreault <drgfreeman@tuta.io> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the ...
decode_wavernn_dualgru_compact_lpc_mband_16bit.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2020 Patrick Lumban Tobing (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import division from distutils.util import strtobool import argparse import logging import math import os import sys import time import...
school_bell.py
#!/usr/bin/python3 # absolute imports import argparse import calendar import json import logging import os import schedule import sys import tempfile from gpiozero import Buzzer from subprocess import Popen, PIPE from time import sleep from threading import Thread # Relative imports try: from .version import vers...
Pic_Spider.py
# -*- coding: utf-8 -*- """ Author : Lamadog Time : 2019/12/10 Email : xwen.xi@icloud.com """ import os import re import threading import time from urllib import request, parse import multiprocessing from config import * class Spider(object): def __init__(self, word): self.word = word if no...
playlist.py
from flask import Blueprint, request, jsonify from jukebox.src.Track import Track from jukebox.src.util import * import threading playlist = Blueprint('playlist', __name__) @playlist.route("/add", methods=['POST']) @requires_auth def add(): """ Adds a song to the playlist. Song information are stored in req...
progress.py
import contextlib import sys import threading import time from timeit import default_timer from ..callbacks import Callback def format_time(t): """Format seconds into a human readable form. >>> format_time(10.4) '10.4s' >>> format_time(1000.4) '16min 40.4s' """ m, s = divmod(t, 60) h...
Monitor.py
import os, logging from flask import request, render_template, jsonify from flask_socketio import emit class MonitorSocket(object): def __init__(self): self.events = {'publish-sensors':self.sensors,'publish-actions':self.actions} self.args = {'emitter':None,'namespace':'default','listen':False} ...
test_channel_e2e.py
import unittest import random import string import multiprocessing from multiprocessing import Process from multisock.channel import Channel from multisock.crypter import Crypter def get_random_string(length): letters = string.ascii_lowercase result_str = ''.join(random.choice(letters) for i in range(length))...
audiofeeds.py
# -*- coding: utf-8 -*- # Copyright 2005 Joe Wreschnig # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation import cPickle as pickle import os import sys import threading import time fro...
test_run_example.py
''' This test tests whether starting a `run_ogcore_example.py` run of the model does not break down (is still running) after 5 minutes or 300 seconds. ''' import multiprocessing import time import os import sys import importlib.util import shutil from pathlib import Path import pytest def call_run_ogcore_example(): ...
CycleModelServing.py
from http.server import BaseHTTPRequestHandler import os import subprocess import time from typing import ClassVar, Dict, List, Optional, Tuple from onceml.components.base import BaseComponent, BaseExecutor from onceml.orchestration.Workflow.types import PodContainer from onceml.types.artifact import Artifact from once...
artifacts.py
import hashlib import json import mimetypes import os from copy import deepcopy from datetime import datetime from multiprocessing import RLock, Event from multiprocessing.pool import ThreadPool from tempfile import mkdtemp, mkstemp from threading import Thread from time import time from zipfile import ZipFile, ZIP_DEF...
test_xmlrpc.py
import base64 import datetime import decimal import sys import time import unittest from unittest import mock import xmlrpc.client as xmlrpclib import xmlrpc.server import http.client import http, http.server import socket import re import io import contextlib from test import support try: import gzip except Impor...
apkAnalyzer.py
#!/usr/bin/python3 import json import sys import os import threading import queue # Module handling try: from androguard.core.bytecodes.apk import APK except: print("Error: >androguard< module not found.") sys.exit(1) try: from prettytable import PrettyTable except: print("Error: >prettytable< mo...
system_integration_testing.py
""" Module is intended to automatically test the system package with how it integrates with the sub systems. The main idea would be to simulate keypresses and PIR events to feed into the queues that the system uses to take actions. """ import logging import time from threading import Thread from time import sleep from...
app.py
""" PyGPSClient - Main tkinter application class. Created on 12 Sep 2020 :author: semuadmin :copyright: SEMU Consulting © 2020 :license: BSD 3-Clause """ from threading import Thread from tkinter import Tk, Frame, N, S, E, W, PhotoImage, font from .strings import ( TITLE, MENUHIDESE, MEN...
Logger.py
import threading Log = print f = open("./Log.txt", 'a') cache = [] mutex = threading.Lock() def writeFile(): global cache tmp = cache mutex.acquire() cache = [] mutex.release() f.writelines("\n".join(tmp)) f.write("\n") f.flush() def writeLog(str): mutex.acquire() cache.ap...
context.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...
controllerClass.py
# coding=utf-8 import os import re import time import socket import inspect import threading import subprocess import logger gsmThreadName = 'gsmReceptor' gprsThreadName = 'gprsReceptor' wifiThreadName = 'wifiReceptor' emailThreadName = 'emailReceptor' ethernetThreadName = 'ethernetReceptor' bluetoothThreadName = '...
deployovf.py
#!/usr/bin/env python """ Written by Leon Qin based on VMWare's sample code originally written by Tony Allen Github: https://github.com/stormbeard Blog: https://stormbeard.net/ This code has been released under the terms of the Apache 2 licenses http://www.apache.org/licenses/LICENSE-2.0.html Script to deploy VM...
views.py
from django.shortcuts import render from django.http import HttpResponse, JsonResponse from .models import Transaction, Block, Peer, Lock from .api.views import getBlockchain, Blockchain from auth.models import ActiveVoter from .serializers import TransactionSerializer, BlockSerializer, PeerSerializer from rest_framewo...
t.py
# Dancing Dron - CrazyFly dancing for music beat # Cnaan Aviv 2013-10-05 import time, sys import usb from threading import Thread import logging import cflib from cflib.crazyflie import Crazyflie from cfclient.utils.logconfigreader import LogConfig from cfclient.utils.logconfigreader import LogVariable #import alsaau...
utils_test.py
import asyncio import collections from contextlib import contextmanager import copy import functools from glob import glob import io import itertools import logging import logging.config import os import queue import re import shutil import signal import socket import subprocess import sys import tempfile import textwr...
Signal_Tester.py
# use for environment variables import os # use if needed to pass args to external modules import sys # used for math functions import math # used to create threads & dynamic loading of modules import threading import multiprocessing import importlib # used for directory handling import glob #discord needs import...
DependencyNodeTest.py
########################################################################## # # Copyright (c) 2011-2012, John Haddon. All rights reserved. # Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted prov...
detect_service.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Tencent is pleased to support the open source community by making Metis available. Copyright (C) 2018 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the BSD 3-Clause License (the "License"); you may not use this file except in compliance with th...
KMControllers.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Sun Dec 10 16:50:24 2017 @author: takata@innovotion.co.jp """ import serial,struct import threading import time import atexit import signal # from bluepy import btle def float2bytes(float_value): float_value=float(float_value) return struct.pac...
settings.py
from flask import request, redirect, Response, session import urllib.parse import threading import time import json class Settings(): endpoints = ["/api/settings"] endpoint_name = "api_settings" endpoint_methods = ["GET", "POST"] def __init__(self, fhdhr): self.fhdhr = fhdhr self.res...
CoronaCrawler.py
import requests import threading import time from bs4 import BeautifulSoup class CronaCrawler: def __init__(self, url: str): self.__url = url self.__page = page = requests.Session().get(url) self.__soup = BeautifulSoup(page.content, 'html.parser') self.__isUpdated = False ...
core.py
''' Created on May 29, 2015 @author: mzwier ''' from pickle import UnpicklingError # Every ten seconds the master requests a status report from workers. # This also notifies workers that the master is still alive DEFAULT_STATUS_POLL = 10 # If we haven't heard from the master or a worker (as appropriate) in these #...
test_streams.py
"""Tests for streams.py.""" import gc import os import queue import pickle import socket import sys import threading import unittest from unittest import mock from test import support try: import ssl except ImportError: ssl = None import asyncio from test.test_asyncio import utils as test_utils def tearDown...
collatz.py
######################################################### # # # Collatz conjecture algorithm: # # -Starting from a positive integer number # # -If the number is even, divide it by two # # -If the number is odd, ...
controller.py
import binascii import datetime import glob import hashlib import json import logging import subprocess import time from multiprocessing import Process, Lock, Manager from os import path import pygame from flask import Flask, render_template, request import settings import util from rfid import RFID logger = logging...
random_shuffle_queue_test.py
# Copyright 2015 Google 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 # # Unless required by applicable law or a...
master.py
""" This module contains all of the routines needed to set up a master server, this involves preparing the three listeners and the workers needed by the master. """ import collections import copy import ctypes import functools import logging import multiprocessing import os import re import signal import stat import sy...
tcpros_pubsub.py
# Software License Agreement (BSD License) # # 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...
ThreadIndexFiles.py
# ==================================================================== # 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 re...
fusekistore.py
from os.path import os import threading from urllib2 import HTTPError import urllib2 from SPARQLWrapper import SPARQLWrapper, POST, JSON, SELECT, INSERT from rdflib.graph import ConjunctiveGraph import triplestoreadapter from virtualisation.misc.jsonobject import JSONObject from virtualisation.misc.log import Log as ...
update.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from re import sub import sublime_plugin from ..api import deviot from ..libraries.messages import Messages from ..libraries.thread_progress import ThreadProgress class DeviotCheckPioUpdatesCommand(sublime_plugin.WindowCommand): ...
tab.py
from __future__ import absolute_import from __future__ import unicode_literals from webfriend.rpc import ( Base, Browser, Console, DOM, Emulation, Input, Network, Overlay, Page, Reply, Runtime, Target, ) import json import time from webfriend import exceptions from webfri...
release.py
#!/usr/bin/python import re import sys import os import os.path import subprocess import shutil import tempfile from datetime import * from multiprocessing import Process from utils import * try: from xml.etree.ElementTree import ElementTree except: prettyprint(''' Welcome to the Infinispan Release Script....
sample_spreadsheetServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
example_binance_jex.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # File: example_binance_jex.py # # Part of ‘UNICORN Binance WebSocket API’ # Project website: https://github.com/LUCIT-Systems-and-Development/unicorn-binance-websocket-api # Documentation: https://lucit-systems-and-development.github.io/unicorn-binance-websocket-api # P...
threading.py
"""A threading based handler. The :class:`SequentialThreadingHandler` is intended for regular Python environments that use threads. .. warning:: Do not use :class:`SequentialThreadingHandler` with applications using asynchronous event loops (like gevent). Use the :class:`~kazoo.handlers.gevent.Sequential...
mydealz.py
#!/usr/bin/python # coding=utf-8 ''' The MIT License (MIT) Copyright (c) 2015 Roy Freytag 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 righ...
TextSharding.py
# coding=utf-8 # Copyright 2021 Intel Corporation. All rights reserved. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # ...
sqsqueue.py
import sys import boto3 import multiprocessing # init logger from logging import getLogger, StreamHandler, DEBUG logger = getLogger(__name__) handler = StreamHandler() handler.setLevel(DEBUG) logger.setLevel(DEBUG) logger.addHandler(handler) logger.propagate = False sqs = boto3.resource("sqs") def get_queue(name="ch...
NodeUDP.py
from Node import * from socket import * from ReachabilityTables import * class BColors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' GG = '\033[96m' ENDC = '\033[0m' BOLD = '\033[1m' UNDERLINE = '\033[4m' class NodeUDP(Node):...
widget.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) The widget is called from web2py ---------------------------------- """ import datetime import sys i...
agentConnMeasure.py
# Copyright (c) 2011-2013 Peng Sun. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the COPYRIGHT file. # agentConnMeasure.py # Measure connection-level statistics (TCP, via web10G) import time import traceback from threading import Thread from uuid import getn...
train_pg.py
import numpy as np import tensorflow as tf import gym import logz import scipy.signal import os import time import inspect from multiprocessing import Process #============================================================================================# # Utilities #====================================================...
battleships.py
""" Copyright (c) 2021 Matthew Nickson, All rights reserved You may use, distribute and modify this code under the terms of the MIT license which can be found in the project root. You should have received a copy of the MIT license with this file. If not, please write to : mnickson@sidingsmedia.com or visit: https://r...
learn.py
# # Unity ML-Agents Toolkit # ## ML-Agent Learning import logging import os import multiprocessing import numpy as np from docopt import docopt from unitytrainers.trainer_controller import TrainerController from unitytrainers.exception import TrainerError def run_training(sub_id, use_seed, options): # Docker P...
ble2lsl.py
"""Interfacing between Bluetooth Low Energy and Lab Streaming Layer protocols. Interfacing with devices over Bluetooth Low Energy (BLE) is achieved using the `Generic Attribute Profile`_ (GATT) standard procedures for data transfer. Reading and writing of GATT descriptors is provided by the `pygatt`_ module. All clas...
test_rpc.py
import os import time import socket import dgl import backend as F import unittest, pytest import multiprocessing as mp from numpy.testing import assert_array_equal if os.name != 'nt': import fcntl import struct INTEGER = 2 STR = 'hello world!' HELLO_SERVICE_ID = 901231 TENSOR = F.zeros((10, 10), F.int64, F....
evecat.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Date : 2020-06-30 15:50:54 # @Author : umm233 import requests, threading, os from bs4 import BeautifulSoup def download_pics(url, pic_dir, n): pic_path = pic_dir + str(n) + '.gif' if not os.path.isfile(pic_path): r = requests.get(url, h...
nastro_mindvision.py
import ctypes import cv2 import numpy as np import threading import mvsdk import time import gc def get_first_available_camera(): devList = mvsdk.CameraEnumerateDevice() nDev = len(devList) if nDev < 1: print("No camera was found!") return None devInfo = devList[0] print(devInfo)...
cluster.py
# Future from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import ast # Standard import importlib import signal import socket import traceback import uuid from multiprocessing import Event, Process, Value, current_proce...
test_tensorflow2_autolog.py
# pep8: disable=E501 import collections import os import pickle import sys from unittest.mock import patch import json import numpy as np import pandas as pd import pytest import tensorflow as tf from tensorflow import estimator as tf_estimator from packaging.version import Version from tensorflow.keras import layers...
tests.py
from __future__ import unicode_literals import threading import warnings from datetime import datetime, timedelta from django.core.exceptions import MultipleObjectsReturned, ObjectDoesNotExist from django.db import DEFAULT_DB_ALIAS, DatabaseError, connections from django.db.models.fields import Field from django.db.m...
Hiwin_RT605_ArmCommand_Socket_20190627192719.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import socket ##多執行序 import threading import time import sys import matplotlib as plot import HiwinRA605_socket_TCPcmd as TCP import HiwinRA605_socket_Taskcmd as Taskcmd import numpy as np from std_msgs.msg import String from ROS_Socket.srv imp...
youtube-dl-server.py
from __future__ import unicode_literals import json import os import subprocess from queue import Queue from bottle import route, run, Bottle, request, static_file from threading import Thread import youtube_dl from pathlib import Path from collections import ChainMap from os import listdir from os.path import isfile, ...
processify.py
# https://gist.github.com/Chiron1991/8199fc1a41c2107982053aba809838c6 # # tests functions from the gist were moved to utilities.tests.test_processify # so they can be picked up by our test runner import sys import traceback from functools import wraps from multiprocessing import Process, Queue def processify(func): ...
_app.py
""" websocket - WebSocket client library for Python Copyright (C) 2010 Hiroki Ohtani(liris) This library 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, ...
generate_REAL.py
import imageio import os import glob import numpy as np import tensorflow as tf import threading from time import time from argparse import ArgumentParser parser = ArgumentParser() parser.add_argument('--labelpath', type=str, dest='labelpath', default='DIV2K_train_HR/*.png') parser.add_argument('--datapath', type=str...
record_audio.py
# coding: utf8 import pyaudio import wave from threading import Thread import load_file as lf import tensorflow as tf import numpy as np import speech2text as sp2t import threading import requests from pydub import AudioSegment CHUNK = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 16000 RECORD_SECONDS = 1 RECORD_O...
build.py
# Copyright 2014 The Oppia 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 applicable ...
test_unittest_tools.py
# ------------------------------------------------------------------------------ # Copyright (c) 2005-2013, Enthought, Inc. # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in /LICENSE.txt and may be redistributed only # under the conditions described i...
soak_test_base.py
#!/usr/bin/python """ (C) Copyright 2019-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent """ import os import time from datetime import datetime, timedelta import multiprocessing import threading from apricot import TestWithServers from general_utils import run_command, DaosTestError, get_log_fil...
explorations.py
# explorations.py # Imports import os import csv import math import copy import logging import operator import datetime from functools import reduce from itertools import combinations from collections import defaultdict, Counter, OrderedDict from typing import Dict, List, Tuple, Generator, Optional, DefaultDict impor...
acquisitions.py
import numpy as np import multiprocessing import threading from inspect import signature import time from pycromanager.zmq import deserialize_array, Bridge from pycromanager.data import Dataset import warnings import os.path import queue from pycromanager.zmq import JavaObjectShadow from docstring_inheritance import Nu...
openolt_device.py
# # Copyright 2018 the original author or 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 agre...
runtests.py
import os, sys, tempfile, shutil, signal from getopt import getopt from optparse import OptionParser import multiprocessing, Queue from test import * parser = OptionParser( usage="Usage: %prog [options] tests...", description="Run specified tests on the project. " "By default, all tests are run.") p...
test_utilities.py
# Copyright 2015 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...
nameserver.py
import json import logging import threading from pathlib import Path import Pyro4.naming logger = logging.getLogger(__name__) def start_nameserver(ns_ip: str = '127.0.0.1', ns_port: int = 0, credentials_file: Path = Path.cwd() / f'HPBenchExpUtils_pyro4_nameserver_0.json', ...
2.4-2.py
import threading import time import requests def download_url(url): print("Downloading the contents of {} from {}".format(url, threading.current_thread().name)) requests.get(url) print("Download of {} done".format(url)) if __name__ == "__main__": threads = [] test_dict = { "Google": "htt...
context_test.py
# -*- coding: utf-8 -*- ''' tests.unit.context_test ~~~~~~~~~~~~~~~~~~~~ ''' # Import python libs from __future__ import absolute_import import tornado.stack_context import tornado.gen from tornado.testing import AsyncTestCase, gen_test import threading import time # Import Salt Testing libs from salttesting i...
__init__.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Implements context management so that nested/scoped contexts and threaded contexts work properly and as expected. """ from __future__ import absolute_import import collections import functools import logging import os import platform import socket import stat import s...
client.py
"""A semi-synchronous Client for IPython parallel""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from __future__ import print_function try: from collections.abc import Iterable except ImportError: # py2 from collections import Iterable import socket fr...
build_environment.py
# Copyright 2013-2019 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """ This module contains all routines related to setting up the package build environment. All of this is set up by packa...
train_pg_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany """ import numpy as np import tensorflow as tf import gym import logz import os import time im...
main.py
import select from queue import Empty from game.chunkthread import * from game.world import * from kademlia.node import Node import socket, sys, json class DHTThread: # todo: make this gracefully die/integrate it into the select stuff def __init__(self, socket, dht : DHTServer): self.socket = socket ...
artists.py
from flask import Blueprint, request, make_response, render_template, session, redirect, url_for, g, flash import re from ...utils.utils import make_template, count_to_pages, get_offset_from_url_query, get_value from ...internals.database.database import get_cursor from ...lib.artist import get_artist, get_artist_pos...
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...
test_vrf.py
import sys import time import threading import Queue import yaml import json import random import re import logging from collections import OrderedDict from natsort import natsorted from netaddr import IPNetwork from functools import partial import pytest from ptf_runner import ptf_runner from common.utilities impor...
WayScript_bot.py
import telebot import json from threading import Thread, Event bot = telebot.AsyncTeleBot() stop_event = Event() commands_sent = [] google_assistant_reply = [] chat_id = 511021111 variables = {'Targets_Commands': 'pc laptop wakeup'} def send_given_reqest(target, command): """Function send request to next point in...
job_test.py
"""""" import os import unittest import re from threading import Thread from django.test import TestCase from norc.core.models import Job, JobNode, Dependency, Instance, Schedule from norc.norc_utils import wait_until, log, testing class JobTest(TestCase): def queue_items(self): items = [] ...
server.py
import socket import threading from HW1.Q2.Model.Message import Message from HW1.Q2.Model.Account import Account from HW1.Q2.Model.Channel import Channel from HW1.Q2.Model.Group import Group from HW1.Q2.constants import * # Locks for thread safety clients_lock = threading.Lock() accounts_lock = threading.Lock() chann...
train.py
#!/usr/bin/env python from __future__ import division """ Portions Copyright (c) Microsoft Corporation """ """ Main training workflow """ import argparse import glob import os import random import signal import time import torch from pytorch_pretrained_bert import BertConfig import bertsum.distributed as distribu...
views.py
from wsgiref.util import request_uri from django.http import HttpResponse, StreamingHttpResponse from django.shortcuts import render from django.views.decorators import gzip from django.contrib.auth.decorators import login_required from cameras.models import Camera import cv2 import threading from timeit import defau...
__init__.py
''' Slave classes responsible for distributing requests to replicas, proposers, ... ''' from rexfw import Parcel class Slave(object): def __init__(self, replicas, comm): ''' Default slave class :param replicas: a dict of replicas with their names as keys :type replicas: dict ...
etapa9-MultiplosProcessos-3.py
import multiprocessing, time, random def somaProc(q1,q2): lista = q1.get() soma = 0 for i in lista: soma = soma + i q2.put(soma) if __name__ == "__main__": N = int(input("Entre com o tamanho do vetor:")) # Captura tempo inicial t_inicio = float(time.time()) #Gera lista com v...
connector.py
from __future__ import print_function import threading from io import TextIOBase import json import grpc import connector_service_pb2 import connector_service_pb2_grpc import wrappers_pb2 import empty_pb2 from connector_types import PingResponseType, TestRequestListenerBase, TestType from profiling_configuration impo...
server.py
import asyncio import multiprocessing import os import sys import traceback from collections import deque from functools import partial from inspect import isawaitable from signal import SIG_IGN, SIGINT, SIGTERM, Signals from signal import signal as signal_func from socket import SO_REUSEADDR, SOL_SOCKET, socket from ...
layer_artist.py
import os import uuid import time import shutil import tempfile import matplotlib from glue.core import Data, Subset from glue.viewers.common.layer_artist import LayerArtist from .layer_state import OpenSpaceLayerState from .utils import get_point_data from threading import Thread from matplotlib.colors import Color...
run_experiments.py
#!/usr/bin/python import subprocess import threading import multiprocessing conf_str_template = '''init_cwnd: 12 max_cwnd: 15 retx_timeout: 45e-06 queue_size: 36864 propagation_delay: 0.0000002 bandwidth: 40000000000.0 queue_type: {0} flow_type: 2 num_flow: 100000 flow_trace: CDF_aditya.txt cut_through: 1 mean_flow_s...