source
stringlengths
3
86
python
stringlengths
75
1.04M
Simple_t.py
# system modules import cherrypy from cheroot.test import webtest from cherrypy import expose from multiprocessing import Process # WMCore modules from WMCore.REST.Test import setup_dummy_server, fake_authz_headers from WMCore.REST.Test import fake_authz_key_file from WMCore.REST.Tools import tools FAKE_FILE = fake_a...
gather.py
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # File : gather.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 02/16/2018 # # This file is part of Jacinle. # Distributed under terms of the MIT license. import time import multiprocessing as mp from jacinle.comm.gather import make_gather_pair fr...
queue_runner.py
import tensorflow as tf import numpy as np import time import multiprocessing as mp import threading import Queue class CustomRunner(object): """ This class manages the the background threads needed to fill a queue full of data. # Need to call the following code block after ini...
sinopac_gateway.py
# encoding: UTF-8 import os import sys from copy import copy from datetime import datetime from threading import Thread from time import sleep import shioaji as sj from shioaji.order import Status as SinopacStatus from shioaji import constant from shioaji.account import StockAccount, FutureAccount from...
pyfiscan.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Pyfiscan is free web-application vulnerability and version scanner and can be used to locate out-dated versions of common web-applications in Linux-servers. Example use case is hosting-providers keeping eye on their users installations to keep up with security-updates...
incoming_link.py
import threading import logging import os import sys from ..scanner_cogs import * from .. scanner_cogs import get_ip from .head_recv import * local_net = [] lhost = get_ip.get_ip() def p2p_welcomer(server): """[summary] A function that takes incoming connections and transfers them to an incoming link. Can list...
bb8.py
# -*- coding: utf-8 -*- # Copyright CERN since 2016 # # 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 ...
KiwoomOpenApiStore.py
# pylint: disable=no-member import time import datetime import threading import collections import backtrader as bt import pytz from backtrader import TimeFrame from backtrader.metabase import MetaParams from backtrader.utils.py3 import queue, with_metaclass from koapy.context.KiwoomOpenApiContext import KiwoomOpen...
dessin.py
import pygame from bisect import bisect_left from PIL import Image from bresenham import bresenham import numpy as np import delegator import math from threading import Thread from subprocess import Popen, PIPE from pyo import * from time import time from collections import namedtuple class WacomValues: def __in...
test_threading.py
# Very rudimentary test of threading module import test.test_support from test.test_support import verbose import random import sys import threading import thread import time import unittest # A trivial mutable counter. class Counter(object): def __init__(self): self.value = 0 def inc(self): s...
l500.py
## License: Apache 2.0. See LICENSE file in root directory. ## Copyright(c) 2015-2017 Intel Corporation. All Rights Reserved. ############################################### ## Open CV and Numpy integration ## ############################################### import pyrealsense2 as rs import numpy as np imp...
model.py
# -*- coding: utf-8 -*- from __future__ import absolute_import import os import threading import tensorflow as tf import torch import torchvision as tv import numpy as np import skeleton from architectures.resnet import ResNet18 from skeleton.projects import LogicModel, get_logger from skeleton.projects.others import...
cpp-header-checker.py
#!/usr/bin/env python # Tool cpp-header-checker # # Copyright (C) 2022 Wang Qi (wqking) # # 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 # # U...
nethack.py
import ctypes import datetime import os import multiprocessing import traceback import gym from .abstract_game import AbstractGame from autoascend.env_wrapper import EnvWrapper class MuZeroConfig: def __init__(self, rl_model=None): # More information is available here: https://github.com/werner-duvaud/...
start_proxy.py
# Copyright 2019 Google LLC # 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 writing, so...
http.py
import logging import base64 import sys import random import string import os import ssl import time import copy import json import sys from pydispatch import dispatcher from flask import Flask, request, make_response, send_from_directory # Empire imports from lib.common import helpers from lib.common import agents fro...
sanehados.py
#!/usr/bin/env python3 import requests import random import re import threading import os url = 'http://www.icanhazip.com' #TARGET httpproxies = [] socks4proxies = [] socks5proxies = [] def get_proxies(): proxies = [] res = requests.get('https://free-proxy-list.net').text p = re.findall('(\d+\.\d+\.\d+\.\d+):(\d+)...
aio_launcher.py
import asyncio import math import os import shutil import subprocess import sys from multiprocessing import Process, Pipe import instance loop = asyncio.get_event_loop() executable = str(shutil.which('python3.6') or shutil.which('py')).split('/')[-1] instance_queue = [] instances = [] class PendingInstance: de...
isolateserver.py
#!/usr/bin/env python # Copyright 2013 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. """Archives a set of files or directories to an Isolate Server.""" from __future__ import print_function import collection...
c-realV2.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- # discord import discord, sys, requests, os, time from discord.ext import commands import asyncio from packaging import version from random import randint, choice, randrange, random, choices from threading import Thread from inputimeout import inputimeout, TimeoutOccurred from...
registrar_common.py
''' SPDX-License-Identifier: Apache-2.0 Copyright 2017 Massachusetts Institute of Technology. ''' import base64 import ipaddress import threading import sys import signal import time import http.server from http.server import HTTPServer, BaseHTTPRequestHandler from socketserver import ThreadingMixIn from sqlalchemy.ex...
test_shutdown.py
""" Tests for _shutdown. """ from __future__ import absolute_import import sys import subprocess import time from twisted.trial.unittest import TestCase from crochet._shutdown import ( Watchdog, FunctionRegistry, _watchdog, register, _registry) from ..tests import crochet_directory class ShutdownTests(TestCas...
multiproc_fetcher.py
import re import os import sys import json import time import pickle import random import requests import traceback import url_normalize from multiprocessing import Pool from multiprocessing import Queue from multiprocessing import Process # Disable insecure warning from requests.packages.urllib3.exceptions import Inse...
indexer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ A command-line program that indexes seismogram files into a database. :copyright: The ObsPy Development Team (devs@obspy.org) :license: GNU Lesser General Public License, Version 3 (https://www.gnu.org/copyleft/lesser.html) .. rubric:: Usage Examples (1) ...
thread6.py
# Python Program To Create A Thread That Act On The Objects Of A Class # That Is Not Derived From The Thread Class ''' Function Name : Creating Thread Without Sub Class To Thread Class Function Date : 3 Oct 2020 Function Author : Prasad Dangare Input : Integer Output : Integer...
__init__.py
""" Base classes for job runner plugins. """ import os import time import string import logging import datetime import threading import subprocess from Queue import Queue, Empty import galaxy.jobs from galaxy.jobs.command_factory import build_command from galaxy import model from galaxy.util import DATABASE_MAX_STRI...
test_handlers.py
import re import threading import urllib import pytest import requests from avs_client.refreshtoken import handlers, helpers, http_server @pytest.fixture(scope='session') def server(): return http_server.AmazonLoginHttpServer( server_address=('localhost', 9000), RequestHandlerClass=handlers.Amaz...
z.DNS.py
from SocketServer import BaseRequestHandler, ThreadingUDPServer , StreamRequestHandler , ThreadingTCPServer from cStringIO import StringIO from fnmatch import fnmatch import os import socket import struct import time , thread , threading import re import sys DNS_TYPE_A = 1 DNS_CLASS_IN = 1 DNS_CONFIG_FILE = 'dns.conf'...
gtest_parallel.py
# Copyright 2013 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...
main_movember.py
from tkinter import * from PIL import Image from PIL import ImageTk import cv2, threading, os, time from threading import Thread from os import listdir from os.path import isfile, join import random import dlib from imutils import face_utils, rotate_bound import math def draw_sprite(frame, sprite, x_offset, y_offset)...
ds_store_exp.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # LiJiejie my[at]lijiejie.com http://www.lijiejie.com import sys import urllib2 import cStringIO import urlparse import os import Queue import threading from lib.ds_store import DSStore class Scanner(object): def __init__(self, start_url): self.queue ...
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_'. import os import pickle import random import subprocess import sys import time import unittest from test import support from test.support import MISSING_C_DOCSTRINGS try:...
802_pytorch_nnBenchmark_threadNumAndMultiProcess.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Mar 5 20:01:56 2019 @author: yangyutu123 """ import time import torch import torch.nn as nn import torch.nn.functional as F from torch.multiprocessing import Process from termcolor import colored as clr class TestNet(nn.Module): """ Net for low-...
iCopy.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os, sys, logging from telegram import Bot from telegram.utils.request import Request as TGRequest from utils import load from telegram.ext import ( Updater, CommandHandler, MessageHandler, Filters, CallbackQueryHandler, ConversationHandler, ) fr...
ib_gateway.py
""" IB Symbol Rules SPY-USD-STK SMART EUR-USD-CASH IDEALPRO XAUUSD-USD-CMDTY SMART ES-202002-USD-FUT GLOBEX SI-202006-1000-USD-FUT NYMEX ES-2020006-C-2430-50-USD-FOP GLOBEX """ from copy import copy from datetime import datetime, timedelta from threading import Thread, Condition from typing import Optional, D...
dataloader.py
import os import time import json import threading from horovod.mxnet.mpi_ops import local_rank class TimtLineRecorder(object): def __init__(self, _trace_name, _name): if os.environ.get("BYTEPS_TRACE_ON", "") == "1": self._end_trace = True self._end_trace = False self.trace_dir ...
neighbors.py
"""Author: Brandon Trabucco Calculate the closest neighbors of each word in embedding space. """ import numpy as np import os.path import collections import nltk import threading import glove def word_neighbors(vocab, embeddings, words, k=5): """Compute the k closest neighbors to the word ids in embedding spa...
test.py
import gzip import json import logging import os import io import random import threading import time import helpers.client import pytest from helpers.cluster import ClickHouseCluster, ClickHouseInstance MINIO_INTERNAL_PORT = 9001 SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) CONFIG_PATH = os.path.join(SC...
runtests.py
#!/usr/bin/env python from __future__ import print_function import atexit import base64 import os import sys import re import gc import heapq import locale import shutil import time import unittest import doctest import operator import subprocess import tempfile import traceback import warnings import zlib import glo...
__init__.py
""" Base classes for job runner plugins. """ import os import time import string import logging import threading import subprocess from Queue import Queue, Empty import galaxy.jobs from galaxy import model from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size log = logging.getLogger( __name__ ) S...
main.py
#!/usr/bin/env python import os import subprocess import threading import time import queue index=0 idx=0 filepath='/Users/joe/Desktop/videos' outpath='/Users/joe/Desktop/BU_19_Spring/EC500/output-video' def file_input(filepath): files = os.listdir(filepath) q=queue.Queue() for file in files: q.put(file) retu...
dataloader_webcam.py
import os import torch from torch.autograd import Variable import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image, ImageDraw from SPPE.src.utils.img import load_image, cropBox, im_to_torch from opt import opt from yolo.preprocess import prep_image, prep_frame, inp_to_image fro...
multipro02.py
from multiprocessing import Process import os def info(title): print(title) print('module name:', __name__) print('parent process:', os.getppid()) print('process id:', os.getpid()) def f(name): info('\nsegundo\n') print('\nBye', name) if __name__ == '__main__': info('\nPrimero\n') ...
main.py
from __future__ import print_function import argparse import torch import torch.nn as nn import torch.nn.functional as F import torch.multiprocessing as mp from train import train, test # Training settings parser = argparse.ArgumentParser(description='PyTorch MNIST Example') parser.add_argument('--batch-size', type=i...
async_trainer.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import time from threading import Thread import tensorflow as tf from reinforceflow import logger from reinforceflow.core import Stats from reinforceflow.core.runner import EnvRunner from reinforceflow.core.s...
videoio.py
from pathlib import Path from enum import Enum from collections import deque import subprocess import threading import logging import cv2 LOGGER = logging.getLogger(__name__) WITH_GSTREAMER = False class Protocol(Enum): FILE = 0 CSI = 1 V4L2 = 2 RTSP = 3 class VideoIO: """ Class for video ...
local_network.py
import socket import threading import time from queue import Queue from lora_multihop import serial_connection class LocalNetwork: def __init__(self, port, module_address, host=None): self.host = host self.port = port self.module_address = module_address self.send_queue = Queue()...
injector_test.py
# encoding: utf-8 # # Copyright (C) 2010 Alec Thomas <alec@swapoff.org> # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. # # Author: Alec Thomas <alec@swapoff.org> """Functional tests for the "Injector" dependency inje...
base.py
# -*- coding: utf-8 -*- ''' napalm-logs base ''' from __future__ import absolute_import from __future__ import unicode_literals # Import std lib import os import yaml import time import socket import logging from multiprocessing import Process, Pipe # Import napalm-logs pkgs import napalm_logs.exceptions from napalm_...
telnet.py
import socketserver import threading from hpotter import tables from hpotter.tables import CREDS_LENGTH from hpotter import logger from hpotter.env import logger, write_db, telnet_server from hpotter.docker_shell.shell import fake_shell, get_string # https://docs.python.org/3/library/socketserver.html class TelnetHan...
test_bert_thor_mlperf.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...
network.py
import random import time from inspect import signature from queue import Queue import matplotlib.pyplot as plt import networkx as nx from qunetsim.backends import EQSNBackend from qunetsim.objects import Qubit, RoutingPacket, Logger, DaemonThread from qunetsim.utils.constants import Constants # Network singleton c...
_ipython_utils.py
"""Utilities for integrating with IPython These functions should probably reside in Jupyter and IPython repositories, after which we can import them instead of having our own definitions. """ import atexit import os try: import queue except ImportError: # Python 2 import Queue as queue from subprocess im...
udp.py
import socket import sys import traceback import struct import threading from threading import Thread import time import datetime import json import buffered_message from connection_state import ConnectionState import uuid # ************* # EXAMPLE USAGE # ************* """ import socket import udp def connect1(ip, p...
cve_2019_19781_scanner.py
#!/usr/bin/env python3 import argparse import multiprocessing import ipaddress import requests from requests import ReadTimeout, ConnectTimeout, ConnectionError from requests.packages.urllib3.exceptions import InsecureRequestWarning from requests.exceptions import TooManyRedirects requests.packages.urllib3.disable_...
RawJobDispatcher.py
import sys import multiprocessing import threading import time import traceback import queue import random import datetime import signal import socket import settings import WebMirror.JobUtils import RawArchiver.misc import common.NetlocThrottler import common.get_rpyc import common.util.urlFuncs import common.proces...
java_tls_test.py
""" Created on Feb 2, 2016 @author: Nick White """ from __future__ import unicode_literals, absolute_import from multiprocessing import Process import subprocess import unittest import ssl import os import sys from py4j.java_gateway import ( JavaGateway, CallbackServerParameters, set_default_callback_accept_...
test.py
import time import threading #_lock = threading.Lock() def _io_bound(): while True: time.sleep(1) print("io: ", threading.current_thread().ident) # _lock.acquire() # for i in range(10000000): # pass # _lock.release() def _cpu_bound(): k = 0 while k ...
session.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...
core.py
import logging from collections import defaultdict from threading import Thread import dask.array as da import dask.dataframe as dd import numpy as np import pandas as pd import xgboost as xgb from dask import delayed from dask.distributed import default_client, wait from toolz import assoc, first from tornado import ...
Welcome.py
from PySide2 import QtWidgets, QtCore, QtGui import PySide2 from Updater import checkForUpdates from urllib.request import urlopen from threading import Thread from Tools import * #from Tools import log, debugging, _platform, getFileIcon, getPath, openOnExplorer, notify, settings, version, openSettingsWindow ...
streamlabs.py
import json import requests import websockets import asyncio import threading import queue import arrow import traceback class NoWebsocketToken(Exception): pass class StreamlabsAPI(object): def __init__(self): self._alertbox_url = None self._websocket_token = None self._websocket_dat...
p2p-nfc.py
#!/usr/bin/python # # Example nfcpy to wpa_supplicant wrapper for P2P NFC operations # Copyright (c) 2012-2013, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import os import sys import time import random import threading import argparse...
core.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
HiwinRA605_socket_ros_test_20190625190139.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
test_core.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
masterspider.py
# -*- encoding: utf-8 -*- from tornado.log import enable_pretty_logging, LogFormatter, access_log, app_log, gen_log from tornado.options import options gen_log.info("--> importing .masterspider") # import pprint from pprint import pprint, pformat import os import shutil from urllib2 import unquote, quote import...
transaction.py
#!/usr/bin/env python3 # # Electrum - lightweight Bitcoin client # Copyright (C) 2011 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 withou...
main.py
from io import StringIO from random import randint import threading import h5py import serial from PySide2.QtCore import QSize, Qt, QAbstractTableModel, Signal, QTimer, QRunnable, Slot, QThreadPool from PySide2.QtGui import QKeySequence, QSyntaxHighlighter, QTextCharFormat, QPixmap, QImage, QPalette, QColor from PySide...
displacements.py
import math import os import re import sys import threading import warnings from functools import reduce from glob import glob from typing import * import numpy as np import scipy.interpolate import SimpleITK as sitk from disptools import * import disptools.drawing as drawing import disptools.io as io import _dispto...
docker_image_manager.py
from collections import namedtuple import threading import time import traceback import logging import docker from docker import DockerClient from codalab.lib.telemetry_util import capture_exception, using_sentry import codalab.worker.docker_utils as docker_utils from .docker_utils import DEFAULT_DOCKER_TIMEOUT from...
Dark-FB.py
# -*- coding: utf-8 -*- import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize from multiprocessing.pool import ThreadPool from requests.exceptions import ConnectionError from mechanize import Browser reload(sys) sys.setdefaultencoding('utf8') br = mechanize.Browser...
tensorboard.py
import os import time from io import BufferedReader from pathlib import Path from queue import Queue, Empty from subprocess import Popen, PIPE from threading import Thread from typing import List, Optional from labml.logger import Text from labml import logger from labml.internal.experiment.experiment_run import Run...
vsnp_build_tables.py
#!/usr/bin/env python import argparse import multiprocessing import os import queue import re import pandas import pandas.io.formats.excel from Bio import SeqIO INPUT_JSON_AVG_MQ_DIR = 'input_json_avg_mq_dir' INPUT_JSON_DIR = 'input_json_dir' INPUT_NEWICK_DIR = 'input_newick_dir' # Maximum columns allowed in a Libre...
h264decoder.py
# -*- coding: utf-8 -*- # Copyright (c) 2013 Adrian Taylor # Inspired by equivalent node.js code by Felix Geisendörfer # # 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, i...
abandoned_lock.py
#!/usr/bin/env python3 """ Three philosophers, thinking and eating sushi """ import threading chopstick_a = threading.Lock() chopstick_b = threading.Lock() chopstick_c = threading.Lock() sushi_count = 500 def philosopher(name, first_chopstick, second_chopstick): global sushi_count while sushi_cou...
terminate.py
import time from threading import Thread, Event def count(stop_event): n = 0 while not stop_event.is_set(): n += 1 print(n) time.sleep(1) def other_work(): time.sleep(5) raise RuntimeError def main(): stop_event = Event() t = Thread(target=count, args=(stop_event,))...
server.py
"""TCP Server module.""" import time import socket import select import threading from testplan.common.utils.timing import wait class Server(object): """ A server that can send and receive messages over the session protocol. Supports multiple connections. :param host: The host address the server is...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional, Union, Callable, Sequence from electrum_firo.dash_ps_util import (PSPossibleDoubleSpendError, PSSpe...
note.py
#!/bin/python from threading import Thread import socket import sys import gi gi.require_version("Gtk", "3.0") from gi.repository import GLib from gi.repository import Gtk from gi.repository import Gdk PORT = 12347 HOST = "127.0.0.1" def start_server(w): def show_all(w): w.show_all() s = socket.sock...
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...
main.py
#!python3 import os import sys from time import time, sleep import json import logging import threading from queue import Queue from multiprocessing import Pipe, freeze_support, current_process from PyQt5 import QtWidgets, QtCore, QtGui, uic from neil_vst_gui.ui_logging import MainLogHandler, ProcessLogEmitter from ...
sshScripts.py
### This script is used to send commands to RPi over an SSH connection. # Initiate connection by initating the class as connection = ssh(serverIP,sshUsername,sshPassword) # Then send commands with connection.sendCommand('type_command_here') from paramiko import client from paramiko.ssh_exception import SSHException f...
ovf.py
# Copyright (c) 2019 VMware, 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 w...
jsonrpc_stream.py
# pyre-strict from __future__ import absolute_import, division, print_function, unicode_literals import json from queue import Empty, Queue from threading import Thread from typing import BinaryIO, Optional from utils import Json class JsonRpcStreamReader: def __init__(self, stream: BinaryIO) -> None: ...
kubernetes.py
import os import threading import time import kubernetes as k8s from urllib3.exceptions import ProtocolError from villas.controller.components.manager import Manager from villas.controller.components.simulators.kubernetes import KubernetesJob def _match(a, b): if a == b: return True elif len(a) < len...
pow_tests.py
# # Pow Default Tests # # # runtest script. # runs test with respect to some paramters # currently only os import sys import pytest # possible sys.platform results: # http://stackoverflow.com/questions/446209/possible-values-from-sys-platform MODELNAME = "pow_test_model" class TestClass: @pytest.mark.notonosx ...
utils.py
""" Copyright (c) 2021, NVIDIA 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 ...
graph_ZSL_w_argmin.py
import json import multiprocessing from datetime import datetime from node2vec import Node2Vec import pandas as pd import numpy as np import networkx as nx import pickle import os import argparse from numpy import linalg as la from sklearn.metrics.pairwise import cosine_similarity from sklearn import model_selection a...
get_code.py
# pip install requests # requests>=2.5.0 import threading import requests from pprint import pprint import http.server as SimpleHTTPServer import socketserver api_port=5000 auth_url='http://127.0.0.1:5000/oauth/authorize' server_port=3000 #redirect_url='http://127.0.0.1:3000' redirect_uri='http%3A%2F%2F127.0.0.1%3A3...
device.py
from io import BytesIO import os import selectors from threading import Lock, Thread from typing import Dict, Iterator, Optional, Tuple, Union, cast import evdev import rospy from .shape import DeviceShape from .util import evdev_util from .util.evdev_const import DeviceAxis, DeviceEventType, DeviceKey, SyncEvent cl...
util.py
from threading import Thread from time import sleep import webbrowser from PIL import Image, ImageChops import enum from pathlib import Path import imagehash from send2trash import send2trash def open_browser_tab(url): def _open_tab(): sleep(1) webbrowser.open_new_tab(url) thread = Thread(tar...
val.py
import sys import argparse from pathlib import Path from threading import Thread import torch import numpy as np from tqdm import tqdm from utils.callbacks import Callbacks from models.experimental import attempt_load from utils.datasets import create_dataloader from utils.plots import plot_images, output_to_target f...
node.py
import grequests import requests from blockchain import * from klein import Klein FULL_NODE_PORT = "30013" NODES_URL = "http://{}:{}/nodes" TRANSACTIONS_URL = "http://{}:{}/transactions" BLOCK_URL = "http://{}:{}/block/{}" BLOCKS_RANGE_URL = "http://{}:{}/blocks/{}/{}" BLOCKS_URL = "http://{}:{}/blocks" TRANSACTION_H...
_a4c_start.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...
test_jobs.py
# -*- coding: utf-8 -*- # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the #...
__init__.py
""" low level API consider using higher level containers package instead this one """ import multiprocessing import collections import time import abc import inspect import alvi.client.data_generators from .. import utils API_URL_SCENE_SYNC = 'api/scene/sync' API_URL_SCENE_REGISTER = 'api/scene/register' class Subs...
hw.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 r...
collective_ops_test.py
# Copyright 2020 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 applicab...
dynamics.py
from datetime import datetime import numpy as np import random import torch import copy from torch.multiprocessing import set_start_method from torch.utils.data import DataLoader from ase.io.trajectory import Trajectory from nff.md.utils_ax import mol_dot, mol_norm, ZhuNakamuraLogger, atoms_to_nxyz from nff.md.nvt_...