source
stringlengths
3
86
python
stringlengths
75
1.04M
PyShell.py
#! /usr/bin/env python3 import getopt import os import os.path import re import socket import subprocess import sys import threading import time import tokenize import traceback import types import io import linecache from code import InteractiveInterpreter try: from tkinter import * except ImportError: prin...
conftest.py
import copy import logging import os import random import time import tempfile import threading from concurrent.futures.thread import ThreadPoolExecutor from datetime import datetime from math import floor from shutil import copyfile from functools import partial from botocore.exceptions import ClientError import pyte...
logging_test.py
# Copyright 2017 The Abseil 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 ...
wspbus.py
r"""An implementation of the Web Site Process Bus. This module is completely standalone, depending only on the stdlib. Web Site Process Bus -------------------- A Bus object is used to contain and manage site-wide behavior: daemonization, HTTP server start/stop, process reload, signal handling, drop privileges, PID ...
kombu_listener.py
# Copyright (c) 2016 Intel Corporation # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless req...
maxinet.py
#!/usr/bin/python """MaxiNet main file This file holds the main components of MaxiNet and is intended to be the only part of MaxiNet which needs to be used by the user or third-party applications. Classes in this file: Experiment: Use this class to specify an experiment. Experiments are created for one-time-usag...
map_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
imageme.py
#!/usr/bin/python """ imageMe is a super simple image gallery server. Run imageme.py from the top level of an image directory to generate gallery index HTML and run a SimpleHTTPServer on the localhost. Imported as a module, use imageme.serve_dir(your_path) to do the same for any directory programmatically. When run a...
athenad.py
#!/usr/bin/env python3 import base64 import bz2 import hashlib import io import json import os import queue import random import select import socket import subprocess import sys import tempfile import threading import time from collections import namedtuple from datetime import datetime from functools import partial f...
utils.py
from typing import Any import time from queue import Queue from typing import Union, Tuple from threading import Thread from functools import partial from ding.utils.autolog import LoggedValue, LoggedModel from ding.utils import LockContext, LockContextType, remove_file def generate_id(name, data_id: int) -> str: ...
fileViewer.py
############################################################################ # # SAGE UI - A Graphical User Interface for SAGE # Copyright (C) 2005 Electronic Visualization Laboratory, # University of Illinois at Chicago # # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
coref_model_memnn_cnn3.py
import operator import random import math import json import threading import numpy as np import tensorflow as tf import util import coref_ops import conll import metrics class CorefModel(object): def __init__(self, config): self.config = config self.embedding_info = [(emb["size"], emb["lowercase"]) for emb...
convert_to.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # # Author: Jorge de la Peña García # Author: Carlos Martínez Cortés # import sys import os import subprocess import argparse class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[93m' FAIL = '\033[91m' EN...
transactions_ring.py
#! /usr/bin/env python # # =============================================================== # Description: Create a line graph. Then delete all edges # and connect consecutive vertices i s.t. # i == 0 mod 2. Then delete all edges and # repeat for i == 0 mod 3. C...
server_launcher.py
#!/usr/bin/python import os import shutil import time from conans import SERVER_CAPABILITIES from conans.server.conf import get_server_store from conans.server.crypto.jwt.jwt_credentials_manager import JWTCredentialsManager from conans.server.crypto.jwt.jwt_updown_manager import JWTUpDownAuthManager from conans.server...
communication.py
import socket import threading import re import pickle import time from BlockChain import MinerChain, TraderChain from random import randint from colorama import Fore, Style import traceback # Variaveis globais, apenas para a concatenação da string e colorir a mesma (Biblioteca Colorama) styleCommunication = Fore.MAGE...
main.py
import bittensor from config import Config from dendrite import Dendrite from metagraph import Metagraph from itertools import cycle from loguru import logger import numpy as np import os import pickle import queue import time import tensorflow as tf import tensor2tensor.data_generators.cola as cola import threading ...
framereader.py
import os import glob import json import time import struct import tempfile import threading import xml.etree.ElementTree as ET import numpy as np import Queue as queue import subprocess32 as subprocess import cPickle as pickle from cStringIO import StringIO from aenum import Enum from lru import LRU from functools imp...
simple.py
import os import socket import socketserver import threading import ujson from ipc_unix.utils import NEW_LINE, read_payload class Client: def __init__(self, socket_path): self.socket_path = socket_path def send(self, data: dict): with socket.socket(socket.AF_UNIX, type=socket.SOCK_STREAM) as...
__init__.py
from flask import Flask from flask_cors import CORS from flask_socketio import SocketIO from pathlib import Path from shutil import copyfile from ruamel.yaml import YAML import pathlib from threading import Thread BASE_PATH = Path(__file__).parents[1] socketio = SocketIO() yaml = YAML() def create_di...
start_menu_helper.py
"""Reorganize the start menu folder.""" import logging import pathlib import re import time from typing import List from library import configuration, constants from library.helpers import windows_shortcuts from library.helpers.stopable_thread import StoppableThread class StartMenuHelper: """Starts and stops cle...
scan_helper_png_monochrome.py
# -*- coding: utf-8 -*- # version: python 3 # ========== # 作用: # imagemagick处理图片(处理成黑白) # 多进程处理 # ========== # 依赖项: # https://github.com/ImageMagick/ImageMagick/issues/594 # brew install imagemagick@6 # ========== import sys, os, time from multiprocessing import Process, Queue path = '/Users/osx/Desktop/test' # 处理目录...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import warnings import unittest from math import sqrt from torch.multiprocessing import Process from torch.testing import FileCheck fr...
fcImgThread.py
import cv2 #needed for histogram plotting and preview window display #need to build and install opencv version 3 to support frame blending import threading import struct import logging import config import numpy as np import io from time import sleep from fractions import Fraction from PyQt5 ...
player_blink_gui.py
"""GUI Application for blink detection and seed identification""" try: import heapq import json import os.path import os # solves camera start up issues, must be done before importing cv2 os.environ["OPENCV_VIDEOIO_MSMF_ENABLE_HW_TRANSFORMS"] = "0" import cv2 import rngtool import si...
managers.py
# # Module providing the `SyncManager` class for dealing # with shared objects # # multiprocessing/managers.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # __all__ = [ 'BaseManager', 'SyncManager', 'BaseProxy', 'Token' ] # # Imports # import sys import threading import ar...
kapbot.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Simple Bot to send you notifications on Kaplan classes """ This Bot uses the Updater class to handle the bot. First, a few callback functions are defined. Then, those functions are passed to the Dispatcher and registered at their respective places. Then, the bot is sta...
via_app_data.py
"""Bootstrap""" from __future__ import absolute_import, unicode_literals import logging from contextlib import contextmanager from threading import Lock, Thread from virtualenv.info import fs_supports_symlink from virtualenv.seed.embed.base_embed import BaseEmbed from virtualenv.seed.embed.wheels.acquire import get_w...
MAPS_plugin.py
# -*- coding: UTF-8 -*- import math import time import serial import threading import traceback from datetime import datetime from collections import deque from statistics import mean MIC_COM_PORT = '/dev/ttyACM0' BAUD_RATES = 115200 #pairs = datetime.now().strftime("%Y-%m-%d %H-%M").split(" ") #slo...
api.py
# This file is part of the NESi software. # # Copyright (c) 2020 # Original Software Design by Ilya Etingof <https://github.com/etingof>. # # Software adapted by inexio <https://github.com/inexio>. # - Janis Groß <https://github.com/unkn0wn-user> # - Philip Konrath <https://github.com/Connyko65> # - Alexander Dincher <...
test_threading.py
""" Tests for the threading module. """ import test.support from test.support import verbose, import_module, cpython_only, unlink from test.support.script_helper import assert_python_ok, assert_python_failure import random import sys import _thread import threading import time import unittest import weakref import os...
broadcaster.py
""" This is an example of a broadcaster role BLE device. It advertises as a non-connectable device and emits the device's current time as a part of the advertising data. """ import time import threading from blatann import BleDevice from blatann.gap.advertising import AdvertisingMode, AdvertisingData, Advertisin...
serial_test.py
#!/usr/bin/env python import signal import sys import serial import threading import os import global_types def signal_handler(signal, frame): print("Ctrl + C captured, exitting.") sys.exit(0) class fsrThread(object): def __init__(self): thread = threading.Thread(target=self.read_thread, args = ()) thread.daem...
mpirun_exec_fn.py
# Copyright 2019 Uber Technologies, 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 applica...
sigmatcp.py
''' Copyright (c) 2018 Modul 9/HiFiBerry 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, merge, publish, distribu...
scheduler.py
import os import time import signal import shutil import math import tvm import numpy as np try: import torch.multiprocessing as _multi except ImportError: import multiprocessing as _multi multi = _multi.get_context("spawn") from tvm import rpc from collections import deque from queue import Empty from functool...
calculate.py
from pyramid.view import view_config, view_defaults from pyramid.request import Request import DnD_battler as DnD import time from functools import wraps from threading import Thread from typing import * from collections import defaultdict import logging from io import StringIO DnD.log.setLevel(logging.INFO) class Ti...
main.py
import os import re from threading import Thread from enum import Enum from copy import deepcopy import webbrowser import json import googleapiclient.errors import httplib2 import openpyxl.utils.exceptions from PyQt5.QtGui import QColor, QStandardItem from PyQt5.QtWidgets import QLineEdit, QInputDialog, QFileDialog, ...
canlii.py
from datetime import datetime import requests import json import hashlib import sqlite3 from bs4 import BeautifulSoup import os.path from os import path import time import random import threading import os # import pytesseract # try: # import Image # except ImportError: # from PIL import Image agents = [ ...
Simulation.py
"""Simulation System for PiCN. The PiCN Simulation System consists of a Simulation Bus and Simulation Interfaces The Simulation Bus is the dispatcher for different Simulation Interfaces. Each Simulation Interface has a unique address which can be used as identify for a Face in the LinkLayer. """ import multiprocessing...
1.py
import sys import random import json import concurrent.futures import urllib.request from http.server import HTTPServer, ThreadingHTTPServer, BaseHTTPRequestHandler from threading import Thread from io import BytesIO class SimpleHTTPRequestHandler(BaseHTTPRequestHandler): def do_POST(self): body = self.rf...
base.py
""" Module containing base classes that represent object entities that can accept configuration, start/stop/run/abort, create results and have some state. """ import os import sys import time import signal import threading import traceback from collections import deque, OrderedDict import psutil from schema import Or...
victim.py
#!/usr/bin/env python3 from urllib import request import ftplib import http.server import os import socket import socketserver import subprocess import threading class Victim(http.server.BaseHTTPRequestHandler): default_response = '<html><head><title>Test</title></head><body>&nbsp;</body></html>' def with_...
__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...
live.py
#!/usr/bin/env python # Copyright (c) 2018 by Dmitry Odintsov # This code is licensed under the MIT license (MIT) # (http://opensource.org/licenses/MIT) import argparse import json import os import queue import signal import sys import threading from datetime import datetime import twdl headers = None stopSignal ...
lambda_executors.py
import os import re import sys import glob import json import time import logging import threading import traceback import subprocess import six import base64 from multiprocessing import Process, Queue try: from shlex import quote as cmd_quote except ImportError: from pipes import quote as cmd_quote # for Pyth...
mimic_tts.py
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
executor.py
""" Driver of the test execution framework. """ from __future__ import absolute_import import threading from . import fixtures from . import hooks as _hooks from . import job as _job from . import report as _report from . import testcases from .. import config as _config from .. import errors from .. import logging ...
VolumeBar.py
import os, sys parentPath = os.path.abspath("..") if parentPath not in sys.path: sys.path.insert(0, parentPath) from widgets.Label import Label from widgets.Image import Image import gi gi.require_version("Gtk", "3.0") from gi.repository import Gtk, GObject, Gdk import datetime import psutil gi.require_version('N...
utils.py
import numpy as np from random import seed, shuffle import loss_funcs as lf # our implementation of loss funcs from scipy.optimize import minimize # for loss func minimization from multiprocessing import Pool, Process, Queue from collections import defaultdict from copy import deepcopy import sys SEED = 1122334455 see...
NodeEval.py
''' @name NodeEval @package sublime_plugin @author Derek Anderson @requires NodeJS This Sublime Text 2 & 3 plugin adds NodeJS "eval" functionality to the right click context menu, etc. Usage: Make a selection (or not), Choose NodeEval from the context menu and see the results in the console. ''' import subl...
test_state.py
import logging import os import shutil import sys import tempfile import textwrap import threading import time import pytest import salt.utils.atomicfile import salt.utils.files import salt.utils.path import salt.utils.platform import salt.utils.stringutils from salt.ext import six from salt.modules.virtualenv_mod imp...
gstreamer_pipeline.py
''' * Copyright (C) 2019-2020 Intel Corporation. * * SPDX-License-Identifier: BSD-3-Clause ''' import copy import json import os import string import time from threading import Lock, Thread from collections import namedtuple import gi gi.require_version('Gst', '1.0') gi.require_version('GstApp', '1.0') # pylint: disab...
create_tfrecords.py
""" Create the tfrecord files for a dataset. A lot of this code comes from the tensorflow inception example, so here is their license: # 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...
main.py
import argparse import base64 import datetime import logging import logging.config import os import shutil import subprocess import threading import time import traceback import urllib3 import yaml from progress.spinner import Spinner import openbaton.utils as utils from openbaton.errors import MethodNotFound, ImageC...
_threading_local.py
"""Thread-local objects. (Note that this module provides a Python version of the threading.local class. Depending on the version of Python you're using, there may be a faster one available. You should always import the `local` class from `threading`.) Thread-local objects support the management of thread-local d...
core_test.py
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
app.py
import json import os import threading import urllib.parse import flask import flask_talisman import google.auth.transport.requests import google.oauth2.id_token import sheets import sessions ADMIN_ENABLED = bool(os.environ.get("LAM_ADMIN_ENABLED")) ANALYTICS_ENABLED = bool(os.environ.get("LAM_ANALYTICS_ENABLED")) A...
test_pooling.py
# Copyright 2009-present MongoDB, 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 wri...
utils.py
"""Helper methods to run the experiment """ import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D import threading from channel import Channel from environment import Environment from interaction import Interaction from fish import Fish from observer import Observer def generate...
subprocess_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 us...
vanity.py
""" Test - Generate vanity ecdsa address """ import sys from os import urandom from time import time from secrets import token_hex from multiprocessing import Process sys.path.append("../") from polysign.signer import SignerType, SignerSubType from polysign.signerfactory import SignerFactory # TODO: click would be a...
timing.py
import multiprocessing import time def mxnet_worker(): b_time = time.time() print('{}'.format(b_time)) # import mxnet print ('time consumes: {}'.format(time.time()-b_time)) a = 1 b = 2 print(a+b) read_process = [multiprocessing.Process(target=mxnet_worker) for i in range(8)] for p in read_...
main.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # main.py # # Copyright 2014 Michael Davenport <Davenport.physics@gmail.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 witho...
terminalmockos.py
import abc import multiprocessing from contextlib import contextmanager import six import mock __copyright__ = 'Copyright (C) 2019, Nokia' @six.add_metaclass(abc.ABCMeta) class TerminalMockOsBase(object): def __init__(self): self._serverprocess_factory = None self._manager = multiprocessing.Mana...
e6v2.py
#!/usr/bin/env python ''' Use threads and Netmiko to connect to each of the devices in DB. Execute 'show version' on each device. Record the amount of time required to do this. ''' from netmiko import ConnectHandler from datetime import datetime from net_system.models import NetworkDevice, Credentials import django im...
drone_manager.py
import logging import socket import sys import time import threading #https://dl-cdn.ryzerobotics.com/downloads/Tello/Tello%20SDK%202.0%20User%20Guide.pdf #https://github.com/dji-sdk/Tello-Python/blob/master/Tello_Video/install/Windows/install.bat logging.basicConfig(level=logging.INFO, stream=sys.stdout) logger = lo...
udpclient.py
import socket import threading import time #UDP_IP = "80.217.114.215" UDP_IP = "127.0.0.1" UDP_PORT = 9001 sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #sock.connect((UDP_IP, UDP_PORT)) sock.sendto(b'vcon oboforty', (UDP_IP, UDP_PORT)) resp = sock.recv(1024) print(resp) def worker(): """thread wor...
server.py
from socket import * from threading import Thread import io from datetime import datetime import json import string #432 Client_adresses = [] def clientHandler(): conn, addr = s.accept() global Client_adresses Client_adresses.append(addr) print addr, "is connected" filepath = '/Users/Simen/Docu...
vcping.py
from gevent import monkey monkey.patch_all() import discord import os from flask import Flask from flask_compress import Compress from gevent.pywsgi import WSGIServer from threading import Thread client = discord.Client() def get_role(guild, name): return discord.utils.get(guild.roles, name=name) @client.event a...
client.py
import socket import threading import json # json.dumps(some)打包 json.loads(some)解包 import tkinter import tkinter.messagebox from tkinter.scrolledtext import ScrolledText # 导入多行文本框用到的包 import time import requests from tkinter import filedialog import vachat import os from time import sleep from PIL import ImageGrab ...
main.py
#!/usr/bin/env python3 import json import logging import multiprocessing import os import requests BAIDU_IMG_URL = 'https://image.baidu.com/' PARAMS = 'search/acjson?tn=resultjson_com&ipn=rj&ct=201326592&fp=result&cl=2&lm=-1&ie=utf-8&oe=utf-8&word={0}&st=-1&face=0&istype=2&nc=1&pn={1}&rn=30' HEADERS = { 'User-Age...
stau_executor.py
#!/usr/bin/env python """Stau job executor This module contains all the required functions for the job executor/worker. The executor is the process that listens for work on the queue and is able to execute it locally. It also handles dependency resolving and general queue maintenance. The module is designed as a cont...
test_memusage.py
import decimal import gc import itertools import multiprocessing import weakref import sqlalchemy as sa from sqlalchemy import ForeignKey from sqlalchemy import Integer from sqlalchemy import MetaData from sqlalchemy import select from sqlalchemy import String from sqlalchemy import testing from sqlalchemy import Unic...
rpc.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. 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...
apply.py
from threading import Thread from typing import List, Optional, Set import boto3 import click import semver from botocore.config import Config from botocore.exceptions import ClientError from packaging import version from opta.amplitude import amplitude_client from opta.constants import ( DEV_VERSION, MAX_TER...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class and IPv6 environment import ftplib import threading import asyncore import asynchat import socket import io from unittest import TestCase from test import support from test.support import HOST # the dummy data returned by server ...
test_functional.py
# Copyright (c) 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 require...
signals.py
import os from threading import Thread from django.db.models.signals import post_save from .models import Task from django.conf import settings from catalog.management.commands.get_books import run_crawler def handler_tasks(sender, instance, **kwargs): if kwargs.get('created'): if instance.task == 'run_s...
test_c10d_nccl.py
import copy import math import os import random import signal import sys import tempfile import threading import time import unittest from contextlib import contextmanager from datetime import timedelta from itertools import product from unittest import mock import torch import torch.distributed as c10d if not c10d.i...
gobject_worker.py
# gobject_worker.py # # MIT License # # Copyright (c) 2020 Andrey Maksimov <meamka@ya.ru> # # 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 t...
test_multiprocess_iterator.py
from __future__ import division import copy import errno import os import platform import signal import subprocess import sys import tempfile import threading import time import unittest import numpy import six from chainer import iterators from chainer import serializer from chainer import testing from chainer.testi...
test_util.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
test_functools.py
import abc import builtins import collections import collections.abc import copy from itertools import permutations import pickle from random import choice import sys from test import support import threading import time import typing import unittest import unittest.mock from weakref import proxy import contextlib imp...
UDPimage-2.py
from socket import * import threading import cv2 import numpy as np from time import sleep tello_socket = socket(AF_INET, SOCK_DGRAM) video_socket = socket(AF_INET, SOCK_DGRAM) #绑定端口 tello_socket.bind(('', 8080)) #video_socket.bind(('', 11111)) #不停接收 def recv_data(): while True: recv_msg ...
api.py
import threading import socket,os import json from ._version import __version__ DEAULT_SOCKET_PATH="/tmp/senseapp.sock" class API: socket = None thread = None context = None clients = [] def __init__(self, context, socket_file_path = DEAULT_SOCKET_PATH): self.context = context s...
handler.py
# # (C) Copyright IBM Corp. 2020 # (C) Copyright Cloudlab URV 2020 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ap...
train.py
import torch import torch.distributed as dist import torch.multiprocessing as mp from math import ceil from torch.utils.data import DataLoader from data import Vocab, MyDataset, STR, END, CLS, SEL, rCLS, sparsify_batch, worker_init_fn from generator import Generator from extract import LexicalMap from adam import Ada...
threading_daemon_join_timeout.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Timing out join() for busy daemon threads """ #end_pymotw_header import threading import time import logging logging.basicConfig(level=logging.DEBUG, format='(%(threadName)-10s) %(message)s', ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
tester.py
# Copyright (c) 2014 Dropbox, 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...
sensor_interface.py
import copy import logging import weakref import numpy as np import os import time import math from threading import Thread from queue import Queue from queue import Empty import carla from srunner.scenariomanager.carla_data_provider import CarlaDataProvider from srunner.scenariomanager.timer import GameTime from .m...
client_config.py
# -*- coding: utf-8 -*- ################################################################################ # Copyright (c) 2018 McAfee LLC - All Rights Reserved. ################################################################################ """ Contains the :class:`DxlClientConfig` class, which holds the information n...
test_fx.py
import builtins import contextlib import copy import functools import math import numbers import operator import os import pickle import sys import torch import traceback import warnings import unittest from math import sqrt from pathlib import Path from torch.multiprocessing import Process from torch.testing import Fi...
__init__.py
import http.server as http_server import plone.testing import threading import time import wsgiref.handlers class Layer(plone.testing.Layer): host = 'localhost' port = 0 # choose automatically def __init__(self, request_handler=None, *args, **kw): super().__init__(*args, **kw) self.requ...
env.py
# _ _ _ _ _ _ _ _ # /\ \ /\ \ _ / /\ /\ \ /\_\/\_\ _ _\ \ /\ \ # / \ \ \ \ \ /_/ / / / \ \ / / / / //\_\/\__ \ \ \ \ # / /\ \ \ \ \ \ \___\/ / /\ \ \ /\ \/ \ \/ / / /_ \...
train_ac_exploration_f18.py
""" Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017 Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam Adapted for CS294-112 Fall 2018 by Soroush Nasiriany, Sid Reddy, and Greg Kahn Adapted for CS294-112 Fall 2018 with <3 by Michael Chang, some experiments by Greg Kah...
led.py
#!/usr/bin/python3 import board import neopixel import atexit import queue import threading import time from encoder import Encoder # Byte structure: based on the num_lights we need to create a list of lists frames = [[RGB values for num_ligts]] # RGB values will be encoded via chunks of 3 bytes # So the size of the i...
main server.py
import socket,time from threading import Thread from subprocess import call servers={} connecting_server=[] admins_connection={} all_servers=[] def connection_checker(c,a): for connection in connecting_server: try: connection.send(bytes("type?",'utf-8')) data3=connection.recv(1024) data3=data3....
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...