source
stringlengths
3
86
python
stringlengths
75
1.04M
__init__.py
import pickle import functools import tornado.web from lp import * from attrs import * from task import * def call(fn): fn() class viewer(tornado.web.RequestHandler, Attrs): viewers = [] app = None @classmethod def observe(cls, model, point=r"/"): cls.viewers.append((point, cls, dict(...
tunnel.py
from __future__ import print_function import sys, time, json import socket __version__ = '2.2.0' READ_BUF_LEN = 1300 TIME_WAIT_SEND_S = 3 TIME_FOR_PING_S = 30 IS_PY3 = sys.version_info >= (3, 0) def print_it(*args): print(time.time(), *args) def send_str(sock, msg, code=0): if sock: sock.sendall(...
solrqueue.py
from datetime import datetime import logging from queue import Empty, Full, Queue import threading from haystack.utils import get_identifier from api_v2.search.index import TxnAwareSearchIndex LOGGER = logging.getLogger(__name__) class SolrQueue: def __init__(self): self._queue = Queue() self._...
parallel_npy2dzi.py
import os import time import subprocess from multiprocessing import Process import fire import numpy as np import PIL from PIL import Image import os import sys import deepzoom import time import shutil def worker(wsi_name, web_dir, shrink_factor): # disable safety checks for large images PIL.Image.MAX_IMAG...
pangeamt_files_preprocess.py
#!/usr/bin/env python import os import json import argparse from multiprocessing import Process from pangeamt_toolkit.processors import Pipeline # Parallel preprocess of train, dev and test files. def _get_parser(): parser = argparse.ArgumentParser(description='Preprocess file.') parser.add_argument('config'...
socket_test.py
import os #importing os library so as to communicate with the system import time #importing time library to make Rpi wait because its too impatient time.sleep(1) # As i said it is too impatient and so if this delay is removed you will get an error import socket import queue import threading max_value = 1675 #c...
subprocess.py
from threading import Thread import pyrealtime as prt class SubprocessLayer(prt.TransformMixin, prt.ThreadLayer): def __init__(self, port_in, cmd, *args, encoder=None, decoder=None, **kwargs): super().__init__(port_in, *args, **kwargs) self.cmd = cmd self.proc = None self.read_thr...
prog3.py
def gpuWrap(dv, q): q.add(dv.apply(useGPUs)) def fWrap(dv, i, q): q.add(dv.apply(f, i)) # we assume that the engines have been correctly instantiated def main( ): q = Queue.Queue() # collect results in here threads = [] seqNum = 1 c = Client() for i in range(100): ...
ddos_dissector.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- ############################################################################### # Concordia Project # # This project has received funding from the European Union’s Horizon # 2020 Research and Innovation program under Grant Agreement No 830927. # # Joao Ceron - joaocer...
exchange_rate.py
from datetime import datetime import inspect import requests import sys import os import json from threading import Thread import time import csv import decimal from decimal import Decimal from .bitcoin import COIN from .i18n import _ from .util import PrintError, ThreadJob # See https://en.wikipedia.org/wiki/ISO_42...
core.py
#!/usr/bin/env python import requests, threading, time, json, sys, socket, random from queue import Queue class AsyncRequest(object): def __init__(self, gateway_addr='127.0.0.1', gateway_port=8000): self.gateway_addr = gateway_addr self.gateway_port = gateway_port self.base_url = 'http://'...
bomber.py
#!/usr/bin/env python from datetime import datetime import os import hashlib import sys import time import threading import string import random import base64 import urllib.request import urllib.parse import keyboard try: import requests except ImportError: print('[!] Error: some dependencies are not installed...
main.py
# -*- coding: utf-8 -*- import sys from urllib.request import urlopen from bs4 import BeautifulSoup from queue import Queue, Empty from threading import Thread visited = set() queue = Queue() def get_parser(host, root, charset): def parse(): try: while True: url = queue.get_n...
a.py
# # Copyright 2015 riteme # from multiprocessing import * import os def proc(name): print 'Running child process \"' + name +'\", pid:', os.getpid() if __name__ == "__main__": print 'Parent process is', os.getpid() new_proc = Process(target = proc, args = ('A',)) print 'Process will start' new_pr...
data_api2Server.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
test_git_repo.py
#!/usr/bin/env python #-*- coding:utf-8; mode:python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*- import sys import os.path as path import multiprocessing from bes.testing.unit_test import unit_test from bes.fs.file_util import file_util from bes.fs.temp_file import temp_file from bes.system.env_overri...
index.py
from flask import Flask, request, jsonify from src.request_processing import PredictRequestProcessor, ModelRequestProcessor from initialize import before_all import logging import threading import asyncio from src.model_manager import ModelManager import asyncio app = Flask(__name__) PORT = 80 def initialize_all(): ...
__init__.py
from collections import defaultdict from pyspark import AccumulatorParam from pyspark.profiler import Profiler from os.path import join from threading import Thread, Event from sys import _current_frames def extract_stack(frame): result = [] while frame is not None: result.append(( frame.f...
mark.py
from .set_mark.namumark import namumark from .set_mark.markdown import markdown from .set_mark.tool import * import re import html import sqlite3 import urllib.parse import threading import multiprocessing def load_conn2(data): global conn global curs conn = data curs = conn.cursor() def send_parse...
sample_selector.py
#!/usr/bin/env python __author__ = 'Florian Hase' #======================================================================== import numpy as np from multiprocessing import Process, Queue from Utils.utils import VarDictParser #======================================================================== class SampleSel...
python_ls.py
# Copyright 2017 Palantir Technologies, Inc. from functools import partial import logging import os import socketserver from .plugins.jedi_completion import pyls_completions import napkin from pyls_jsonrpc.dispatchers import MethodDispatcher from pyls_jsonrpc.endpoint import Endpoint from pyls_jsonrpc.streams import J...
base_test.py
import shopify from test.test_helper import TestCase from pyactiveresource.activeresource import ActiveResource from mock import patch import threading class BaseTest(TestCase): @classmethod def setUpClass(self): shopify.ApiVersion.define_known_versions() shopify.ApiVersion.define_version(shop...
crawl.py
#!/usr/bin/env python2 import re import urllib2 import httplib from bs4 import BeautifulSoup import dao import string from threading import Thread import sys import json import traceback import js2py import downloader def getDocSoup(url, cookie=""): try: opener = urllib2.build_opener() opener.add...
_RPIO.py
# -*- coding: utf-8 -*- # # This file is part of RPIO. # # Copyright # # Copyright (C) 2013 Chris Hager <chris@linuxuser.at> # # License # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published # by the Free Softw...
mv_manager_tester.py
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
test_file2k.py
import sys import os import unittest import itertools import time from array import array from weakref import proxy try: import threading except ImportError: threading = None from test import test_support from test.test_support import TESTFN, run_unittest from UserList import UserList class AutoFileTests(unit...
wifiConnection.py
""" Holds all the data and commands needed to fly a Bebop drone. Author: Amy McGovern, dramymcgovern@gmail.com """ from zeroconf import ServiceBrowser, Zeroconf import time import socket import ipaddress import json from util.colorPrint import color_print import struct import threading from commandsandsensors.DroneSe...
sim.py
import copy import inspect import itertools from functools import partial import numpy as np import os import random import threading import time as ttime import uuid import weakref import warnings from collections import deque, OrderedDict from tempfile import mkdtemp from .signal import Signal, EpicsSignal, EpicsS...
SimpleHDLC.py
#!/usr/bin/python # coding: utf8 __version__ = '0.2' import logging import struct import time from threading import Thread from PyCRC.CRCCCITT import CRCCCITT import sys logger = logging.getLogger(__name__) def calcCRC(data): crc = CRCCCITT("FFFF").calculate(bytes(data)) b = bytearray(struct.pack(">H", crc...
mapreduce.py
import sys import mrutil import argparse import threading from time import sleep import grpc import gleam_pb2 import gleam_pb2_grpc parser = argparse.ArgumentParser(description="mapreduce args") parser.add_argument('--pymodule', '-module', required=True, type=str, help='python mapreduce module file') group = parser.a...
master.py
import logging from multiprocessing import Process from PyPark.result import Result from PyPark.shootback.master import run_master from PyPark.util.net import get_random_port def addNat(data): from PyPark.park import NAT_IP,NAT_PORT_MAP nat_port = int(data['nat_port']) target_addr = data['target_addr'] ...
__init__.py
# -*- coding: utf-8 -*- """ Set up the Salt integration test suite """ from __future__ import absolute_import, print_function import atexit import copy import errno import logging import multiprocessing import os import pprint import re import shutil import signal import socket import stat import subprocess import sy...
deploy.py
# Copyright (c) OpenMMLab. All rights reserved. import argparse import logging import os.path as osp from functools import partial import mmcv import torch.multiprocessing as mp from torch.multiprocessing import Process, set_start_method from mmdeploy.apis import (create_calib_table, extract_model, ...
creat_threading_function.py
#!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Lyon import threading import time def func(name): print("I am %s" % name) time.sleep(2) if __name__ == '__main__': t1 = threading.Thread(target=func, args=("Lyon",)) t2 = threading.Thread(target=func, args=("Kenneth",)) print(t1.isAlive) prin...
test_cuda.py
# Owner(s): ["module: cuda"] from itertools import repeat, chain, product from typing import NamedTuple import collections import contextlib import ctypes import gc import io import pickle import queue import sys import tempfile import threading import unittest import torch import torch.cuda import torch.cuda.comm as...
connection.py
import logging import socket import select import threading import time from . import const from . import response class TiVoError(Exception): pass class TiVoSocketError(Exception): pass class ThreadedSocket(object): def __init__(self, host, port): self._host = host self._port = port self._data = ...
services.py
""" Execute dotnet projects in parallel separate processes """ import glob import shlex import subprocess from multiprocessing import Process from os import path from typing import List from .printing import print_green def run(project: str, command_type: str, watch_mode: bool): """Execute dotnet command Ar...
commands.py
# These are the Mailpile commands, the public "API" we expose for searching, # tagging and editing e-mail. # import copy import datetime import json import os import os.path import random import re import shlex import socket import subprocess import sys import traceback import threading import time import unicodedata i...
PythonController.py
#!/usr/bin/env python import sys import time import serial import networkx as nx import threading from threading import Thread from datetime import datetime import networkx as nx def readUART(Topo): try: ser = serial.Serial('/dev/ttyUSB1',115200) #time.sleep(10) prev_length = [] length = [] for t in r...
main.py
from tkinter import * from tkinter import messagebox import time import threading import random time_limit = 0 stop_event = False free_cells = 0 total_free_cells = 0 first_move = True class Entry_number(Entry): """ A class that was used in the Main Menu in order to make Entry Boxes that don't accept inva...
script.py
import sys import ConfigParser from os.path import expanduser # Set system path home = expanduser("~") cfgfile = open(home + "\\STVTools.ini", 'r') config = ConfigParser.ConfigParser() config.read(home + "\\STVTools.ini") # Master Path syspath1 = config.get('SysDir','MasterPackage') sys.path.append(syspath1) # Built Pa...
NitroGen.py
import requests import string import random from sys import argv, exit from threading import Thread try: caracteres = int(argv[1]) threads = int(argv[2]) proxys = argv[3] except: print('Error, Set Characters, Threads And List Proxys!!!') exit() proxys = open(proxys, 'r') proxys = proxys.readlines(...
vc.py
# -*- coding: utf-8 -*- """Prompt formatter for simple version control branches""" # pylint:disable=no-member, invalid-name import os import sys import queue import builtins import threading import subprocess import re import pathlib import xonsh.tools as xt from xonsh.lazyasd import LazyObject RE_REMOVE_ANSI = Lazy...
test.py
import firebase_admin import datetime from firebase_admin import credentials from firebase_admin import firestore from google.cloud.firestore_v1beta1 import ArrayUnion import threading import time cred = credentials.Certificate("firebase_key.json") firebase_admin = firebase_admin.initialize_app(cred) db = firestore.cl...
facerec_from_webcam_mult_thread.py
# !/usr/bin/python3.6 # -*- coding: utf-8 -*- # @author breeze import threading import argparse import multiprocessing import time from multiprocessing import Queue, Pool import face_recognition import pandas as pd import win32com.client import cv2 import encoding_images from app_utils import * # This is a demo of ru...
server.py
import array import contextlib import ctypes import fcntl import io import logging import mmap import os import signal import socket import socketserver import struct import sys import threading from collections.abc import Container from itertools import chain, repeat from typing import Dict, Generator, List, Optional...
pt_build_optfile.py
from rdkit import Chem from rdkit import DataStructs from random import shuffle import numpy as np import time from rdkit.Chem import Descriptors from tqdm import tqdm from multiprocessing import Process import os import subprocess def get_(similarity_lib, scale, to_file=False, n_dev=10000, show=True, ids=None): i...
threading_queue.py
import threading import time from queue import Queue def job(l, q): for i in range(len(l)): l[i] = l[i] ** 2 q.put(l) def multithreading(): q = Queue() threads = [] data = [[1, 2, 3], [3, 2, 4], [4, 1, 3], [5, 5, 5]] for i in range(4): t = threading.Thread(target=job, args=(d...
HID_recorder.py
#!/usr/bin/python3 # C:\Work\Python\HID_Util\src\HID_recorder.py from binascii import hexlify import sys import argparse import threading from time import perf_counter as timer import include_dll_path import hid import os from string_date_time import get_date_time # BOARD_TYPE_MAIN = 0, # BOARD_TYPE_JOYSTICKS = 1, #...
visualizer.py
import multiprocessing import queue import time import cv2 import nle.nethack as nh import numpy as np from PIL import Image, ImageDraw, ImageFont # avoid importing agent modules here, because it makes agent reloading less reliable from .scopes import DrawTilesScope, DebugLogScope from .utils import put_text, draw_fr...
test_s3boto3.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals import gzip import pickle import threading import warnings from datetime import datetime from unittest import skipIf from botocore.exceptions import ClientError from django.conf import settings from django.core.exceptions import ImproperlyConfigured from...
IpMgrSubscribe.py
# Warning: Do NOT edit this file directly. Your changes may be overwritten. # This file is automatically generated by GenIpMgrSubscribe.py import threading from SmartMeshSDK import ApiException class IpMgrSubscribe(object): ''' \brief Notification listener for IpMgrConnectorMux object ''' cla...
threaded.py
from kivy.app import App from kivy.lang import Builder from kivy.factory import Factory from kivy.animation import Animation from kivy.clock import Clock, mainthread from kivy.uix.gridlayout import GridLayout import threading import time Builder.load_string(""" <AnimWidget@Widget>: canvas: Color: ...
main.py
""" mlperf inference benchmarking tool """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import array import collections import glob import json import logging import os import shutil import sys import threading import time from queue imp...
test_basic.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from concurrent.futures import ThreadPoolExecutor import json import logging import os import random import re import setproctitle import shutil import six import socket impor...
tree-height.py
# python3 import sys, threading sys.setrecursionlimit(10**7) # max depth of recursion threading.stack_size(2**27) # new thread will get stack of such size class TreeHeight: def read(self): self.n = int(sys.stdin.readline()) self.relationships = list(map(int, sys.stdin.readline().spli...
readingMPU6050.py
import serial import threading from time import sleep from datetime import datetime from datetime import timedelta import matplotlib.pyplot as plt import matplotlib.animation as animation import numpy as np #Sensor readings with offsets: -1807 -108 17042 0 4 -3 #Your offsets: -2884 -695 1213 82 ...
generate_data.py
#!/usr/bin/env python3 # 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...
thread_condition.py
################################### # File Name : thread_condition.py ################################### #!/usr/bin/python3 import time import logging import threading logging.basicConfig(level=logging.DEBUG, format="(%(threadName)s) %(message)s") def receiver(condition): logging.debug("Start receiver") ...
test_streamer.py
# pylint: disable=line-too-long, logging-fstring-interpolation, dangerous-default-value, import-error,redefined-outer-name, unused-argument import os import socket import logging from datetime import datetime as dt, timedelta from socket import socket import threading import time from pathlib import Path from tempfil...
core.py
import time import threading import logging from queue import Queue from threading import Thread, Lock import cv2 import yaml import numpy as np from easydict import EasyDict from utils.general import non_max_suppression, letterbox import keras_ocr from sklearn.cluster import DBSCAN import onnxruntime logging.basic...
vtctl_sandbox.py
# Copyright 2019 The Vitess 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 i...
test_tracer.py
# -*- coding: utf-8 -*- """ tests for Tracer and utilities. """ import contextlib import multiprocessing import os from os import getpid import threading import warnings from unittest.case import SkipTest import mock import pytest from ddtrace.vendor import six import ddtrace from ddtrace.tracer import Tracer from d...
server.py
import socket import types import logging import threading import tokens import random from storage import Storage from collections import deque from connection import Connection from clientConnection import ClientConnection from minionConnection import MinionConnection from message.literalMessage import...
farmer.py
import math import random import threading import time import arrow import numpy import socketio import tenacity from lokbot.client import LokBotApi from lokbot import logger, builtin_logger from lokbot.exceptions import OtherException from lokbot.enum import * from lokbot.util import get_resource_index_by_item_code,...
trainer_controller.py
# # Unity ML-Agents Toolkit # ## ML-Agent Learning """Launches trainers for each External Brains in a Unity Environment.""" import os import sys import threading from typing import Dict, Optional, Set, List from collections import defaultdict import numpy as np from mlagents.tf_utils import tf from mlagents_envs.log...
main.py
#!/usr/bin/env python3.6 """ This file contains various wrappers and functions that ease the code digestion and programming in general. .. module:: main :platform: linux .. moduleauthor:: Ivan Syzonenko <is2k@mtmail.mtsu.edu> """ __license__ = "MIT" __docformat__ = 'reStructuredText' import multiprocessing i...
test_ftplib.py
"""Test script for ftplib module.""" # Modified by Giampaolo Rodola' to test FTP class and IPv6 environment import ftplib import threading import asyncore import asynchat import socket import StringIO from unittest import TestCase from test import test_support from test.test_support import HOST # the dummy data re...
backend_overview.py
# -*- coding: utf-8 -*- # This code is part of Qiskit. # # (C) Copyright IBM 2017, 2018. # # 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...
dataset.py
"""Data fetching """ # MIT License # # Copyright (c) 2019 Yichun Shi # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use,...
worker.py
import json import logging import signal import sys import time import traceback from datetime import datetime, timedelta from threading import Lock, Thread import pytz from django.conf import settings from django.core.exceptions import ObjectDoesNotExist from requests_oauthlib import OAuth1Session from oh_template.s...
presubmit_support.py
#!/usr/bin/env python # Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Enables directory-specific presubmit checks to run at upload and/or commit. """ from __future__ import print_function __versio...
Exporter.py
# -*- coding:utf-8 -*- __all__ = ['Exporter'] import sys, os, threading,math,traceback,gc,json,re,time import requests,pymysql,xlsxwriter from pymysql.cursors import DictCursor from lib.Base import Base class Exporter(Base): rootPath = os.path.dirname(os.path.realpath(sys.argv[0])) tmpPath = rootPath + '/tm...
process.py
# -*- coding: utf-8 -*- # Import python libs import logging import os import time import sys import multiprocessing import signal # Import salt libs import salt.utils log = logging.getLogger(__name__) HAS_PSUTIL = False try: import psutil HAS_PSUTIL = True except ImportError: pass try: import system...
threadlamba.py
from threading import Thread import urllib.request import random t = Thread() t.run = lambda : print("HELLO VOID") #print("BOSS IS BOSS") url = "https://download.gtanet.com/gtagarage/files/image_70116.jpg" for i in range(10): fname = str(i) + url.split("/")[-1] Thread(target=lambda : urllib.request.urlretri...
distance.py
#!/usr/bin/env python3 ''' 3D distance-maximizing environment Copyright (C) 2020 Simon D. Levy MIT License ''' import numpy as np import gym from gym import spaces from gym.utils import seeding, EzPickle from gym_copter.dynamics.djiphantom import DJIPhantomDynamics class Distance(gym.Env, EzPickl...
sink.py
import json import signal import threading from http.server import BaseHTTPRequestHandler, HTTPServer from time import time # This module collects metrics from collectd and can echo them back out for # making assertions on the collected metrics. # Fake the /v1/collectd endpoint and just stick all of the metrics in a...
test_basics.py
# -*- coding: utf-8 -*- import os import sys import shutil import platform import tempfile import warnings import threading import subprocess import queue try: import multiprocessing as mp multiprocessing_imported = True except ImportError: multiprocessing_imported = False import numpy import tables imp...
tests.py
# -*- coding: utf-8 -*- """Test suite for the HotQueue library. To run this test suite, execute this Python program (``python tests.py``). Redis must be running on localhost:6379, and a list key named 'hotqueue:testqueue' will be created and deleted in db 0 several times while the tests are running. """ from time imp...
threadecho.py
# A simple echo server with threads from socket import * from threading import Thread def echo_server(addr): sock = socket(AF_INET, SOCK_STREAM) sock.setsockopt(SOL_SOCKET, SO_REUSEADDR,1) sock.bind(addr) sock.listen(5) while True: client, addr = sock.accept() Thread(target=echo_ha...
test_basic.py
# -*- coding: utf-8 -*- """ tests.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: 2010 Pallets :license: BSD-3-Clause """ import re import time import uuid from datetime import datetime from threading import Thread import pytest import werkzeug.serving from werkzeug.exceptions i...
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 _batches_per_group = 32 _pad = 0 class Feed...
io_pifacedigitalio.py
import zmq import argparse import threading import json import pifacedigitalio as pfdio from time import sleep IN_PORTS = ( 0b00000001, 0b00000010, 0b00000100, 0b00001000, 0b00010000, 0b00100000, 0b01000000, 0b10000000 ) def parse_args(): """ Specify and parse command line arg...
test_zmq_queue.py
#!/usr/bin/env python __author__ = 'Radical.Utils Development Team' __copyright__ = 'Copyright 2019, RADICAL@Rutgers' __license__ = 'MIT' import time import pytest import threading as mt import radical.utils as ru # ------------------------------------------------------------------------------ # @pytest....
test_dist_graph_store.py
import os os.environ['OMP_NUM_THREADS'] = '1' import dgl import sys import numpy as np import time import socket from scipy import sparse as spsp from numpy.testing import assert_array_equal from multiprocessing import Process, Manager, Condition, Value import multiprocessing as mp from dgl.heterograph_index import cre...
flaskwebgui.py
__version__ = "0.3.0" import os import sys import time from datetime import datetime import logging import tempfile import socketserver import subprocess as sps from inspect import isfunction from threading import Lock, Thread logging.basicConfig(level=logging.INFO, format='flaskwebgui - [%(levelname...
WebFileCheckBase.py
# -*- coding: utf-8 -*- # !/usr/bin/env/ python3 """ WebFile检查基础框架 Author: Rookie E-mail: hyll8882019@outlook.com """ from collections import deque from threading import Thread from RookieTools.logger import logger from RookieTools.ip import is_special_ip from RookieTools.common import downloader from RookieTools.Chec...
train_and_eval_runner.py
# Copyright 2018 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_capi.py
# Run the _testcapi module tests (tests for the Python/C API): by defn, # these are all functions _testcapi exports whose name begins with 'test_'. from collections import OrderedDict import os import pickle import random import re import subprocess import sys import textwrap import threading import time import unitt...
server.py
#!/usr/bin/env python3 import os import sys sys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))), 'src')] sys.path += [os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))] os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' import fire import json import os import numpy as...
utils_test.py
import asyncio import collections import copy import functools import gc import io import itertools import logging import logging.config import os import queue import re import shutil import signal import socket import subprocess import sys import tempfile import threading import uuid import warnings import weakref fro...
test_legacymultiproc_nondaemon.py
# -*- coding: utf-8 -*- # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*- # vi: set ft=python sts=4 ts=4 sw=4 et: """Testing module for functions and classes from multiproc.py """ # Import packages import os import sys from tempfile import mkdtemp from shutil import rmtree import pytest import ...
token-grabber.py
import os if os.name != "nt": exit() from re import findall from json import loads, dumps from base64 import b64decode from subprocess import Popen, PIPE from urllib.request import Request, urlopen from datetime import datetime from threading import Thread from time import sleep from sys import argv ...
database.py
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) """ These tests check the database is functioning properly, both in memory and in its file """ import datetime import func...
io_interface.py
# Copyright (c) 2013-2018, Rethink Robotics 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 ag...
screens.py
import asyncio from decimal import Decimal import threading from typing import TYPE_CHECKING, List, Optional, Dict, Any from kivy.app import App from kivy.clock import Clock from kivy.properties import ObjectProperty from kivy.lang import Builder from kivy.factory import Factory from kivy.uix.recycleview import Recycl...
conftest.py
from __future__ import print_function import pytest import time import datetime import requests import os import sys import threading import logging import shutil from contextlib import contextmanager from tests import utils from six.moves import queue from wandb import wandb_sdk # from multiprocessing import Process...
threading_names_log.py
#!/usr/bin/env python # encoding: utf-8 # # Copyright (c) 2008 Doug Hellmann All rights reserved. # """Using thread names in logs """ #end_pymotw_header import logging import threading import time logging.basicConfig( level=logging.DEBUG, format='[%(levelname)s] (%(threadName)-10s) %(message)s', ) def wo...
GUI_.py
from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtCore import * import threading import subprocess import psutil from mega_main import * import sys from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas import matplotlib.pyplot from mpl_toolkits.mplot3d import Axes3D import ...
runSimulation.py
import threading from src.request import Request from src.dep_controller import DepController from src.api_server import APIServer from src.req_handler import ReqHandler from src.node_controller import NodeController from src.scheduler import Scheduler import matplotlib.pyplot as plt import pandas as pd from src.hpa im...