source
stringlengths
3
86
python
stringlengths
75
1.04M
DDoS_on_vsftpd.py
# Exploit Title: vsftpd 3.0.3 - Remote Denial of Service # Date: 22-03-2021 # Exploit Author: xynmaps # Vendor Homepage: https://security.appspot.com/vsftpd.html # Software Link: https://security.appspot.com/downloads/vsftpd-3.0.3.tar.gz # Version: 3.0.3 # Tested on: Parrot Security OS 5.9.0 #-------------------------...
general_tools.py
import os import fnmatch import subprocess from threading import Thread from scipy.stats import truncnorm import matplotlib.colors as colors import numpy as np def get_truncated_normal(mean=0., sd=1., low=0., upp=10.): return truncnorm( (low - mean) / sd, (upp - mean) / sd, loc=mean, scale=sd) def find(...
scraper.py
import time import threading import metrics import logging from cluster_clients import MockClient class Scraper(object): def __init__(self, logger, skyfire_delegate, kube_client, perceptor_clients, hub_clients, perceptor_pause, kube_pause, hub_pause): self.logger = logger self.skyfire_delegate = ...
get_my_faces.py
import cv2 import dlib import os import sys from scipy import misc import time from multiprocessing import Process, Queue from random import random import time import glob import facenet.src.align.detect_face as detect_face import numpy as np import tensorflow as tf #tasks_queue = JoinableQueue() results_queue = Queue...
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...
session.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
power_monitoring.py
import random import threading import time from statistics import mean from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog CAR_VOLTAGE_LOW_PASS_K = 0.091 # LPF gain for 5s tau...
ParadiseKGDownloader.py
from bs4 import BeautifulSoup from pyppeteer import launch from urllib import request import threading import requests import asyncio import getopt import queue import sys import os exitFlag = False def log(prefix, info): print("[" + prefix + "] " + info + ".") async def getContent(url): browser = await launch() ...
Examples.py
''' Este script tiene como propósito estudiar los threas y los procesos No Se aprecia dientecia con lo que sé. ¿Estoy midiendo bien? Aqui está mostrando que es mas rapido el tread ''' import time import multiprocessing as mp import threading as th def count_down(n): while n >0: n -=1 if __name__...
PMC_hits.py
import threading import pandas import requests from bs4 import BeautifulSoup result_dir = '../results/PMC-validation/' top_limit = 100 lncRNA_disease_prediction_path = '../data/lncRNA-disease-prediction.csv' base_url = 'https://www.ncbi.nlm.nih.gov/pmc/?term=' # https://www.ncbi.nlm.nih.gov/pmc/?term=(Breast+cancer)...
controller.py
from controller import correct_yaw, correct_roll, correct_pitch, correct_range, correct_vertical, correct_horizontal from data import data import threading # yaw correction def yaw(): correct_yaw.run() while correct_yaw.get_yaw_error() != correct_yaw.setpoint: correct_yaw.increment_single() print('...
serialize_tensorboard.py
# Copyright 2015 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...
gui.py
from tkinter import * from tkinter.messagebox import * import threading from mcts import MCTS from alpha import Alpha class Gomoku(): def __init__(self, row=19, column=19): self.row, self.column = row, column self.mesh = 25 self.half_mesh = self.mesh / 2 self.piece_r = 0.9 * self...
node1.py
import struct import json import psycopg2 as pg2 #import threading import logging from pysyncobj import SyncObj, SyncObjConf from pysyncobj.batteries import ReplCounter, ReplLockManager, SyncObjConsumer, replicated from time import time, sleep from contextlib import closing from fastapi import FastAPI, status ...
thanosied.py
import argparse import multiprocessing import time from copy import deepcopy from multiprocessing.dummy import Pool from couchbase.bucket import Bucket, LOCKMODE_WAIT, CouchbaseError, \ ArgumentError, NotFoundError, TimeoutError from couchbase.cluster import ServerTasks, PasswordAuthenticator from decorator import...
collision_control.py
import multiprocessing as mp from threading import Thread from common.constants import SCENE_GRID_BLOCK_WIDTH, SCENE_GRID_BLOCK_HEIGHT, SCENE_WIDTH, SCENE_HEIGHT from common.enums.climb_state import ClimbState from common.enums.collision_control_methods import CCMethods from common.enums.direction import Direction fro...
rbts_download_tablesServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
horse_racing_feature_manager.py
import pandas as pd import numpy as np import time from multiprocessing import Process def calculate_new_features(df1, y1, y2): st = time.time() length = len(df1) average = 0 sum_calc_time = 0 output_yz1_list = [] output_yz2_list = [] output_yz3_list = [] output_yz4_lis...
runner.py
import argparse import json import logging import threading from pyinstrument import Profiler from landia.client import GameClient from landia.config import GameDef, PlayerDefinition, ServerConfig from landia.content import Content from landia.common import StateDecoder, StateEncoder from landia.registry import lo...
session_debug_testlib.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...
test_basic.py
# -*- coding: utf-8 -*- #----------------------------------------------------------------------------- # Copyright (c) 2005-2021, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is...
jizicibot.py
# SPDX-License-Identifier: GLWTPL import asyncio import logging import threading from os import getenv from random import random from time import sleep import schedule from aiocqhttp import CQHttp, Event, Message, MessageSegment from config import ENABLED_GROUPS, HOST, PORT # Edit config.py logging.basicConfig( ...
tests.py
# Copyright 2021 Cortex Labs, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
test_api.py
""" mbed SDK Copyright (c) 2011-2014 ARM Limited Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in wr...
thermald.py
#!/usr/bin/env python3 import datetime import os import queue import threading import time from collections import OrderedDict, namedtuple from pathlib import Path from typing import Dict, Optional, Tuple import psutil from smbus2 import SMBus import cereal.messaging as messaging from cereal import log from common.di...
test_trio_endpoint_compat_with_asyncio.py
import asyncio import multiprocessing import pytest from lahja.asyncio import AsyncioEndpoint from lahja.common import BaseEvent, ConnectionConfig class EventTest(BaseEvent): def __init__(self, value): self.value = value def run_asyncio(coro, *args): loop = asyncio.get_event_loop() loop.run_un...
main.py
import sys from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * from PyQt5.QtWebEngineWidgets import * from PyQt5.QtWebChannel import * from PyQt5.QtGui import QDesktopServices from ffmpy3 import FFmpeg from multiprocessing import Process import filter import os, subprocess, time...
connection.py
# # A higher level module for using sockets (or Windows named pipes) # # multiprocessing/connection.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # # Modifications Copyright (c) 2020 Cloudlab URV # import time import selectors import threading import random import io import...
notification.py
# coding: utf-8 """ Slack notifications. """ __all__ = ["notify_slack"] import threading import logging import six from law.config import Config from law.util import escape_markdown logger = logging.getLogger(__name__) def notify_slack(title, content, attachment_color="#4bb543", short_threshold=40, token=None...
BBScan.py
#!/usr/bin/env python # -*- encoding: utf-8 -*- # A tiny Batch weB vulnerability Scanner # my[at]lijiejie.com http://www.lijiejie.com import urlparse import requests import logging import re import threading import Queue from bs4 import BeautifulSoup import multiprocessing import time from string import Template i...
__init__.py
"""PyVogen合成引擎""" #基于Vogen 7月28日代码 import tqdm import vogen import numpy import pyworld from typing import List,Optional from vogen.synth import f0 from vogen.synth import utils from vogen.synth import prosody from vogen.synth import acoustics from vogen.synth import timetable params=utils.Params() d...
bot.py
""" * Copyright 2019 Kamil Łobiński <kamilobinski@gmail.com>. * * 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...
grpc_interface.py
# Copyright 2021-present Ralf Kundel, Fridolin Siegmund # # 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...
run.py
#SPDX-License-Identifier: MIT """ Augur library commands for controlling the backend components """ from copy import deepcopy import os, time, atexit, subprocess, click, atexit, logging import multiprocessing as mp import gunicorn.app.base from gunicorn.arbiter import Arbiter from augur.housekeeper.housekeeper import...
utils.py
import queue import threading from django.db import connection def run_concurrently(fn, kwargs=None, num_threads=5): exceptions = queue.Queue() def worker(**kwargs): try: fn(**kwargs) except Exception as exc: exceptions.put(exc) else: exceptions.pu...
shot702_controller.py
""" Communicate with an OptoSigma SHOT-702 controller. """ from time import ( sleep, time, ) from threading import Thread from typing import Tuple from msl.qt import Signal from . import ( BaseEquipment, equipment, ) @equipment(manufacturer=r'OptoSigma', model=r'SHOT-702') class OptoSigmaSHOT702(Bas...
game.py
import os, sys, json, requests, random, time from threading import Thread from Crypto.Hash import SHA256 from Crypto.PublicKey import RSA from Crypto.Signature import pkcs1_15 sys.setrecursionlimit(500000) from flask import Flask, request app = Flask(__name__) # import logging # log = logging.getLogger('werkzeug')...
miniterm.py
#!C:\Users\redfa\Desktop\Neurohack\Neurohacking\venv\Scripts\python.exe # Very simple serial terminal # (C)2002-2011 Chris Liechti <cliechti@gmx.net> # Input characters are sent directly (only LF -> CR/LF/CRLF translation is # done), received characters are displayed as is (or escaped trough pythons # repr, useful fo...
ProtocolBaseClass.py
#!/usr/bin/env python # # (c) Copyright Rosetta Commons Member Institutions. # (c) This file is part of the Rosetta software suite and is made available under license. # (c) The Rosetta software is developed by the contributing members of the Rosetta Commons. # (c) For more information, see http://www.rosettacommons.or...
client.py
''' Module for network functionality ''' # !/usr/bin/env python3 import os import base64 import select import socket import json import datetime import traceback import threading import logging import netifaces as nf import database.db_helper as db_helper from opt.appearance import cprint from opt.strings import * ...
kambi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import json import multiprocessing import os.path import kambi.sumologic import kambi.statuspageio import kambi.metric import time import random class Kambi(object): def __init__(self): config_path = os.path.join( os.path.expanduser('~'), ...
mail.py
from flask_mail import Message from PrizeBondApp import mail from flask import render_template, current_app as app from threading import Thread from flask import flash from functools import wraps def production_mode(func): @wraps(func) def wrapper(*args, **kwargs): if app.debug: flash("Not ...
util.py
"""Utilities for working with mulled abstractions outside the mulled package.""" import collections import hashlib import logging import re import sys import tarfile import threading from io import BytesIO import packaging.version import requests log = logging.getLogger(__name__) QUAY_REPOSITORY_API_ENDPOINT = 'htt...
FTPListener.py
import logging import os import sys import threading import SocketServer import ssl import socket from . import * from pyftpdlib.authorizers import DummyAuthorizer from pyftpdlib.handlers import FTPHandler, TLS_FTPHandler from pyftpdlib.filesystems import AbstractedFS from pyftpdlib.servers import ThreadedFTPServe...
Get-Cloud-Music-Comments.py
#!/usr/local/bin/python3.7 # -*- coding: utf-8 -*- # @Author skillnull # @Function 获取网易云音乐评论 import os import random import sys import json import time import base64 import codecs import requests import multiprocessing # 多进程 from Crypto.Cipher import AES import re # 正则表达式库 import numpy as np # numpy数据处理库 import co...
generator.py
########################################################################################## # Copyright (c) MemSQL. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root for license information. ########################################################################################## "...
task.py
""" Created on Sep 14, 2017 @author: riteshagarwal """ import json import threading import zlib import copy import json as Json import os import random import socket import time from httplib import IncompleteRead from _threading import Lock from BucketLib.BucketOperations import BucketHelper from BucketLib.Memcached...
ArtWork Downloader.py
from Helper import main_function import PySimpleGUI as sg import os import time import threading from src.utils.txtDatabaseHandling import dict_to_json from src.utils.general import url_validator, artwork_url_verifier, image_counter, save_dir_global, successful_download_dict, ProgVars, print_Queue root_dir = os.path....
unit_test_Cache.py
import re import os import tempfile import time import random from unittest.mock import patch from collections import OrderedDict from multiprocessing import Process import synapseclient.core.cache as cache import synapseclient.core.utils as utils def add_file_to_cache(i, cache_root_dir): """ Helper function...
code.py
# Python program to create a table from tkinter import * import requests,threading,time from bs4 import BeautifulSoup class Table: def __init__(self,root): total_rows = len(lst) total_columns = len(lst[0]) # code for creating table for i in...
CustomTime.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "MPZinke" ########################################################################################## # # created by: MPZinke # on 2020.03.31 # # DESCRIPTION: # BUGS: # FUTURE: # #################################################################################...
utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
test_nogil.py
# Copyright (C) 2018-2022 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import time import pytest import os import io from threading import Thread import numpy as np from openvino.runtime import Core, Model, AsyncInferQueue, PartialShape, Layout, opset8 as ops, serialize from openvino.preprocess import PreP...
task.py
import atexit import json import os import shutil import signal import sys import threading import time from argparse import ArgumentParser from logging import getLogger from operator import attrgetter from tempfile import mkstemp, mkdtemp from zipfile import ZipFile, ZIP_DEFLATED try: # noinspection PyCompatibili...
test_tf_model.py
# Copyright 2020-present Tae Hwan Jung # # 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...
pants_daemon.py
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import logging impor...
patcher_test.py
import os import shutil import sys import tempfile from eventlet.support import six from tests import LimitedTestCase, main, run_python, skip_with_pyevent base_module_contents = """ import socket try: import urllib.request as urllib except ImportError: import urllib print("base {0} {1}".format(socket, urllib...
test_web_api.py
import unittest from multiprocessing import Process import os from web_api import * from .helpers.input_file_helpers import * from stix_shifter.stix_translation.src.modules.splunk import stix_to_splunk DEFAULT_LIMIT = 10000 DEFAULT_TIMERANGE = 5 default_timerange_spl = '-' + str(DEFAULT_TIMERANGE) + 'minutes' class...
__init__.py
#!/bin/python3 # author: Jan Hybs import datetime from loguru import logger import sys from cihpc.cfg.cfgutil import find_valid_configuration import argparse import json import os import queue import subprocess import threading from flask import Flask, request from cihpc.cfg.config import global_configuration fr...
extraction_engine.py
# -*- coding: utf-8 -*- """The single process extraction engine.""" import collections import os import pdb import threading import time from dfvfs.lib import definitions as dfvfs_definitions from dfvfs.lib import errors as dfvfs_errors from dfvfs.resolver import resolver from plaso.containers import counts from pla...
cmdaq_gui.py
""" GUI launcher for magnetotransport DAQ for magnetic JJ research Implement only simple functions BB, 2016 """ import tkinter as tk from tkinter import filedialog import os, platform, sys, queue, time, threading, shlex, functools import subprocess as subp import signal import configparser #def call_daq(cmd, **kwarg...
worker.py
import sys import socket import threading import logging import json import time import os MASTER_HOST = os.getenv("MASTER_HOST", "localhost") MASTER_RESPONSE_PORT = 5001 thread_lock = threading.Lock() def init_logging(worker_id): logging.basicConfig( filename=f"../logs/worker{worker_id}.log", ...
webtransport_h3_server.py
import asyncio import logging import os import ssl import threading import traceback from urllib.parse import urlparse from typing import Any, Dict, List, Optional, Tuple # TODO(bashi): Remove import check suppressions once aioquic dependency is resolved. from aioquic.buffer import Buffer # type: ignore from aioquic....
test_cinderjit.py
# Copyright (c) Facebook, Inc. and its affiliates. (http://www.facebook.com) import _testcapi import asyncio import builtins import dis import gc import sys import threading import types import unittest import warnings import weakref from compiler.consts import CO_SUPPRESS_JIT, CO_NORMAL_FRAME from compiler.static impo...
test_crawler.py
import asyncio from multiprocessing import Process, Value from ctypes import c_int from pathlib import Path import os import signal from aiohttp.web import Application, Response, run_app import pytest from proxypool.proxy_crawler import proxy_crawler_test_run from proxypool.config import HOST, PORT phantomjs = pyte...
vidtest.py
#!/usr/bin/python # # python-v4l2capture # # This file is an example on how to capture a picture with # python-v4l2capture. # # 2009, 2010 Fredrik Portstrom # # I, the copyright holder of this file, hereby release it into the # public domain. This applies worldwide. In case this is not legally # possible: I grant anyon...
views.py
from django.shortcuts import render, redirect from .forms import TutorSignUpform, TutorProfile, PostAnAdForm, QualificationForm, ProfilePicture, AboutForm, VerifyForm from .models import Tutor, Invitaions, AboutAndQualifications, Verify,WishList,WishList_tut, Invitaions_by_academy from .models import PostAnAd as Post...
scdlbot.py
# -*- coding: utf-8 -*- """Main module.""" import gc import pathlib import random import shelve import shutil from datetime import datetime from multiprocessing import Process, Queue from queue import Empty from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404 from urllib.parse import urljoin, urlparse from...
mixins.py
# -*- coding: utf-8 -*- ''' :codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)` ============= Class Mix-Ins ============= Some reusable class Mixins ''' # pylint: disable=repr-flag-used-in-string # Import python libs from __future__ import absolute_import, print_function import os import sys...
TrissSimulator.py
import random from Triss import Triss from datetime import datetime, time import multiprocessing from threading import Thread # Create list of triss:es trissList = [] def createTrissList(start, end): print("Calling: createTrissList({},{})".format(start, end)) # Create 200000 triss for triss_number in ra...
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_client.py
#!/usr/bin/env python # Copyright 2012 James McCauley # # This file is part of POX. # # POX is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later ver...
app.py
from flask import Flask, render_template, request, jsonify from dotenv import load_dotenv import os from threading import Thread load_dotenv() API_KEY = os.getenv('API_KEY') API_SECRET = os.getenv('API_SECRET') app = Flask(__name__) from views import * from predictions import start_trade thread = Thread(target=star...
test_api.py
import mock import errno import re import socket import threading import time import warnings from unittest import TestCase import pytest from ddtrace.api import API, Response, UDSHTTPConnection from ddtrace.compat import iteritems, httplib, PY3, get_connection_response from ddtrace.internal.runtime.container import...
evaluate_policy.py
"""Author: Brandon Trabucco, Copyright 2019, MIT License""" from cs285.baselines.baseline import Baseline from cs285.distributions.continuous.gaussian import Gaussian from cs285.data.samplers.parallel_sampler import ParallelSampler import tensorflow as tf import threading import numpy as np class EvaluatePolicy(Bas...
liveserverfixture.py
import inspect import json import multiprocessing import socket import socketserver import time from contextlib import contextmanager from urlparse import urlparse, urljoin import pytest import requests from flask import request from flask.blueprints import Blueprint class liveFlaskServer(object): """ Help...
launch.py
# Copyright 2018 Datawire. 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 agr...
main.py
# -*- coding: utf-8 -*- """ ------------------------------------------------- File Name: main.py Description : 运行主函数 Author : JHao date: 2017/4/1 ------------------------------------------------- Change Activity: 2017/4/1: ----------------------------------------...
engine.py
#!/usr/bin/python import commands import glob import itertools import Queue import os import os.path import shutil import subprocess import sys import threading import time import traceback import zipfile import class_cache import symlink BUILD_DIR = "build" ICBM_PATH = os.path.abspath(os.path.dirname(__file__)) cl...
test_client.py
from __future__ import annotations import asyncio import functools import gc import inspect import logging import os import pickle import random import subprocess import sys import threading import traceback import types import warnings import weakref import zipfile from collections import deque from collections.abc i...
jfrc_video_server.py
#!/usr/bin/env python import sys import io import os import shutil import json from subprocess import Popen, PIPE from string import Template from struct import Struct from threading import Thread from time import sleep, time from http.server import HTTPServer, BaseHTTPRequestHandler from wsgiref.simple_server import ...
test_httplib.py
import errno from http import client import io import itertools import os import array import socket import unittest TestCase = unittest.TestCase from test import support here = os.path.dirname(__file__) # Self-signed cert file for 'localhost' CERT_localhost = os.path.join(here, 'keycert.pem') # Self-signed cert fil...
apso.py
# coding: utf-8 from __future__ import unicode_literals import uno import unohelper import ast import traceback import webbrowser from sys import getfilesystemencoding, version_info from threading import Thread from subprocess import call as sub_call from apso_utils import console, msgbox, getConfigurationAccess, get...
test_gauge.py
"""Unit tests for gauge""" # pylint: disable=protected-access # pylint: disable=too-many-lines from collections import namedtuple import random import re import shutil import tempfile import threading import time import os import unittest from unittest import mock from http.server import HTTPServer, BaseHTTPRequestH...
lyr_chaseRainbow2.py
#!/usr/bin/python import pxlBuffer as pxb import random from time import sleep import time import math from collections import deque def wheel(pos, brightness): """Generate rainbow colors across 0-255 positions.""" if pos < 85: return pxb.Color(pos * 3 * brightness, (255 - pos * 3) * brightness, 0) elif pos < 17...
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...
updater.py
import logging import os import shutil import zipfile from concurrent.futures import ThreadPoolExecutor, wait from threading import Thread from urllib.request import urlopen import boto3 import requests from bs4 import BeautifulSoup import newstools logger = logging.getLogger() logger.setLevel(logging.INFO) def ge...
basic.py
# -*- coding: utf-8 -*- """ theflasktest.testsuite.basic ~~~~~~~~~~~~~~~~~~~~~ The basic functionality. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import re import uuid import flask import pickle import unittest from datetime import datetime from thre...
standalone_test.py
"""Tests for acme.standalone.""" import os import shutil import threading import tempfile import time import unittest from six.moves import http_client # pylint: disable=import-error from six.moves import socketserver # pylint: disable=import-error import requests from acme import challenges from acme import crypt...
test_autograd.py
import contextlib import gc import sys import io import math import random import tempfile import time import threading import unittest import warnings from copy import deepcopy from collections import OrderedDict from itertools import product, permutations from operator import mul from functools import reduce, partial...
run_server.py
import argparse parser = argparse.ArgumentParser() parser.add_argument("keyfile", help="file with list of valid authentication keys") args = parser.parse_args() with open(args.keyfile) as fh: AUTH_KEYS = [line.strip() for line in fh.readlines()] AUTH_KEYS = filter(None, AUTH_KEYS) print "valid keys:", AUTH...
thread13.py
# Python Program Where Thread Communication Is Done Through Notify() And Wait() Methods Of Condition Object ''' Function Name : Thread Communication Is Done Through Notify() And Wait() Function Date : 5 Oct 2020 Function Author : Prasad Dangare Input : String Output : String,Int...
system_event_logs.py
import os.path import zipfile from copy import deepcopy from datetime import datetime, timedelta from random import choice, randint from threading import Thread, Lock from time import time from BucketLib.BucketOperations_Rest import BucketHelper from BucketLib.bucket import Bucket from Cb_constants import CbServer fro...
application.py
import email import imaplib import threading from PySide2 import QtCore, QtWidgets, QtMultimedia from telethon.sync import TelegramClient from controllers.c_main import CMain from models.config_data import ConfigData from models.my_email import MyEmail from windows.app_main_window import AppMainWindow class App(QtW...
test_logging.py
# Copyright 2001-2017 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
wordnet_app.py
# Natural Language Toolkit: WordNet Browser Application # # Copyright (C) 2001-2020 NLTK Project # Author: Jussi Salmela <jtsalmela@users.sourceforge.net> # Paul Bone <pbone@students.csse.unimelb.edu.au> # URL: <http://nltk.org/> # For license information, see LICENSE.TXT """ A WordNet Browser application whic...
script2.py
import torch from torch import optim, nn from torch.functional import F import torch.multiprocessing as mp def train(net): # Construct data_loader, optimizer, etc. for i in range(5): data = torch.randn((num_samples, input_size)).to(device) labels = torch.randint(0, 2, (num_samples, 1)) ...
testing.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Author: leeyoshinari import os import re import time import shutil from threading import Thread from git import Repo from sendEmail import sendMsg from logger import logger, cfg, handle_exception class Testing(object): def __init__(self): self...
reduction.py
# # Module to allow connection and socket objects to be transferred # between processes # # multiprocessing/reduction.py # # Copyright (c) 2006-2008, R Oudkerk --- see COPYING.txt # __all__ = [] import os import sys import socket import threading import _multiprocessing from multiprocessing import c...
vpp_papi.py
#!/usr/bin/env python3 # # Copyright (c) 2016 Cisco and/or 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 require...