source
stringlengths
3
86
python
stringlengths
75
1.04M
media_lights_sync.py
"""Synchronize RGB lights with media player thumbnail""" import appdaemon.plugins.hass.hassapi as hass import sys import threading import io from PIL import Image if sys.version_info < (3, 0): from urllib2 import urlopen from urlparse import urljoin else: from urllib.parse import urljoin from urllib.re...
core.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """PY4WEB - a web framework for rapid development of efficient database driven web applications""" # Standard modules import asyncio import cgitb import code import copy import datetime import enum import functools import http.client import http.cookies import importlib.ma...
controls.py
#!/usr/bin/env python3 import threading import subprocess import gi gi.require_version('Gtk', '3.0') gi.require_version('Gdk', '3.0') gi.require_version('GtkLayerShell', '0.1') from gi.repository import Gtk, Gdk, GLib, GtkLayerShell from nwg_panel.tools import check_key, get_brightness, set_brightness, get_volume, ...
faiss.py
import os import math import faiss import torch import numpy as np import threading import queue from colbert.utils.utils import print_message, grouper from colbert.indexing.loaders import get_parts from colbert.indexing.index_manager import load_index_part from colbert.indexing.faiss_index import FaissIndex def ge...
callbacks_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
lo.py
#!/usr/bin/env python # coding=utf-8 import time import threading def consumenr(cond): t = threading.current_thread() with cond: cond.wait() print '{}: resource is available to consumenr'.format(t.name) def producer(cond): t = threading.current_thread() with cond: print '{}: ...
thread.py
import cv2, threading, queue class ThreadingClass: def __init__(self, name): self.cap = cv2.VideoCapture(name) self.q = queue.Queue() t = threading.Thread(target=self._reader) t.daemon = True t.start() def _reader(self): while True: ret, frame = sel...
test_subprocess.py
import unittest from unittest import mock from test import support from test.support import import_helper from test.support import os_helper from test.support import warnings_helper import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback ...
websocketconnection.py
import threading import websocket import gzip import ssl import logging from urllib import parse import urllib.parse from binance_f.base.printtime import PrintDate from binance_f.impl.utils.timeservice import get_current_timestamp from binance_f.impl.utils.urlparamsbuilder import UrlParamsBuilder from binan...
email.py
from threading import Thread from flask import current_app, render_template from flask_mail import Message from . import mail import sys def send_async_email(app, msg): with app.app_context(): try: mail.send(msg) except Exception as ex: ex_name = ex.__class__.__name__ ...
go_tool.py
import argparse import copy import json import os import shutil import subprocess import sys import tempfile import threading arc_project_prefix = 'a.yandex-team.ru/' std_lib_prefix = 'contrib/go/_std/src/' vendor_prefix = 'vendor/' def compare_versions(version1, version2): v1 = tuple(str(int(x)).zfill(8) for x ...
a3c-gs.py
import tensorflow as tf from time import sleep import threading import numpy as np from tensorflow.contrib import slim import time import scipy.signal import cv2 #import gym import csv from scipy.ndimage.filters import gaussian_filter1d from simulator import simulator num_workers = 2; global_workers = 3 #there are 2 w...
knowledgeGraphCreator.py
from datetime import datetime from elasticsearch import Elasticsearch import os import subprocess from collections import Counter from elasticsearch.helpers import bulk import itertools import operator import json import logging import copy from flask import Flask, request, jsonify,make_response from threading import ...
calibExternNov2016.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Mar 17 19:16:43 2017 hacer la calibracion de los datos tomados en nov 2016 @author: sebalander """ # %% import cv2 from copy import deepcopy as dc from calibration import calibrator as cl from calibration import RationalCalibration as rational impor...
tunnel.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
TFSparkNode.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """This module provides low-level functions for managing the TensorFlowOnSpark cluster.""" from __future__ import absolute_import from __future__ import division from __future__ im...
client.py
import socket from time import sleep import sys import pickle from threading import Thread import rawscriptsmenu import hashlib import videoscriptcore import datetime import publishmenu import pandas as pd import settings settings.generateConfigFile() from PyQt5 import QtWidgets import configparser from PyQt5.QtCore i...
main_window.py
import re import os import sys import time import datetime import traceback from decimal import Decimal import threading import asyncio from typing import TYPE_CHECKING, Optional from electrum_mona.bitcoin import TYPE_ADDRESS from electrum_mona.storage import WalletStorage, StorageReadWriteError from elec...
rtk_process.py
""" ********************************************************************* This file is part of: The Acorn Project https://wwww.twistedfields.com/research ********************************************************************* Copyright (c) 2019-2021 Taylor Alexande...
test_modelcontext.py
# Copyright 2020 The PyMC Developers # # 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 ag...
gps_handler.py
import time import datetime import serial from threading import Thread import adafruit_gps uart = None gps = None last_print = time.monotonic() def initialize(): global uart global gps uart = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=3000) gps = adafruit_gps.GPS(uart, debug=False) # Turn...
pyrdock.py
#!/usr/bin/env python import sys import os import numpy as np from multiprocessing import Manager from multiprocessing import Process from multiprocessing import Queue import subprocess import argparse import pandas as pd from pdbtools import ligand_tools from vhts import sdtether class Docking(object): """ p...
app.py
import hashlib import json import os import sys import threading import time from urllib.parse import urlparse from uuid import uuid4 import ipfsapi from flask import (Flask, Response, jsonify, request, send_file, send_from_directory) from werkzeug import secure_filename import objectpath...
Robot.py
from pymata_aio.constants import Constants from pymata_aio.pymata3 import PyMata3 from threading import * import time import asyncio def map(state): x = state['right_analog_x'] y = state['right_analog_y'] def compute(a, b): MAX = max(a, b) if b == 0: return MAX, MAX ...
event_tests.py
import os import time import unittest import threading import classad import htcondor SAMPLE_EVENT_TEXT = """\ 006 (23515.000.000) 04/09 17:55:39 Image size of job updated: 260 1 - MemoryUsage of job (MB) 252 - ResidentSetSize of job (KB) ... """ class TestEventReader(unittest.TestCase): de...
test_router.py
import threading from typing import List, Tuple import pytest import requests import werkzeug from werkzeug.exceptions import NotFound from localstack.http import Request, Response, Router from localstack.http.router import E, RegexConverter, RequestArguments from localstack.utils.common import get_free_tcp_port de...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The belicoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt 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 i...
multi1.py
"The Basics: Processes and Locks" """ multiprocess basics: Process works like threading.Thread, but runs function call in parallel in a process instead of a thread; locks can be used to synchronize, e.g. prints on some platforms; starts new interpreter on windows, forks a new process on unix; """ import os from multip...
gsi_replica_indexes.py
import json from .base_gsi import BaseSecondaryIndexingTests from membase.api.rest_client import RestConnection, RestHelper import random from lib import testconstants from lib.memcached.helper.data_helper import MemcachedClientHelper from lib.remote.remote_util import RemoteMachineShellConnection from threading impor...
experiment.py
from multiprocessing import Process from DLplatform.coordinator import Coordinator, InitializationHandler from DLplatform.worker import Worker from DLplatform.communicating import Communicator, RabbitMQComm from DLplatform.dataprovisioning import IntervalDataScheduler from DLplatform.learningLogger import LearningLogge...
main_int.py
import wx import main import threading class Frames(wx.Frame): def __init__(self, parent,id, title): super(Frames, self).__init__(parent, title=title, \ size=(550, 350)) self.InitUI() self.Centre() self.Show(True) def InitUI(self): panel = wx.Panel(self) faicon = wx.Icon...
train_faf_com_kd_distributed.py
from utils.model import forecast_lstm import random import torch import torch.nn as nn import torch.optim as optim import torch.nn.functional as F from torch.nn.parallel import DistributedDataParallel as DDP import torch.distributed as dist import torch.multiprocessing as mp import numpy as np import time import sys im...
__init__.py
import argparse import functools import ipaddress import signal import threading import wsgiref.simple_server from . import wsgiext from . import exporter def main(): ''' You are here. ''' parser = argparse.ArgumentParser() parser.add_argument('--bind-address', type=ipaddress.ip_address, default='...
shad0w.py
#!/usr/bin/env python3 import ssl import socket import argparse from threading import Thread from lib import debug from lib import banner from lib import http_server from lib import console from lib import encryption from lib import buildtools class Shad0wC2(object): def __init__(self, args): super(Sh...
sync.py
# Copyright 2014 OpenStack Foundation # Copyright 2014 Hewlett-Packard Development Company, L.P. # # 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/LICENS...
__init__.py
import atexit import threading import reprlib from gi.repository import GObject, GLib from gi.types import GObjectMeta from zope.interface import providedBy, Interface, Attribute from zope.interface.adapter import AdapterRegistry from zope.interface.interface import adapter_hooks from mxdc.com import ca from mxdc.uti...
thread_test_BNLtt.py
import time from sys import stdout from threading import Thread import epics from epics.ca import CAThread pvlist_a = ('S14A:P0:mswAve:x:AdjustedCC', 'S14A:P0:ms:x:SetpointAO', 'S13C:P0:mswAve:x:AdjustedCC', 'S13C:P0:ms:x:SetpointAO', 'S13C:P0:mswAve:x:E...
cifar10-fast.py
#!/usr/bin/env python import argparse import numpy as np import os import multiprocessing as mp import tensorflow as tf from tensorpack import * from tensorpack.utils import logger from tensorpack.tfutils.tower import TowerFunc from tensorpack.tfutils.varreplace import custom_getter_scope from tensorpack.dataflow imp...
gen_index.py
from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC # for local hosting, since selenium requires a hosted page to work ...
csm.py
#!/usr/bin/env python3 import json import os import threading import time from copy import deepcopy from datetime import datetime from datetime import timedelta from functools import update_wrapper from urllib.parse import quote from uuid import uuid4 from flask import current_app from flask import jsonify from flask...
session.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
views.py
from django.shortcuts import render, redirect from django.conf import settings from django.http import (HttpResponseForbidden, HttpResponseNotFound, HttpResponse) from django.template import Context import os from threading import Thread from datetime import datetime from research.models impor...
main.py
# Copyright 2020 Google Research. 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...
app.py
# encoding: utf-8 ''' A REST API for Salt =================== .. py:currentmodule:: salt.netapi.rest_cherrypy.app :depends: - CherryPy Python module. Note: there is a `known SSL traceback for CherryPy versions 3.2.5 through 3.7.x <https://github.com/cherrypy/cherrypy/issues/1298>`_. Please use ...
binary_sensor.py
"""Support to use flic buttons as a binary sensor.""" import logging import threading from pyflic import ( ButtonConnectionChannel, ClickType, ConnectionStatus, FlicClient, ScanWizard, ScanWizardResult, ) import voluptuous as vol from homeassistant.components.binary_sensor import PLATFORM_SCHE...
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...
traffic.py
__author__ = 'Santi' ''' Packet sniffer in python using the pcapy python library Project website http://oss.coresecurity.com/projects/pcapy.html ''' import socket from struct import * import pcapy import sys from time import gmtime, strftime, sleep import web import threading global results def threaded(fn): ...
k8s.py
from __future__ import print_function, division, unicode_literals import base64 import functools import hashlib import json import logging import os import re import subprocess import tempfile from copy import deepcopy from pathlib import Path from threading import Thread from time import sleep from typing import Text...
misc.py
import os import time from time import sleep import multiprocessing import numpy as np __copyright__ = "Copyright 2016-2018, Netflix, Inc." __license__ = "Apache, Version 2.0" def empty_object(): return type('', (), {})() def get_unique_sorted_list(l): """ >>> get_unique_sorted_list([3, 4, 4, 1]) ...
Crawler.py
import os import re import socket import threading import time import urllib.request from urllib.parse import urlparse from urllib.request import Request, urlopen import logging from os.path import basename from urllib.error import HTTPError, URLError from selenium.common.exceptions import TimeoutException, WebDriver...
B.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def main(): return 'JDBot Tester is up and running!!' def run(): app.run(host='0.0.0.0', port=3000) def b(): server = Thread(target=run) server.start()
testcases.py
""" Subclasses of unittest.TestCase. """ from __future__ import absolute_import import os import os.path import shutil import threading import unittest from .. import config from .. import core from .. import logging from .. import utils def make_test_case(test_kind, *args, **kwargs): """ ...
base.py
""" Project: pubsne Authors: kceades """ # imports from classes I wrote import snmc import creator import tools import snetools # imports from standard packages import os import numpy as np from sklearn.decomposition import PCA from mfa import FactorAnalysis import pickle import matplotlib.pyplot as plt import scipy...
test_utils.py
import copy import tempfile from unittest import TestCase import os import six from pyff import utils from pyff.constants import NS from pyff.resource import Resource from pyff.samlmd import find_entity, entities_list from pyff.utils import resource_filename, parse_xml, root, resource_string, b2u, Lambda, schema, find...
test_errno.py
import unittest, os, errno from ctypes import * from ctypes.util import find_library try: import threading except ImportError: threading = None class Test(unittest.TestCase): def test_open(self): libc_name = find_library('c') if libc_name is None: raise unittest.SkipTest('Unab...
start.py
#!/usr/bin/python3 import os import glob import multiprocessing import logging as log import sys from podop import run_server from socrate import system, conf log.basicConfig(stream=sys.stderr, level=os.environ.get("LOG_LEVEL", "WARNING")) def start_podop(): os.setuid(8) url = "http://" + os.environ["ADMI...
helper.py
import os import threading import time import pyautogui import math import validators import re import socket import importlib import inspect from itertools import cycle from halo import Halo from datetime import datetime from pathlib import Path from random import randint def banner(native_print=F...
postmaster.py
import logging import multiprocessing import os import psutil import re import signal import subprocess logger = logging.getLogger(__name__) STOP_SIGNALS = { 'smart': signal.SIGTERM, 'fast': signal.SIGINT, 'immediate': signal.SIGQUIT if os.name != 'nt' else signal.SIGABRT, } def pg_ctl_start(conn, cmdli...
data_collector.py
''' Data collector : This class connects NewsAPI collects bulk collection of news articles and insert into db ''' import os import math from newsapi import NewsApiClient from datetime import datetime, timedelta from TopicExtractor.src.utils.database import NewsDatabase import threading from kafka import KafkaProducer,...
streaming_processing.py
""" NeurodataLab LLC 09.12.2019 Created by Andrey Belyaev """ import cv2 import json from queue import Empty from multiprocessing import Event, Process, Queue import gi import numpy as np from PIL import Image, ImageDraw, ImageFont gi.require_version('Gst', '1.0') gi.require_version('GstRtspServer', '1.0') from gi.rep...
extractipy.py
#!/usr/bin/env python3 import sys import signal import os from gi import require_version require_version("Gtk", "3.0") from gi.repository import Gtk, GObject from subprocess import call import threading import ntpath # Function to extract the audio from all the files of a folder which is passed as parameter def extrac...
conftest.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # Copyright (c) 2002-2020 "Neo4j," # Neo4j Sweden AB [http://neo4j.com] # # This file is part of Neo4j. # # 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 L...
test_multiprocessing.py
#!/usr/bin/env python # # Unit tests for the multiprocessing package # import unittest import threading import queue as pyqueue import time import io import sys import os import gc import errno import signal import array import socket import random import logging import test.support # Skip tests if _multiprocessing...
test_ibm_job.py
# This code is part of Qiskit. # # (C) Copyright IBM 2021. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications or derivative wo...
async_rl.py
import time import multiprocessing as mp import psutil import torch from collections import deque import math from rlpyt.runners.base import BaseRunner from rlpyt.utils.quick_args import save__init__args from rlpyt.utils.logging import logger from rlpyt.utils.collections import AttrDict from rlpyt.utils.seed import s...
consumer.py
from kafka import KafkaConsumer from json import loads, dumps import requests import threading from time import sleep class StreamReddit: def __init__( self, subreddit, limit=100000, author=True, comments=False, url=True, name=False, num_comments=False, score=False, ...
clone.py
"""Worker class that performs tasks on a seperate process""" import queue from copy import copy from multiprocessing import Process, Queue from typing import Any, Callable, Optional, Tuple from loguru import logger class ShadowClone: """Task worker""" def __init__(self): """Set initial task""" ...
client.py
#!/usr/bin/env python # # Copyright 2014 Huawei Technologies Co. Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by ...
views.py
import logging import threading import time import re from collections import defaultdict from typing import Optional, Union from laboratory.settings import SYSTEM_AS_VI, SOME_LINKS, DISABLED_FORMS, DISABLED_STATISTIC_CATEGORIES, DISABLED_STATISTIC_REPORTS from utils.response import status_response from django.core.va...
test_celery.py
import threading import pytest pytest.importorskip("celery") from sentry_sdk import Hub, configure_scope from sentry_sdk.integrations.celery import CeleryIntegration from sentry_sdk._compat import text_type from celery import Celery, VERSION from celery.bin import worker @pytest.fixture def connect_signal(request...
main.py
import muirc import sys import pybot from threading import Thread def userInput(): while connected: msg = raw_input(); if connected: conn.privmsg("#local", msg) connected = True server = "" channel = "" if(len(sys.argv) < 2): print("Not enough arguments. Please spec...
resourceAllocator.py
import numpy as np import pandas as pd class GradientFreeResourceAllocator: def __init__(self, depth=3, lmda=1, n_restarts=10, n_trials=int(1e3),\ allocationMethod='variablePrecision'): # General parameters with default values self.lmda = lmda self.n_trials = n_trials ...
client.py
import os import socket import random as rand import threading import time as t import functions.cmd_handler as cmd_handler import functions.commands.client_hardware_info as client_hardware_info server_host = '' # control server ip server_port = 420 is_connected = False client_socket = socket.socket(socket.AF_INET, ...
gerritbot.py
# -*- coding: utf-8 -*- # # 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 ...
test_unix_events.py
"""Tests for unix_events.py.""" import collections import errno import io import os import pathlib import signal import socket import stat import sys import tempfile import threading import unittest import warnings from unittest import mock if sys.platform == 'win32': raise unittest.SkipTest('UNIX only') import...
automate.py
# This is the main file which controls the logic for the UI automation. import parse import common from constants import * import performance import sys import report_generator # Platforms import web import mac import win import os import json import time from multiprocessing import Process import subprocess import s...
test_http_client.py
from mock_decorators import setup, teardown from flask import Flask, request from threading import Thread import urllib2 import os import ssl @setup('HTTP GET & POST requests') def setup_http_get(e): app = Flask(__name__) def shutdown_server(): func = request.environ.get('werkzeug.server.shutdown') ...
Hiwin_RT605_ArmCommand_Socket_20190627161451.py
#!/usr/bin/env python3 # license removed for brevity import rospy import os import numpy as np from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import math import enum pos_feedback_times = 0 mode_feedback_times = 0 msg_feedback = 1 #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 i...
main.py
import eel import os import threading from projects import get_project_list, get_project_data from clipboard import get_clipboard_text, paste_text_to_clipboard def close(page, sockets): if not sockets: os._exit(0) @eel.expose def get_projects(): return get_project_list() @eel.expose def get_project(pro...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.general import xyxy2xywh, xywh2xyxy, torch_di...
client_test.py
#!/usr/bin/env python3 import unittest from multiprocessing import Process from session.client import RemoteSession import session.server as server def remote_session(name): return RemoteSession(name, 'localhost', 7007) class TestBashSession(unittest.TestCase): @classmethod def setUpClass(self): s...
_test_multiprocessing.py
# # Unit tests for the multiprocessing package # import unittest import unittest.mock import queue as pyqueue import time import io import itertools import sys import os import gc import errno import signal import array import socket import random import logging import subprocess import struct import operator import p...
ops_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...
context.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...
providers.py
# Copyright (c) 2010-2011, Found IT A/S and Piped Project Contributors. # See LICENSE for details. import logging import threading import time import zmq from twisted.application import service from twisted.internet import reactor, defer, task from zope import interface from piped import exceptions, resource, depende...
pixelserver.py
#!/usr/bin/env python import threading import time from queue import Queue,Empty import opc from bottle import request, route, run, static_file ADDRESS = "localhost" queue = Queue() @route('/') def index(): return static_file("help.html",root="./") @route('/api', method='POST') def api(): """ API JSON fun...
generators.py
__author__ = 'Fabian Isensee' import numpy as np import lasagne def batch_generator(data, target, BATCH_SIZE, shuffle=False): if shuffle: while True: ids = np.random.choice(len(data), BATCH_SIZE) yield data[ids], target[ids] else: for idx in range(0, len(data), BATCH_SIZ...
operations.py
import requests import logging import json import API.authentication as auth import deviceControl.operationsHandler import threading logger = logging.getLogger('Operations API') logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s') logger.info('Logger for operations w...
polybeast.py
# Copyright (c) Facebook, Inc. and its affiliates. # 2 May 2020 - Modified by urw7rs # # 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...
multithreading.py
#!/usr/bin/env python3 """ Multithreading/processing utils for faceswap """ import logging import multiprocessing as mp from multiprocessing.sharedctypes import RawArray from ctypes import c_float import queue as Queue import sys import threading import numpy as np from lib.logger import LOG_QUEUE, set_root_logger l...
draw_graphs_from_config_file.py
import argparse import threading import shlex import bandwidth_cdf import bandwidth_through_time import flow_length_cdf import flow_size_cdf import inter_arrival_distribution_graph import ipg_distribution_graph import microburst_analysis import packet_size_distribution_graph import packet_size_distribution_through_time...
generate_train_4.py
import json import os from multiprocessing import Process def chunks(lst, n): """Yield successive n-sized chunks from lst.""" for i in range(0, len(lst), n): yield lst[i:i + n] def cut_videos(cmds, i): for i in range(len(cmds)): cmd = cmds[i] print(i, cmd) os.system(cmd) ...
__init__.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...
mumbleBot.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re import threading import time import sys import math import signal import configparser import audioop import subprocess as sp import argparse import os import os.path import pymumble_py3 as pymumble import pymumble_py3.constants import variables as var import logg...
test_multiprocessing.py
#!/usr/bin/env python # # Unit tests for the multiprocessing package # import unittest import threading import queue as pyqueue import time import io import sys import os import gc import signal import array import copy import socket import random import logging import test.support # Skip tests if _multiprocessing ...
nic_simulator.py
#!/usr/bin/env python3 """ _ _ _____ _____ _____ _____ __ __ _ _ _ _______ ____ _____ | \ | |_ _/ ____| / ____|_ _| \/ | | | | | /\|__ __/ __ \| __ \ | \| | | || | | (___ | | | \ / | | | | | / \ | | | | | | |__) | | . ` | | || | \___ \ | | | |\/| | | ...
Thread_definition.py
import threading def pasien(thread_number): return print('pasien called by dokter {}'.format(thread_number)) def main(): threads = [] for i in range(10): t = threading.Thread(target=pasien, args=(i,)) threads.append(t) t.start() t.join() if __name__ == "__main__": ma...
test_updater.py
import unittest import threading import logging import time from katsdpscripts.fake.updater import (WarpClock, PeriodicUpdaterThread, SingleThreadError) logging.basicConfig(level=logging.DEBUG) class TestingUpdate(unittest.TestCase): """Run 'nosetests -s --nologcapture' ...
node_provider.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import random import threading from collections import defaultdict import boto3 from botocore.config import Config from ray.autoscaler.node_provider import NodeProvider from ray.autoscaler.tags import TAG_RAY...
test.py
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. 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 # noti...