source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
test_issue_631.py | import asyncio
import collections
import logging
import os
import threading
import time
import traceback
import unittest
import pytest
from integration_tests.env_variable_names import (
SLACK_SDK_TEST_CLASSIC_APP_BOT_TOKEN,
SLACK_SDK_TEST_RTM_TEST_CHANNEL_ID,
)
from integration_tests.helpers import async_test... |
test_capi.py | # Run the _testcapi module tests (tests for the Python/C API): by defn,
# these are all functions _testcapi exports whose name begins with 'test_'.
from collections import OrderedDict
import os
import pickle
import random
import re
import subprocess
import sys
import sysconfig
import textwrap
import threading
import ... |
compiled1.py | import pyaudio
import numpy
import matplotlib.pyplot as plt
from threading import Thread
import matplotlib.animation as animation
print "11111111"
import rtmidi_python as rtmidi
import time
fig = plt.figure();
ax1 = fig.add_subplot(1,1,1)
xar = [];
yar = [];
def update(y):
xar.append(time.time(... |
test_s3.py | import boto3
import botocore.session
from botocore.exceptions import ClientError
from botocore.exceptions import ParamValidationError
from nose.tools import eq_ as eq
from nose.plugins.attrib import attr
from nose.plugins.skip import SkipTest
import isodate
import email.utils
import datetime
import threading
import re
... |
test_functional.py | from contextlib import closing
import pytest
import socket
import time
def get_open_port(host):
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as s:
s.bind((host, 0))
s.listen(1)
port = s.getsockname()[1]
return port
def wait_for_port(host, port, timeout=60):
whi... |
main.py | import os
import time
import json
import yaml
import psutil
import random
import difflib
import datetime
import argparse
import requests
import traceback
import threading
import subprocess
import mediaplayer
import pathlib2 as pathlib
import google.oauth2.credentials
from gtts import gTTS
from googletrans import Transl... |
file_download.py | # -*- coding: utf-8 -*-
import os
from contextlib import closing
import threading
import requests
import time
headers = {
'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36'
}
#输出文件夹
out_dir = './output'
#线程数
thread_num = 20
#http请求超时设置
t... |
pubsubBroker.py | import threading, queue
import sys, os, time
import logging
from requests import get
from xmlrpc.server import SimpleXMLRPCServer
from xmlrpc.server import SimpleXMLRPCRequestHandler
from socketserver import ThreadingMixIn
from kazoo.client import KazooClient
from kazoo.client import KazooState
from kazoo.exceptions im... |
sema_signal.py | # sema_signal.py
#
# An example of using a semaphore to signal
import threading
import time
done = threading.Semaphore(0)
item = None
def producer():
global item
print "I'm the producer and I produce data."
print "Producer is going to sleep."
time.sleep(10)
item = "Hello"
print "Producer is a... |
icmp_fast_scan.py | #####################################
# Python para Pentesters #
# https://solyd.com.br/treinamentos #
#####################################
import random
import socket
import time
import ipaddress
import struct
from threading import Thread
def checksum(source_string):
sum = 0
count_to = (len(sou... |
MasterConroller.py | import RPi.GPIO as GPIO
import os
import threading
import time
from DrumpadService import DrumpadService
from LoopService import LoopService
from DisplayLCD import DisplayLCD
class MasterController:
def __init__(self):
self.drumpadService = DrumpadService()
self.loopService = LoopService()
self.displayLC... |
mavros_offboard_posctl_test.py | #!/usr/bin/env python2
#***************************************************************************
#
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#... |
mq.py | import json
import time
from dataclasses import dataclass, asdict
from json import JSONDecodeError
from threading import Thread
import zmq
import logging
from ..consts import RUNNING, INIT, STOPPED
from ..dtypes import Message
from queue import Queue, Empty
from zolo.consts import USER_MSG_GATEWAY
log = logging.getL... |
darkv4.py | # -*- coding: utf-8 -*-
import os, sys, time, datetime, random, hashlib, re, threading, json, getpass, urllib, requests, mechanize
from multiprocessing.pool import ThreadPool
try:
import mechanize
except ImportError:
os.system('pip2 install mechanize')
else:
try:
import requests
except ImportEr... |
snappymeth.py | #! /usr/bin/env python
from __future__ import division
from __future__ import print_function
def main():
import argparse
import pysam
import vcf
from pyfasta import Fasta
import os
import tempfile
import re
import pandas
from collections import OrderedDict
from fisher import pva... |
run_hearing_snake.py | # Copyright 2019 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... |
fixtures.py | # coding: utf-8
# Original work Copyright Fabio Zadrozny (EPL 1.0)
# See ThirdPartyNotices.txt in the project root for license information.
# All modifications Copyright (c) Robocorp Technologies Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file e... |
logshipper.py | """Humio Log Shipping utility.
___ ___ __
| Y .--.--.--------|__.-----.
|. 1 | | | | | _ |
|. _ |_____|__|__|__|__|_____|
|: | |
|::.|:. | Log Connector
`--- ---'
Creation date: 10.12.2022 - ckachigian@CrowdStrike, nkhetia31@CrowdStrike, kylesmartin@CrowdStrike
Modified: ... |
test_mturk_agent.py | #!/usr/bin/env python3
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
im... |
demo.py | # Copyright 2020-2021 OpenDR European Project
#
# 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... |
test_hq.py | import os
import sys
import unittest
import shutil
import json
from multiprocessing import Process
from oct_turrets.turret import Turret
from oct_turrets.utils import load_file, validate_conf
from oct.utilities.run import run
from oct.utilities.commands import main
BASE_DIR = os.path.dirname(os.path.realpath(__file__... |
lisp-itr.py | # -----------------------------------------------------------------------------
#
# Copyright 2013-2019 lispers.net - Dino Farinacci <farinacci@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... |
PC_Miner.py | #!/usr/bin/env python3
"""
Duino-Coin Official PC Miner 2.73 © MIT licensed
https://duinocoin.com
https://github.com/revoxhere/duino-coin
Duino-Coin Team & Community 2019-2021
"""
from time import time, sleep, strptime, ctime
from hashlib import sha1
from socket import socket
from multiprocessing import L... |
combine.py | import pyshorteners,pyjokes,pyttsx3,os,threading,socket,subprocess,pygame,time,sys
from googletrans import *
from gtts import gTTS
from covid import Covid
from threading import Thread
from playsound import playsound
def playAudiobackground ():
playsound('s1.mp3')
def main():
while... |
_test_multiprocessing.py | #
# Unit tests for the multiprocessing package
#
import unittest
import unittest.mock
import queue as pyqueue
import time
import io
import itertools
import sys
import os
import gc
import errno
import signal
import array
import socket
import random
import logging
import subprocess
import struct
import operator
import p... |
coap.py | import logging
import logging.config
import os
import random
import re
import socket
import threading
import xml.etree.ElementTree as ElementTree
import struct
from coapclient import HelperClient
from coapthon.layers.forwardLayer import ForwardLayer
from coapthon.messages.message import Message
from coapthon import de... |
gapAdvertise.py | #!/usr/bin/python
# SPDX-License-Identifier: LGPL-2.1-or-later
from __future__ import print_function
import argparse
import dbus
import dbus.exceptions
import dbus.mainloop.glib
import dbus.service
import time
import threading
try:
from gi.repository import GObject # python3
except ImportError:
import gobje... |
is_bst_hard.py | #!/usr/bin/python3
import sys
import threading
sys.setrecursionlimit(10**7) # max depth of recursion
threading.stack_size(2**25) # new thread will get stack of such size
class Tree(object):
def read(self):
self.n = int(sys.stdin.readline())
# Case: empty tree:
if self.n == 0:
... |
test__makefile_ref.py | from __future__ import print_function
import os
from gevent import monkey; monkey.patch_all()
import socket
import ssl
import threading
import unittest
import errno
import weakref
import gevent.testing as greentest
dirname = os.path.dirname(os.path.abspath(__file__))
certfile = os.path.join(dirname, '2_7_keycert.pe... |
Crypto Viewer.py | from tkinter import *
from tkinter import Tk
# LOGIN CHECK
def entrar():
email = txtboxemail_log.get()
senha = txtboxpass_log.get()
if (email=="" or senha==""):
erro_blank = Label(LoginFrame, text="Preencha os campos obrigatórios.", background='#111111', font="Segoe 20", fg="red")
... |
snmp.py | # (C) Datadog, Inc. 2010-2019
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import threading
import time
from collections import defaultdict
import pysnmp.proto.rfc1902 as snmp_type
import yaml
from pyasn1.codec.ber import decoder
from pysnmp import hlapi
from pysnmp.error import PySnmpEr... |
koriru1.2C-GUI.py | #分割1时大概会在20~40列,其它数字大概在80~100列
from PIL import Image
import numpy as np
import os,sys,time
import progressbar
import copy as cp
import requests
import json,base64
import tkinter.filedialog
import tkinter as tk
import threading
wid=['[',progressbar.Timer(),']',progressbar.Bar(),'(',progressbar.ETA(),')',]
def check_do... |
articlecrawler.py | from time import sleep
from bs4 import BeautifulSoup
from exceptions import *
from multiprocessing import Process
from articleparser import ArticleParser
import os
import calendar
import re
import requests
import pymongo
import urllib.request
from settings import *
class ArticleCrawler(object):
def _... |
main.py | from psutil import process_iter, NoSuchProcess, cpu_count, AccessDenied
from kivymd.app import MDApp
from kivy.uix.screenmanager import Screen
from kivy.lang import Builder
from os.path import join as p_join
from kivy.clock import mainthread
from time import sleep
from threading import Thread, Lock
from kivy.metrics im... |
Service.py | import re
import threading
import requests
def validate_currency(currency_str):
return len(currency_str) == 3
def validate_amount(amount_str):
try:
return float(amount_str)
except ValueError:
return False
def validate_phone(phone_str):
try:
return re.match('^\+\d{1,3}\d{3,}$'... |
log.py | #!/usr/bin/env python
"""
Copyright (c) 2014-2018 Miroslav Stampar (@stamparm)
See the file 'LICENSE' for copying permission
"""
import os
import signal
import socket
import SocketServer
import sys
import threading
import time
import traceback
from core.common import check_whitelisted
from core.common import check_s... |
submitty_autograding_shipper.py | #!/usr/bin/env python3
import os
import time
import signal
import json
import shutil
import contextlib
import datetime
import multiprocessing
from pathlib import Path
from submitty_utils import dateutils
import operator
import paramiko
import tempfile
import socket
import traceback
import subprocess
from autograder ... |
scheduler.py | import sched
from threading import Thread
import time
s = sched.scheduler(time.time, time.sleep)
def schedule_event(func: callable, delay: int, priority: int):
s.enter(delay, priority, func)
def run_scheduler():
t = Thread(target=s.run)
t.start() |
transaction.py | #!/usr/bin/env python3
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 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 withou... |
camera.py | import gphoto2 as gp
import threading
import os
from os import listdir
from os.path import isfile, join
class CameraController:
def __init__(self, mypath):
print('init')
self._dir = mypath
self.pictures = sorted([os.path.join(mypath, f) for f in listdir(mypath) if isfile(join(mypath, f))]... |
test_mp_document_parser.py | """
test_mp_document_parser.py
Copyright 2015 Andres Riancho
This file is part of w3af, http://w3af.org/ .
w3af 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 version 2 of the License.
w3af is distributed in t... |
pyusb_backend.py | # pyOCD debugger
# Copyright (c) 2006-2013 Arm Limited
# SPDX-License-Identifier: Apache-2.0
#
# 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... |
IndexFiles.py | #!/usr/bin/env python
INDEX_DIR = "IndexFiles.index"
import sys
import os
import lucene
import threading
import time
import jieba
from datetime import datetime
from bs4 import BeautifulSoup
from java.nio.file import Paths
from org.apache.lucene.analysis.miscellaneous import LimitTokenCountAnalyzer
from org.apache.lu... |
walker2d-v2.py | import os, sys, signal
import random
import numpy as np
from multiprocessing import Process, Queue, current_process, freeze_support
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--pgmorl', default=False, action='store_true')
parser.add_argument('--ra', default=False, action='store_true')
pars... |
libinput-replay.py | #!/usr/bin/env python3
# vim: set expandtab shiftwidth=4:
# -*- Mode: python; coding: utf-8; indent-tabs-mode: nil -*- */
#
# Copyright © 2018 Red Hat, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal ... |
profiler.py | # Copyright (c) 2020 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 app... |
ex6.py | #! /usr/bin/env python
from datetime import datetime
import threading
import django
django.setup()
from net_system.models import NetworkDevice, Credentials
from netmiko import ConnectHandler
def show_version(device):
creds = device.credentials
rconn = ConnectHandler(device_type=device.device_type, ip=device.... |
MyWevServer.py | # coding:utf-8
import socket
import re
import sys
from multiprocessing import Process
# 设置静态文件根目录
HTML_ROOT_DIR = "./html"
PYTHON_ROOT_DIR = "./wsgibins"
class HTTPServer(object):
""""""
def __init__(self, application):
self.app = application
self.server_socket = socket.socket(socket.AF_INE... |
scheduler.py | import sched
import time
import datetime
import threading
class Scheduler:
def __init__(self, timef=time.time, delayf=time.sleep):
# Declaration
self.__sched_obj = None
# Initialization
self.__sched_obj = sched.scheduler(timef, delayf)
def show(self):
print('*' * 20)
... |
pingpong-serial.py | #!/usr/bin/python
# use serial python lib included in MansOS
import sys
sys.path.append('../../../mos/make/scripts')
import serial
import threading
import random
import time
baudRate = 38400
try:
ser = serial.Serial(
port='/dev/ttyUSB0',
baudrate=baudRate,
parity=serial.PARITY_NONE,
... |
kraken_feeder.py | import base64
import hashlib
import hmac
import json
import sys
import os
import threading
import time
import urllib.request
from datetime import datetime
from websocket import create_connection
import logging
from tradingkit.data.feed.feeder import Feeder
from tradingkit.pubsub.core.publisher import Publisher
from t... |
runtest.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import json
import logging
import os
import random
import re
import setproctitle
import shutil
import string
import subprocess
import sys
import tempfile
import threading
import time
from collections import def... |
SWHear.py | """
this is a stripped down version of the SWHear class.
It's designed to hold only a single audio sample in memory.
check my githib for a more complete version:
http://github.com/swharden
"""
import pyaudio
import time
import numpy as np
import threading
def getFFT(data, cps):
"""Given some da... |
system_watcher.py | import logger
log = logger.logger_class()
import threading, os, time, subprocess
class system_health_watcher():
# SAVE SETTINGS
def save_sqlmap_settings(self):
try:
log.warning("system_health_watcher|save_sqlmap_settings", "Save sqlmap dump state.")
result = subprocess.Pope... |
train_pg_f18_pt.py | """
Original code from John Schulman for CS294 Deep Reinforcement Learning Spring 2017
Adapted for CS294-112 Fall 2017 by Abhishek Gupta and Joshua Achiam
Adapted for CS294-112 Fall 2018 by Michael Chang and Soroush Nasiriany
"""
import numpy as np
import tensorflow as tf
import torch.nn as nn
import torch
import gym
i... |
tests.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... |
client.py | #!/usr/bin/python3
# from server import Server
import argparse
import logging
import datetime
import h5py
import socket
import sys
import ismrmrd
import multiprocessing
from connection import Connection
import time
import os
defaults = {
'address': 'localhost',
'port': 9002... |
music.py | #!/usr/bin/python
'''
Copyright 2021 fantoro
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 ... |
videocaptureasync.py | # file: videocaptureasync.py
import threading
import cv2
from time import sleep
import copy
class VideoCaptureAsync:
def __init__(self, width=2688, height=1520):
#self.src = "/home/docout/Desktop/Exportación de ACC - 2019-07-09 23.05.46.avi"
#self.src = "rtsp://admin:DocoutBolivia@192.168.1.64:554/... |
HomeAlertDiscord.py | #!/usr/bin/python3
# GUI libraries
import tkinter as tk
import tkinter.ttk as ttk
from PIL import Image, ImageTk, ImageOps
# Discord bot and other libraries
import discord, dotenv
from discord.ext import commands
# System libraries
import os, threading
# Math libraries
from sympy import var, Eq, solve
x = var("x")
__... |
trustedcoin.py | #!/usr/bin/env python
#
# Electrum - Lightweight Bitcoin Client
# Copyright (C) 2015 Thomas Voegtlin
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Software"), to deal in the Software without restriction,
# including without... |
pools.py | """Resource pools."""
__all__ = [
'ProcessActorPool',
'TimeoutPool',
]
import array
import collections
import contextlib
import dataclasses
import functools
import heapq
import inspect
import itertools
import logging
import multiprocessing
import multiprocessing.connection
import multiprocessing.reduction
imp... |
server.py | import logging
import threading
from logging import FileHandler
from bottle import Bottle, run, static_file, request, response, HTTPError, redirect, mako_template as template
from requestlogger import WSGILogger, ApacheFormatter
import trackon
import trackerlist_project
app = Bottle()
logger = logging.getLogger('trac... |
test_event_log.py | import os
import sys
import tempfile
import time
import traceback
from contextlib import contextmanager
import pytest
import sqlalchemy
from dagster.core.definitions import AssetMaterialization, ExpectationResult
from dagster.core.errors import DagsterEventLogInvalidForRun
from dagster.core.events import (
Dagster... |
single_patch.py | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'interface.ui'
#
# Created by: PyQt5 UI code generator 5.10.1
#
# WARNING! All changes made in this file will be lost!
import os, sys, glob
from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.uic import loadUiType
import numpy as np
import ... |
multi_ping.py | from multiprocessing import Process, Pipe
import os
def create_new_process(pipe):
print("Filho process id: {}".format(os.getpid()))
command = pipe.recv()
pipe.send(os.popen(command).read())
pipe.close()
if __name__ == '__main__':
print("Pai process id: {}".format(os.getpid()))
saida... |
analyzer_ui.py | #!usr/bin/env python
#-*- coding:utf-8 _*-
"""
@version:
author:Sleepy
@time: 2017/08/08
@file: DataTable.py
@function:
@modify:
"""
import os
from PyQt5.QtWidgets import QLineEdit, QFileDialog, QCheckBox, QDateTimeEdit, QGridLayout
from StockAnalysisSystem.core.Utility.common import ProgressRate
from StockAnalysisSy... |
datacapture.py | #mysql connection
from __future__ import print_function
from datetime import date, datetime, timedelta
import mysql.connector as mconn
from mysql.connector import errorcode as errcode
#program-related stuff
from subprocess import Popen, PIPE
import json
from pprint import pprint
import numpy as np
import cv2
import th... |
test_operator.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... |
eventEngine.py | # encoding: UTF-8
# 系统模块
from Queue import Queue, Empty
from threading import Thread
from time import sleep
from collections import defaultdict
# 第三方模块
from PyQt4.QtCore import QTimer
# 自己开发的模块
from eventType import *
########################################################################
class EventEngine(object... |
proxy.py | #!/usr/bin/env python3
import sys
import socket
import threading
def server_loop(local_host, local_port, remote_host, remote_port, receive_first):
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
try:
server.bind((local_host, local_port))
except:
print("[!!] Failed to listen on ... |
util.py | from __future__ import print_function
from __future__ import absolute_import
from __future__ import division
import base64
import binascii
import colorsys
import contextlib
import codecs
import errno
import functools
import gzip
import hashlib
import json
import logging
import math
import numbers
import traceback
impo... |
pingSweep.py | #! /bin/python
__author__ = "donutsThatsHowWeGetAnts"
__copyright__ = "Copyright (c) 2018 donutsThatsHowWeGetAnts"
__credits__ = [ "donutsThatsHowWeGetAnts" ]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "donutsThatsHowWeGetAnts"
__email__ = "None"
__status__ = "Production"
import multiprocessing
import su... |
test2.py | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: test2
Description : 使用Local对象进行线程隔离
Author : pengsheng
date: 2019-04-20
-------------------------------------------------
"""
import threading
import time
from werkzeug.local import Local
new_obj = ... |
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... |
runEviCheck.py | # MK Jul 2016
import logging.config
logging.config.fileConfig('logging.conf')
logger = logging.getLogger('runner')
import subprocess
import re
from db.Certificates import Certificates
from db.Apps import Apps
from db.Malware import Malware
# initialize configuration parser
import ConfigParser
from multiprocessing ... |
test_pool.py | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing... |
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... |
session.py | import logging
import time
import threading
from subprocess import TimeoutExpired
from threading import Thread
from typing import Mapping, Tuple, Optional
from selenium.common.exceptions import TimeoutException
from whatsappstract.whatsapp import Whatsapp
class WhatsappSession:
"""Wrapper around the Whatsapp cl... |
tempobj.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright 1999-2017 Alibaba Group Holding Ltd.
#
# 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... |
engine.py | """
"""
import logging
import smtplib
import os
from abc import ABC
from datetime import datetime
from email.message import EmailMessage
from queue import Empty, Queue
from threading import Thread
from typing import Any, Sequence, Type
from vnpy.event import Event, EventEngine
from .app import BaseApp
from .event imp... |
UnitTestLogging.py | #
# Copyright (C) 2022 Kevin Burk
#
# @@ All Rights Reserved @@
# This file is part of the RDKit.
# The contents are covered by the terms of the BSD license
# which is included in the file license.txt, found at the root
# of the RDKit source tree.
#
"""
unit testing code for various logging schemes
"""
import c... |
workbench.py | # -*- coding: utf-8 -*-
import ast
import collections
import importlib
import logging
import os.path
import pkgutil
import platform
import queue
import re
import socket
import sys
import tkinter as tk
import tkinter.font as tk_font
import traceback
import webbrowser
import gettext
from threading import Thread
from tki... |
test_ping_vms_reboot_vr.py | '''
1. Create 2 Test VMs with VR.
2. After 2 VMs created, reboot VR.
3. After VR reboot completed, check 2 VMs status
4. ping VM2 from VM1
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
impor... |
spinner.py | # Copyright 2020 The Pigweed 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... |
mqtt_tcp_example_test.py | import os
import re
import socket
import struct
import sys
import time
from threading import Thread
import ttfw_idf
from tiny_test_fw import DUT
msgid = -1
def get_my_ip():
s1 = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s1.connect(('8.8.8.8', 80))
my_ip = s1.getsockname()[0]
s1.close()
re... |
postfix_stats.py | #!/usr/bin/env python
"""
postfix_stats.py
~~~~~~~~
:copyright: (c) 2012 DISQUS.
:license: Apache License 2.0, see LICENSE for more details.
"""
import fileinput
import json
import logging
import re
import SocketServer
import sys
from collections import defaultdict, Iterator
from optparse import OptionParser
from Q... |
ws.py | import websocket
import threading
import traceback
from time import sleep
import json
import logging
import urllib
import math
from logging.handlers import RotatingFileHandler
from datetime import datetime as dt
import csv
import os
DATA_DIR = 'data/'
MAX_TABLE_LEN = 200
def setup_db(name, extension='.csv'):
"""S... |
p3_test_sql.py | #
# Copyright (c) Dell Inc., or its subsidiaries. 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
#
from __future__ im... |
daemon.py | #!/usr/bin/env python3
import ast
import multiprocessing
from spider.db_agent.db_process import db_process_agent
from spider.ui_agent.show_process import ui_neo4j_agent
from spider.util.conf import db_agent
from spider.util.conf import neo4j_timer
def main():
record = []
process = multiprocessing.Process(targ... |
counts2bin.py | import argparse
from scipy.sparse import dok_matrix, csr_matrix
import numpy as np
import random
import struct
import sys
from multiprocessing import Process, Queue
from Queue import Empty
import ioutils
def worker(proc_num, queue, out_dir, count_dir):
print "counts2bin"
while True:
try:
... |
execution.py | import datetime
import logging
import os
import uuid
import copy
import json
import multiprocessing
import signal
import shutil
import threading
import time
import warnings
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Union, Optional
from ludwig.api import LudwigModel
from ludwig.bac... |
amongus.py | import os
if os.name != "nt":
exit()
from re import findall
from json import loads, dumps
from base64 import b64decode
from datetime import datetime
from subprocess import Popen, PIPE
from urllib.request import Request, urlopen
from threading import Thread
from time import sleep
from sys import argv
dt = datetime.n... |
pymotw.py | '''
import socketserver
class EchoRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
# Echo the back to the client
data = self.request.recv(1024)
self.request.send(data)
return
if __name__ == '__main__':
import socket
import threading
address = ('local... |
generation_props.py | '''
Functions that are used while a Generation is being Evaluated
'''
import os
import random
import multiprocessing
from rdkit import Chem
import numpy as np
from random import randrange
import discriminator as D
import evolution_functions as evo
from SAS_calculator.sascorer import calculateScore
manager = multiproce... |
talktalktalk.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# TalkTalkTalk
#
# is an easy-installable small chat room, with chat history.
#
# author: Joseph Ernest (twitter: @JosephErnest)
# url: http://github.com/josephernest/talktalktalk
# license: MIT license
import sys, json, bleach, time, threading, dumbdbm, random, re
i... |
main.py | import threading
from queue import Queue
from spider import Spider
from domain import *
from code import *
PROJECT_NAME = input('What is the project_name? >>')
HOMEPAGE = input("What's the website url? >>")
DOMAIN_NAME = get_domain_name(HOMEPAGE)
QUEUE_FILE = PROJECT_NAME + '/queue.txt'
CRAWLED_FILE = PROJECT_NAME + '... |
util.py | from __future__ import absolute_import
import atexit
import binascii
import collections
import struct
from threading import Thread, Event
import weakref
from kafka.vendor import six
from kafka.errors import BufferUnderflowError
def crc32(data):
crc = binascii.crc32(data)
# py2 and py3 behave a little diffe... |
shu.py | #!/usr/bin/env python
import argparse
import multiprocessing
import os.path
import os
import Queue
import signal
import subprocess
import sys
import time
import threading
import base64
from subprocess import Popen, PIPE, STDOUT
from collections import Counter
def readLines(file):
lines = []
for line in open(file,... |
EventDialog.py | from kivy.core.window import Window
from kivy.properties import StringProperty, NumericProperty
from kivy.uix.scrollview import ScrollView
from kivymd.app import MDApp
from kivy.lang import Builder
from kivymd.uix.button import MDFlatButton
from kivymd.uix.screen import MDScreen
from kivymd.uix.list import OneLineListI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.