source
stringlengths
3
86
python
stringlengths
75
1.04M
hyperparam_multiproc.py
""" Test out different hyperparameter values for: momentum, weight decay, initial learning rate """ # These imports will not trigger any theano GPU binding, so are safe to sit here. from multiprocessing import Process, Manager from optparse import OptionParser import os import cPickle import gzip import sys import t...
run_unittests.py
#!/usr/bin/env python3 # Copyright 2016-2017 The Meson development team # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by ...
maven.py
# Copyright (c) 2015 Tencent Inc. # All rights reserved. # # Author: Li Wenting <wentingli@tencent.com> # Date: August 28, 2015 """ This is the maven module which manages jar files downloaded from maven repository """ from __future__ import absolute_import from __future__ import print_function import os import s...
websocket_server.py
# WebSocket server for Blender # Version 0.1.0 # Copyright 2015 Jonathan Giroux (Bloutiouf) # Licensed under MIT (http://opensource.org/licenses/MIT) bl_info = { "name": "WebSocket server", "author": "Jonathan Giroux (Bloutiouf)", "version": (0, 1, 0), "blender": (2, 69, 0), "description": "Send Bl...
update-references.py
"""Script to download the references used by the project """ import sys, os, time, types, re, traceback, threading, io, datetime, csv, json, urllib, requests, zipfile, tarfile from win32api import GetFileVersionInfo, LOWORD, HIWORD __dir__ = os.path.dirname(os.path.realpath(__file__)) def main(): set_working_di...
memory_objects.py
import os import json import threading import time from django.http import JsonResponse from datetime import datetime,timedelta import OmniDB_app.include.OmniDatabase as OmniDatabase global_object = {} to_be_removed = [] def cleanup_thread(): while True: v_remove_index = len(to_be_removed)-1 try:...
misphere.py
import json import socket import os import threading import time import io import select import netifaces as ni from msgids import * class Session(): pass class MiSphereConn: ms_ip = '192.168.42.1' ms_tcp_port = 7878 ms_uk_port = 8787 ms_fs_port = 50422 def init(self): self.socket ...
base.py
#!/usr/bin/env python # Copyright 2021 Hewlett Packard Enterprise Development LP # # 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...
oai_kpa_stm_data.py
# -*- coding: utf-8 -*- import time import threading # pip install https://github.com/CrinitusFeles/OaiModbus/releases/download/v.1.1/OAI_ModBus-0.1.1.tar.gz # import oai_modbus from OAI_modbus import OAI_Modbus import json class OaiKpaSTM: def __init__(self, *args, **kwargs): # разбор именованных параме...
start_azureml.py
#!/usr/bin/env python import os import sys import copy import uuid import json import time import socket import argparse import itertools import threading import subprocess from azureml.core import Workspace, Experiment, Environment from azureml.core.compute import AmlCompute, ComputeTarget from azureml.train.estimat...
fetch.py
from threading import Thread from time import sleep import itertools as it import numpy as np import gym from gym.envs.robotics import FetchEnv from gym.agents.fetch import FetchPickAndPlaceAgent, FetchPushAgent from gym.utils.mjviewer import add_selection_logger from playground.utils import wait_for_key selected_ac...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
host_callback_test.py
# Copyright 2020 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, ...
app_context.py
import sys from threading import Thread from importlib import import_module class AppContext: def __init__(self, config, state): self.config = config self.state = state self.plugins = {} modules_path = self.config['modules_path'] modules_list = self.config['modules'] ...
_channel_test.py
# Copyright 2016, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
videocapture_async.py
#Source: http://blog.blitzblit.com/2017/12/24/asynchronous-video-capture-in-python-with-opencv/ import threading import cv2 class VideoCaptureAsync: def __init__(self, src=0, width=640, height=480): self.src = src self.cap = cv2.VideoCapture(self.src) self.cap.set(cv2.CAP_PROP_FRAME_WIDTH, ...
game.py
import pygame, json, socket, threading, random, os, ai, item client=None def get_image(path): if path is None: return pygame.Surface((0,0)) return pygame.image.load(path).convert_alpha() def load_json(path): with open(path, 'r') as fd: return json.load(fd) options=load_json("assets/global_options.json") class...
controller.py
#!/usr/bin/env python """Creates shared data structures, then spawns processes for the major robot tasks and passes them those data structures.""" errors = { "ERROR_BAD_CWD" : 100, "ERROR_MAP_SCRIPT" : 101 } errors.update(dict((v,k) for k,v in errors.iteritems())) # Converts errors to a two-way dict config = { "map_...
rebalancein.py
import time, os from threading import Thread import threading from basetestcase import BaseTestCase from rebalance.rebalance_base import RebalanceBaseTest from membase.api.exception import RebalanceFailedException from membase.api.rest_client import RestConnection, RestHelper from couchbase_helper.documentgenerator im...
filemanager.py
""" Components/File Manager ======================= A simple manager for selecting directories and files. Usage ----- .. code-block:: python path = '/' # path to the directory that will be opened in the file manager file_manager = MDFileManager( exit_manager=self.exit_manager, # function called wh...
decorator.py
import time import sys import threading #statistics time def statisticsTime(func): showInfo = str(func.__name__)+" function: " def showTime(begin, end): interval = end - begin if interval >= 3600: hourInterval = interval / 3600 # minute hour = hourInterval / 60 ...
isin_to_wgs84.py
#!/usr/bin/python #------------------------------------------------------------------------------- # # Project: EOxServer <http://eoxserver.org> # Authors: Stephan Krause <stephan.krause@eox.at> # Stephan Meissl <stephan.meissl@eox.at> # #------------------------------------------------------------------------...
config.py
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: r""" A Python module to maintain unique, run-wide *fMRIPrep* settings. This module implements the memory structures to keep a consistent, singleton config. Settings are passed across processes via filesyst...
main.py
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more # * contributor license agreements. See the NOTICE file distributed with # * this work for additional information regarding copyright ownership. # * The OpenAirInterface Software Alliance licenses this file to You under # * the OAI Public ...
test_browser.py
# coding=utf-8 # Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import argparse import json import multiprocessing imp...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import from __future__ import print_function import copy import errno import fnmatch import hashlib import logging import multiprocessing import os import re import salt import signal import sys import threa...
client5.py
import threading from scapy.all import * import os import subprocess import json import argparse import random import socket from struct import * import datetime import pcapy import sys import time parser = argparse.ArgumentParser(description='Client') parser.add_argument('-interface', dest='interface', action='store...
main.py
#! /usr/bin/env python3 __version__ = '1.0' import os os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import sys import cv2 import numpy as np import matplotlib.pyplot as plt import seaborn as sns from sys import getsizeof import random from tqdm import tqdm from keras.models import model_from_json from keras.models import ...
axon.py
# The MIT License (MIT) # Copyright © 2021 Opentensor.ai # 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,...
test_async.py
from amuse.support.interface import InCodeComponentImplementation from amuse.test.amusetest import TestWithMPI from amuse.support import exceptions from amuse.support import options import os import time from amuse.units import nbody_system from amuse.units import units from amuse import datamodel from amuse.rfi.tool...
dataengine_install_libs.py
#!/usr/bin/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 ...
executor.py
"""The Norc Executor is defined here.""" import os import signal import time from datetime import datetime, timedelta from threading import Thread # from multiprocessing import Process # Alas, 2.5 doesn't have multiprocessing... from subprocess import Popen, STDOUT import resource from django.db.models import ( ...
test.py
#!/usr/bin/env python3 import socketserver import threading import http.server import json import queue from http import HTTPStatus from sqlalchemy import create_engine from sqlalchemy.schema import MetaData respQ = queue.Queue(maxsize=1) class WebhookHandler(http.server.BaseHTTPRequestHandler): def do_GET(self...
wm_interpreter_node.py
#!/usr/bin/env python import roslib import rospy import smach import smach_ros from smach import StateMachine import actionlib import time import threading from smach_ros import SimpleActionState from smach_ros import ActionServerWrapper from std_msgs.msg import String from std_msgs.msg import UInt8 from wm_interprete...
ExecuteCmd.py
#!/usr/bin/env python # # Copyright (c) 2015-2019 Intel, Inc. All rights reserved. # $COPYRIGHT$ # # Additional copyrights may follow # # $HEADER$ # from __future__ import print_function from builtins import str import sys import select import subprocess import time import datetime import signal import os, threading,...
cache_test.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################# # Copyright 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 copy of th...
publisher.py
# -*- coding: utf-8 -*- ''' Listener worker process ''' from __future__ import absolute_import # Import pythond stdlib import os import signal import logging import threading # Import third party libs import zmq import umsgpack import nacl.utils import nacl.secret from prometheus_client import Counter # Import napal...
task_launcher.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # TODO(#99) do we standardize some kinds of data loader formats? perhaps # one that loads from files, and then an arbit...
artifacts.py
import json import mimetypes import os import pickle from six.moves.urllib.parse import quote 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 t...
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...
parallel_runner.py
from envs import REGISTRY as env_REGISTRY from functools import partial from components.episode_buffer import EpisodeBatch from multiprocessing import Pipe, Process import numpy as np import torch as th # Based (very) heavily on SubprocVecEnv from OpenAI Baselines # https://github.com/openai/baselines/blob/master/bas...
runspec.py
#!/usr/bin/python # Copyright (c) 2016 Intel 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...
run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint:disable=relative-import ''' 入口文件 ''' import sys from multiprocessing import Process from conf import SPIDER_DIC from spider_process import get_default_setting, get_spider_process, crawl def spider_settings(settings): dict_pipelines = {} settings.set("IT...
server.py
# # Copyright 2020 Eugene Borodin (eugene.borodin at gmail.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # ...
tools.py
# Licensed under a 3-clause BSD style license - see LICENSE.rst """ This file contains utilities to generate test repositories. """ import datetime import io import os import threading import time import tempfile import textwrap import sys import shutil import subprocess import platform import http.server from os.pat...
test_operator.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 u...
commands.py
# Copyright (c) 2013-2014 Intel Corporation # # Released under the MIT license (see COPYING.MIT) # DESCRIPTION # This module is mainly used by scripts/oe-selftest and modules under meta/oeqa/selftest # It provides a class and methods for running commands on the host in a convienent way for tests. import os import s...
tf_job_client.py
# Copyright 2019 The Kubeflow 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...
variable_scope.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...
build_image_data.py
# Copyright 2016 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...
app.py
#!/usr/bin/env python3 """DConnect application class""" import sys import signal import socket import logging.handlers from random import randint from threading import Thread from socketserver import ThreadingUDPServer, UDPServer from .device_manager import DeviceManager, Device from .server_search import ServerSear...
app.py
import json import sys from gps import * import RPi.GPIO as GPIO import time import smbus from flask import Flask from flask import jsonify from flask import request from flask_cors import * from bmp_280 import BMP280 import threading from imutils.video import VideoStream from flask import Response from playsound impor...
SubnetWebServer.py
import sys from socket import * from threading import Thread from HttpRequest import httpReq server_socket = socket(AF_INET, SOCK_STREAM) server_port = 12000 thread_num = 1 access_address = [] server_socket.bind(("", server_port)) server_socket.listen(1) with open("subnet_network_list.txt") as file: lines = fi...
inline.py
from utlis.rank import setrank,isrank,remrank,remsudos,setsudo,GPranks,IDrank from utlis.send import send_msg, BYusers, Sendto, fwdto,Name,Glang from utlis.locks import st,getOR,Clang,st_res from utlis.tg import Bot from config import * from pyrogram import ReplyKeyboardMarkup, InlineKeyboardMarkup, InlineKeyboardButt...
SearchEngineGUI_Alpha nodir.py
import glob import os import os.path import sys from ScrapeGoogle import fetch_results, parse_results, scrape_google import tkinter import tkinter.scrolledtext as tkst #import threading def searchEngineModule(wordCheck, lineNumCheck="True", lineShowCheck="False", sensitiveCheck="False", googleSearc...
thermostat.py
# coding: latin-1 ### BEGIN LICENSE # Copyright (c) 2016 Jpnos <jpnos@gmx.com> # 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 right...
db.py
import threading import glob import gzip try: from StringIO import StringIO # Python 2.7 except: from io import StringIO # Python 3.3+ import uuid import re import os import sys from collections import defaultdict import pandas as pd import pybars from .column import Column, ColumnSet from .table import Tab...
server_sockets.py
import struct from typing import Union, Tuple, List from CONSTANTS import * import threading import socket shared_lock = threading.Lock() def receive_data(sock): raw_data = sock.recv(2048).decode() if not raw_data: return '', '', False raw_data = raw_data.split('\r\n\r\n') header = raw_data[...
tex.py
import subprocess import shlex import webbrowser import threading class Document: """ Class representing a LaTeX document """ def __init__(self, outfile): """ Create a new document. :param outfile: the file path to the output .tex file """ try: self...
package.py
import html, json, os, re, socket, sublime, sublime_plugin, threading from collections import defaultdict from .src import bencode from typing import Any, Dict ns = 'sublime-clojure-repl' class Eval: # class next_id: int = 10 # instance id: int view: sublime.View status: str ...
upnp.py
import logging import threading from queue import Queue from typing import Optional try: import miniupnpc except ImportError: pass log = logging.getLogger(__name__) class UPnP: thread: Optional[threading.Thread] = None queue: Queue = Queue() def __init__(self): def run(): t...
networksclients.py
#! /usr/bin/env python3 from scapy.all import * from threading import Thread, currentThread import time import os import sys import glob def check_perm(): if os.geteuid() != 0: print("You should run this program as root") sys.exit(1) def get_own_mac() -> list: mac_loc = glob.glob('/sys/class/...
test_utils.py
# Copyright 2016 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. A copy of # the License is located at # # http://aws.amazon.com/apache2.0/ # # or in the "license" file accompa...
event_logger.py
import logging import threading import copy import time from falcon.core.events.event_factory import EventFactory, EventType from falcon.core.events.types import SocketSend, SocketReceive, SocketConnect from falcon.core.events.handling.base_handler import BaseHandler from sortedcontainers import SortedSet class Synchr...
main.py
from _webkit import eval_js import json import threading, time import traceback, inspect print 'loading module' class Server(object): def __init__(self, webkit_handle): try: self.webkit_handle = webkit_handle self.thread = threading.Thread(target=self.delay_test) self....
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_btcc.util import bfh, bh2u, UserCancelled from electrum_btcc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, TYPE_ADDRESS, TYPE_SCRIPT, is_segwit_address) from...
node_4.py
import socket import multiprocessing as mp import time import json node_id = 4 #stored_string = "" nodes = [1,2,3,4,5] manager = mp.Manager() node_wise_write_update = manager.list([0]*5) stored_string = manager.list([""]) node_status = [0,0,0,0,0] leader_node_id = 0 start = time.time() def conver...
cpdbench_bocpdms.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Wrapper for BOCPDMS in CPDBench. Author: G.J.J. van den Burg Date: 2019-10-02 License: See the LICENSE file. Copyright: 2019, The Alan Turing Institute """ import argparse import numpy as np import time from bocpdms import CpModel, BVARNIG, Detector from multiproce...
action.py
from __future__ import absolute_import, unicode_literals import os import pipes import signal import subprocess import sys import time from contextlib import contextmanager from threading import Thread import py from tox import reporter from tox.constants import INFO from tox.exception import InvocationError from to...
recorders.py
import time from threading import Thread import subprocess import matplotlib.pyplot as plt from pynvml import * import numpy as np class StatsRecorder(object): def __init__(self): self.stopped = False self.time_history = [] def start(self, interval=1): Thread(target=self._update, args=...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
viewer.py
import numpy as np import cv2 import OpenGL.GL as gl import pangolin import time from multiprocessing import Process, Queue class DynamicArray(object): def __init__(self, shape=3): if isinstance(shape, int): shape = (shape,) assert isinstance(shape, tuple) self.data = np.ze...
video_extract.py
import numpy as np import time import json import os import torch import slowfast.utils.checkpoint as cu import slowfast.utils.logging as logging import slowfast.datasets.utils as utils from slowfast.models.build import MODEL_REGISTRY from slowfast.datasets.extractor import Extractor from torch import multiprocessing...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
BaseSensor.py
try: import serial has_serial = True except ImportError: has_serial = False import socket import time import threading from subprocess import PIPE, Popen, TimeoutExpired __all__ = 'Sensor SoftwareSensor SerialSensor LANSensor TestSensor'.split() class Sensor(object): """ Generic sensor class. Def...
train.py
#!/usr/bin/env python """ Main training workflow This uses OpenNMT github code: https://github.com/OpenNMT/OpenNMT-py. Make sure you change the environment to nmtpy2 env. Use open_nmt.sh script. It show cases how to use train and translate. """ import configargparse import os import signal import torch...
checker.py
import json import os import sys import time import random import unittest import threading import traceback import subprocess from pprint import pprint from multiprocessing import Pool class GymfcChecker: def run_sh(self, args: tuple): command = args[0] if args.__len__() == 2: thread_...
collect_thread.py
# # Collect Thread Class # Author: Francis T # # Thread for handling data collection operations # import logging import dryad.ble_utils as ble_utils from random import randint from time import sleep from threading import Thread, Event, Lock from queue import Queue from dryad.database import DryadDatabase from...
main_window.py
from tkinter import * from tkinter.font import Font from tkinter import filedialog from PIL import ImageTk, Image from tkinter import Tk, Canvas, Frame, BOTH, NW import json from threading import Thread import threading import cv2 from utils.pokemon_detector import PokemonDetector class MainWindow: def browseF...
my_calculate.py
__author__ = 'Steven LI' import time class Num_Base: def __init__(self, base=0): self.data = base def add(self, *args): ret_val = self.data for val in args: ret_val += val return ret_val def multiple(self, *args): ret_val = self.data for val in ...
handler.py
# -*- coding: utf-8 -*- import logging import random import threading from copy import copy from datetime import timedelta from random import randint from time import sleep from typing import Dict, List, Optional from urllib.parse import parse_qs, unquote, urlparse import pytz import requests from django.conf import s...
tcp_proxy.py
#! /usr/bin/python # ----------------------------------------------------------------------------------------------------------------------------- # GENERAL # ----------------------------------------------------------------------------------------------------------------------------- # # author: Sebastiaan Van Hoecke ...
request_handler.py
import flags import settings import time import music from playsound import playsound import threading import os import pickle def start_music_player(): while True: music_obj = music.playlist.get_next() if music_obj is not None: path = os.path.join(settings.STORAGE, music_obj.filename)...
swift_rings.py
#!/usr/bin/env python # Copyright 2014, Rackspace US, 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...
test_executors.py
# pylint: disable=missing-docstring import asyncio import logging import os import subprocess import sys import threading import unittest from contextlib import suppress from pathlib import Path from time import sleep from unittest import mock import zmq import zmq.asyncio from asgiref.sync import async_to_sync from ...
bench_mem.py
from decimal import Decimal from multiprocessing import Process from os import makedirs from os import remove from os.path import exists, join from subprocess import call, check_output from time import sleep from invoke import task from tasks.util.env import PROJ_ROOT, BENCHMARK_BUILD, RESULT_DIR, set_benchmark_env f...
NodeManager.py
#coding:utf-8 from multiprocessing.managers import BaseManager import time from multiprocessing import Process, Queue from DataOutput import DataOutput from UrlManager import UrlManager class NodeManager(object): def start_Manager(self,url_q,result_q): ''' 创建一个分布式管理器 :param url_q: url...
unzip_scans.py
import os import sys import glob import numpy as np import multiprocessing from zipfile import ZipFile import argparse import shutil _FILES_TO_UNZIP = [ 'house_segmentations', 'matterport_camera_intrinsics', 'matterport_skybox_images', 'region_segmentations', 'sens', 'undistorted_camera_paramet...
multi_process.py
# Copyright (c) The University of Edinburgh 2014 # # 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...
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...
handler.py
#!/usr/bin/env python import os import struct from queue import Queue import time import threading import socket import sys import signal import ntpath # Getting currunt path currunt_path_temp = os.path.abspath(__file__) currunt_path = os.path.split(currunt_path_temp)[0] + "/" server_host = "" server_port = "" if (...
GUI.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 required by applicable law or agreed to in writing, software distributed under the License is ...
window.py
import os import sys import psutil import sqlite3 import pandas as pd from PyQt5.QtGui import QPalette from PyQt5 import QtCore, QtWidgets from PyQt5.QtCore import Qt, QThread from multiprocessing import Queue, Process from trader import Trader from strategy import Strategy sys.path.append(os.path.dirname(os.path.abspa...
ipctest.py
from subprocess import Popen try: from subprocess import run except ImportError: from subprocess import call as run import pytest import time import i3ipc import threading from threading import Thread, Condition import math from random import random class IpcTest: timeout_thread = None i3_conn = None ...
core.py
import re import json import socket import os.path import logging from threading import Thread from logging.handlers import TimedRotatingFileHandler logging.basicConfig( level=logging.DEBUG, format="[%(levelname)s] [%(asctime)s] >> \n%(message)s", datefmt="%Y-%m-%d %H:%M:%S" ) class Bot: def __init__(...
collection_replica.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-...
discrete_DPPO.py
""" A simple version of OpenAI's Proximal Policy Optimization (PPO). [https://arxiv.org/abs/1707.06347] Distributing workers in parallel to collect data, then stop worker's roll-out and train PPO on collected data. Restart workers once PPO is updated. The global PPO updating rule is adopted from DeepMind's paper (DPP...
worker.py
import multiprocessing import Queue import sys from pair import Pair from parse import FastqWriter, SamWriter from util import _debug, _warn from mask import PLUS_PLACEHOLDER, MINUS_PLACEHOLDER class SpatsWorker(object): '''Manages multiprocessing aspects of Spats. ''' def __init__(self, run, processor...
script_runner.py
#!/usr/bin/env python import os import shlex import signal import subprocess import sys import threading import time import rospy from master_discovery_fkie.common import resolve_url ROS_NODE = 'script_runner' def set_terminal_name(name): ''' Change the terminal name. @param name: New name of the term...
__main__.py
from __future__ import division, unicode_literals, print_function, absolute_import # Ease the transition to Python 3 import os import labscript_utils.excepthook try: from labscript_utils import check_version except ImportError: raise ImportError('Require labscript_utils > 2.1.0') check_version('labscript_ut...