source
stringlengths
3
86
python
stringlengths
75
1.04M
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...
test_cpp_extensions_jit.py
# Owner(s): ["module: cpp-extensions"] import os import shutil import sys import unittest import warnings import re import tempfile import subprocess import glob import textwrap from multiprocessing import Process import torch.testing._internal.common_utils as common import torch import torch.backends.cudnn import t...
self.py
# -*- coding: utf-8 -*- import zz7 from zz7.lib.curve.ttypes import * from datetime import datetime import time, random, sys, ast, re, os, io, json, subprocess, threading, string, codecs, requests, ctypes, urllib, urllib2, urllib3, wikipedia, tempfile from bs4 import BeautifulSoup from urllib import urlopen import req...
hashdump_sam.py
import core.implant class HashDumpSAMImplant(core.implant.Implant): NAME = "SAM Hash Dump" DESCRIPTION = "Dumps the SAM hive off the target system." AUTHORS = ["zerosum0x0"] STATE = "implant/gather/hashdump_sam" def load(self): self.options.register("LPATH", "/tmp/", "local file save path...
heartbeats.py
#!/usr/bin/env python import unicornhathd import time import colorsys import numpy import threading from getch import getch from itertools import chain """Unicorn HAT HD: Heart Beats Displaying a beating heart... Your Unicorn HAT HD loves you. """ heart = [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [...
py_k8s.py
import time,datetime,logging,os,sys dir_common = os.path.split(os.path.realpath(__file__))[0] + '/../' sys.path.append(dir_common) # 将根目录添加到系统目录,才能正常引用common文件夹 import re from kubernetes import client,config,watch from kubernetes.client.models import v1_pod,v1_object_meta,v1_pod_spec,apps_v1beta1_deployment,apps_v1b...
test_utils.py
# Copyright (c) 2010-2012 OpenStack Foundation # # 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 agree...
environment.py
import tornado import tornado.ioloop from threading import Thread from steps.event_handler import EventHandler from slackrest.command import CommandParser, Visibility def before_feature(context, feature): if 'integration' in feature.tags: loop = tornado.ioloop.IOLoop.instance() context.slack_event...
BaseTestLib.py
import logging import os, sys import shutil import subprocess import time from Tests.XmlArtifact import XmlOutput #assume PythonLibrary already on path....required by consumer of this from Uefi.EdkII.Parsers.DecParser import * from Uefi.EdkII.Parsers.InfParser import * from Uefi.EdkII.Parsers.DscParser import * cla...
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...
interface.py
# File is generated by: tox -e codemod # -*- coding: utf-8 -*- """Backend Sender - Send to internal process Manage backend sender. """ import json import logging import threading import uuid import six from six.moves import queue import wandb from wandb import data_types from wandb.proto import wandb_internal_pb2 a...
run_squad_ColabTCPTrans_PbTest20191119.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team 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 ...
multi_agent_match.py
import os import sys import time from multiprocessing import Process from os.path import join import numpy as np import torch from algorithms.appo.learner import LearnerWorker from algorithms.appo.model import create_actor_critic from algorithms.utils.arguments import parse_args, load_from_checkpoint from algorithms....
_time.py
# Copyright 2017 gRPC 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 writing...
exchange_rate.py
from datetime import datetime import inspect import requests import sys from threading import Thread import time import traceback import csv from decimal import Decimal from electrum.bitcoin import COIN from electrum.plugins import BasePlugin, hook from electrum.i18n import _ from electrum.util import PrintError, Thre...
process_Manager.py
#! /usr/bin/env python3 # -*- coding:utf-8 -*- # 实现了进程之间的数据共享 进程Manager:真正实现进程间的数据共享(不只是数据传递) from multiprocessing import Process, Manager import os def f(d, l): d["name"] = "alex" d["sex"] = "Man" d["age"] = 33 l.append(os.getpid()) print(l) if __name__ == "__main__": with Manager() as m...
gui.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """Dragon5232's cool text editor.""" import sys import asyncio import os import inspect import re import io import random from datetime import datetime import signal import traceback import shutil import logging import discord from PyQt5.QtCore import * fr...
test_interrupt.py
import os import signal import time from threading import Thread import pytest from dagster import ( DagsterEventType, DagsterSubprocessError, Field, ModeDefinition, String, execute_pipeline_iterator, pipeline, reconstructable, resource, seven, solid, ) from dagster.core.in...
Enrichr_clustergram_endpoint.py
def main(mongo_address): import json import fake_enrichr from pymongo import MongoClient import threading import flask import time import run_enrich_background as enr_sub from flask import request, current_app if request.method == 'POST': enr_json = json.loads(request.data) elif request.method...
taskmgr.py
#!/usr/bin/env python # DummyMP - Multiprocessing Library for Dummies! # Copyright 2014 Albert Huang. # # 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/LI...
Validator.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys import chardet from gevent import monkey monkey.patch_all() import json import os import gevent import requests import time import psutil from multiprocessing import Process, Queue import config from db.DataStore import sqlhelper from util.exception import Te...
IntegrationTests.py
import os import sys import time import unittest import multiprocessing import percy from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.common.desired_capabilities import DesiredCapabilities from selenium.webdriver.su...
ben_lights_server.py
#!/usr/bin/python3 import threading import time import zmq import libioplus as io import sys import random import rospy import rosgraph import re # Possible light states: # - On - The light is on # - Off - The light is off # - Single - The light f...
monitorController.py
from multiprocessing import Process from flask import Blueprint, request from controller import node_monitor from util.Result import success from util.MysqldbClass import * from util.node_cpu_mem_monitor import node_cpu_mem_monitor from util.node_gpu_monitor import node_gpu_monitor monitor = Blueprint('monitor', __na...
rest_server.py
################################################################################ # BSD LICENSE # # Copyright(c) 2019-2020 Intel Corporation. All rights reserved. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following condit...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
test_tls.py
import datetime as dt import itertools import multiprocessing as mp import pickle import platform import select import socket import sys import time from contextlib import suppress import pytest from mbedtls import hashlib from mbedtls.exceptions import TLSError from mbedtls.pk import RSA from mbedtls.tls import * fr...
test_framework.py
from __future__ import print_function class bcolors: PASSED = '\033[32m' FAILED = '\033[91m' ENDC = '\033[0m' class AssertException(Exception): pass def format_message(message): return message def display(type, message, label="", mode=""): color = bcolors.FAILED if type == 'FAILED' else ...
test_auto_scheduler_task_scheduler.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
dialogs.py
from threading import Thread, RLock import xbmc import xbmcaddon import xbmcgui def select_ext(title, populator, tasks_count, sort_function = None): addonPath = xbmcaddon.Addon().getAddonInfo('path').decode('utf-8') dlg = SelectorDialog("DialogSelect.xml", addonPath, title=title, pop...
avnav_websocket.py
# -*- coding: utf-8 -*- # vim: ts=2 sw=2 et ai ############################################################################### # Copyright (c) 2012,2013-2021 Andreas Vogel andreas@wellenvogel.net # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documen...
approvals_test.py
#!/usr/bin/env python """Tests for API client and approvals-related API calls.""" import threading import time from grr_response_core.lib import flags from grr_response_server.gui import api_auth_manager from grr_response_server.gui import api_call_router_with_approval_checks from grr_response_server.gui import api_...
worker.py
""" Module that handles running the scraper repeatedly and generating diffs that can be returned from the API. The diff format used internally by this module is documented in the README, except that we don't have any special cases for e.g. the "error" and "until" keys (those are added on by the API module at a higher ...
service.py
# # Licensed under the LICENSE. # Copyright 2017, Sony Mobile Communications Inc. # ''' Service ''' import os import threading from flask import Response from .client_storage import get_wh_dict class Service: """ Service """ STATES = { 'started': 'STARTED', 'warm_up': 'WARM_UP', ...
TServer.py
# Copyright (c) Facebook, Inc. and its affiliates. # # 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 ...
quantize_lenet3.py
#!/usr/bin/env python # -------------------------------------------------------- # Quantize Fast R-CNN based Network # Written by Chia-Chi Tsai # -------------------------------------------------------- """Quantize a Fast R-CNN network on an image database.""" import os os.environ['GLOG_minloglevel'] = '2' import _...
mqtt_ssl_example_test.py
from __future__ import print_function, unicode_literals import os import re import ssl import sys from builtins import str from threading import Event, Thread import paho.mqtt.client as mqtt import ttfw_idf from tiny_test_fw import DUT event_client_connected = Event() event_stop_client = Event() event_client_receive...
rpc_test.py
import concurrent.futures import contextlib import json import logging import os import sys import threading import time import unittest import warnings from collections import namedtuple from functools import partial from threading import Event from threading import Lock from unittest import mock import torch impo...
test_c10d_nccl.py
# Owner(s): ["oncall: distributed"] import copy import math import os import random import signal import sys import tempfile import threading import time from contextlib import contextmanager, suppress from datetime import timedelta from itertools import product from unittest import mock import torch import torch.dis...
threading_init.py
import threading def myTask(): print("Hello World: {}".format(threading.current_thread())) # We create our first thread and pass in our myTask function myFirstThread = threading.Thread(target=myTask) # We start out thread myFirstThread.start()
detector_utils.py
# Utilities for object detector. import numpy as np import sys import tensorflow.compat.v1 as tf import os from threading import Thread from datetime import datetime import cv2 from utils import label_map_util from collections import defaultdict detection_graph = tf.Graph() sys.path.append("..") # score threshold fo...
visualizer.py
import time import atexit import threading import numpy as np import torch import matplotlib.pyplot as plt import cv2 def get_class_color(color_map, class_id, num_classes): """ Get color for a class id. Args: class_id (int): class id. """ rgb = color_map(class_id / num_classes)[:3] bg...
dependency_resolver.py
from network.network import ReceiverQueue from execution.operations import Operation from queue import Queue from threading import Thread from util.logger import Logger class DoneOperationsQueue: # simple hashset to check if operation ids are already executed # storing string and object seperately # str...
cli.py
import click import pydub from pydub import generators from pydub import playback import multiprocessing # Plays specified tone. # Uses pydub to generate tone. # pydub could be used to play audio files as well by changing segment to your choice of audio segments from pydub. # The type of wave can also be changed (cu...
vsphere.py
import logging import os from threading import Thread from time import sleep from cloud_provider.cloud_client import CloudClient from pyVim import connect from pyVmomi import vim from cloud_provider.utils import download_plugins from kubeoperator.settings import CLOUDS_RESOURCE_DIR from kubeops_api.models.setting impo...
warp.py
import atexit import subprocess import threading import time import signal def background_process(stop_server, command): """ Manager of background process :param stop_server: This boolean flag is used to signal the stopping of the background process :param command: Command that should be executed to s...
edfToFifDialog.py
''' Created on Dec 16, 2014 @author: Jaakko Leppakangas ''' import os import subprocess from threading import Thread, Event from time import sleep import mne from PyQt4 import QtGui, QtCore from PyQt4.Qt import QFileDialog from PyQt4.QtCore import pyqtSignal from ui_EdfToFifDialog import Ui_EdfToFifDialog from ui_I...
helper.py
import asyncio import functools import json import math import os import random import re import sys import threading import time import uuid import warnings from argparse import ArgumentParser, Namespace from datetime import datetime from itertools import islice from types import SimpleNamespace from typing import ( ...
test_state.py
# -*- coding: utf-8 -*- ''' Tests for the state runner ''' # Import Python Libs from __future__ import absolute_import, print_function, unicode_literals import errno import logging import os import shutil import signal import tempfile import time import textwrap import threading # Import Salt Testing Libs from tests....
http_server.py
#!/usr/bin/env python import http.server import socketserver import os import sys import threading BASE_DIR = os.getcwd() print(f"base_dir: {BASE_DIR}\n") def start_server(directory, port): print(f"Starting server on port: {port}") print(f"base_dir: {BASE_DIR}") print(f"directory: {directory}") web...
construct_etl.py
"""Construct ETL.""" import logging import multiprocessing import uuid from etl import ETL from etl.helpers import ETLHelper from etl.helpers import TextProcessingHelper from files import JSONFile from transactors import CSVTransactor from transactors import Neo4jTransactor class ConstructETL(ETL): """Construct ...
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...
utils.py
import os import threading import warnings from wsgiref.simple_server import make_server, WSGIRequestHandler from wsgiref.util import shift_path_info import requests warnings.filterwarnings(action="ignore", category=DeprecationWarning, module="requests") TEST_FILE_PATH = os.path.join(os.path.dirname(__file__), "tes...
history.py
""" Implementations for the history of a `Buffer`. NOTE: There is no `DynamicHistory`: This doesn't work well, because the `Buffer` needs to be able to attach an event handler to the event when a history entry is loaded. This loading can be done asynchronously and making the history swappable would ...
base.py
import ctypes import sys import threading import time import traceback from collections import OrderedDict import cv2 import numpy as np import auv_python_helpers.misc as aph import shm from auvlog.client import log as auvlog from misc.utils import register_exit_signals from vision import camera_message_framework f...
sniffle.py
from serial import Serial,SerialException from serial.tools.list_ports import comports from threading import Lock from queue import Queue import time,random,struct from base64 import b64encode, b64decode from binascii import Error as BAError from mirage.libs.ble_utils.constants import * from mirage.libs.ble_utils.scapy...
fg.py
from threading import Thread exit_flag = False def f(): global exit_flag i = 1 while not exit_flag: i = (i + 1) % 100000000 if i % 100000 == 0: print("f making progress: {0}".format(i)) def g(): global exit_flag j = 1 while not exit_flag: j = (j - 1) % 100000000 ...
dataset_exploration.py
DATASET_PATH = "/home/lorenzo/catkin_data/datasets/2d_gallery_detection/test_dataset" from threading import Thread import pickle import os from time import time_ns as ns import matplotlib.pyplot as plt import numpy as np def plot_label(label): label = np.roll(np.flip(label),180) plt.plot(label) plt.xlim(...
log.py
""" lantz.log ~~~~~~~~~ Implements logging support for Lantz. :copyright: 2012 by The Lantz Authors :license: BSD, see LICENSE for more details. """ import types import pickle import select import socket import struct import logging import threading from logging import DEBUG, INFO, WARNING, ER...
generate.py
import random import pandas as pd import json import os.path from os import path import sys import multiprocessing def remove_quotes(word): l = ['"', "'", ','] for ll in l: word = word.replace(ll, '') return word def replace_punc(word): l = ['.', '!', '?'] for ll in l: word =...
wallet.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights t...
jd_OpenCrad.py
#!/bin/env python3 # -*- coding: utf-8 -* ''' 项目名称: JD_OpenCard Author: Curtin 功能:JD入会开卡领取京豆 CreateDate: 2021/5/4 下午1:47 UpdateTime: 2021/5/15 ''' version = 'v1.0.5' readmes = """ # JD入会领豆 - 轻松日撸千豆 ## 目录结构 JD-Script/ #仓库 |-- LICENSE |-- OpenCrad # 主目录 | |-- jd_OpenCrad...
rankingMultiThd2.py
#!/usr/bin/python # This script computes ranking for test.idx, use multithreading to # improve performance # Input: /dat/fb15k-intermediate/test_divided/test_[1,2,3,4].idx # /result/... # Output: /evaluation/rank15k_i[ITERATION]_d[DIM].txt import numpy as np from collections import OrderedDict import s...
__init__.py
from typing import Dict, Any, Iterator, Optional from functools import wraps from contextlib import contextmanager import argparse import os import signal import subprocess import logging import sys import threading import time import flask import docker import psutil import git from ..version import __version__ from...
executor_service.py
# Lint as: python3 # Copyright 2019, The TensorFlow Federated 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 ...
test_cmd2.py
# coding=utf-8 # flake8: noqa E302 """ Cmd2 unit/functional testing """ import argparse import builtins import io import os import sys import tempfile from code import InteractiveConsole import pytest import cmd2 from cmd2 import COMMAND_NAME, ansi, clipboard, constants, exceptions, plugin, utils from .conftest impo...
api.py
import json import logging import os import time from threading import Thread from typing import Callable, Dict, Optional, Union from oauthlib.oauth2 import TokenExpiredError from requests import Response from requests_oauthlib import OAuth2Session from .sseclient import SSEClient URL_API = "https://api.home-connect...
env_wrappers.py
""" Modified from OpenAI Baselines code to work with multi-agent envs """ import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv, CloudpickleWrapper from .get_img import get_image def worker(remote, parent_remote, env_fn_wrapper): parent_remote.close() env = en...
scraper.py
from bs4 import BeautifulSoup import urllib3 import ssl import pandas from multiprocessing import Process import tldextract ssl._create_default_https_context = ssl._create_unverified_context # Load data into pandas dataframe df = pandas.read_csv('./data/majestic_million.csv') # We will fetch and try to get the meta ...
qiubai_process.py
from lxml import etree from bs4 import BeautifulSoup import requests import time from multiprocessing import Process from multiprocessing import JoinableQueue as Queue class SpiderQiuBai: def __init__(self): self.base_url = 'http://www.qiushibaike.com/8hr/page/{}' self.headers = { ...
rptr.py
#------------------------------------------------------------------------------- # Name: RPTR # Purpose: Automate automation # # Author: John de Kroon # # Created: 25-05-2016 # Copyright: (c) John de Kroon 2016 # Version: 1.0 #-------------------------------------------------------------------...
conftest.py
import asyncio import json import os import threading import time import typing import pytest import trustme from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.serialization import ( BestAvailableEncryption, Encoding, PrivateFormat, load_pem_private_key, ) from...
safe_t.py
from binascii import hexlify, unhexlify import traceback import sys from typing import NamedTuple, Any, Optional, Dict, Union, List, Tuple, TYPE_CHECKING from electrum.util import bfh, bh2u, versiontuple, UserCancelled, UserFacingException from electrum.bip32 import BIP32Node from electrum import constants from electr...
core.py
#!/usr/bin/env python3.4 # encoding: utf-8 # creator: matsbauer # date created: 24.01.2018 import json import os.path import socket from threading import Thread import sys, re, time, sys from random import randint import codecs if sys.version_info >= (3, 0): from urllib.request import Request, urlopen else: ...
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...
4_3_is_bst_hard.py
# python3 import sys, threading import numpy as np sys.setrecursionlimit(10**7) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size class Tree: def __init__(self): self.n = int(sys.stdin.readline().strip()) self.key = [0 for i in range(self.n)] ...
runfile.py
import tkinter as tk import psycopg2 import pickle import time, calendar, requests, datetime try: conn = psycopg2.connect(database="postgres", user="postgres", password="Contec123", host="10.10.100.120") print("connected") except: print("I am unable to connect to the database") motions = [] stationMotions...
tests.py
import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from pathlib import Path from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation fro...
vmtop.py
#!/usr/bin/python3 # TODO: # - system-wide metrics # - /sys/devices/system/node/nodeX/numastat # - can we get guest throttling data (for live migration) ? # - user-controlled list metrics to show, the list is getting large # - vmexit rate + reasons # - arbitrary groups of processes metrics (kernel threads, # ...
test_server.py
# -*- coding: utf-8 -*- import os import signal import time import random from multiprocessing import Process import socket import argparse import dnslib import pytest from six.moves import socketserver from greendns import server from greendns.handler_greendns import GreenDNSHandler def get_myip(): s = socket.so...
smb_hashes.py
from src.platform.tomcat.authenticate import checkAuth from src.platform.tomcat.interfaces import TINTERFACES from src.lib.cifstrap import Handler from requests.utils import dict_from_cookiejar from auxiliary import Auxiliary from threading import Thread from re import findall from collections import OrderedDict from t...
SnailVision.py
#!/usr/bin/env python3 import numpy as np import cv2 import imutils import numpy import imutils.contours import math import json import subprocess import sys import GripPipeline import os from time import sleep, monotonic from threading import Thread, RLock, Condition scriptDir = os.path.dirname(os.path.realpath(__fi...
manager.py
from dataclasses import dataclass import logging import threading import time import traceback from pathlib import Path from typing import Any, Callable, Dict, List, Optional, Set, Tuple, Iterator from concurrent.futures.thread import ThreadPoolExecutor from blspy import G1Element from chiapos import DiskProver from ...
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...
multiprocess_iterator.py
from __future__ import division import datetime import multiprocessing from multiprocessing import sharedctypes import signal import sys import threading import warnings import numpy import six from chainer.dataset import iterator from chainer.iterators._statemachine import (IteratorState, ...
portable_runner.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...
runtest.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import json import os import re import setproctitle import string import subprocess import sys import threading import time from collections import defaultdict, namedtuple, OrderedDict import numpy as np impor...
imgcache.py
# Copyright 2021 Ringgaard Research ApS # # 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...
multi_thread_clocks.py
from Old.Other_Scripts.clock import * class Client(threading.Thread): def __init__(self, interval=1.0): self.thread_count = 0 self.interval = interval threading.Thread.__init__(self) self.start() def new_clock(self): self.thread_count += 1 exec("%s = None" % ...
monitor.py
import sys sys.path.append(r"/home/anoldfriend/OpenFOAM/anoldfriend-7/utilities/") import signal import multiprocessing as mp import time from residual_monitor import read_residuals,plot_multiple_residuals,quit log="run.log" pressure_name="p" nCorrectors=5 interval=2 sample_size=300 # m_residuals=[["h"],["Ux","Uy"...
async.py
# -*- coding: utf-8 -*- """ async.py ~~~~~~~~~~~~~~~~~~~ :author: Finger :license: BSD, see LICENSE for more details. """ from multiprocessing import Process import threading def async_thread(func): def wrapper(*args, **kwargs): thread = threading.Thread(target=func, args=args, kwarg...
main.py
import glob import os import shutil from threading import Thread extension = ['png', 'jpg', 'heic', 'jpeg', 'mp4'] root_dir = [chr(x) + ":\\" for x in range(65,91) if os.path.exists(chr(x) + ":")] exclusions = [ "AppData", 'Midas Gen', 'midas Design+', 'Lumion', 'DroidCam', 'Program Files', 'Program F...
threading_daemon_join_timeout.py
#!/usr/bin/env python3 # 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 def daemon(): logging.debug('Starting') time.sleep(0.2) logging.debug('Exiting') def non_d...
executor.py
# Copyright (C) 2015-2021 Regents of the University of California # # 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 app...
VkBot.py
import json import threading import vk_api from vk_api import VkApi, VkUpload from vk_api.utils import get_random_id from apps.bot.classes.bots.Bot import Bot as CommonBot from apps.bot.classes.bots.vk.MyVkBotLongPoll import MyVkBotLongPoll from apps.bot.classes.consts.ActivitiesEnum import VK_ACTIVITIES, ActivitiesE...
process.py
from .logging import debug, exception_log, server_log import subprocess import os import shutil import threading try: from typing import Any, List, Dict, Tuple, Callable, Optional, Union assert Any and List and Dict and Tuple and Callable and Optional and Union except ImportError: pass def add_extension_...
feeder.py
import os import threading import time import numpy as np import tensorflow as tf from datasets import audio from infolog import log from keras.utils import np_utils from sklearn.model_selection import train_test_split from .util import is_mulaw_quantize, is_scalar_input import pdb _batches_per_group = 32 class F...
saltmod.py
# -*- coding: utf-8 -*- ''' Control the Salt command interface ================================== This state is intended for use from the Salt Master. It provides access to sending commands down to minions as well as access to executing master-side modules. These state functions wrap Salt's :ref:`Python API <python-ap...
test_webpage.py
import unittest from flask import Flask from multiprocessing import Process from webpage import WebPage import time class TestWebPage(unittest.TestCase): SERVER = "http://127.0.0.1:5000/" NO_LINKS_HTML = "<html> <body>Hello World</body> </html>" JS_LINKS_HTML = "<html> <head> <script src='/source.js'></script><...
echo_dialog.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...