source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
loader.py | """
The Salt loader is the core to Salt's plugin system, the loader scans
directories for python loadable code and organizes the code into the
plugin interfaces used by Salt.
"""
import contextvars
import copy
import functools
import importlib
import importlib.machinery # pylint: disable=no-name-in-module,import-erro... |
scaler.py | """
Central component of this autoscaling system.
@author: fernandez
"""
import math
from time import time, sleep
from conpaas.services.webservers.manager.autoscaling import log
from conpaas.services.webservers.manager.autoscaling.performance import StatUtils
from conpaas.services.webservers.manager.autoscaling.cos... |
installwizard.py |
from functools import partial
import threading
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.properties import ObjectProperty, StringProperty, OptionProperty
from kivy.core.window import Window
from kivy.uix.button import Button
from kivy.utils import platform
from kivy... |
toy_dist.py | import os
import torch
import torch.distributed as dist
from torch.multiprocessing import Process
from torchvision import datasets
from torchvision import transforms
from torch import nn
from torch.nn import functional as F
from random import Random
from math import ceil
from torch import optim
""" Dataset partitionin... |
subproc_vec_env.py | import multiprocessing as mp
from collections import OrderedDict
from typing import Any, Callable, List, Optional, Sequence, Tuple, Type, Union
import gym
import numpy as np
from stable_baselines3.common.vec_env.base_vec_env import (
CloudpickleWrapper,
VecEnv,
VecEnvIndices,
VecEnvObs,
VecEnvStep... |
app.py | # ElectrumSV - lightweight Bitcoin client
# Copyright (C) 2019 ElectrumSV developers
#
# 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 ... |
xla_client_test.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
tester.py | import threading
import client
import Security
if __name__ == '__main__':
user_object = client.Babble('vmTesting', 'vmTesting')
def receive():
while True:
user_object.received_message()
# Receive Message Thread
thread = threading.Thread(target=receive)
thread.start()
# ... |
generator.py | #!/usr/bin/env python3
from scapy.all import *
import requests
from random import randint
from base64 import b64encode as b64e
from re import findall
from multiprocessing import Process
from time import sleep
import sys
def generate_dns_flag(section):
packet = IP(dst='1.0.1.0')/\
UDP(dport=53)/\
DNS(rd=1, qd=DN... |
serving.py | # -*- coding: utf-8 -*-
"""
werkzeug.testsuite.serving
~~~~~~~~~~~~~~~~~~~~~~~~~~
Added serving tests.
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import sys
import time
import urllib
import httplib
import unittest
from functools import update_wrapper
f... |
test_InfoExtractor.py | #!/usr/bin/env python
from __future__ import unicode_literals
# Allow direct execution
import io
import os
import sys
import unittest
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from test.helper import FakeYDL, expect_dict, expect_value, http_server_port
from youtube_dlc.compat im... |
generate_forward_data.py | import data_utils
import constructor
import params
import random
import torch
import pickle
import time
import os
args = params.get_args()
#args.partial_lm = True
#args.num_props = 4248
#args.gen_lm = True
if args.partial_lm:
lm = data_utils.build_language_model(args.num_props, new=args.gen_lm, _all=False)
co... |
sigs.py | from threading import Thread, Lock
mutex = Lock()
mutex.acquire()
mutex.release()
CRASH_STATUS = None
def processData(data):
return
#t = Thread(target = processData, args = (0,))
#t.start()
|
handbrake_wrapper.py | #!/user/bin/env python3
# Inspired by https://stackoverflow.com/a/49178529/967410
import json
import logging
import logging.config
import re
import sys
import threading
import time
from datetime import datetime
from json import JSONDecodeError
from typing import Any
import zmq
from sarge import run, Capture
from thr... |
engine.py | import time
import typing
from collections import Callable
from threading import Thread
import cv2
import logging
import pywintypes
from fishy.engine.IEngine import IEngine
from fishy.engine.semifisher import fishing_event
from .fishing_event import HookEvent, StickEvent, LookEvent, IdleEvent
from .fishing_mode impo... |
test_windows_events.py | import os
import signal
import socket
import sys
import subprocess
import time
import threading
import unittest
from unittest import mock
if sys.platform != 'win32':
raise unittest.SkipTest('Windows only')
import _overlapped
import _testcapi
import _winapi
import asyncio
from asyncio import windows_events
from t... |
mod_server_turret_extended109.py | # -*- coding: utf-8 -*-
import datetime
import re
import random
import string
import os
import json
import codecs
import urllib2
import urllib
import threading
import BigWorld
import CommandMapping
import VehicleGunRotator
from gui.app_loader import g_appLoader
from gun_rotation_shared import decodeGunAngles
from con... |
test_proxy_scale.py | import multiprocessing
import pytest
from customize.milvus_operator import MilvusOperator
from common import common_func as cf
from common.common_type import CaseLabel
from scale import scale_common as sc, constants
from utils.util_log import test_log as log
from utils.util_k8s import wait_pods_ready, read_pod_log
fro... |
missionmanifest.py | import random
import discord
from discord.ext import commands
from discord import Embed
import os
import re
import datetime
import sqlite3
from time import sleep
from threading import Thread, Lock
import asyncio
from typing import List, Tuple, Dict
import pickle
import atexit
datetime_fmt = re.compile(r"(\d{4})-((?:0... |
tests.py | import os
import sys
import subprocess
import time
import threading
import random
MAX_SLEEP = 5 # seconds
def build_get_topic(topic, is_random=False):
def _get_topic():
if not is_random:
return topic
return random.choice(['a', 'b', 'c', 'd', 'e'])
return _get_topic
def publish(por... |
expired_checker.py | import time
import win32process
import threading
from twisted.web.http import stringToDatetime
class ExpiredChecker(object):
def __init__(self, time_expired, interval=20 * 60):
self.time_expired = time_expired
self.interval = interval
self._thread_check = threading.Thread(target=self.thread_check)
... |
ml_machine_launcher.py | # -*- coding: utf-8 -*-
"""
Created on Thu Aug 2 16:10:17 2018
@author: Lionel Massoulard
"""
import time
import argparse
from enum import Enum
import pandas as pd
from multiprocessing import Process
from aikit.ml_machine.ml_machine import AutoMlConfig, JobConfig, MlJobManager, MlJobRunner, AutoMlResultReader
fro... |
leaky_bucket_error_count.py | #!/usr/bin/env python2
import threading
from threading import Timer
from collections import defaultdict
import time
import logging
"""
references:
- http://blog.ianbicking.org/good-catch-all-exceptions.html
"""
class LeakingErrorCounter():
"""A leaky bucket type of exception counter
@param decay_rate dec... |
main.py | import logging
import os
from threading import Thread
import traceback
from tcp import TcpServer
from config import Config
def setup_logging():
if Config.LOG_FILE:
os.makedirs(Config.LOG_DIR, exist_ok=True)
logging.basicConfig(format=Config.LOG_FORMAT,
filemode=Config.... |
covid_code.py | #do all the imports
import requests
import bs4
import tkinter as tk
import plyer
import time
import datetime
import threading
#get html data of website
def get_html_data(url) :
data = requests.get(url)
return data
#parsing html and extracting data
def get_corona_detail():
url = "https://ww... |
util.py | # coding: utf-8
import sys
import time
from math import ceil
import threading
def progressbar(percent, end=1, bar_length=40, slug='#', space='-'):
percent = percent / end # float
slugs = slug * int( round( percent * bar_length ) )
spaces = space * ( bar_length - len( slugs ) )
bar = slugs + spaces
... |
tensorFI.py | #!/usr/bin/python
# Library for performing fault injections into TensorFlow graphs (in place)
# Uses the fault injection functions defined in modifyGraph and ficonfig
import tensorflow as tf
import printGraph as pg
import modifyGraph as mg
from injectFault import initFIConfig, initFILog, logRun
from fiConfig import c... |
ping_host.py | #!/usr/bin/env python3.6
"""
fping
Output options:
-a, --alive show targets that are alive
-A, --addr show targets by address
-C, --vcount=N same as -c, report results in verbose format
-D, --timestamp print timestamp before each output line
-e, --elapsed show elapsed time on r... |
tests.py | from threading import Lock, Thread
from django.http import HttpRequest, HttpResponse
from django.test import TestCase
from nose.tools import eq_
from multidb import (DEFAULT_DB_ALIAS, MasterSlaveRouter,
PinningMasterSlaveRouter, get_slave)
from multidb.middleware import (PINNING_COOKIE, PINNING_S... |
dijkstra.py | # Copyright 2016 Uber Technologies, 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 ... |
idle_manager.py | import time
import collections
import threading
from pynput import mouse, keyboard
from pype.api import Logger
class IdleManager(threading.Thread):
""" Measure user's idle time in seconds.
Idle time resets on keyboard/mouse input.
Is able to emit signals at specific time idle.
"""
time_callbacks =... |
parse_david.py | """
Code to parse
https://www.davidrumsey.com
"""
from bs4 import BeautifulSoup
import os
from urllib import request
import numpy as np
from multiprocessing import Process
from threading import Thread
header = { 'User-Agent' : 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)' }
#url = "https://www.davidr... |
test.py | import json
import os.path as p
import random
import socket
import subprocess
import threading
import time
import avro.schema
import kafka.errors
import pytest
from confluent.schemaregistry.client import CachedSchemaRegistryClient
from confluent.schemaregistry.serializers.MessageSerializer import MessageSerializer
fro... |
conftest.py | import collections
import contextlib
import threading
import platform
import sys
import pytest
import trustme
from tornado import web, ioloop
from dummyserver.handlers import TestingApp
from dummyserver.server import run_tornado_app
from dummyserver.server import (
DEFAULT_CA,
DEFAULT_CA_KEY,
CLIENT_INTER... |
l7a.py | from queue import Queue
from optparse import OptionParser
import time,sys,socket,threading,logging,urllib.request,random
def sedot_parameters():
global ip,host,port,thr,item,referer,uri,path,method,isbot
ip = "118.98.73.214"
host = "www.google.com"
port = 80
thr = 500
path = "/"
uri = "/" # lokasi/ha... |
snmpbrute.py | #!/usr/bin/env python
# Requires metasploit, snmpwalk, snmpstat and John the Ripper
# _____ _ ____ _______ ____ __
# / ___// | / / |/ / __ \ / __ )_______ __/ /____
# \__ \/ |/ / /|_/ / /_/ / / __ / ___/ / / / __/ _ \
# ___/ / /| / / / / ____/ / /_/ / / / /_/ / /_/ __/
#/____/_/ |_/_... |
client.py | from threading import Thread, current_thread, local
from random import randint, random
from time import sleep
from socket import socket, AF_INET, SOCK_STREAM
from port import PORT
def rc():
'Return random numbers for coordinates'
return randint(-300, 300)
colors = ('red', 'blue', 'yellow', 'brown', 'green',... |
hatdecrypter.py | #!/usr/bin/env python
import crackers, threading, time, itertools
from crackers import *
def wordpress(hash):
wp = threading.Thread(target=wpPHPass(hash)).start()
def saltanduser(hash, type):
spu = threading.Thread(target=userOne(hash, type, options.user)).start()
hshpu = threading.Thread(target=userTw... |
updata_Process_list.py | # -*-encoding:utf-8-*-
from multiprocessing import Process, Manager
from time import sleep
def thread_a_main(sync_data_pool): # A 进程主函数,存入100+的数
for ix in range(100, 105):
sleep(1.)
sync_data_pool.append(ix)
def thread_b_main(sync_data_pool): # B 进程主函数,存入300+的数
for ix in range(300, 309):
... |
wsdump.py | #!c:\users\batle\pycharmprojects\rentomatic\venv\scripts\python.exe
import argparse
import code
import sys
import threading
import time
import ssl
import gzip
import zlib
import six
from six.moves.urllib.parse import urlparse
import websocket
try:
import readline
except ImportError:
pass
def get_encoding(... |
test_logging.py | #!/usr/bin/env python
#
# Copyright 2001-2004 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 n... |
server.py | from socket import *
import threading
import os
from util.DBManager import updateIoTData
from util.DBManager import updateAndroidData
from util.DBManager import requestAndroidDataToIoT
from util.jsonManager import JsonToDataManager
from util.serverLog import LogD
from util.serverLog import setLogDirectory
Debug = 1
... |
GUI.py |
from datetime import datetime
from tkinter import *
import tkinter as tk
import stepper
import numpy as np
import cv2
from PIL import Image, ImageTk
import threading
from random import randint
import time
import datetime as dt
GPIO_pins = (14, 15, 18)
direction= 20 # Direction -> GPIO Pin
step = 21
reset = ... |
elk_hunter.py | #!/usr/bin/env python3
import argparse
from configparser import ConfigParser
from datetime import datetime, timedelta
import glob
import logging
import logging.config
import os
import os.path
from queue import Queue, Empty
import re
import signal
import sys
import threading
import time
import traceback
import requests... |
skeletonAppiumRealOrVirtual.py | ####################################################################
# Skeleton for Appium tests on Sauce Labs RDC
####################################################################
###################################################################
# Imports that are good to use
###################################... |
ssh.py | #!/usr/bin/python
import getopt
import sys
from threading import Thread
from datetime import datetime
import uuid
sys.path = [".", "lib"] + sys.path
from platform_utils.remote.remote_util import RemoteMachineShellConnection
import TestInput
import logging.config
logging.config.fileConfig("scripts.logging.conf")
log ... |
webrtc_out_wait_answer.py | import mp as pn
import numpy
import cv2
from io import BytesIO
import time
import argparse
import json
import sys
import signal
import os
import threading
import asyncio
import websockets
import ssl
import random
import gi
gi.require_version('Gst', '1.0')
gi.require_version('GstWebRTC', '1.0')
gi.require_version('GstS... |
flamingo_check_analyses.py | import os
import inspect
import logging
import threading
#import pandas as pd
from oasislmf.utils import (
log,
db,
conf,
)
from flamingo_utils import * #do_poll_analysis
from flamingo_db_utils import * #get_stalled_analyses
CURRENT_DIRECTORY = os.path.dirname(os.path.abspath(inspect.getfile(inspect.cur... |
santaClaus.py | #!/usr/bin/python3
'''
Martinez Hernandez Niver Asaid
Problema: Santa Claus
Plateamiento:
- Santa Claus duerme en el Polo Norte mientras sus elfos
trabajan frenéticamente en la construcción de millones de
nuevos juguetes
- A veces se topan con un problema — Pueden pedir ayuda a
Santa Claus, pero sólo de tres ... |
testmain.py |
import cv2
from threading import Thread
from PIL import Image, ImageOps
import numpy as np
from tensorflow import keras
from home import *
from configparser import ConfigParser
from VideoGet import VideoGet
net = cv2.dnn.readNet("yolov3_training_4000.weights", "yolov3_testing.cfg")
layer_names = net.getL... |
discretization.py | # Copyright (c) 2011-2016 by California Institute of Technology
# Copyright (c) 2016 by The Regents of the University of Michigan
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistrib... |
ofw.py | import getpass
import subprocess
import threading
from optimization.pyroServerManagement import PyroServerManagement
from utils_intern.messageLogger import MessageLogger
"""
Created by Gustavo Aragón on 14.03.2018
"""
import configparser
import os
import signal
import sys
import shutil
# import swagger_server.__ma... |
application.py | from utils.mailSender import mailSender
from flask import Flask, request, abort, url_for, redirect, render_template
import json, time, threading, datetime
class Application:
def __init__(self):
self.loadConfig()
self.app = Flask(__name__)
# Rotas da API
@self.app.route('/', methods... |
test_data_node_scale.py | import threading
import time
import pytest
from base.collection_wrapper import ApiCollectionWrapper
from common.common_type import CaseLabel
from common import common_func as cf
from customize.milvus_operator import MilvusOperator
from scale import constants
from pymilvus import connections
from utils.util_log import... |
powerserver3.py | #! /usr/bin/python3
import threading
import time
import datetime
import os
import sys
import re
import json
import urllib.request, urllib.parse, urllib.error
import urllib.request, urllib.error, urllib.parse
import base64
import solar_config
import http.server
from http.server import HTTPServer
# sys.stderr = open(... |
qdb.py | #!/usr/bin/env python
# coding:utf-8
"Queues(Pipe)-based independent remote client-server Python Debugger"
__author__ = "Mariano Reingart (reingart@gmail.com)"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__license__ = "LGPL 3.0"
__version__ = "1.03b"
# remote debugger queue-based (jsonrpc-like interface):
... |
md5_crash.py | # md5碰撞
import multiprocessing
import datetime
import hashlib
import string
import random
CHARS = string.digits + string.ascii_letters
def cmp_md5(substr, stop_event, str_len, start=0, size=20):
global CHARS
while not stop_event.is_set():
rnds = ''.join(random.choice(CHARS) for _ in range(size))
... |
iters.py | from __future__ import division
import math
# import multiprocessing
import itertools
import time
from decimal import *
from django.forms.models import model_to_dict
from core.models import Factor,Radiators,Horizontal,Vertical,Fins
class Iters(object):
counter=0
basic={}
core={}
tapping={}
lv={}
hv={}
cca={}
c... |
ADS1299_API.py | """
# file: ADS1299_API.py
# author: Frederic Simard (frederic.simard.1@outlook.com)
# version: Fall 2017
# descr: This files implements the basic features required to operate the ADS1299 using the SPI port
of a Raspberry Pi (tested on RPi 3, Raspbian Lite Jessie).
The API handles the commun... |
main_window.py | import re
import os
import sys
import time
import datetime
import traceback
from decimal import Decimal
import threading
import asyncio
from electrum.bitcoin import TYPE_ADDRESS
from electrum.storage import WalletStorage
from electrum.wallet import Wallet, InternalAddressCorruption
from electrum.paymentrequest import ... |
stream.py | # _____ ______ _____
# / ____/ /\ | ____ | __ \
# | | / \ | |__ | |__) | Caer - Modern Computer Vision
# | | / /\ \ | __| | _ / Languages: Python, C, C++
# | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer
# \_____\/_/ \_ \______ |_| \_\
# Li... |
ssh_utils.py | #!/usr/bin/env python
#
# Copyright (c) Greenplum Inc 2008. All Rights Reserved.
#
# This file contains ssh Session class and support functions/classes.
import cmd
import os
import sys
import socket
import threading
from gppylib.commands.base import WorkerPool, REMOTE, ExecutionError
from gppylib.commands.unix import ... |
moduloTello.py | # coding: utf8
import logging
import socket
import time
import threading
import cv2
from threading import Thread
try:
from .decorators import accepts
except:
try:
from decorators import accepts
except:
print("IMPOSIBLE IMPORTAR MODULO DECORATORS")
class Tello:
"""Python wrapper to interact with... |
endpoints.py | import copy
import json
import os
import pandas as pd
import shutil
import spacy
import sys
import threading
import time
import zipfile
from flask import send_file
from io import BytesIO
from numpy import random
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from api.active_sampler imp... |
scr_hlp.py | #!/usr/bin/env python3
# coding=UTF-8
import os
import shutil
import sys
import urllib.request
from time import sleep
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from usernames import Users, CustomException
from threading import Thread
def save_current_page(html... |
misc_utils.py | # -*- coding: utf-8 -*-
"""
Copyright (C) 2017 Sebastian Golasch (plugin.video.netflix)
Copyright (C) 2018 Caphm (original implementation module)
Miscellaneous utility functions
SPDX-License-Identifier: MIT
See LICENSES/MIT.md for more information.
"""
from __future__ import absolute_import, divisi... |
remove_nans_dmstack_parallel.py | # Remove nans from textfile output of dmstack and only extract few columns
# Author: Bhishan Poudel
#
# Filtering:
# 1. flag calib_psfCandidate==False
# 2. column deblend_nChild==0
# 3. ellipticity e = sqrt(e1^2 + e2^2) < 1.5
# 4. choose only few columns given below
# 5. remove nans from all these columns
# 6. change ... |
lldb_batchmode.py | # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or http://... |
clusterScaler.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... |
main.py | from flask import Flask, send_from_directory
from flask_cors import CORS
from flask_restful import Resource, Api, reqparse, abort
from config import debug
from db import currencies, trade_currencies, trades, eth_trades, engine
from utils import *
from contract_helper import getAddressFromPuzzleHash, getContractProgram,... |
pbo_depwalker.py | #!/usr/bin/python
import os
import subprocess
import sys
import threading
import armaclassparser
def dokanpbo_mount_pbos(src_folder):
dokanpbo_args = []
for root, dirs, files in os.walk(src_folder):
basename = os.path.basename(root)
if not basename.startswith('@'):
continue
... |
toy_test_parallel.py | # Copyright (C) 2018-2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#
# Parallel version of toy test example with skopt.benchmarks.branin
# https://scikit-optimize.github.io/stable/modules/generated/skopt.benchmarks.branin.html
#
# Three minima points
# (9.42478, 2.475)
# (3.141592, 2.275)
# (-3.14159... |
__init__.py | import ctypes
import logging
import threading
import time
from contextlib import contextmanager
from queue import Queue
from typing import Any, Callable, Dict, Generator, Iterable, List, Optional, Tuple, Union, cast
import attr
import hypothesis
import hypothesis.errors
import requests
from _pytest.logging import LogC... |
priorityQueue.py | import threading
import queue
import random
import time
def mySubscriber(queue):
while not queue.empty():
item = queue.get()
if item is None:
break
print("{} removed {} from the queue".format(threading.current_thread(), item))
queue.task_done()
time.sleep(1)
myQueue = queue.PriorityQueue(... |
calibration.py | import cv2
import numpy as np
import time
import os
import data_storage as ds
from PySide2.QtCore import QObject, Signal, Slot, Property
from sklearn.gaussian_process import GaussianProcessRegressor
from sklearn.gaussian_process import kernels
from threading import Thread
class Calibrator(QObject):
'''
An in... |
test_executors.py | import multiprocessing
import time
from datetime import timedelta
from unittest.mock import MagicMock
import pytest
import prefect
from prefect.utilities.executors import (
main_thread_timeout,
multiprocessing_timeout,
Heartbeat,
)
def test_heartbeat_calls_function_on_interval():
class A:
de... |
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 ... |
test_pcap.py | import os
import shutil
import queue
import subprocess
from multiprocessing import Process, Queue
from time import time
from fieldedge_pcap import pcap
TEST_DIR = './pcaps/samples'
TEST_INTERFACE = 'en0'
def is_corrupt(filename: str) -> bool:
try:
res = subprocess.run(['tshark', '-r', f'{filename}'], che... |
network_communication.py | """
RenderPipeline
Copyright (c) 2014-2016 tobspr <tobias.springer1@gmail.com>
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 right... |
gc_utils.py | import os
import queue
from threading import Thread
from eggroll.core.constants import StoreTypes
from eggroll.core.meta_model import ErStore
from eggroll.core.datastructure import create_simple_queue
from eggroll.utils.log_utils import get_logger
L = get_logger()
class GcRecorder(object):
def __init__(self, r... |
__init__.py | import os
import asyncio
import pathlib
import subprocess
from pathlib import Path
from queue import Queue
from threading import Thread
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from uvicorn import Config, Server
from jina import __version__, __resources_path__
from jina.logging.l... |
marathon_lb.py | #!/usr/bin/env python3
"""# marathon-lb
### Overview
The marathon-lb is a service discovery and load balancing tool
for Marathon based on HAProxy. It reads the Marathon task information
and dynamically generates HAProxy configuration details.
To gather the task information, marathon-lb needs to know where
to find Mar... |
ordercontroller.py | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved.
#
# This file is part of ewm-cloud-robotics
# (see https://github.com/SAP/ewm-cloud-robotics).
#
# This file is licensed under the Apache Software License, v. 2 except as noted
# otherwise in the LIC... |
socketcan.py | #
# Copyright (C) 2014-2016 UAVCAN Development Team <uavcan.org>
#
# This software is distributed under the terms of the MIT License.
#
# Author: Ben Dyer <ben_dyer@mac.com>
# Pavel Kirienko <pavel.kirienko@zubax.com>
#
from __future__ import division, absolute_import, print_function, unicode_literals
import... |
independent0.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import random
import math
import json
import threading
import numpy as np
import tensorflow as tf
import util
import coref_ops
import metrics
import optimization
from bert import tokenization
from be... |
dimse.py | """
Implementation of the DIMSE service provider.
"""
from io import BytesIO
import logging
import queue
import threading
from typing import TYPE_CHECKING, Tuple, Optional, Dict, Union, cast
from pynetdicom import evt
# pylint: disable=no-name-in-module
from pynetdicom.dimse_messages import (
C_STORE_RQ,
C_ST... |
pydoc.py | # uncompyle6 version 3.2.4
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:30:26) [MSC v.1500 64 bit (AMD64)]
# Embedded file name: pydoc
__author__ = 'Ka-Ping Yee <ping@lfw.org>'
__date__ = '26 February 2001'
__version__ = '$Revision: 88564 $'
__credits__ = 'Guido va... |
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... |
resolver.py | # -*- coding: utf-8 -*-
"""
resolver.py - A fast multi-threaded DNS resolver using the dnspython library
Examples:
# Importing the library
# from fastdns import resolver
# Resolving many DNS hosts
# >>> from pprint import pprint
# >>> r = resolver.Resolver(domain='cisco.com')
# >>> r.hostnames... |
tornado_threading.py | import time
import threading
import logging
from tornado.web import asynchronous, RequestHandler, Application
from tornado.ioloop import IOLoop
from tornado import stack_context
io_loop = IOLoop.instance()
class HangingHandler(RequestHandler):
@asynchronous
def get(self):
threading.Thread(target = la... |
line-tcr.py | #-*- coding: utf-8 -*-
import LINETCR
from LINETCR.lib.curve.ttypes import *
from datetime import datetime
import time,random,sys,json,codecs,threading,glob,re
cl = LINETCR.LINE()
cl.login(qr=True)
cl.loginResult()
ki.kk.kc.cl
print "login success"
reload(sys)
sys.setdefaultencoding('utf-8')
``````` botKey `````... |
lesson14_test.py | """Тесты для урока № 14"""
from typing import Any
from time import sleep
from random import random
from threading import Thread
from pytest import raises
from lesson14.implementations import (
SimpleIoC, IoCController, PolymorphIoC, ThreadSafeIoC, ThreadLocalIoC)
def test_simple_ioc():
def _found(value):
... |
plugin.py | from binascii import hexlify, unhexlify
from electrum.util import bfh, bh2u
from electrum.bitcoin import (b58_address_to_hash160, xpub_from_pubkey,
TYPE_ADDRESS, TYPE_SCRIPT,
is_segwit_address)
from electrum import constants
from electrum.i18n import _
from e... |
unit.py | """Support functionality for using twill in unit tests."""
import sys
import time
from io import StringIO
from multiprocessing import Process
from .parse import execute_file
HOST = '127.0.0.1' # interface to run the server on
PORT = 8080 # default port to run the server on
SLEEP = 0 # time to wait for the server... |
refactor.py | # Copyright 2006 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Refactoring framework.
Used as a main program, this can refactor any number of files and/or
recursively descend down directories. Imported as a module, this
provides infrastructure to write your own refactoring too... |
MyLabelPrint.py | # -*- coding: utf-8 -*-
import base64
import hashlib
import json
import os
import subprocess
import threading
import time
import ConnectionTracer
import barcode
import keyboard
import win32api
import win32con
import win32print
import win32ui
import wx
import wx.xrc
import qrcode
from PIL import ImageWin, Image, ImageD... |
prepro.py | # -*- coding: utf-8 -*-
import threading
import time
import numpy as np
import scipy
import scipy.ndimage as ndi
import skimage
# import tensorlayer as tl
from scipy import linalg
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates
from six.moves import range
from... |
server.py | from flask import Flask
from threading import Thread
app = Flask('')
@app.route('/')
def main():
return "Bot up and running..."
def run():
app.run(host="0.0.0.0", port=5001)
def keep_alive():
server = Thread(target=run)
server.start()
|
gcp_janitor.py | #!/usr/bin/env python3
# Copyright 2016 The Kubernetes 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 appl... |
ServiceRegistry.py | import threading
import requests
import time
import socket
import json
RegistryAddress = ""
def registry(serviceName, serverName, port = 9000, serviceRegistryAddress="http://127.0.0.1:8761/" ):
hostname = socket.gethostname()
ip_address = socket.gethostbyname(hostname)
global RegistryAddress
RegistryAd... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.