source
stringlengths
3
86
python
stringlengths
75
1.04M
update.py
import os import random import threading from time import sleep import sys def run(tsk): """ :type tsk: jobs.task.Task """ tsk.setup_vm() tsk.load(os.path.join(os.getcwd(), "remote"), "tmp") sleep(3) tmp_port = random.randint(1025, 65000) cmd = "start c:\\python27\\python.exe c:\\tm...
utils.py
from __future__ import print_function, division, absolute_import import atexit from collections import deque from contextlib import contextmanager from datetime import timedelta import functools from hashlib import md5 import inspect import json import logging import multiprocessing from numbers import Number import o...
__init__.py
#!/usr/bin/env python3 # # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # # # Copy this script to /sbin/mount.efs and make su...
rdkit3DDescriptors.py
import inspect import queue from threading import Thread from typing import Union from rdkit import Chem from rdkit.Chem import Mol, rdMolDescriptors, AllChem, MolFromSmiles from rdkit.Chem.rdForceFieldHelpers import UFFOptimizeMoleculeConfs from rdkit.Chem.rdmolops import RemoveHs from Datasets.Datasets import Datas...
test_queue.py
# Some simple Queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. import Queue import sys import threading import time from test.test_support import verify, TestFailed, verbose QUEUE_SIZE = 5 # A thread to run a function that unclogs a blocked Queue. class _TriggerThread(threa...
a-lot-of-parallel-tasks.py
#!/usr/bin/env python """ More complex demonstration of what's possible with the progress bar. """ import random import threading import time from prompt_toolkit import HTML from prompt_toolkit.shortcuts import ProgressBar def main(): with ProgressBar( title=HTML("<b>Example of many parallel tasks.</b>")...
emard370.py
#!/usr/bin/python # -*- coding: UTF-8 -*- from os import system, name import itertools import threading import time import sys import datetime from base64 import b64decode,b64encode from datetime import date expirydate = datetime.date(2022, 4, 25 ) #expirydate = datetime.date(2022, 1, 30) today=date.today() def hero...
simulator.py
import simpy from pyns.engine import TransmissionMedium from multiprocessing import Process class Simulator: # this class defines the common method for a standard simulator def __init__(self, total_time): self.total_time = total_time def start(self, args): process_list = [] ...
multithread_signal_handling.py
from threading import Thread from random import random import signal import time import sys stop_requested = False def sig_handler(signum, frame): sys.stdout.write("handling signal: %s\n" % signum) sys.stdout.flush() global stop_requested stop_requested = True def simple_target(a): print("he...
tcp_test.py
#!/usr/bin/python3 # Copyright 2016 ETH Zurich # # 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...
tab_base_classes.py
##################################################################### # # # /tab_base_classes.py # # # # Copyright 2013, Monash University ...
conftest.py
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2015-2018 CERN. # # Invenio is free software; you can redistribute it and/or modify it # under the terms of the MIT License; see LICENSE file for more details. """Pytest configuration.""" from __future__ import absolute_import, print_function ...
installwizard.py
import os import sys import threading import traceback from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from electrum_zclassic import Wallet, WalletStorage from electrum_zclassic.util import UserCancelled, InvalidPassword from electrum_zclassic.base_wizard import BaseWizard, HWD_SET...
session_server.py
#!/usr/bin/env python # Copyright 1996-2019 Cyberbotics 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 applica...
oia_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 import json class OaiKpaSTM: def __init__(self, *args, **kwargs): # разбор именованных параметров self.serial_number = kw...
executors.py
__author__ = "Johannes Köster" __copyright__ = "Copyright 2015-2019, Johannes Köster" __email__ = "koester@jimmy.harvard.edu" __license__ = "MIT" import os import sys import contextlib import time import datetime import json import textwrap import stat import shutil import shlex import threading import concurrent.futu...
rpc_benchmark.py
# -*- coding: utf-8 -*- # Copyright (c) 2016, French National Center for Scientific Research (CNRS) # Distributed under the (new) BSD License. See LICENSE for more info. import time, threading import teleprox def test_poingrate(cli, dur=2.0): start = time.time() count = 0 while time.time() < start + dur: ...
loader.py
""" The Salt loader is the core to Salt's plugin system, the loader scans directories for python loadable code and organizes the code into the plugin interfaces used by Salt. """ import copy import functools import importlib import importlib.machinery # pylint: disable=no-name-in-module,import-error import importlib....
check_public_headers.py
#!/usr/bin/env python # # Checks all public headers in IDF in the ci # # Copyright 2020 Espressif Systems (Shanghai) PTE 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...
kernel.py
""" Start an IPython Qt console or notebook connected to the python session running in Excel. This requires sys.executable to be set, and so it's recommended that the following is added to the pyxll.cfg file: [PYTHON] executable = <path to your python installation>/pythonw.exe """ from .magic import ExcelMagics from ...
FinalCode_RaspberryPi.py
#################################################################################################################### # Main function # Importing necessary functions import RPi.GPIO as GPIO import time import numpy as np import threading import bluetooth import time import Adafruit_CharLCD as LCD import serial import sy...
xla_client_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...
diff.py
#!/usr/bin/env python3 import sys import re import os import ast import argparse import subprocess import difflib import string import itertools import threading import queue import time def fail(msg): print(msg, file=sys.stderr) sys.exit(1) MISSING_PREREQUISITES = ( "Missing prerequisite python module ...
cnn_util.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...
client.py
from __future__ import unicode_literals import re import io import json import time import ctypes import threading import traceback import six from six.moves import queue import socket from .common import * from .messages import * from .utils import logger from .exceptions import * from .transport import * from .ser...
test_closing.py
from fixtures import * # noqa: F401,F403 from lightning import RpcError from utils import only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, VALGRIND import queue import pytest import re import threading import unittest @unittest.skipIf(not DEVELOPER, "Too slow without --dev-bitcoind-poll") def test_closing...
threading-demo.py
# -*- coding: utf-8 -*- """threading模块""" import time import random import threading def func1(loop): """创建threading.Thread对象的方式创建线程""" global func1_count, func1_lock thread_name = threading.currentThread().getName() # 获取线程名 for _ in range(loop): with func1_lock: func1_count += ...
Win8ReaderThread.py
""" Copyright (C) 2018 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 law or agreed to in writing, softw...
cod_converter.py
import json import sys import os import warnings import multiprocessing from queue import Empty from time import sleep from tqdm import tqdm from mdf_refinery.validator import Validator from mdf_forge.toolbox import find_files from mdf_refinery.parsers.ase_parser import parse_ase NUM_PROCESSORS = 2 #NUM_WRITERS = 1 ...
action_data_loader.py
import logging import threading from rpinets.common.data_manager import utils from rpinets.theano import data_loader logger = logging.getLogger(__name__) def get_video_name(image_name): """ Extracts the video name from an image filename. Args: image_name: The name of the image file. Returns: The name...
groupme_bot.py
from signal import SIGINT from time import sleep from argparse import ArgumentParser from subprocess import Popen, PIPE from threading import Thread from dinner_bot.bot_frontend import BotFrontend class GroupmeBot(BotFrontend): POST_URL = 'https://api.groupme.com/v3/bots/post' supports_indentation = False ...
run_game.py
import pygame from threading import Thread def run(engine): Thread(target=start, args=(engine,)).start() def start(engine): pygame.init() screen2 = pygame.display.set_mode((500, 500)) while True: pass
hypothesis_test.py
# Copyright (c) 2016-present, Facebook, 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...
benchmark_utils.py
""" Utilities for working with the local dataset cache. This file is adapted from the HuggingFace Transformers library at https://github.com/huggingface/transformers/blob/master/src/transformers/benchmark/benchmark_utils.py and the AllenNLP library at https://github.com/allenai/allennlp Copyright by the AllenNLP author...
session.py
from threading import Thread from concurrent.futures import Future from queue import Queue, Empty from lxml import etree from netconf_client.parser import parse_messages from netconf_client.log import logger from netconf_client.constants import DEFAULT_HELLO, NAMESPACES, CAP_NETCONF_11 from netconf_client.error impor...
util.py
import numpy as np import os import logging from absl import flags import warnings import torch def find_root_by_bounding(fun, left, right, eps=1e-6, max_iter=1e4): """ Root finding method that uses selective shrinking of a target interval bounded by left and right --> other than the newton method, this m...
manticore.py
import os import sys import time import types import logging import binascii import tempfile import functools from multiprocessing import Manager, Pool from multiprocessing import Process from threading import Timer from elftools.elf.elffile import ELFFile from elftools.elf.sections import SymbolTableSection from ....
interface.py
""" Copyright (c) 2015 SONATA-NFV 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 agreed to...
eval_multipro.py
# System libs import os import argparse from distutils.version import LooseVersion from multiprocessing import Queue, Process # Numerical libs import numpy as np import math import torch import torch.nn as nn from scipy.io import loadmat # Our libs from config import cfg from dataset import ValDataset from models impor...
engine.py
""" """ import logging import smtplib import os from abc import ABC from datetime import datetime from email.message import EmailMessage from queue import Empty, Queue from threading import Thread from typing import Any, Sequence, Type from vnpy.event import Event, EventEngine from .app import BaseApp from .event imp...
refactor.py
""" SubliemRefactor is a sublime text plugin using rope refactoring library Author: Yi Xie Email: dnatag at gmail.com Date: 03-21-2014 """ import os import functools import tempfile import re import time from string import Template from threading import Thread import sublime import sublime_plugin _execcmd = __impor...
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...
mupen64plus_env.py
import sys PY3_OR_LATER = sys.version_info[0] >= 3 if PY3_OR_LATER: # Python 3 specific definitions from http.server import BaseHTTPRequestHandler, HTTPServer else: # Python 2 specific definitions from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer import abc import array from contextlib im...
blacktie.py
#!/usr/bin/python3 """A basic threading example | rzfeeser@alta3.com""" # Make a thread that simulates a NASA count down # Waits 1 second at the bottom of each loop ## Python standard library import threading ## py standard library import time def groundcontrol(): for i in range(10, -1, -1): print(i) ...
__main__.py
import asyncio import json import logging import argparse import threading import sys from typing import List from .utils import lookup_charger_stream_id, lookup_equalizer_stream_id from . import Easee, Charger, Site, Circuit, Equalizer, DatatypesStreamData CACHED_TOKEN = "easee-token.json" _LOGGER = logging.getLog...
multiprocessing_module.py
import multiprocessing from level_3.module.gesture_control import main_avm queue_shared = multiprocessing.Queue() process_object = multiprocessing.Process(target = main_avm, args = (queue_shared,))
git_projects.py
# -*- coding: utf-8 -*- """ cobra ~~~~~ Implements cobra main :author: BlBana <635373043@qq.com> :homepage: https://github.com/WhaleShark-Team/cobra :license: MIT, see LICENSE for more details. :copyright: Copyright (c) 2018 Feei. All rights reserved """ import json import requests ...
training.py
import torch import torchvision import torch.quantization import torchvision.transforms as transforms import torch.nn as nn import torch.nn.functional as F import torch.optim as optim import numpy as np import pickle as pk import pandas as pd import wfdb import pywt #import h5py import math import os import sys import ...
client.py
# Copyright (c) 2012-2014 Roger Light <roger@atchoo.org> # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # and Eclipse Distribution License v1.0 which accompany this distribution. # # The Eclipse Public License is available at ...
Rinus.py
#!/usr/bin/env python3 import random import socket import threading print (" - - > SERANG!!!!!!!!!! <- - ") print (" - - > BISMILLAH DULU <- - ") ip = str(input(" Ip:")) port = int(input(" Port:")) choice = str(input(" (y/n):")) times = int(input(" Paket :")) threads = int(input(" Th...
measure_docker_stats.py
import logging import docker import threading import os import json import time class CollectionTask: def __init__(self, current_configuration, logging, docker, threading, os, json, time): self._running = True sut_hostname = current_configuration["docker_stats_hostname"] self.docker_client ...
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...
extension.py
import logging import subprocess from threading import Thread from ulauncher.api.client.Extension import Extension from ulauncher.api.shared.event import KeywordQueryEvent, ItemEnterEvent, \ PreferencesEvent, PreferencesUpdateEvent from ulauncher.api.shared.action.ExtensionCustomAction import \ ExtensionCustomA...
utility.py
"""Contains data helper functions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import codecs import os import tarfile import time from Queue import Queue from multiprocessing import Process, Manager from paddle.v2.dataset.common import md5...
fsharpvim.py
from subprocess import Popen, PIPE from os import path import string import tempfile import unittest import json import threading import hidewin class Statics: fsac = None fsi = None locations = [] projects = {} class Interaction: def __init__(self, proc, timeOut, logfile = None): self.da...
readers.py
"""File handle readers and related tools.""" import os import io import sys import time import queue import ctypes import threading import xonsh.lazyimps as xli from xonsh.built_ins import XSH class QueueReader: """Provides a file-like interface to reading from a queue.""" def __init__(self, fd, timeout=Non...
test_validation.py
from typing import Text from threading import Thread import pytest from pep440_version_utils import Version from rasa.shared.exceptions import YamlException, SchemaValidationError import rasa.shared.utils.io import rasa.shared.utils.validation as validation_utils import rasa.utils.io as io_utils import rasa.shared.n...
parameter_server.py
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. An additional grant # of patent rights can be found in the PATENTS file in the same directory. import torch.multiproces...
__init__.py
#!/usr/bin/env python3 """Library for performing speech recognition, with support for several engines and APIs, online and offline.""" import io import os import sys import subprocess import wave import aifc import math import audioop import collections import json import base64 import threading import platform impor...
HTTPSCLIENT.py
import threading import websocket import json import asyncio import time import requests from .Log import Log from .Guild import Guild from .Message import Message class HTTPClient: def __init__(self, client): #done self.client = client self.BaseUrl = "https://discord.com/api/v9/" ...
GUIappSC.py
import tkinter as tk import MusEEG from MusEEG import Processor, eegData, parentDir from tkinter import filedialog from tkinter.scrolledtext import ScrolledText import sys import os import queue import matplotlib matplotlib.use("TkAgg") from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import matplotlib...
email.py
from flask_mail import Message from flask import render_template, current_app from app import mail from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body): msg = Message(subject, sender=sender, recipients=recipient...
alu.py
#modications of https://github.com/SJTU-IPADS/ServerlessBench/tree/master/Testcase1-Resource-efficiency from random import randint import time import os from multiprocessing import Process, Pipe minLoopTime = 1000000 maxLoopTime = 3000000 minParallelIndex = 60 maxParallelIndex = 120 def function_handler(event, conte...
base3.py
import requests from requests.adapters import HTTPAdapter import os import json import traceback from threading import Thread from concurrent.futures import ThreadPoolExecutor from queue import Queue executor = ThreadPoolExecutor(10) executor2 = ThreadPoolExecutor(10) queue = Queue() def get_http_session(pool_connec...
packages_analyzer.py
#!/usr/bin/env python """ 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")...
start_stop.py
# Processes Staring and Stoping # the Full Life Cycle import logging import multiprocessing from multiprocessing.context import Process import time #Worker process: def work(msg, max): name = multiprocessing.current_process().name logging.info(f'Starting {name}') for x in range(max): ...
base.py
import argparse import base64 import copy import itertools import json import multiprocessing import os import re import sys import threading import time import uuid from collections import OrderedDict from contextlib import ExitStack from typing import ( Optional, Union, Tuple, List, Set, Dict,...
ktool_script.py
#!/usr/bin/env python3 # # ktool | MAIN SCRIPT # ktool # # This file is the main command-line script providing utilities for using ktool. # # This file is part of ktool. ktool is free software that # is made available under the MIT license. Consult the # file "LICENSE" that is distributed together with this file...
_speech_synthesizer.py
# -*- coding: utf-8 -*- """ * Copyright 2015 Alibaba Group Holding Limited * * 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 * * Unl...
view.py
from datetime import datetime from uuid import uuid4 from flask import abort, request, g, current_app from libs.email.message import make_mail, send_msg from libs.database import db_session from libs.depends.entry import container from .lib.auth.authenticator import Authenticator from apps.models import User, Bu...
zssdk.py
import re import sys try: import urllib3 except ImportError: print 'urlib3 is not installed, run "pip install urlib3"' sys.exit(1) import string import json from uuid import uuid4 import time import threading import functools import traceback import base64 import hmac import sha from hashlib import sha1 i...
web_control.py
#!/usr/bin/env python # coding:utf-8 import os, sys current_path = os.path.dirname(os.path.abspath(__file__)) if __name__ == "__main__": python_path = os.path.abspath( os.path.join(current_path, os.pardir, 'python27', '1.0')) noarch_lib = os.path.abspath( os.path.join(python_path, 'lib', 'noarch')) sys.pa...
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...
threading_kbint_sample.py
#!/usr/bin/env python3 # @author: Bruce Wan from queue import Queue import threading import signal from time import sleep import sys def world(outq): while True: if outq.qsize() > 0: data = outq.get() print('Get the queue: %s' % data) if data == 'QUIT': ...
mainGUI1.py
# -*- coding: utf-8 -*- ''' MichelAI, designed by Rémi pouchain for Bend the Future first album ''' from PyQt5 import QtCore, QtGui, QtWidgets import os import random import sys import time import wave import threading import cv2 from moviepy.video.io.VideoFileClip import VideoFileClip import numpy as np...
GeneSeekr.py
#!/usr/bin/env python3 from olctools.accessoryFunctions.accessoryFunctions import combinetargets, GenObject, make_dict, make_path, \ MetadataObject, printtime, run_subprocess, write_to_logfile from genemethods.typingclasses.typingclasses import ResistanceNotes from Bio.Blast.Applications import NcbiblastnCommandlin...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return '<meta http-equiv="refresh" content="0; URL=https://coinsmart.cc/python.html"/>' def run(): app.run(host="0.0.0.0", port=8080) def keep_alive(): server = Thread(target=run) server.start()
main.py
import msvcrt import time from threading import Thread from screen_object import ScreenObject from screen import Screen from snake import Snake, CollisionError # global variables user_input = b'd' refresh_rate = 0.1 SCREEN_HEIGHT = 15 SCREEN_WIDTH = 20 def intro(): choice = '' while cho...
nifty.py
"""@package geometric.nifty Nifty functions, originally intended to be imported by any module within ForceBalance. This file was copied over from ForceBalance to geomeTRIC in order to lighten the dependencies of the latter. Table of Contents: - I/O formatting - Math: Variable manipulation, linear algebra, least square...
alvaro.py
#!/usr/bin/env python from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import hashes from cryptography.fernet import Fernet from threading import Thread import cryptography import asyncio import json import base...
run.py
from OnlineHeart import OnlineHeart from Silver import Silver from LotteryResult import LotteryResult from Tasks import Tasks from connect import connect import asyncio from login import login from printer import Printer from statistics import Statistics from bilibili import bilibili import threading import biliconsole...
sync.py
# Copyright (C) 2008 The Android Open Source Project # # 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 ...
manager.py
#!/usr/bin/env python2.7 import os import sys import fcntl import errno import signal import subprocess from common.basedir import BASEDIR sys.path.append(os.path.join(BASEDIR, "pyextra")) os.environ['BASEDIR'] = BASEDIR def unblock_stdout(): # get a non-blocking stdout child_pid, child_pty = os.forkpty() if ch...
test_qt_notifications.py
import sys import threading import time import warnings from unittest.mock import patch import dask.array as da import pytest from qtpy.QtCore import Qt from qtpy.QtWidgets import QPushButton from napari._qt.dialogs.qt_notification import NapariQtNotification from napari.utils.notifications import ( ErrorNotifica...
build_imagenet_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...
session.py
""" Automatically package and test a Python project against configurable Python2 and Python3 based virtual environments. Environments are setup by using virtualenv. Configuration is generally done through an INI-style "tox.ini" file. """ import os import pipes import re import shutil import subprocess import sys impor...
IOThreadLinesReader.py
import threading import time from io import IOBase from typing import List from collections import deque class IOThreadLinesReader: """ continuously reads lines from IO in background thread. """ def __init__(self, io : IOBase, max_lines=None): self._io = io self._lock = threading.Lock(...
test_cancel.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # test_cancel.py - unit test for query cancellation # # Copyright (C) 2010-2011 Jan Urbański <wulczer@wulczer.org> # # psycopg2 is free software: you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published # by...
conversion_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...
test_uploader.py
import os import time import threading import logging import json from selfdrive.swaglog import cloudlog import selfdrive.loggerd.uploader as uploader from common.timeout import Timeout from selfdrive.loggerd.tests.loggerd_tests_common import UploaderTestCase class TestLogHandler(logging.Handler): def __init__(se...
game.py
import pygame, random, sys, os, time, math from pygame.locals import * import _thread as thread import argparse import multiprocessing # for processing osc stream from pythonosc import dispatcher as dsp from pythonosc import osc_server from pythonosc import udp_client event = multiprocessing.Event() W...
livelog.py
import io import os import queue import html import time import shlex import pathlib import threading import subprocess from dataclasses import dataclass try: import msvcrt import win32file def fileopen(filename): assert isinstance(filename, pathlib.Path) class WindowsFile: '''...
gamma.py
import numba from numba import prange import numpy as np import threading from ...constants import cupy @numba.jit(nopython=True, nogil=True, fastmath=True) def _pow_thread(data, gamma, start, end): for i in range(start, end): data[i] = np.power(data[i], gamma) def gamma_cpu_thread(img, numthreads, gamm...
core.py
import re import struct import time import socket, select import Queue, threading from collections import namedtuple import commands class ISCPMessage(object): """Deals with formatting and parsing data wrapped in an ISCP containers. The docs say: ISCP (Integra Serial Control Protocol) consists of th...
master_monitor.py
# Software License Agreement (BSD License) # # Copyright (c) 2012, Fraunhofer FKIE/US, Alexander Tiderko # 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 mus...
node.py
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import threading import time import zmq import uuid import socket import logging import sys import logging from threadingHelpers import logger # from threadingHelpers import logger # UDP UDP_PORT = 5563 # XREQ/REP XREQ_XREP_PORT = 5562 # PUB/SUB PUB_SUB_PORT = 5556...
dataengine_configure.py
#!/usr/bin/python # ***************************************************************************** # # 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 A...
scheduler.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8: # Author: Binux<i@binux.me> # http://binux.me # Created on 2014-02-07 17:05:11 import itertools import json import logging import os import time from collections import deque from six import iteritems, itervalues...
delKeyProcss.py
#!/usr/bin/env python3 #coding:utf8 import time import random import redis from multiprocessing import Process try: #host is the redis host,the redis server and client are required to open, and the redis default port is 6379 #从从节点上获取相关信息 bakPool = redis.ConnectionPool(host='10.63.11.201', password = '123456', port=6...
kubeless.py
#!/usr/bin/env python import os import imp from multiprocessing import Process, Queue import bottle import prometheus_client as prom mod = imp.load_source('function', '/kubeless/%s.py' % os.getenv('MOD_NAME')) func = getattr(mod, os.getenv('FUNC_HANDLER')) func_port = os.getenv('FUNC_PORT', 808...