source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
reduction.py | #
# Module to allow connection and socket objects to be transferred
# between processes
#
# multiprocessing/reduction.py
#
# Copyright (c) 2006-2008, R Oudkerk
# Licensed to PSF under a Contributor Agreement.
#
from __future__ import absolute_import
__all__ = []
import os
import sys
import socket
import threading
f... |
io.py | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from collections import defaultdict
from concurrent.futures import ProcessPoolExecutor, ThreadPoolExecutor, Executor, Future, _base, as_c... |
fps.py | # -*- coding: utf-8 -*-
'''
@author: look
@copyright: 1999-2020 Alibaba.com. All rights reserved.
@license: Apache Software License 2.0
@contact: 390125133@qq.com
'''
'''FPS监控器
'''
import queue
import datetime
import time
import re
import threading
import os,sys
import copy
import csv
import traceback
... |
multi_moses.py | #!/usr/bin/env python
# Written by Michael Denkowski
#
# This file is part of moses. Its use is licensed under the GNU Lesser General
# Public License version 2.1 or, at your option, any later version.
'''Parallelize decoding with multiple instances of moses on a local machine
To use with mert-moses.pl, activate --... |
bttrc_ev3.py | #!/usr/bin/env python3
#
# Back To The Roots Communication
#
# 2020 - Rafael Urben | Matthew Haldimann
#
from bttrc import Chat, Morse, Printer
from multiprocessing import Process
import time
def processQueue():
Printer.processQueue()
def morse2chat():
while True:
Chat.send(Morse.enterText())
def... |
hybridworker.py | #!/usr/bin/env python3
# ====================================
# Copyright (c) Microsoft Corporation. All rights reserved.
# ====================================
import configparser
import os
import platform
import shutil
import subprocess
import sys
import threading
import time
import traceback
# import worker modul... |
trezor.py | from binascii import hexlify, unhexlify
import traceback
import sys
from electrum_axe.util import bfh, bh2u, versiontuple, UserCancelled
from electrum_axe.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub,
TYPE_ADDRESS, TYPE_SCRIPT, is_address)
from electrum_... |
subdoc_autotestgenerator.py | import queue
import copy
import json
import threading
from multiprocessing import Process
import couchbase.subdocument as SD
from membase.api.rest_client import RestConnection
from memcached.helper.data_helper import VBucketAwareMemcached
from lib.couchbase_helper.random_gen import RandomDataGenerator
from lib.couchb... |
sqlite3_autocommit.py | #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Illustrate the effect of autocommit mode.
"""
#end_pymotw_header
import logging
import sqlite3
import sys
import threading
import time
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s (%(threa... |
ARP_UDP.py | import logging
logging.getLogger("scapy.runtime").setLevel(logging.ERROR)
from scapy.all import *
import threading
from termcolor import colored
os.system("clear")
print("""
____ ___________ __________
| | \______ ______ )
| | /| | \| ___)
... |
cnn_utility_functions.py | #!/usr/bin/python
# PROGRAMMER: Luke Wilson
# DATE CREATED: 2021-10-12
# REVISED DATE: 2021-01-01
# PURPOSE: Provide utility functions for import into main
# - u1_get_input_args()
# - u2_load_processed_data(data_dir)
# - u3_process_data(transform_request)
# - u4_data_iterator(dict_datasets)
# - u5_time_limite... |
main.py | from argparse import ArgumentParser
import logging
import os
import sys
from threading import Thread
from time import sleep
from bottle import error, redirect, request, response, route, run, template
from requests import HTTPError
from fiodash.aklite import AkliteClient
from fiodash.templates import INDEX_TPL
loggin... |
web_server.py | import socket
import re
import multiprocessing
import time
# import dynamic.mini_frame
import sys
class WSGIServer(object):
def __init__(self, port, app, static_path):
# 1. 创建套接字
self.tcp_server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.tcp_server_socket.setsockopt(so... |
misc.py | import requests
import random
from datetime import datetime
from bs4 import BeautifulSoup
import threading
from six.moves import urllib
import socket
hds = [{'User-Agent': 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.6) Gecko/20091201 Firefox/3.5.6'},
{'User-Agent': 'Mozilla/5.0 (Windows NT 6.2) Ap... |
skipgram_item2vec.py | #!/usr/bin/env python3
# coding: utf-8
# File: (app)item2vector.py
# Author: maozida880
# Date: 21-01-18
import collections
import math
import random
import numpy as np
import tensorflow as tf
import common_io
import random
import queue
import time
import threading
tf.app.flags.DEFINE_string("tables", "初处理输入表,训练输入表 ... |
common.py | """Test the helper method for writing tests."""
import asyncio
from datetime import timedelta
import functools as ft
import json
import os
import sys
from unittest.mock import patch, MagicMock, Mock
from io import StringIO
import logging
import threading
from contextlib import contextmanager
from homeassistant import ... |
clientEncryptor.py | import random
import os
import threading
import queue
import socket
# Encryption function that the threads will call
def encrypt(key):
while True:
file = q.get()
print(f'Encrypting {file}')
try:
key_index = 0
max_key_index = len(key) - 1
enc... |
test_failure.py | import json
import logging
import os
import signal
import sys
import tempfile
import threading
import time
import numpy as np
import pytest
import redis
import ray
import ray.utils
import ray.ray_constants as ray_constants
from ray.exceptions import RayTaskError
from ray.cluster_utils import Cluster
from ray.test_uti... |
Hybrid_m_circles.py | import cv2
from tkinter import Tk
from tkinter.filedialog import askopenfilename
import numpy as np
import imutils
import threading
def main():
cap = cv2.VideoCapture(vid_path)
status1, previous_frame = cap.read()
total_frames = int(cap.get(cv2.CAP_PROP_FRAME_COUNT))
copy_frame = cv2.cvtColor... |
amqp_puka.py | from contexture import __version__
import json
import logging
import os
# import pika
import puka
from Queue import Queue, Full, Empty
import resource
import socket
import sys
import time
import threading
import uuid
# Don't make this __name__. Used by logging config to wire amqp handler.
LOGGER = logging.getLogger('... |
coap.py | import logging.config
import os
import random
import socket
import threading
import time
from coapthon import defines
from coapthon.layers.blocklayer import BlockLayer
from coapthon.layers.messagelayer import MessageLayer
from coapthon.layers.observelayer import ObserveLayer
from coapthon.layers.requestlaye... |
reader.py | # Copyright (c) 2019 PaddlePaddle 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 appli... |
tasks.py | from __future__ import with_statement
from functools import wraps
import inspect
import sys
import textwrap
from fabric import state
from fabric.utils import abort, warn, error
from fabric.network import to_dict, normalize_to_string, disconnect_all
from fabric.context_managers import settings
from fabric.job_queue im... |
smiler.py | import os
import subprocess
import re
import shutil
import threading
import signal
import logging
import time
from config import config
from granularity import Granularity
from instrumenting import manifest_instrumenter
from libs.libs import Libs
from instrumenting.apkil.smalitree import SmaliTree
from instrumenting.ap... |
main.py | # -*- coding: UTF-8 -*-
from functions import *
command = []
used = []
TIME_INTERVAL = 600 # 更换间隔 (秒)
running = r"D:\waifu2x-caffe\waifu2x-caffe-cui.exe" # waifu2x-coffe所在文件夹
path = r'D:\Sean\我的图片\WallPaper\osusume' # 壁纸文件所在的文件夹
tmp_path = r'D:\test\tmp' # 临时文件所在的文件夹
if not os.path.exists(tmp_path):
os.mkdir(t... |
cli.py | import argparse
import datetime
import sys
import threading
import time
import matplotlib.pyplot as plt
import numpy
import yaml
from .__about__ import __copyright__, __version__
from .main import (
cooldown,
measure_temp,
measure_core_frequency,
measure_ambient_temperature,
test,
)
def _get_ver... |
versionScraper.py | import urllib.request, urllib.error, urllib.parse
from bs4 import BeautifulSoup
import string
import json
from threading import Thread
def _getVanilla():
def _vanillaGetDirect(url):
user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'
headers = ... |
synchronization.py | #!/usr/bin/env python2.7
''' CONFIDENTIAL
Copyright (c) 2021 Eugeniu Vezeteu,
Department of Remote Sensing and Photogrammetry,
Finnish Geospatial Research Institute (FGI), National Land Survey of Finland (NLS)
PERMISSION IS HEREBY LIMITED TO FGI'S INTERNAL USE ONLY. THE CODE
MAY BE RE-LICE... |
minion.py | from arbiter import Minion
from multiprocessing import Process
from time import sleep
import logging
app = Minion(host="localhost", port=5672, user='user', password='password', queue="default")
@app.task(name="add")
def add(x, y):
logging.info("Running task 'add'")
# task that initiate new task within same a... |
variable_scope.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
dns_spoof.py | import os
from interface import Interface
from scapy.all import *
class DNSSpoof:
def __init__(self, interface, domain_file):
self.service = 'dnsmasq'
self.active = False
self.interface = Interface(interface, True)
self.interface.enable_sniff()
self.domain_file = domain_file
self.domains = list()
self.... |
message_processor.py | import re
import base64
import utils
import pandas as pd
from threading import Thread
from utils import log
from collections import Counter
from sym_api_client_python.clients.sym_bot_client import SymBotClient
from sym_api_client_python.processors.sym_message_parser import SymMessageParser
from .admin_processor import ... |
run.py | import requests
import json
import threading
import os
import glob
SUCCESS_LOGIN = 0
FAILED_LOGIN = 0
Threadtimeout = 60
ThreadPoolSize = 3
ValidEmails = []
storeThreads = []
def threadManager(function,Funcargs,Startthreshold,Threadtimeout=5):
if len(storeThreads) != Startthreshold:
storeThreads.append(threadi... |
test_contextvars.py | import unittest
import gc
import sys
from functools import partial
from greenlet import greenlet
from greenlet import getcurrent
try:
from contextvars import Context
from contextvars import ContextVar
from contextvars import copy_context
except ImportError:
Context = ContextVar = copy_context = None... |
logpump.py | import csv
import functools
import heapq
import logging
import re
import threading
import time
from datetime import datetime
from pathlib import Path
logger = logging.getLogger(__name__)
class Entry(list):
"""ログのエントリを表現するクラス"""
def __init__(self, row: list, category: str, ngs: bool):
super(Entry, se... |
MrBurner.py | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQtEngine import Ui_MainWindow
from SerialManager import SerialManager
from ConsoleManager import ConsoleManager
from FileManager import FileManager
from BurnerManager import BurnerManager
from time import sleep as delay
from Utils import Utils
import threading
import sy... |
datasets.py | import glob
import math
import os
import random
import shutil
import time
from pathlib import Path
from threading import Thread
import cv2
import numpy as np
import torch
from PIL import Image, ExifTags
from torch.utils.data import Dataset
from tqdm import tqdm
from utils.utils import xyxy2xywh, xywh2xyxy
help_url =... |
dotpy.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import tools
import time
import re
import db
import threading
class Source (object) :
def __init__ (self):
self.T = tools.Tools()
self.now = int(time.time() * 1000)
def getSource (self) :
sourcePath = './plugins/dotpy_source'
with... |
pollinotify_test.py | '''
Created on 30 Jun 2014
@author: julianporter
'''
import random
import unittest
import multiprocessing
import collections
import tempfile
import time
import os
import sys
from .actions import EventGenerator, EventObserver
class TestInotify(unittest.TestCase):
def __init__(self,methodName='r... |
Sample_MultiProcess.py | import multiprocessing as mp
from multiprocessing import Process, Pipe
import time
class InputDataClass:
input_data_1 = 0
input_data_2 = 0
def __init__(self, in1, in2):
self.input_data_1 = in1
self.input_data_2 = in2
class OutputDataClass:
output_data_1 = 0
output_data_2 = 0
... |
ui_context.py | import ravestate as rs
import ravestate_rawio as rawio
import ravestate_nlp as nlp
import ravestate_phrases_basic_en as lang
import ravestate_verbaliser as verbaliser
from .ui_model import UIActivationModel, UISpikeModel
from .session import SessionClient
from typing import Any, Tuple, List, Union, Dict, Optional, Ca... |
broadcast_listener.py | import socket
import threading
class BroadcastListener:
def __init__(self, channel, port):
self._request_channel = channel
self.listener = socket.socket(
socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP
)
# Enable to run multiple clients and servers on a single (h... |
licenseversion.py | #!/usr/bin/python
## Binary Analysis Tool
## Copyright 2011-2016 Armijn Hemel for Tjaldur Software Governance Solutions
## Licensed under Apache 2.0, see LICENSE file for details
import os, os.path, sys, subprocess, copy, cPickle, Queue
import multiprocessing, re, datetime
from multiprocessing import Process, Lock
fr... |
app.py | import sqlite3
import json
import datetime
import logging
import requests
import uuid
import RPi.GPIO as GPIO
from time import sleep
from threading import Thread
from flask_apscheduler import APScheduler
from flask import Flask, request, g, Response
from flask_restful import Resource, Api
from gpiozero import Button, O... |
epic_battle_royale.py | import argparse
import sys
import os
from pong_testbench import PongTestbench
from multiprocessing import Process, Queue
from matplotlib import font_manager
from time import sleep
import importlib
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument("dir", type=str, help="Directory with agents.")
... |
test_lock.py | import pytest
from conda.lock import DirectoryLock, FileLock, LockError
from os.path import basename, exists, isfile, join
def test_filelock_passes(tmpdir):
"""
Normal test on file lock
"""
package_name = "conda_file1"
tmpfile = join(tmpdir.strpath, package_name)
with FileLock(tmpfile) as ... |
translator.py |
import re
import threading
def parse_text(session, args):
print(threading.current_thread(), 'parse_text')
print(threading.enumerate(), 'parse_text')
bytes_list = args[0].split(',')
bytes_array = bytearray([int(i) for i in bytes_list]).decode()
sentences = bytes_array.split('\n')
va... |
capture_from_local-s11_4.py | #!/usr/bin/python
import os
import sys
import time
import json
import string
import socket
import subprocess
import multiprocessing
from multiprocessing import Process
import psutil as ps
from pprint import pprint
from libsstore import SStore
from urlparse import urlparse
from functools import partial
from urllib2 imp... |
runtest.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import re
import setproctitle
import string
import subprocess
import sys
import threading
import time
from collections import defaultdict, namedtuple, OrderedDict
import nu... |
database.py | import asyncio
import json
import os
import threading
import databases
import orm
import sqlalchemy
from functools import partial
from orm import Model, JSON, DateTime, Integer, String
from sqlalchemy.sql import func
from sqlalchemy.orm import sessionmaker
database = databases.Database(os.getenv('DATABASE_URL'))
met... |
client_discovery.py | import json
import logging
import threading
from functools import wraps
import grpc
from etcd3.events import PutEvent, DeleteEvent
from grpc_microservice.common.client import header_manipulator_client_interceptor
from grpc_microservice.common.exceptions import NoServerNodeException
from grpc_microservice.common.meta_c... |
copynet_batcher.py | # Copyright 2017 Google 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 writing, ... |
Chap10_Example10.32.py | from threading import *
class abc:
def __init__(self, seat_available):
self.seat_available = seat_available
self.mylock = Lock()
def abc_reserveseat(self, seat_required):
self.mylock.acquire()
print("Number of seats remaining : ", self.seat_available)
if sel... |
Quizzical_StreamlabsSystem.py | # ---------------------------------------
# Import Libraries
# ---------------------------------------
import sys
import clr
clr.AddReference("IronPython.SQLite.dll")
clr.AddReference("IronPython.Modules.dll")
import os
from threading import Thread, Event
from json import loads
from Queue import Queue
import traceback... |
util.py | from app import app, mail
from app.oauth import require_oauth
from app.models import User
from flask import render_template, url_for, abort, current_app, make_response
from flask_mail import Message
import functools
from authlib.flask.oauth2 import current_token
from authlib.specs.rfc6749 import OAuth2Error
from thread... |
stage_op_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... |
mod_getting_packets.py | #!/usr/local/bin/python3
# -*- coding: utf-8 -*-
# Встроенные модули
import time, sys, socket
from threading import Thread
# Внешние модули
try:
from scapy.all import *
except ModuleNotFoundError as err:
print(err)
sys.exit(1)
# Внутренние модули
try:
from mod_common import *
except ModuleNotFoundError as er... |
_testing.py | import bz2
from collections import Counter
from contextlib import contextmanager
from datetime import datetime
from functools import wraps
import gzip
import os
from shutil import rmtree
import string
import tempfile
from typing import Any, List, Optional, Union, cast
import warnings
import zipfile
import numpy as np
... |
WinPosManager.py | #!/usr/bin/python
# -*- coding: utf8 -*-
import win32gui
import win32con
import win32api
from io import StringIO
import datetime
import os, sys
import tkinter as tk
import threading
import SysRegEdit
import SysRunAdmin
import WinPosCore as wp
import SysTrayIcon as tray
import system_hotkey
# constant value
MIN_WIDTH ... |
test_util_test.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
variable-strained.py | import numpy as np
import pandas as pd
from scipy.interpolate import interp1d
import itertools as iter
import threading
import sys
import pathlib
import time
from time import sleep
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\... |
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... |
HiFiGANDataset.py | import os
import random
from multiprocessing import Manager
from multiprocessing import Process
import librosa
import soundfile as sf
import torch
from torch.utils.data import Dataset
from tqdm import tqdm
from Preprocessing.AudioPreprocessor import AudioPreprocessor
class HiFiGANDataset(Dataset):
def __init__... |
__init__.py | import struct
import datetime
import time
import socket
import argparse
import logging
import os
import traceback
import atexit
from threading import Event, Thread
import ncsbench.common.params as p
import ncsbench.common.socket as controll_socket
import ncsbench.common.packet as packet
ev3 = None
#TODO meassure diff... |
test_table_count.py | import random
import pdb
import pytest
import logging
import itertools
from time import sleep
from multiprocessing import Process
from milvus import IndexType, MetricType
from utils import *
dim = 128
index_file_size = 10
add_time_interval = 3
tag = "1970-01-01"
class TestTableCount:
"""
params means differen... |
DosFrame.py | import wx
import os
import re
import time
import threading
from DosLibrary import DosLibrary
from DosUtils import DosUtils
class DosFrame(wx.Frame):
def __init__(self):
self.endcallback = None
self.ser = None
self.amiga = None
self.execlib = None
self.doslib = None
se... |
tester.py | # Copyright (c) 2014-2016 Dropbox, 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... |
EMD_Parallel_Test.py | import pyhht
from pyhht.emd import EMD
from pyhht.visualization import plot_imfs
import numpy as np
import math
from pyhht.utils import extr
from pyhht.utils import get_envelops
import matplotlib.pyplot as plt
from pyhht.utils import inst_freq
import wfdb
import os
import sys
import glob
import GPUtil
import config
imp... |
QCWY.py | __author__ = 'Joynice'
from utils.utils import get_header, get_time
import requests
import queue
from lxml import etree
import threading
import os
import csv
class QCWY(object):
'''
前程无忧
:param
传入参数:关键字、城市、线程数
传出:csv文件
'''
def __init__(self, keyword, city='北京', thread=10, path=os.getcwd()... |
sdk_worker_main.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... |
sensor.py | """Sensor to monitor incoming/outgoing phone calls on a Fritz!Box router."""
import datetime
import logging
import re
import socket
import threading
import time
from fritzconnection.lib.fritzphonebook import FritzPhonebook
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homea... |
gpu_imagenet_bench.py | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... |
helpers.py | from pymongo import MongoClient
import pymongo
from collections import OrderedDict
from lxml import etree, html
import requests
import urllib2
import threading
NUM_OF_STUDENTS = 150
RESPONSE_COUNT = 0
NUM_OF_COLLEGES = 172
#BRANCH_CODES = ['bt', 'cv', 'ee', 'ec', 'te', 'is', 'cs', 'me']
BRANCH_CODES = ['is']
BASE... |
yandexwebdav.py | #!/usr/bin/python
# coding=utf-8
import os
import sys
import threading
import logging
import base64
import xml.dom.minidom
from six.moves import queue
from six.moves import http_client
from six import u, b, PY3
if PY3:
from urllib.parse import unquote, quote
else:
from urllib import unquote, quote
logger = ... |
pool-pi.py | from distutils.log import INFO
from commands import *
from threading import Thread
from model import *
from web import *
from parsing import *
from os import makedirs
from os.path import exists
from os import stat
import logging
from logging.handlers import TimedRotatingFileHandler
#TODO start this on pi startup
def... |
WtCtaOptimizer.py | import multiprocessing
import time
import threading
import json
import os
import math
import numpy as np
import pandas as pd
from pandas import DataFrame as df
from wtpy import WtBtEngine,EngineType
def fmtNAN(val, defVal = 0):
if math.isnan(val):
return defVal
return val
class P... |
main_window.py | import copy
from functools import partial
import os
import pickle
from threading import Thread
from PySide2 import QtCore, QtGui
from PySide2.QtGui import QKeyEvent
from PySide2.QtWidgets import (QApplication, QLabel, QSizePolicy, QMainWindow,
QScrollArea, QMessageBox, QAction, QFileDial... |
test_io.py | """Unit tests for the io module."""
# Tests of io are scattered over the test suite:
# * test_bufio - tests file buffering
# * test_memoryio - tests BytesIO and StringIO
# * test_fileio - tests FileIO
# * test_file - tests the file interface
# * test_io - tests everything else in the io module
# * test_univnewlines - ... |
queue_consumer.py | from logging import getLogger
import eventlet
from eventlet import event
import threading
from nameko_proxy.event_queue import EventQueue
from kombu import Connection
from kombu.messaging import Consumer
from kombu.mixins import ConsumerMixin
from nameko.constants import (
AMQP_URI_CONFIG_KEY, DEFAULT_SERIALIZER, ... |
router.py | from socket import (
socket,
SOCK_DGRAM,
SOL_SOCKET,
SO_REUSEADDR,
SOCK_STREAM,
SO_BROADCAST,
)
from time import sleep
from json import loads, dumps
from threading import Thread, Semaphore
from queue import Queue
from ..utils.network import (
Decode_Response,
Encode_Request,
Send_Bro... |
jayrboltonTestServer.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... |
WebLogin.py | #! /bin/env python
#coding:utf8
from threading import Thread
from Queue import Queue
from socket import error
from re import compile
from ConfigParser import *
#from os import *
import subprocess
import time
import paramiko
import sys
import signal
import Mobigen.Common.Log as Log
SHUTDOWN = False
def shutdown(sigNum... |
brutespray.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
from argparse import RawTextHelpFormatter
import readline, glob
import sys, time, os
import subprocess
import xml.dom.minidom
import re
import argparse
import argcomplete
import threading
import itertools
import tempfile
import shutil
from multiprocessing import Process
servic... |
ircthread.py | #!/usr/bin/env python
# Copyright(C) 2011-2016 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, m... |
test_tailchaser.py | import glob
import gzip
import logging
import logging.handlers
import os
import tempfile
import threading
import time
import six
from tailchaser.cli import main
from tailchaser.tailer import Tailer
def cmp_file(src_file, dst_file):
six.print_('testing: ', src_file, dst_file)
assert (Tailer.file_opener(src_f... |
test_client.py | import sys
import unittest
import threading
import multiprocessing
from stiqueue.sqserver import SQServer
from stiqueue.sqclient import SQClient
import os
import time
class ClientTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
time.sleep(1)
host = "127.0.0.1"
port = 1234
... |
make.py | import argparse
import datetime
import os, shutil
import json
from http.server import HTTPServer, SimpleHTTPRequestHandler
import threading
import re
import subprocess
CONFIG = 'docs/_config'
CONFIG_DATABASE = os.path.join(CONFIG, "db.json")
CONFIG_SITEMAP = os.path.join(CONFIG, "sitemap.xml")
SITE_BASEURL = 'https:/... |
main_window.py | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... |
__main__.py | from multiprocessing import Process
from numba import jit
import os, sys
import math
import time
# Initialises Pygame graphics library and hides debugging output
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
import pygame
os.environ['SDL_VIDEO_CENTERED'] = '0'
pygame.display.init()
pygame.font.init()
refresh_Rate... |
server.py | import socket
import threading
HEADER = 64
PORT = 5050
SERVER = socket.gethostbyname(socket.gethostname())
ADDR = (SERVER, PORT)
FORMAT = 'utf-8'
DISCONNECT_MESSAGE = "!DISCONNECT"
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind(ADDR)
def handle_client(conn, addr):
print(f"[NEW CONNECTION... |
sync.py | # Copyright 2014 OpenStack Foundation
# Copyright 2014 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENS... |
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 glob
import io
import json
import logging
from multiprocessing import Process
import os
import random
import re
import... |
arp_spoof.py | """
Based on ARP packets received, sends out spoofed ARP packets.
"""
from host_state import HostState
import scapy.all as sc
import threading
import utils
import time
# Min seconds between successive spoofed packets
MIN_ARP_SPOOF_INTERVAL = 0.01
# If we want to block a device, we should use the follow corrupt mac ... |
views.py | from binascii import hexlify, unhexlify
from passlib.hash import pbkdf2_sha256
from threading import Thread
from time import sleep
import os
from flask_login import login_user, login_required
from flask import (
render_template, request,
redirect, url_for, json,
jsonify, make_response, session
)
from a... |
receive_nii.py | #!/usr/bin/env python
import argparse
from collections import namedtuple
import os
import socket
import sys
from time import sleep
import threading
import SocketServer
import external_image
import nibabel as nb
import numpy as np
SocketServer.TCPServer.allow_reuse_address = True
class ThreadedTCPRequestHandler(Soc... |
test_random.py | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, assert_, assert_raises, assert_equal, assert_warns,
assert_no_warnings, assert_array_equal, assert_array_almost_equal,
suppress_warnings
)
fr... |
measure2.py |
from rabinkarp_parallel import RabinKarpParallel
from multiprocessing import Process, Queue, Lock
from doc_handle import DocumentHandle
import sys
def main(lock):
processes = []
R = Queue()
# number of threads
k = 3
prk = RabinKarpParallel()
doc = DocumentHandle()
# open name and content original document
... |
collect_data.py | from robot import Robot
import utils
import os
import time
import threading
import datetime
import argparse
import numpy as np
import cv2
from constants import workspace_limits, heightmap_resolution, DEPTH_MIN
class PushDataCollector():
def __init__(self, args):
# Create directory to save data
tim... |
main.py | import re
import requests
from os import _exit
from time import sleep
from random import choice,uniform
from threading import Thread
from argparse import ArgumentParser
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy,ProxyType
from fake_useragent import UserAgent
parser=ArgumentParser(... |
widgets.py | ###############################################################################
# Copyright (c) 2019, NVIDIA CORPORATION. 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.