source
stringlengths
3
86
python
stringlengths
75
1.04M
terminal.py
# Copyright 2015 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import base64 import fcntl import json import logging import os import signal import struct import termios import threading from ws4py.websocket import W...
__main__.py
# Copyright (c) 2017 Iotic Labs Ltd. 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 # # https://github.com/Iotic-Labs/py-IoticBulkData/blob/master/LICENSE # # Unless...
__init__.py
""" Plugin for Pyramid apps to submit errors to Rollbar """ from __future__ import absolute_import from __future__ import unicode_literals import copy import functools import inspect import json import logging import os import socket import sys import threading import time import traceback import types import uuid imp...
mqtt_hibou_experiment.py
import sys import threading import time import random import os import shutil import subprocess global id_already_taken id_already_taken = set() def writing_proc(vector_message, trace_as_list,trace_with_data_as_list): unique_id = 1 while unique_id in id_already_taken: unique_id = random.randint(1, 10...
applet.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2013 Kitware 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 cop...
constant.py
# Copyright 2014: Mirantis 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 b...
line_detector_node.py
#!/usr/bin/env python from anti_instagram.AntiInstagram import * from cv_bridge import CvBridge, CvBridgeError from duckietown_msgs.msg import (AntiInstagramTransform, BoolStamped, Segment, SegmentList, Vector2D) from duckietown_utils.instantiate_utils import instantiate from duckietown_utils.jpg import image_cv_fr...
03_parallel_orig.py
#!/usr/bin/env python3 import gym import ptan import argparse import torch import torch.optim as optim import torch.multiprocessing as mp from tensorboardX import SummaryWriter from lib import dqn_model, common PLAY_STEPS = 4 def play_func(params, net, cuda, exp_queue): env = gym.make(params.env_name) env...
tunnel.py
"""Basic ssh tunnel utilities, and convenience functions for tunneling zeromq connections. """ # Copyright (C) 2010-2011 IPython Development Team # Copyright (C) 2011- PyZMQ Developers # # Redistributed from IPython under the terms of the BSD License. from __future__ import print_function import atexit import os i...
tensorboard_application.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import re import sqlite3 import threading import time import six from six.moves.urllib import parse as urlparse # pylint: disable=wrong-import-order import tensorflow as tf from werkzeu...
rcnn_demo_kaggle_2.py
# -------------------------------------------------------- # Deformable Convolutional Networks # Copyright (c) 2017 Microsoft # Licensed under The MIT License [see LICENSE for details] # Written by Guodong Zhang # -------------------------------------------------------- from rcnn_demo_kaggle import * if __name__ ...
optimization_checks.py
# Copyright 2019 WebPageTest LLC. # Copyright 2017 Google Inc. # Use of this source code is governed by the Apache 2.0 license that can be # found in the LICENSE file. """Run the various optimization checks""" import binascii import gzip import logging import multiprocessing import os import re import shutil import str...
manage_athenad.py
#!/usr/bin/env python3 import time from multiprocessing import Process from common.params import Params from selfdrive.manager.process import launcher from selfdrive.swaglog import cloudlog from selfdrive.version import version, dirty ATHENA_MGR_PID_PARAM = "AthenadPid" def main(): params = Params() dongle_id ...
main.py
from tkinter import ttk from bs4 import BeautifulSoup from threading import Thread from urllib.parse import urljoin from urllib.parse import unquote from datetime import datetime # import concurrent.futures import tkinter as tk import os import re import requests import mimetypes # from requests.auth import HTTPBasicA...
MPC_Wrapper.py
# coding: utf8 import numpy as np import MPC import FootstepPlanner from multiprocessing import Process, Value, Array class MPC_Wrapper: """Wrapper to run FootstepPlanner + MPC on another process Args: dt (float): Time step of the MPC n_steps (int): Number of time steps in one gait cycle ...
routes.py
from app import app, db, lm, mail from flask import render_template, flash, redirect, g, request, send_from_directory, abort, session,make_response from forms import * from models import * from flask_login import login_user, logout_user, current_user, login_required from flask_mail import Message import datetime import...
moca_file.py
# Ω* #             ■          ■■■■■   #             ■         ■■   ■■  #             ■        ■■     ■  #             ■        ■■        #   ■■■■■     ■        ■■■       #  ■■   ■■    ■         ■■■      # ■■     ■■   ■          ■■■■    # ■■     ■■   ■            ■■■■  # ■■■■■■■■■   ■              ■■■ ...
swiftapi_v2.py
import subprocess from pathlib import Path import random import string import json from prettytable import PrettyTable from datetime import datetime import re import time from tqdm import tqdm import os from fabric import Connection import threading from queue import Queue vm_mapping = { "192.168.1.99": "192.168.1...
missed-moment.py
from datetime import datetime import logging from os.path import exists, expanduser from os import kill, system from signal import SIGTERM, SIGKILL import subprocess from subprocess import check_call, Popen from shutil import move from multiprocessing import Process from gpiozero import Button import picamera # TODO ...
transport.py
""" Communication channel for debug client. """ import abc import logging import socket import select from threading import Thread class Transport(metaclass=abc.ABCMeta): """ Inherit this for each debug communication channel """ @abc.abstractmethod def rx_avail(self): # pragma: no cover...
scriptinfo.py
import os import sys from copy import copy from functools import partial from tempfile import mkstemp import attr import logging import json from pathlib2 import Path from threading import Thread, Event from .util import get_command_output, remove_user_pass_from_url from ....backend_api import Session from ....debugg...
perf.py
#!/usr/bin/python3 import argparse import clickhouse_driver import itertools import functools import math import os import pprint import random import re import statistics import string import sys import time import traceback import xml.etree.ElementTree as et from threading import Thread from scipy import stats tot...
rb.py
import base64 import httplib import json import logging from Queue import Queue from threading import Thread import time from urllib import urlencode from core.settings import Settings class RBQueue(object): review_queue = Queue() worker_thread = None @classmethod def start_worker(cls): if c...
wsgi_server.py
#!/usr/bin/env python # # Copyright 2007 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 applicable law o...
api_server.py
#!/usr/bin/env python3 """ API server to run the JSON-RPC and REST API. Uses neo.api.JSONRPC.JsonRpcApi and neo.api.REST.RestApi Print the help and all possible arguments: ./api-server.py -h Run using TestNet with JSON-RPC API at port 10332 and REST API at port 8080: ./api-server.py --testnet --port-rpc 10...
coqtop.py
import re, os, subprocess, threading def find_coqtop(): for path in [os.path.join(entry, 'coqtop') for entry in os.get_exec_path()]: if os.access(path, os.X_OK): return path class Coqtop: def __init__(self, manager, path, args=[], debug=True): self.debug = debug if self.de...
test_query_node_scale.py
import threading import time import pytest from base.collection_wrapper import ApiCollectionWrapper from common.common_type import CaseLabel from customize.milvus_operator import MilvusOperator from common import common_func as cf from common import common_type as ct from scale import constants from pymilvus import I...
decorators.py
#!/usr/bin/env python # -*- coding: UTF8 -*- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # Pupy is under the BSD 3-Clause license. see the LICENSE file at the root of the project for the detailed licence terms import threading def threaded(fct): def new(*args, **kwargs): t=threading.Thread(ta...
qt_plotting.py
import logging import os import time from threading import Thread import numpy as np import scooby import vtk import vtk.qt from .plotting import BasePlotter from .theme import rcParams # for display bugs due to older intel integrated GPUs vtk.qt.QVTKRWIBase = 'QGLWidget' log = logging.getLogger(__name__) log.setLe...
main.py
#!/usr/bin/env python import PySimpleGUI as sg from os import system from time import sleep from threading import Thread # Read Saved Theme with open("theme.txt") as theme: theme = theme.read() # Variables timer_goal = 5 timer = 0 start_loops = True clicks = 0 running = True final = 0 cps = 0 round_finished =...
savelocation.py
# Copyright 2004-2017 Tom Rothamel <pytom@bishoujo.us> # # 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, modify, m...
multi_thread.py
import math import time from threading import Thread NUM_THREADS = 4 def calc(num_elements): res = 0 for i in range(num_elements): res += math.sqrt(i) print(res) def main(): threads = [] for _ in range(NUM_THREADS): threads.append(Thread(target=calc, args=[8_000_000])) sta...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import...
test_url_load.py
import pytest import sys import threading import traceback try: from queue import Queue except: from Queue import Queue from .util import run_test, destroy_window def url_load(): import webview def _change_url(webview): try: webview.load_url('https://www.google.org') ...
plugin.py
""" This module handles connection objects for databases, APIs etc. by exposing functions which initialise and store class instances for re-use. It's primarily intended to be used to enable database, caching and third-party API connectivity for the helpers in this package, however, you're free to use the functions / c...
SidebarCommands.py
import sublime import sublime_plugin import os import re import shutil import platform import threading import subprocess from functools import partial class CommandHelper(object): @staticmethod def get_path(cmd, paths): try: return paths[0] except IndexError: return cmd.window.active_view().file_name() ...
application_runners.py
""" Run dash applications with a context manager. When exiting the context, the server will close. """ from __future__ import print_function import runpy import shlex import subprocess import time import uuid import urllib from urllib.error import URLError import threading import sys import flask import requests from...
utils.py
import gc import json import string import orjson import torch import pickle import shutil import time from tqdm import tqdm import multiprocessing from pathlib import Path from termcolor import colored from functools import lru_cache from nltk.stem.snowball import SnowballStemmer PUNCS = set(string.punctuation) - {'-...
app.py
import os import re import math import sys import shutil import json import traceback import PIL.Image as PilImage import threading import tkinter as tk from tkinter import messagebox from tkinter import ttk from tkinter import filedialog from constants import * from config import ModelConfig, OUTPUT_SHAPE1_MAP, NETWOR...
utils.py
from flask import render_template, current_app, Blueprint from threading import Thread from flask_mail import Message, Mail class Utils(): def __init__(self): self.mail = None def async_send_mail(self, app, msg): self.mail = Mail(app) with app.app_context(): self.mail....
unittest_nn_convert_dataflow.py
""" Unit tests for nn_examples.py -- chenweiwei@ict.ac.cn """ # pylint: disable=no-member # pylint: disable=no-name-in-module # pylint: disable=invalid-name import os # Local imports from utils.base_test_class import BaseTestClass, execute_tests from nn.nn_visualise import visualise_list_of_nns, visualise_nn from...
mempool_accept.py
#!/usr/bin/env python3 # Copyright (c) 2018 The Bitcoin Unlimited developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. import test_framework.loginit # This test exercises the mempool acceptance data path. from threading impo...
falskICD2.py
import enum from flask import request from datetime import datetime from flask import Flask, Response, render_template, request, jsonify from flask_socketio import SocketIO, emit, send import airsim import numpy as np import math import time import sys from threading import Thread import json app = Flask(__name__) soc...
threaded_video_dataset.py
import random import time import os import cv2 import numpy as np import torch #import torch.multiprocessing as multiprocessing import multiprocessing SHUFFLE_SIZE = 600 BATCH_SIZE=64 """ try: video_dir = "/playpen-nvme/tgreer/MannequinChallenge/train_512/" available_videos = os.listdir(video_dir) availab...
player.py
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz 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, modify, merg...
service.py
""" Base types for all anchore engine services """ import copy import connexion import enum from flask import g, jsonify import json import os from pathlib import Path import yaml import time import threading import traceback from anchore_engine.configuration import localconfig from anchore_engine.subsys import log...
main.py
import torch import torch.nn as nn from pytorchcv.model_provider import get_model from utils import getPicture from torchvision import transforms import torchvision from multiprocessing import Process, Queue import time from tqdm import tqdm from model import theModel import numpy as np import matplotlib.pyplot as p...
main.py
import cv2 import requests import flask import time import json import asyncio import socket from multiprocessing import Process, Queue import threading from flask import Flask, render_template, Response, jsonify from azure.iot.device.aio import IoTHubModuleClient app = Flask(__name__) def flask_run(frame_queue): ...
python_device_server.py
import time import socket import fcntl import struct from socketserver import ThreadingMixIn from http.server import BaseHTTPRequestHandler, HTTPServer import mimetypes import json import threading PORT = _PORT_NUMBER STREAMS = ['color', 'left', 'right'] BOUNDARY = 'jpgboundary-dc0ecf0e4db185d41450' def get_ip_addres...
Multithreaded_PC_Miner.py
#!/usr/bin/env python3 # ---------- Duino-Coin Multithreaded PC Miner (v1.6) ----------- # # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Bilaboz, revox, MrKris7100 2020 # --------------------------------------------------------------- # username = "username" # put your username ...
modelnet_trained.py
# pylint: disable=C,R,E1101,E1102,W0221 import argparse import torch import numpy as np import torch.utils.data import torch.nn as nn import torch.nn.functional as F from se3cnn.blocks import GatedBlock from se3cnn.util.dataset.shapes import ModelNet10, Obj2Voxel, CacheNPY, EqSampler import matplotlib matplotlib.use('A...
callbacks_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
run.py
#!/usr/bin/env python """dMRI preprocessing workflow.""" import os from pathlib import Path import logging import sys import gc import uuid import warnings from argparse import ArgumentParser from argparse import ArgumentDefaultsHelpFormatter from multiprocessing import cpu_count from time import strftime logging.add...
BaseSocket.py
# -*- coding: utf-8 -*- """ Created on Thu May 25 22:02:41 2017 @author: user Base socket for all Observer-pattern platform sockets This class only requires three private methods to be implemented doWriteToSocket( byte[] data ) : void doReadFromSocket() : void initSocket() : void """ from foundation.core.log i...
test_alias.py
# -*- coding: utf-8 -*- # # Copyright (c) 2011-2013, Cédric Krier # Copyright (c) 2011-2013, B2CK # 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...
submit_ddp.py
import argparse import json import os import tarfile from pathlib import Path from typing import Dict import cv2 import numpy as np import torch import torch.distributed as dist import torch.multiprocessing as mp from PIL import Image from omegaconf import OmegaConf from pytorch_toolbelt.datasets import ( INPUT_IM...
video_iterator.py
""" @title @description """ import threading import cv2 class ObservableVideo: def __init__(self, video_fname, output): self.video_fname = video_fname self.video_thread = None self.output = output self.frame_delay = 30 self.frame_history = [] return def star...
bot.py
import cgi import logging import sys import re from signal import signal, SIGINT, SIGTERM, SIGABRT from threading import Thread, Lock from time import sleep import types import json import requests from cached_property import cached_property from expiringdict import ExpiringDict from requests import Request from reque...
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 os import pickle import random import re import subprocess import sys import textwrap import threading import time import unitt...
server.py
# Copyright 2020 Unity Technologies # # 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...
env_stock_papertrading_sb3.py
import datetime import threading from neo_finrl.data_processors.processor_alpaca import AlpacaProcessor import alpaca_trade_api as tradeapi import time import pandas as pd import numpy as np import torch import sys import os class AlpacaPaperTrading(): def __init__(self,ticker_list, time_interval, agent, cwd, net...
singleton.py
#! /usr/bin/env python import sys, os, errno, tempfile, unittest, logging from multiprocessing import Process class SingleInstance: """ If you want to prevent your script from running in parallel just instantiate SingleInstance() class. If is there another instance already running it will exist the application with...
driver.py
import os import sys import threading import time # self-made modules import niMXControl import spikeDetection # Globals niDevice = niMXControl.NIControl() wrt_file = None def clear_screen(): os.system('cls') return def prepare_file(): global wrt_file fileName = input('Enter the filename: ') ...
scheduler.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-07 17:05:11 import itertools import json import logging import os import time from collections import deque from six import iteritems, itervalues...
global_handle.py
#!/usr/bin/python ''' (C) Copyright 2018-2021 Intel Corporation. SPDX-License-Identifier: BSD-2-Clause-Patent ''' import traceback from apricot import TestWithServers from pydaos.raw import DaosPool, DaosContainer, DaosApiError class GlobalHandle(TestWithServers): """Test the ability to share pool handles a...
client.py
#!/usr/bin/env python3 from sys import argv, stdout from threading import Thread import GameData import socket from constants import * import os if len(argv) < 4: print("You need the player name to start the game.") #exit(-1) playerName = "Test" # For debug ip = HOST port = PORT else: playerN...
interactions.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from math import inf import os import time from ressources import prng from . import asciiWarehouse as asc from datetime import datetime import ressources.config as c import ressources.bytesManager as bm ################################################ ###############-...
market_price_rdpgw_client_cred_auth.py
#!/usr/bin/env python # |----------------------------------------------------------------------------- # | This source code is provided under the Apache 2.0 license -- # | and is provided AS IS with no warranty or guarantee of fit for purpose. -- # | See the project's LICENSE.md for det...
chapter6_02.py
import time import threading import tkinter as tk class App(tk.Tk): def __init__(self): super().__init__() self.button = tk.Button(self, command=self.start_action, text="Wait 5 seconds") self.button.pack(padx=50, pady=20) def start_action(self): ...
test_asyncore.py
import asyncore import unittest import select import os import socket import threading import sys import time from test import support from test.support import TESTFN, run_unittest, unlink from io import BytesIO from io import StringIO HOST = support.HOST class dummysocket: def __init__(self): self.close...
utils.py
# -*- coding: utf-8 -*- """ flask_testing.utils ~~~~~~~~~~~~~~~~~~~ Flask unittest integration. :copyright: (c) 2010 by Dan Jacob. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, with_statement import gc import multiprocessing import socket import time tr...
WrapperGarbageCollection.py
########################################################################## # # Copyright (c) 2007-2012, Image Engine Design 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: # # * Redis...
common.py
""" Common housekeeping for tests that rely on daemons """ from configparser import ConfigParser, SectionProxy from contextlib import closing, ExitStack from http.server import HTTPServer, SimpleHTTPRequestHandler from importlib import import_module from multiprocessing import Process from os import kill, unlink from ...
email_support.py
from flask_mail import Message from flask import render_template from threading import Thread from app import mail, app#, celery # @celery.task # def send_async_email(msg_dict): # with app.app_context(): # msg = Message() # msg.__dict__.update(msg_dict) # mail.send(msg) # def send_email(subject, sender, recipi...
uWServer.py
#!/bin/env python3 ''' ''' # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 ...
app.py
""" A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app .. note:: This module is Experimental on Windows platforms and supports limited configurations: - doesn't support PAM authentication (i.e. external_auth: auto) - doesn't support SSL (i.e. disable_ssl: Tru...
bot.py
import cgi import logging import os import re from signal import signal, SIGINT, SIGTERM, SIGABRT from threading import Thread, Lock from time import sleep import types import json import requests from cached_property import cached_property from expiringdict import ExpiringDict from requests import Request from reques...
throttler.py
# -*- coding: utf-8 -*- # Copyright European Organization for Nuclear Research (CERN) since 2012 # # 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-...
camera.py
#!/usr/bin/env python3 #!/usr/bin/python3.8 # OpenCV 4.2, Raspberry pi 3/3b/4b - test on macOS import cv2 from threading import Thread, Lock import time #internal from utils.settings import get_config from dto.record import FrameDTO, ConfigDTO from camera.process_frame import ProcessFrame class CameraAsync: def _...
fconcmd.py
import time import threading import json import queue from socket import gethostname from prompt_toolkit import prompt from prompt_toolkit.history import InMemoryHistory from prompt_toolkit.contrib.completers import WordCompleter from prompt_toolkit.shortcuts import clear from prompt_toolkit.auto_suggest import AutoSu...
test.py
import multiprocessing from django.test import TestCase from django.shortcuts import render_to_response from django.core.exceptions import ValidationError from django_poly_dag.tree_test_output import expected_tree_output from .models import ConcreteNode, ConcreteEdge class DagTestCase(TestCase): def setUp(self...
trezor-t-emu.py
import os import subprocess import sys import logging import time import threading import PyQt5.QtWidgets as qwi def execute_trezor_emu(emulator_base_dir: str, profile_dir: str): env = os.environ env['BROWSER'] = 'chromium' env['TREZOR_PROFILE'] = profile_dir start_sh = 'emu.sh' try: p = ...
base_test.py
# Copyright 2013-present Barefoot Networks, Inc. # Copyright 2018-present Open Networking Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
Hiwin_RT605_ArmCommand_Socket_20190627193201.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...
client.py
# imports import socket import threading from tkinter import * from tkinter import messagebox # import sys # client's GUI class class GUI: # firstly open login window and when the login is True, client will see chat window. def __init__(self): self.window = Tk() self.window.withdraw() ...
test_ssl.py
# Copyright 2012 OpenStack Foundation # 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 requ...
main.py
import time import threading import Content_Discovery as cdisc import Chunk_Downloader as cdown import Chunk_Uploader as cupload import Chunk_Announcer as can #lock = threading.Lock() can.starthread().start() cdisc.starthread().start() #cupload.starthread().start() ...
parallels.py
import inspect import threading import time from test_junkie.debugger import LogJunkie from test_junkie.decorators import synchronized class ParallelProcessor: __PARALLELS = {} __REVERSE_PARALLEL_RESTRICTIONS = {} def __init__(self, **kwargs): self.__test_limit = int(kwargs.get("test_multithre...
server.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 use ...
tensor_models.py
# -*- coding: utf-8 -*- # # tensor_models.py # # Copyright 2020 Amazon.com, Inc. or its affiliates. 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.apa...
trainer.py
# Lint as: python2, python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
NGSUtilsServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, Inva...
debugger_server.py
# Copyright 2020 Huawei Technologies Co., Ltd # # 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...
monitor.py
# Copyright 2018 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
poll.py
# -*- coding: utf-8 -*- from .client import LineClient from types import * import os, sys, threading class LinePoll(object): OpInterrupt = {} client = None def __init__(self, client): if type(client) is not LineClient: raise Exception("You need to set LineClient instance to initialize...
ps_sync_pure.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import logging logging.getLogger('tensorflow').disabled = True import numpy as np import pickle as pickle import socket from multiprocessing import Process, Queue, Manager from ctypes import c_char_p from da...
network.py
#----------------------------------------------------------------------- #Copyright 2019 Centrum Wiskunde & Informatica, Amsterdam # #Author: Daniel M. Pelt #Contact: D.M.Pelt@cwi.nl #Website: http://dmpelt.github.io/msdnet/ #License: MIT # #This file is part of MSDNet, a Python implementation of the #Mixed-Scale Dense...
_a4c_post_configure_source.py
from cloudify import ctx from cloudify.exceptions import NonRecoverableError from cloudify.state import ctx_parameters as inputs import subprocess import os import re import sys import time import threading import platform from StringIO import StringIO from cloudify_rest_client import CloudifyClient from cloudify im...
autoscaling_metrics.py
import bisect import logging import threading import time from collections import defaultdict from dataclasses import dataclass, field from threading import Event from typing import Callable, DefaultDict, Dict, List, Optional, Type import ray from ray.serve.constants import SERVE_LOGGER_NAME logger = logging.getLogge...
AI.py
import os import random from time import time import threading import subprocess SCORE_PATH = os.path.dirname(__file__)+'\\'+'score.exe' def getAction(board, moves): if len(moves) == 1: print('Only one move, immediately return') return moves[0] stones = 0 for e in board: for f in...