source
stringlengths
3
86
python
stringlengths
75
1.04M
data_service_ops_ft_test.py
# Copyright 2020 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...
influxdb_cache.py
import datetime import logging import queue import threading import typing from functools import partial from dateutil import tz from dateutil.parser import parse from dateutil.relativedelta import relativedelta from influxdb import InfluxDBClient, DataFrameClient class BarsFilter(typing.NamedTuple): ticker: typ...
browsefile.py
from tkinter import * from tkinter import ttk from tkinter import filedialog from AudioSABbuilder.src.directorywatcher import Watcher from tinytag import TinyTag, TinyTagException import json import threading class AudioFile: def __init__(self, filename, anthology, language, version, book, bookNumber, mode, chapte...
__init__.py
"""Miscellaneous helper functions (not wiki-dependent).""" # # (C) Pywikibot team, 2008-2022 # # Distributed under the terms of the MIT license. # import collections import gzip import hashlib import ipaddress import itertools import os import queue import re import stat import subprocess import sys import threading im...
subproc_vec_env.py
import numpy as np from multiprocessing import Process, Pipe from baselines.common.vec_env import VecEnv from pysc2.env import environment from pysc2.env import sc2_env from pysc2.lib import features, actions _PLAYER_RELATIVE = features.SCREEN_FEATURES.player_relative.index _SELECTED = features.SCREEN_FEATURES.selecte...
test_consume.py
# -*- coding: utf-8 -*- # @Author : ydf # @Time : 2019/8/8 0008 14:57 from multiprocessing import Process import time from function_scheduling_distributed_framework.constant import BrokerEnum from function_scheduling_distributed_framework import get_consumer, get_publisher, AbstractConsumer from function_scheduling...
executors.py
import copy import cloudpickle import itertools import multiprocessing import os import signal import subprocess import sys import threading import warnings from concurrent.futures import ThreadPoolExecutor from concurrent.futures import TimeoutError as FutureTimeout from functools import wraps from logging import Logg...
_UIAHandler.py
from ctypes import * from ctypes.wintypes import * import comtypes.client from comtypes.automation import VT_EMPTY from comtypes import * import weakref import threading import time import api import appModuleHandler import queueHandler import controlTypes import NVDAHelper import winKernel import winUser...
smbrelayx.py
#!/usr/bin/env python # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved. # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # SMB Relay Module # # Author: # Alberto Solino (@agso...
launcher.py
from dawsonmuse import generate_save_fn, muserecorder import multiprocessing import os import time def run_exp(): import Experiment if __name__ == "__main__": os.system(r"start bluemuse://start?streamfirst=true") cwd = os.path.dirname(os.path.realpath(__file__)) datadir = os.path.join(cwd,"data") ...
Thread_determine.py
import threading import time '''' Ada 3 fungsi yakni fungsi A,B dan C Fungsi ini akan melakukan running, jika proses memakan waktu lama akan masuk pada proses tunda /sleep lalu jika selesai kembalikan nilainya ''' def function_A(): print (threading.currentThread().getName()+str('--> starting \n')) time.sleep(2)...
astar.py
#!/usr/bin/env python3 import math import random import time import threading import pygame running = True pathFound = False infinite = 0xffffffff gridpos = (0, 0) width = 30 height = 30 gridsize = 20 blocksize = 18 grid = [] for i in range(height): grid.append([]) for j in range(width): grid[i].a...
__init__.py
# -*- coding: utf-8 -*- """Miscellaneous helper functions (not wiki-dependent).""" # # (C) Pywikibot team, 2008-2017 # # Distributed under the terms of the MIT license. # from __future__ import absolute_import, unicode_literals __version__ = '$Id: b9c99e093f2af7fab7f8312507664205d1faef58 $' import collections import g...
IVTimer.py
################################################################################ # # IVTimer.py # """ Interval Timer Class A interval timer class. The threading.Timer() class just didn't cut it. Author: Robin D. Knight Email: robin.knight@roadnarrowsrobotics.com URL: http://www.roadnarrowsrobotics.com Date: 20...
dagger.py
"""Author: Brandon Trabucco, Copyright 2019, MIT License""" import multiprocessing from cs285.baselines.imitate.dagger import Dagger from gym.envs.mujoco.walker2d import Walker2dEnv def run_experiment(experiment_id): Dagger( Walker2dEnv, logging_dir="./walker2d/dagger/{}".format(experiment_id), ...
test_socks_transmitter.py
from unittest import TestCase import sockser.socks_transmitter as soc_transmitter from sockser.filesocket.filesocket import filesocket import socket import os import time import threading class TestServer(TestCase): @classmethod def setUpClass(self): ''' file socket creation ''' self.fsoc = f...
runner.py
import asyncio import concurrent.futures import contextlib import threading import types from typing import TYPE_CHECKING, Any, Optional, Tuple, Type, cast import click.testing from typing_extensions import Literal from kopf import cli from kopf.reactor import registries from kopf.structs import configuration _ExcTy...
node_connections.py
import uuid import requests import time import json from urllib.parse import urlparse import threading import traceback import inspect from concurrent.futures import ThreadPoolExecutor from .serializers import PostSerializer from rest_framework.authtoken.models import Token from .models import Author, Post, Comment, ...
simplemultiprocessing.py
from multiprocessing import Process import os def salute(course): print('Hello', course) print('Parent process id:', os.getppid()) print('Process id:', os.getpid()) if __name__ == '__main__': p = Process(target=salute, args=('DS',)) p.start() p.join()
logic.py
#!/usr/bin/python3 import argparse import database import database_proto import datetime import default_nemesis_proto import nemesis_pb2 import os import queue import signal import sys import threading import time import zmq NEMESIS_DATA_PATH = os.getenv('NEMESIS_DATA') def get_priority(user_id): role_dict = { ...
test_drop_collection.py
import pdb import pytest import logging import itertools from time import sleep import threading from multiprocessing import Process from utils.utils import * from common.constants import * uid = "drop_collection" class TestDropCollection: """ *****************************************************************...
mutiplethreads.py
import time, threading, multiprocessing def loop(): print('Thread %s is running.' % threading.current_thread().name) n = 0 while n < 5: n = n + 1 print('Thread %s >>> %s' % (threading.current_thread().name, n)) time.sleep(1) print('Thread %s ended.' % threading.curren...
server.py
import os import pytz import requests from flask import Flask from flask import Response import datetime from rfeed import * from bs4 import BeautifulSoup import time import json import re from threading import Thread,Lock logname = "" password = "" payload = {'username':logname,'password':password} s = requests.Sessio...
MinitouchStream.py
# -*- coding: utf-8 -*- """ This source code file is licensed under the GNU General Public License Version 3. For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package. Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved. """ try: import Qu...
uvicorn_threaded.py
import contextlib import threading import time import uvicorn def asyncio_setup() -> None: # pragma: no cover # Set eventloop for win32 setups # Reverts a change done in uvicorn 0.15.0 - which now sets the eventloop # via policy. import sys if sys.version_info >= (3, 8) and sys.platform == "win...
birdseye_frontend.py
import os.path from threading import Thread from tkinter import messagebox from thonny import get_workbench, get_runner _server_started = False def _start_debug_enabled(): return (get_workbench().get_editor_notebook().get_current_editor() is not None and "debug" in get_runner().get_supported_feature...
__init__.py
# -*- coding: utf-8 -*- ''' Set up the Salt integration test suite ''' # Import Python libs import os import sys import time import errno import shutil import pprint import logging import tempfile import subprocess import multiprocessing from hashlib import md5 from datetime import datetime, timedelta try: import...
bot.py
import socket, random, string from threading import Thread global bot global botid banner = ''' d8888 888 8888888b. 888 888b 888 888 d88888 888 888 "Y88b 888 8888b 888 888 d88P888 888 888 888 ...
test_executor_sequential.py
# Copyright 2016-2018 Dirk Thomas # Licensed under the Apache License, Version 2.0 import asyncio from collections import OrderedDict import os import signal import sys from threading import Thread import time from colcon_core.executor.sequential import SequentialExecutor import pytest ran_jobs = [] async def job1...
MatterBridgeConnection.py
from cmath import exp import json import requests import threading import time import traceback from queue import Queue class MatterBridgeConnection: _send_queue = Queue() _recv_queue = Queue() _connected = False _running = False def __init__(self, api, authToken, gateway): self._api = a...
test_errno.py
import unittest, os, errno import threading from ctypes import * from ctypes.util import find_library class Test(unittest.TestCase): def test_open(self): libc_name = find_library("c") if libc_name is None: raise unittest.SkipTest("Unable to find C library") libc = CD...
tb_device_http.py
"""ThingsBoard HTTP API device module.""" import threading import logging import queue import time import typing from datetime import datetime, timezone from sdk_utils import verify_checksum import requests from math import ceil FW_CHECKSUM_ATTR = "fw_checksum" FW_CHECKSUM_ALG_ATTR = "fw_checksum_algorithm" FW_SIZE_A...
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...
crawler.py
import threading from queue import Queue from settings import * from util import * from url_storer import UrlStorer from spider import Spider class Crawler: ''' Crawler class is a class to collect target data using Spider class which requests a websource from a web site and extracts target data. Craw...
run.py
from multiprocessing import Process import time import engine import sys import util from config import Config if __name__ == "__main__": if (len(sys.argv) != 2): print("ERROR: Invalid command line arguments") print("Usage: python run.py /path/to/your/config") exit(1) begin_t = t...
oepoll.py
# -*- coding: utf-8 -*- from ..LINEBASE.ttypes import TalkException, ShouldSyncException from .client import LINE from threading import Thread from types import * import os, sys, time class OEPoll(object): OpInterrupt = {} client = None __squareSubId = {} __squareSyncToken = {} def __init__(self,...
NehushtanUDPSocketServer.py
import socket from abc import abstractmethod from threading import Thread from typing import Optional from nehushtan.socket.SocketHandleThreadManager import SocketHandlerThreadManager class NehushtanUDPSocketServer: """ Since 0.4.16 """ def __init__(self, host: str, port: int, buffer_size=0, tm: Soc...
pipetool.py
# This file is part of Scapy # See http://www.secdev.org/projects/scapy for more information # Copyright (C) Philippe Biondi <phil@secdev.org> # This program is published under a GPLv2 license from __future__ import print_function import os import subprocess import time import scapy.modules.six as six from threading i...
filemanager.py
# -*- coding: utf-8 -*- """ File Manager ============ Copyright © 2010-2018 HeaTTheatR For suggestions and questions: <kivydevelopment@gmail.com> This file is distributed under the terms of the same license, as the Kivy framework. A simple manager for selecting directories and files. Example ------- from kivy.ap...
stream_compression.py
# import the necessary packages from imutils.video import VideoStream from flask import Response from flask import Flask from flask import request from flask import render_template import threading import argparse import datetime import imutils import time import cv2 # initialize the output frame and a lock used to en...
videostream.py
from threading import Thread import cv2 class WebcamVideoStream: def __init__(self, src=0, resolution=None, fps=None): self.stream = cv2.VideoCapture(src) if resolution is not None: self.stream.set(cv2.CAP_PROP_FRAME_WIDTH, resolution[0]) self.stream.set(cv2.CAP_PROP_FRAME...
stream_announcer114.py
# -*- coding: utf-8 -*- import BigWorld, ResMgr from urllib import urlopen import json import time import datetime from Account import Account from gui.Scaleform.daapi.view.lobby.hangar import Hangar from notification.NotificationListView import NotificationListView from gui import DialogsInterface, SystemMessages fro...
app.py
import marshal from multiprocessing import Condition, Process, Queue, Pipe import os from threading import Timer from types import FunctionType import pickle from celery import Celery from flask import Flask, url_for from grams.grams import Histogram from grams.markov import MC import time def make_app(): def...
light_reaper.py
# -*- coding: utf-8 -*- # Copyright CERN since 2016 # # 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 ...
cloudscan.py
#!/usr/bin/env python # Copyright 2015 Lockheed Martin Corporation # # 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...
plugin.py
# -*- encoding: utf-8 -*- """Publish only required classes to Sublime Text.""" import sublime if int(sublime.version()) < 3153: print('CNC Sinumerik 840D requires ST3 3153+') else: import sys __all__ = [ 'S840dBeautifyCommand', 'S840dBumpVersion', 'S840dGotoDefinitionCommand', ...
microservice.py
import argparse import importlib import json import logging import multiprocessing as mp import os import sys import time from distutils.util import strtobool from functools import partial from typing import Callable, Dict from seldon_core import __version__, persistence from seldon_core import wrapper as seldon_micro...
global_lib.py
import rollbar import pprint import yaml import os, os.path import sys import time import signal from shutil import copy from distutils.sysconfig import get_python_lib from tabulate import tabulate from ansi_chameleon import pg_engine, mysql_source, pgsql_source import logging from logging.handlers import TimedRotati...
email.py
from threading import Thread from flask_mail import Message from flask import render_template, current_app from app import mail def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subject,sender=s...
task.py
# coding:utf8 """消费者模块""" import os import sys import json from multiprocessing import Process from fastweb import app from fastweb.manager import Manager from fastweb.util.tool import timing from fastweb.exception import TaskError from fastweb.component.task import Task from fastweb.util.python import load_object f...
test_asyncore.py
import asyncore import unittest import select import os import socket import sys import time import warnings import errno import struct from test import support from test.support import TESTFN, run_unittest, unlink, HOST, HOSTv6 from io import BytesIO from io import StringIO try: import threading except ImportErr...
parsing.py
#A* ------------------------------------------------------------------- #B* This file contains source code for the PyMOL computer program #C* Copyright (c) Schrodinger, LLC. #D* ------------------------------------------------------------------- #E* It is unlawful to modify or remove this copyright notice. #F* --------...
19-1-log-image-sequence.py
#!/usr/bin/env python """Multiple processes log sequence of images. The expected behavior is that there would be (N processes * len(sequence)) image files """ import multiprocessing as mp import os import numpy as np import wandb import yea def process_child(run): # need to re-seed the rng otherwise we get ...
nfc_lock.py
#!/usr/bin/python # -*- coding: utf-8 -*- import RPi.GPIO as GPIO import time import signal import sys import nfc import threading import os from db import DataBase class NFC_Kagisys(): """サーボモータの制御""" def __init__(self): """基本設定とスレッドの呼び出し""" #基本的なセッティング self.db = DataBase() signal.signal(signal.SIGINT, s...
AVR_Miner.py
#!/usr/bin/env python3 """ Duino-Coin Official AVR Miner 3.1 © MIT licensed https://duinocoin.com https://github.com/revoxhere/duino-coin Duino-Coin Team & Community 2019-2022 """ from os import _exit, mkdir from os import name as osname from os import path from os import system as ossystem from platform import machin...
test_module.py
import unittest, os, sys, tempfile from subprocess import Popen, PIPE import multiprocessing from contextlib import contextmanager try: from StringIO import StringIO # Python 2 except ImportError: from io import StringIO # Python 3 import acme_simple from tests.monkey import gen_keys, run_server @contextmanager def...
udemy.py
import json import os import random import re #!/usr/bin/python3 import webbrowser import threading import multiprocessing import time from urllib.parse import parse_qs, urlsplit import browser_cookie3 import PySimpleGUI as sg import requests import urllib3 from bs4 import BeautifulSoup from pack.con...
lichessbot.py
import argparse import chess from chess import engine from chess import variant import chess.polyglot import model import json import lichess import logging import multiprocessing from multiprocessing import Process import signal import backoff from config import load_config from requests.exceptions import HTTPError, R...
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...
__init__.py
from typing import Optional import importlib from io import StringIO from multiprocessing import Process from pathlib import Path import integration_tests.common from autodidaqt_receiver.receiver import RemoteConfiguration __all__ = [ "run_from_daq_suite", ] INTEGRATION_TEST_ROOT = (Path(__file__).parent / ".."...
__init__.py
# -*- coding: utf-8 -*- # Copyright: (c) 2019-2021, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) """Installed collections management package.""" from __future__ import (absolute_import, division, print_function) __metaclass__ = type import errno import f...
test_vpc_behavior.py
# Copyright 2014 # The Cloudscaling Group, 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...
data.py
# This library contains classes and routines that aid with data stream integration into katuilib import threading import socket import logging import numpy as np import time import warnings import sys import datetime import calendar from struct import unpack import gc import spead2 import spead2.recv import six datal...
app.py
""" Virtual Env Backend Service. runs socketio web server, chrome webdriver & agent. - agent & webdriver communicate via redis pub/sub. - webdriver & browser communicate via selenium & socket connection. """ import sys import threading import logging import json import redis from flask import Flask from flask_socket...
subprocess2.py
# coding=utf8 # 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. """Collection of subprocess wrapper functions. In theory you shouldn't need anything else in subprocess, or this module failed. """ import...
test_gopro.py
# test_gopro.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Fri Sep 10 01:35:03 UTC 2021 # pylint: disable=redefined-outer-name # pylint: disable=missing-return-doc """Unit testing of GoPro Client""" import time import threading from pat...
Baker.py
import wx import threading from leginon.gui.wx.Choice import Choice from leginon.gui.wx.Entry import FloatEntry from leginon.gui.wx.Presets import PresetChoice import leginon.gui.wx.Node import leginon.gui.wx.Settings import leginon.gui.wx.ToolBar class SettingsDialog(leginon.gui.wx.Settings.Dialog): def initialize(...
ipc_msg_queue.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # author: bigfoolliu """ python进程间通信 队列实现 """ from multiprocessing import Process, Queue import time from typing import NoReturn from doctest import testmod def process_read(q: Queue) -> NoReturn: """ 读进程 >>> """ while True: time.sleep(...
s3.py
""" Object Store plugin for the Amazon Simple Storage Service (S3) """ import logging import multiprocessing import os import shutil import subprocess import threading import time from datetime import datetime try: # Imports are done this way to allow objectstore code to be used outside of Galaxy. import boto ...
libvirt_watcher_in_docker.py
# -*- coding: utf-8 -*- ''' Copyright (2021, ) Institute of Software, Chinese Academy of Sciences @author: wuyuewen@otcaix.iscas.ac.cn @author: wuheng@otcaix.iscas.ac.cn ''' import os, sys, traceback, time, socket from threading import Thread from multiprocessing import Process sys.path.append("..") ''' Import thi...
publisher.py
#!/usr/bin/env python import json import pika import schedule import threading import time from datetime import datetime class EWalletPublisher(): def __init__(self, queue_url, npm): self.queue_url = queue_url self.credentials = pika.PlainCredentials('sisdis', 'sisdis') self.npm = npm ...
shell.py
from __future__ import unicode_literals import binascii import codecs import serial import struct import sys import time import threading from prompt_toolkit import PromptSession from prompt_toolkit.history import FileHistory from PIL import Image COM_PORT = 'COM6' ser = '' shotpath = '1.png' def getFileEncoding(p...
patch-stdout.py
#!/usr/bin/env python """ An example that demonstrates how `patch_stdout` works. This makes sure that output from other threads doesn't disturb the rendering of the prompt, but instead is printed nicely above the prompt. """ import threading import time from prompt_toolkit import prompt from prompt_toolkit.patch_stdo...
explorer.py
# Copyright (C) 2020. Huawei Technologies Co., Ltd. All rights reserved. # # 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 us...
case4.py
from __future__ import division import numpy as np import math # for math.ceil import matplotlib.pyplot as plt from numpy.linalg import norm from numpy.random import uniform from scipy.stats import multivariate_normal # for bivariate gaussian -> brownian motion ( normal with mu x(t-1), and variance sigma ) from fil...
app_gpu.py
import os from flask import Flask, request, send_file, redirect, render_template import easyocr import PIL from PIL import Image, ImageOps import base64 import numpy as np import io from queue import Queue, Empty import time import threading UPLOAD_FOLDER = 'static/uploads' app = Flask(__name__, template_folder='tem...
trainer.py
# Lint as: python2, python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # ...
test_closing.py
from fixtures import * # noqa: F401,F403 from flaky import flaky from pyln.client import RpcError from shutil import copyfile from utils import ( only_one, sync_blockheight, wait_for, DEVELOPER, TIMEOUT, account_balance, first_channel_id, basic_fee, TEST_NETWORK, ) import os import queue import pytest import ...
amqpdriver.py
# Copyright 2013 Red Hat, 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 agr...
controller_manager.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Software License Agreement (BSD License) # # Copyright (c) 2010, Antons Rebguns, Cody Jorgensen, Cara Slutter # 2010-2011, Antons Rebguns # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are per...
message_queue.py
#!/usr/bin/env python3 """ Using message queues for IPC """ import os import time from multiprocessing import Process, Queue def process_queue(queue: Queue) -> None: while not queue.empty(): # getting new data for processing from the queue item = queue.get() print(f"PID({os.getpid()}): p...
realizer.py
#!/usr/bin/env python """ Copyright (c) 2014-2015, Leander Tentrup, Saarland University <tentrup@react.uni-saarland.de> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in ...
caching.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """A module that shows USD has lock-less multi-threading support with caches.""" # IMPORT FUTURE LIBRARIES from __future__ import print_function # IMPORT STANDARD LIBRARIES import functools import threading import time # IMPORT THIRD-PARTY LIBRARIES from pxr import Usd ...
constant-strained.py
import numpy as np import pandas as pd from scipy.interpolate import interp1d import itertools as iter from shutil import get_terminal_size from threading import Thread import sys import pathlib import time from time import sleep class bcolors: HEADER = '\033[95m' OKBLUE = '\033[94m' OKCYAN = '\033[9...
root.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Root for webserver. Specifies frontpage, errorpage (default), and pages for restarting and shutting down server. """ import os import sys import cherrypy import htpc import logging import urllib from threading import Thread from cherrypy.lib.auth2 import ...
daemon.py
import asyncio import json import queue import select import socket import sqlite3 import sys import threading import urllib import urllib.request as request import desktop_notify from ptt import common, const from peer import Peer from pollqueue import PollQueue class Daemon: def __init__( self, ...
user.py
#!/usr/bin/env python # -*- coding: utf-8 -*- #** # ######### # trape # ######### # # trape depends of this file # For full copyright information this visit: https://github.com/jofpin/trape # # Copyright 2018 by Jose Pino (@jofpin) / <jofpin@gmail.com> #** import time from core.dependence import urllib2 from flask impo...
connection_manager_4edge.py
import socket import threading import pickle import codecs from concurrent.futures import ThreadPoolExecutor from .core_node_list import CoreNodeList from .message_manager import ( MessageManager, MSG_CORE_LIST, MSG_PING, MSG_ADD_AS_EDGE, ERR_PROTOCOL_UNMATCH, ERR_VERSION_UNMATCH, OK_WITH_...
ida_script.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import print_function import datetime import threading import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer from xml.sax.saxutils import escape import idaapi import idautils import idc # Wait for any processing to get done idaapi.autoWait() ...
test_http.py
# -*- encoding: utf-8 -*- import collections import errno import email.parser import platform import socket import threading import time import pytest from ddtrace import compat from ddtrace.vendor import six from ddtrace.vendor.six.moves import BaseHTTPServer from ddtrace.vendor.six.moves import http_client from ddt...
dx_delete_vdb.py
#!/usr/bin/env python #Adam Bowen - Apr 2016 #This script deletes a vdb #requirements #pip install docopt delphixpy #The below doc follows the POSIX compliant standards and allows us to use #this doc to also define our arguments for the script. This thing is brilliant. """Delete a VDB Usage: dx_delete_db.py (--gro...
download_videos.py
import os import argparse import time import datetime import json import subprocess import cv2 import random import threading import pandas as pd import numpy as np import requests from subprocess import check_output from datetime import datetime, timedelta from pprint import pprint parser = argparse.ArgumentParser(d...
main.py
from wrapper import running_process import numpy as np from time import sleep import threading import ctypes def main(): # running_process(x) # Pass an immutable object to running process. Maybe a list of [x] # Have the c function look at the last element of the list for commands. # x = np.array([1],...
benchmarking_cpu.py
import psutil import time import pandas as pd import numpy as np import multiprocessing import category_encoders as encoders import tests.helpers as th __author__ = 'LiuShulun' """ Record the average and peak system-wide CPU utilization during encoder training and scoring. The utilization is reported as a percentage...
TCP_Server.py
from datetime import datetime import socket import threading class TCPHandler: """Class used to handle a TCP connection for a server-client chat ---------------------------------------------------------------- Attributes ---------- host : str name of the server host ...
processes.py
""" process.py Created by Thomas Mangin on 2011-05-02. Copyright (c) 2009-2017 Exa Networks. All rights reserved. License: 3-clause BSD. (See the COPYRIGHT file) """ import os import errno import time import subprocess import select import fcntl from exabgp.util import str_ascii from exabgp.util import bytes_ascii f...
test_http.py
import asyncio import contextlib import os import sys import threading from http.server import BaseHTTPRequestHandler, HTTPServer import pytest import fsspec.asyn import fsspec.utils fsspec.utils.setup_logging(logger_name="fsspec.http") requests = pytest.importorskip("requests") port = 9898 data = b"\n".join([b"som...
IsyClass.py
"""Simple Python lib for the ISY home automation netapp This is a Python interface to the ISY rest interface providomg simple commands to query and control registared Nodes and Scenes and well as a method of setting or querying vars """ __author__ = 'Peter Shipley <peter.shipley@gmail.com>' __copyright__ = "Copyr...
exy.py
import copy import json import logging as log import math import os import queue import random import threading from pathlib import Path from time import sleep import numpy as np import seaborn as sns from matplotlib import pyplot as plt from matplotlib.pyplot import imshow from PIL import Image, ImageDraw, ImageFil...
whatsapp_spammer.py
#import selenium and selenium keys from selenium import webdriver from selenium.webdriver.common.keys import Keys from time import sleep #threading optional import threading driver = webdriver.Firefox(executable_path="C:\\WebDriver\\bin\\geckodriver.exe") #Enter Location of Firefox driver. To change the bro...