source
stringlengths
3
86
python
stringlengths
75
1.04M
download_video_from_list.py
import os from seleniumwire import webdriver from selenium.webdriver.chrome.options import Options from seleniumwire.request import Response from webdriver_manager.chrome import ChromeDriverManager import wget from videoprops import get_video_properties import multiprocessing as mp """ The audio and video files are se...
zmq_driver.py
# Copyright 2018 Intel 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 applicable law or agreed to in wri...
make.py
import os import glob import time import shutil import bpy import json import stat from bpy.props import * import subprocess import threading import webbrowser import arm.utils import arm.write_data as write_data import arm.make_logic as make_logic import arm.make_renderpath as make_renderpath import arm.make_world as ...
DDbackend.py
from serial import Serial from threading import Thread, Lock class DaisyDriver(Serial): def __init__(self, connected = True): # check for connection bool to allow for dummy DaisyDriver object # if not connected if connected: # initialise DaisyDriver serial object (hard code serial address for now) super...
R6S Scoreboard Scanner.py
#Module importieren import cv2 import PIL import pytesseract import webbrowser import os import pyautogui import numpy as np import time from PIL import ImageGrab, Image, ImageTk import tkinter as tk import tkinter.filedialog as filedialog import ntpath import win32gui import glob import requests import...
fast_map.py
''' It's my first python package. You may notice it's somewhat not very presentable for public release. But it seems to do the thing. ''' import multiprocessing as mp # from multiprocessing.dummy import Pool as ThreadPool from concurrent.futures import ThreadPoolExecutor import math # from itertools import rep...
test_clients_gateways.py
import asyncio import copy import multiprocessing import time from typing import Dict import pytest from jina import Document, DocumentArray from jina.helper import random_port from jina.parsers import set_gateway_parser from jina.serve import networking from jina.serve.runtimes.gateway.grpc import GRPCGatewayRuntime...
datageneratingpipeline_coordinator.py
import argparse import logging import random from pathlib import Path from tempfile import NamedTemporaryFile from threading import Thread import zmq from buglab.data.deduplication import DuplicationIndex from buglab.utils.logging import MetricProvider, configure_logging LOGGER = logging.getLogger(__name__) metric_p...
client.py
__version__ = '0.0.1' import os.path import urllib.request, urllib.parse, urllib.error from urllib.parse import urlparse from threading import Thread, RLock import logging logger = logging.getLogger('onvif') logging.basicConfig(level=logging.INFO) logging.getLogger('suds.client').setLevel(logging.CRITICAL) import su...
test_urllib.py
"""Regresssion tests for urllib""" import urllib import httplib import unittest from test import test_support import os import sys import mimetools import tempfile import StringIO def hexescape(char): """Escape char as RFC 2396 specifies""" hex_repr = hex(ord(char))[2:].upper() if len(hex_r...
socks5proxy.py
# -*- coding: UTF8 -*- # -------------------------------------------------------------- # Copyright (c) 2015, Nicolas VERDIER (contact@n1nj4.eu) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: # ...
NVDAHighlighter.py
# visionEnhancementProviders/NVDAHighlighter.py # A part of NonVisual Desktop Access (NVDA) # This file is covered by the GNU General Public License. # See the file COPYING for more details. # Copyright (C) 2018-2019 NV Access Limited, Babbage B.V., Takuya Nishimoto """Default highlighter based on GDI Plus.""" ...
server.py
""" Utilities for creating bokeh Server instances. """ import datetime as dt import html import inspect import logging import os import pathlib import signal import sys import traceback import threading import uuid from collections import OrderedDict from contextlib import contextmanager from functools import partial,...
watchdog.py
# -*- coding: utf-8 -*- from kazoo.client import KazooClient import os import logging import time import signal from multiprocessing import Process main_dir = "obj" import sys reload(sys) sys.setdefaultencoding('utf-8') signal_dir = '/signal/jingdong' + '_' + sys.argv[1] task_type = "accurate_jingdong" keyword = sys...
profiler_api_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...
context.py
# coding=utf-8 # Licensed Materials - Property of IBM # Copyright IBM Corp. 2015,2020 """ Context for submission and build of topologies. """ __all__ = ['ContextTypes', 'ConfigParams', 'JobConfig', 'SubmissionResult', 'submit', 'build', 'run'] import logging import os import os.path import shutil import json import...
__init__.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ .. module:: locking_system :platform: Unix :synopsis: the top-level submodule of T_System that contains the classes related to T_System's Target Locking System. .. moduleauthor:: Cem Baybars GÜÇLÜ <cem.baybars@gmail.com> """ import threading from math import pi ...
tasks.py
# -*- coding: utf-8 -*- # Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python from collections import OrderedDict, namedtuple, deque import errno import functools import importlib import json import logging import os from io import StringIO from contextlib import redirect_stdout import shutil import stat...
emails.py
#!usr/bin/env python # -*- coding:utf-8 -*- """ @author:Administrator @file: emails.py @time: 2019/05/25 @software: PyCharm @detail: 提醒邮件函数 """ from threading import Thread from flask import url_for, current_app from flask_mail import Message from flask_babel import _ from bluelog.extensions import mail def _send_...
train.py
#!/usr/bin/env python """ Main training workflow """ import configargparse import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.logging import logger from onmt.train_single import main as single_main def main(opt): if opt.rnn_type == "SRU" and not opt....
conftest.py
import gc from http.server import HTTPServer, SimpleHTTPRequestHandler import json import multiprocessing import os import random import shutil import signal import subprocess import tempfile import time import warnings from django.core.servers import basehttp from django.core.wsgi import get_wsgi_application import p...
01.py
# -*- coding: utf-8 -*- import linepy from linepy import * from akad.ttypes import * from multiprocessing import Pool, Process from time import sleep import pytz, datetime, pafy, time, timeit, random, sys, ast, re, os, json, subprocess, threading, string, codecs, requests, tweepy, ctypes, urllib, wikipedia, html5lib f...
test_pdb.py
# A test suite for pdb; not very comprehensive at the moment. import doctest import os import pdb import sys import types import codecs import unittest import subprocess import textwrap from contextlib import ExitStack from io import StringIO from test import support # This little helper class is essential for testin...
dag_processing.py
# -*- coding: utf-8 -*- # # 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 #...
Valx_CTgov_multiCPUcores.py
# Valx: A system for extracting and structuring numeric lab test comparison statements from text # Created by Tony HAO, th2510@columbia.edu # Please kindly cite the paper: Tianyong Hao, Hongfang Liu, Chunhua Weng. Valx: A system for extracting and structuring numeric lab test comparison statements from text. Methods of...
winbox_drop_file.py
import random import threading import socket import sys import time ## # This file implements the Winbox server's key exchange and encryption mechanism # for Winbox before 6.43. The key exchange is Diffie Hellman using a 1984 bit # non-standard prime and the encryption is a custom RC4 drop-3072 using a 124 # byte sess...
context.py
# Ravestate context class import importlib from threading import Thread, Lock, Semaphore import logging from ravestate import icontext from ravestate import activation from ravestate import module from ravestate import state from ravestate import property from ravestate import registry class Context(icontext.ICont...
flasky.py
# -*- coding: utf-8 -*- from flask import Flask, request, make_response, render_template, Response, redirect, url_for from .notifier import WebSocket import json from .utils.inventory import PlayBookFactory, async_run_playbook import threading import time app = Flask(__name__) @app.route('/api/<path:version>/<path:a...
test_logo_client.py
import logging import time import unittest from multiprocessing import Process from os import kill import snap7 from snap7.server import mainloop logging.basicConfig(level=logging.WARNING) ip = '127.0.0.1' tcpport = 1102 db_number = 1 rack = 0x1000 slot = 0x2000 class TestLogoClient(unittest.TestCase): @class...
pzip.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import sys from multiprocessing import Process, Value, Lock from threading import Semaphore, Thread import zipfile import argparse import time def pyzip(args, t=False): global count if t == True: try: ...
scripts_regression_tests.py
#!/usr/bin/env python """ Script containing CIME python regression test suite. This suite should be run to confirm overall CIME correctness. """ import glob, os, re, shutil, signal, sys, tempfile, \ threading, time, logging, unittest, getpass, \ filecmp, time, atexit from xml.etree.ElementTree import ParseEr...
notify.py
#!/usr/bin/env python3 import threading import time import logging import json import smtplib from queue import Queue from queue import Empty import requests logger = logging.getLogger(__name__) class NotifyMsg(object): def __init__(self, email, alert_name): self.email = email self.alert_name ...
Chapter16_AsyncIO_01.py
# coding=utf-8 import threading import time def get_body(i): print("start", i) time.sleep(2) print("end", i) for i in range(5): t = threading.Thread(target=get_body, args=(i,)) t.start() # ### 进程与线程 # 进程是应用程序的启动实例,拥有代码和打开的文件资源、数据资源、独立的内存空间,是资源分配的最小单位; # 线程从属于进程,作为单一顺序的控制流被包含在进程...
InventoryBuilder.py
from flask import Flask from gevent.pywsgi import WSGIServer from threading import Thread from resources.Resourceskinds import NSXTMgmtPlane from tools.Vrops import Vrops import time import json import os import logging logger = logging.getLogger('vrops-exporter') class InventoryBuilder: def __init__(self, atlas...
ArduinoSerial_PyQt_Demo_ThreadMonitorSerial.py
# -*- coding: utf-8 -*- import queue import threading import serial import random import time from ArduinoSerial_PyQt_Demo_Global import * class ThreadArduino: """ """ def __init__(self, port, delay): self.SERIALPORT = port self.running = 1 self.msg = '' self.de...
test20181224.py
from runpy import run_path from tkinter import * import multiprocessing import os # from multiprocessing import Process def make_app(): app = Tk() app.geometry('300x300') Label(app, text='auto run script', font=('Arial', 25, 'bold')).pack() Listbox(app, name='listb', bg='#f2f2f2').pack(fill=BOTH, ex...
cli.py
import click import json from os import path import shutil import socket from multiprocessing import Process from . import VERSION from .clair import check_clair, post_layer, get_report, format_report_text, ClairException from .util import sha256, wait_net_service, err_and_exit, pretty_json from .image import check_im...
topic_observer.py
#!/usr/bin/env python # -*- coding: UTF-8 -*- # Copyright (C) 2020, Raffaello Bonghi <raffaello@rnext.it> # All rights reserved # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # 1. Redistributions of source code mus...
manager.py
import logging logger = logging.getLogger(__name__) logger.debug("Loaded " + __name__) import os import sys import signal from .kafka_connector import KafkaConnector from .rabbitMqConnector import RabbitMqConnector import threading from .vedaio import VedaSocketIO class Manager(object): Type = "Manager" def __ini...
__init__.py
from __future__ import annotations import collections from datetime import datetime from decimal import Decimal from functools import wraps import operator import os import re import string from typing import ( TYPE_CHECKING, Callable, ContextManager, Counter, Iterable, ) import warnings import nu...
dataengine_configure.py
#!/usr/bin/python # ***************************************************************************** # # Copyright (c) 2016, EPAM SYSTEMS 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 # #...
_coreg_gui.py
"""Traits-based GUI for head-MRI coregistration""" # Authors: Christian Brodbeck <christianbrodbeck@nyu.edu> # # License: BSD (3-clause) from copy import deepcopy import os from ..externals.six.moves import queue import re from threading import Thread import numpy as np from scipy.spatial.distance import cdist # al...
CntlrWinMain.py
''' Created on Oct 3, 2010 This module is Arelle's controller in windowing interactive UI mode @author: Mark V Systems Limited (c) Copyright 2010 Mark V Systems Limited, All rights reserved. ''' from arelle import PythonUtil # define 2.x or 3.x string types import os, sys, subprocess, pickle, time, locale, re, fnmatc...
server.py
import socket from threading import Thread #configurasi server listenerSocket = socket.socket() serverIP = "0.0.0.0" serverPort = 2222 def kirim_pesan(handlerSocket : socket.socket): while True: message = input() handlerSocket.send(message.encode()) print("server : {}".format(message)) def...
networking.py
import os import asyncio import ipaddress from threading import Thread from typing import Optional, List, Dict, TYPE_CHECKING, Tuple from urllib.parse import urlparse import grpc from grpc.aio import AioRpcError from jina.logging.logger import JinaLogger from jina.proto import jina_pb2_grpc from jina.enums import Pol...
static_pipe.py
import pandas import time import multiprocessing import os from buffered_pipe import Static_Pipe def SB(Q, pipe, D): Q.put(time.time()) list(map(pipe.send_bytes, D)) Q.put(time.time()) def test(cnt, size, Datas, ctx, method, parameters): Q = ctx.Queue() if method == 'Static_Pipe': pipe_r, ...
camera_image_source.py
import time from threading import Condition from threading import Thread import arc852.cli_args as cli from arc852.camera import Camera from arc852.generic_image_source import GenericImageSource class CameraImageSource(GenericImageSource): args = [cli.usb_camera, cli.usb_port] def __init__(self, usb_camera...
main.py
import json import threading from broker import init_kafka_consumer, KafkaTopics from database import * import logging import os KAFKA_BROKER_INSTANCES = os.environ["KAFKA_BROKER_INSTANCES"].split(",") LOG_LEVEL = os.environ["LOG_LEVEL"] logging.basicConfig(level=logging.ERROR, format='%(asctime)s %(levelna...
test_common.py
import pytest import socket from amqp import RecoverableConnectionError from unittest.mock import Mock, patch from case import ContextMock from kombu import common from kombu.common import ( Broadcast, maybe_declare, send_reply, collect_replies, declaration_cached, ignore_errors, QoS, PREFETCH_COUNT_M...
server.py
import flwr as fl import multiprocessing as mp import argparse from flower_helpers import Net, FedAvgDp, get_weights, test """ If you get an error like: “failed to connect to all addresses” “grpc_status”:14 Then uncomment the lines bellow: """ # import os # if os.environ.get("https_proxy"): # del os.environ["htt...
eventrecording.py
from collections import deque from threading import Thread from queue import Queue import time import cv2 class EventDetection: def __init__(self, bufsize=64, timeout=1.0): self.bufsize = bufsize self.timeout = timeout # create a buffer named frames and a queue for said buffer sel...
basic_gpu_test.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...
Item61.py
""" Item 61: Know How to Port Threaded I/O to asyncio This item shows how to port code that does threaded, blocking I/O over coroutines and asynchronous I/O. Slaitkin implements a TCP-based server (Transfer Control Protocol. See https://en.wikipedia.org/wiki/Transmission_Control_Protocol) for guessing a number. Th...
calc_stats.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2020 Patrick Lumban Tobing (Nagoya University) # Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) from __future__ import print_function import argparse import multiprocessing as mp import logging import os import numpy as np from sklearn.preprocessi...
ffmpegmux.py
import logging import subprocess import sys import threading from streamlink import StreamError from streamlink.compat import devnull, which from streamlink.stream.stream import Stream, StreamIO from streamlink.utils.named_pipe import NamedPipe, NamedPipeBase log = logging.getLogger(__name__) class MuxedStream(Stre...
test_urllib.py
"""Regresssion tests dla urllib""" zaimportuj urllib.parse zaimportuj urllib.request zaimportuj urllib.error zaimportuj http.client zaimportuj email.message zaimportuj io zaimportuj unittest z unittest.mock zaimportuj patch z test zaimportuj support zaimportuj os spróbuj: zaimportuj ssl wyjąwszy ImportError: s...
ThreadingTest.py
########################################################################## # # Copyright (c) 2010-2014, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
temp_var.py
def auto_logoff(): while tempvar.count_time_logoff < 600: tempvar.count_time_logoff += 1 print(tempvar.count_time_logoff) time.sleep(1) motor_stop() return exit() def notresponding(): while tempvar.count_time_stop_if_not_responding < 5: tempvar.count_time_sto...
mod_autoaim_extended309.py
# -*- coding: utf-8 -*- import os import re import json import codecs import datetime import threading import urllib import urllib2 import math import BigWorld import GUI import Vehicle import Math from constants import AUTH_REALM from Avatar import PlayerAvatar from AvatarInputHandler import cameras from BattleReplay...
sensor-threaded.py
#!/usr/bin/python3 """ Program: HC-SR04 Sensor Demo (sensor-threaded.py) Author: M. Heidenreich, (c) 2020 Description: This code is provided in support of the following YouTube tutorial: https://youtu.be/JvQKZXCYMUM This example shows how to use the HC-SR04 sensor to provide a continuou...
IpAddressPoolMain1.py
import time import threading from service.IpService import testIp from service.IpService import acquire from service.IpService import deleteIp import traceback from Log import log def main(): log.info('程序启动') try: threading.Thread(target=checkIpMain).start() threading.Thread(target=updata).sta...
test_gc.py
import unittest import unittest.mock from test.support import (verbose, refcount_test, cpython_only, start_threads, temp_dir, TESTFN, unlink, import_module) from test.support.script_helper import assert_python_ok, make_script import gc impor...
mapdl_grpc.py
"""gRPC specific class and methods for the MAPDL gRPC client """ import fnmatch from functools import wraps import glob import io import os import re import shutil import subprocess import tempfile import threading import time from warnings import warn import weakref import grpc from grpc._channel import _InactiveRpc...
rpi_camera.py
# =============================================================================== # Copyright 2016 Jake Ross # # 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...
jd_15.py
#!/bin/env python3 # -*- coding: utf-8 -* ''' cron: 0 59 23 * * 0 jd_15.py new Env('Faker群友家电15周年助力'); ''' # cron #不做浏览,只做助力 建议先运行jd_appliances.js 在运行此脚本 # export jd15_pins=["pt_pin1","pt_pin2"] from urllib.parse import unquote, quote import time, datetime, os, sys import requests, json, re, random i...
test_repository.py
from argparse import Namespace from multiprocessing import Process import pytest from leapp.repository.scan import find_and_scan_repositories, scan_repo from helpers import make_repository_dir from leapp.snactor.commands.new_actor import cli as new_actor_cmd from leapp.snactor.commands.new_tag import cli as new_tag_c...
host.py
from threading import Thread from input_manager import InputManager from vnc import VNC from port_forward import ssh_tunnel from bogus import main_account_screen import requests import sys PORTS_REQUEST = 'http://136.244.115.143:4000' status = 'None' connection = 'None' vnc = VNC() input_manager = InputManager() def...
dataengine_configure.py
#!/usr/bin/python # ***************************************************************************** # # 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 A...
test_issue_605.py
import collections import logging import os import threading import time 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 is_not_specified from slack import RTMClien...
server.py
#!/usr/bin/env python3 import asyncio import random import websockets import threading import time from queue import Queue event_loop = None websocket = None connection_ready = threading.Semaphore(value=0) recievied_data = Queue() def server_thread_body(): """ The body of the thread where asyncio event loop liv...
run.py
# Copyright (c) 2020 Institution of Parallel and Distributed System, Shanghai Jiao Tong University # ServerlessBench is licensed under the Mulan PSL v1. # You can use this software according to the terms and conditions of the Mulan PSL v1. # You may obtain a copy of Mulan PSL v1 at: # http://license.coscl.org.cn/M...
HiwinRA605_socket_ros_20190521164955.py
#!/usr/bin/env python3 # license removed for brevity #接收策略端命令 用Socket傳輸至控制端電腦 import socket ##多執行序 import threading import time ## import sys import os import numpy as np import rospy import matplotlib as plot from std_msgs.msg import String from ROS_Socket.srv import * from ROS_Socket.msg import * import HiwinRA605_s...
lisp-rtr.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...
setup.py
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import asyncio import contextlib import functools import json import os import socketserver import tempfile import threading from pathlib im...
client.py
from cryptoran import blockcipher, keyexchange import socket import select import threading import sys, os from PigeonConnection import PigeonConnection class PigeonClient(PigeonConnection): def __init__(self, serverIP: str, serverPort: int, messageHandler, disconnectionHandler: callable, cipherIV = N...
stream.py
########################################################################################################################################## ## License: Apache 2.0. See LICENSE file in root directory. ## #############################################...
run_tests.py
from __future__ import print_function from os import walk import sys, signal from datetime import datetime from multiprocessing import Process, Manager, Lock from aggregatortester import AggregatorTester from optimizertester import OptimizerTester from liftertester import LifterTester from structurertester import St...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import functools import os import re import sys import copy import time import types import signal import random import fnmatch import logging import ...
interface.py
''' title : interface.py description : A blockchain voting miner node implemenation, with the following features - Verification of vote (based on RSA algorithm) - Vote counting author : Jerry Xie date_created : 20190118 date_modified : 20190319 version ...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
mainwindow.py
# -*- coding: utf-8 -*- # # Copyright © Spyder Project Contributors # Licensed under the terms of the MIT License # (see spyder/__init__.py for details) """ Spyder, the Scientific Python Development Environment ===================================================== Developped and maintained by the Spyder Pro...
worker.py
#!/usr/bin/env python # encoding: utf-8 """ worker.py Created by Kurtiss Hare on 2010-03-12. """ import datetime import logging import multiprocessing import os import pymongo.objectid import signal import socket import time import util class MonqueWorker(object): def __init__(self, monque, queues=None, dispatch...
base.py
# -*- coding: utf-8 -*- """Internal module of protocols with abstract base classes. Applications should not directly import this module, expect to make subclasses. As a reminder: all internal strings, like identifier, should be represented in UTF-8. Use pynt.xmlns.UTF8 if you need help converting.""" # builtin modules...
views.py
from django.shortcuts import render from django.http import HttpResponse, HttpResponseRedirect from django.template import loader from django.utils import timezone, dateformat from django.urls import reverse from threading import Thread from pathlib import Path from .models import Status from .forms import CsvForm fro...
echoserver.py
import socket import threading import argparse def run_server(host, port): listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM) try: listener.bind((host, port)) listener.listen(5) print('Echo server is listening at', port) while True: conn, addr = listener.a...
graphql_client.py
""" GraphQL Client """ from datetime import datetime import json import random import string import threading import time import websocket from six.moves import urllib from . import __version__ class GraphQLClient: """ A simple GraphQL client """ def __init__(self, endpoint, session=None, verify=T...
utils.py
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import os import base64 import time import binascii import select import pathlib import platform import re from subprocess import PIPE, run from colorama import Fore, Style,init from pyngrok import ngrok import socket import threading import itertools import queue ...
download.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Background download management.""" from __future__ import print_function, unicode_literals, absolute_import import os, shutil, tempfile from threading import Thread, Lock try: # Python 2 # pylint:disable=import-error from urllib2 import urlopen, Request, URLEr...
data.py
from panel.api.router.templated import nodeRegister from panel.config.RootData import RootData import time import requests import threading class nodeData(): def __init__(self) -> None: self.nodeList = {} self.readFile() self.healthCheckStart() pass def healthCheckStart(self): ...
core.py
import re import struct import time import socket, select import threading try: import queue as queue except ImportError: import Queue as queue import netifaces from collections import namedtuple from . import commands from .utils import ValueRange class ISCPMessage(object): """Deals with formatting and ...
surfer.py
import time import random import argparse from multiprocessing import Process import requests from surfer_helper import ( ignore_keyboard_exception, resolve_post_hook, print_result ) @ignore_keyboard_exception def main(options): url = options["url"] num_processes = options["c"] num_requests = options["...
client.py
import logging import subprocess import multiprocessing import sys import uuid import time from socketIO_client import SocketIO, LoggingNamespace, BaseNamespace class appOUT(object): def __init__(self,log_queue=None): self.logger=log_queue def flush(self): pass ...
client.py
import socket import requests import sys from socket import AF_INET, SOCK_STREAM import threading import time import logging logging.basicConfig(filename="client.log", level=logging.DEBUG) logger = logging.getLogger(" [CLIENT] - ") class IRCClient(object): def __init__(self, host, port, name): self.host = host s...
build_imagenet_data.py
# Copyright 2016 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
StartSkip.py
from flask_restful import Api, Resource, reqparse from flask import Request from urllib.parse import urlencode import requests import time, threading import sqlite3 import tensorflow as tf import matplotlib.pyplot as plt import os import numpy as np from tensorflow.keras.preprocessing.image import ImageDataGenerator ...
settings.py
# MIT License # Copyright (c) 2017 GiveMeAllYourCats # 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, modify, mer...
main.py
# TimerX v1.1 # IMPORTS ver = "1.1" import time import tkinter import webbrowser from pathlib import Path from platform import system from threading import Thread from tkinter import Frame, PhotoImage, Tk, ttk from tkinter.constants import DISABLED, END, LEFT from tkinter.filedialog import askopenfile i...
pendcon.py
# -*- coding: utf-8 -*- import datetime import math import queue import serial import struct import threading import numpy as np import matplotlib.pyplot as plt import matplotlib.animation as animation from matplotlib.gridspec import GridSpec from matplotlib.widgets import Button, TextBox from matplotlib.patches impor...
device_monitors.py
#Copyright 2013 Pieter Rautenbach # # 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 writin...
main.py
import torch import torch.multiprocessing as mp import gym from actor_nn import ActorNN from critic_nn import CriticNN from test_process import test_process from train_process import train_process if __name__ == '__main__': #----------------------PARAMETERS------------------------------- MAX_WORKER_G...