source stringlengths 3 86 | python stringlengths 75 1.04M |
|---|---|
email.py | #!/usr/bin/env python
# coding=utf-8
from threading import Thread
from flask import current_app, render_template, copy_current_request_context
from flask_mail import Message
from . import mail
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(to, subject, template, *... |
main.py | import time
from threading import Thread
# Import modules for SMS & CALL flood
import tools.SMS.sendRequest as request
import tools.SMS.numberTools as number
import tools.SMS.randomData as randomData
def SMS_ATTACK(threads, attack_time, phone):
# Finish
global FINISH
FINISH = False
threads_list = []
... |
python3-60.py | #Example app - TCP Echo Server
#Make a TCP server in a process that handles multiple clients
#Echos back the data the client sent
#Imports
import logging
import multiprocessing
import socket
import select
logging.basicConfig(format='%(levelname)s - %(asctime)s: %(message)s',datefmt='%H:%M:%S', level=logging.DEBUG)
#... |
readers_writers.py | from threading import Semaphore, Thread
from concurrency.synchronization import LightSwitch
def write(array, no_writers, no_readers, write_switch):
write_switch.lock(no_readers)
no_writers.acquire()
array[3] = randint(0, 30)
no_writers.release()
write_switch.unlock(no_readers)
def read(array,... |
mbase.py | """
mbase module
This module contains the base model class from which
all of the other models inherit from.
"""
from __future__ import print_function
import sys
import os
import subprocess as sp
import shutil
import threading
if sys.version_info > (3, 0):
import queue as Queue
else:
impo... |
halo_notebook.py | from __future__ import absolute_import, print_function, unicode_literals
import sys
import threading
import cursor
from ..halo import Halo
from ..halo._utils import (colored_frame, decode_utf_8_text)
class HaloNotebook(Halo):
def __init__(self, text='', color='cyan', text_color=None, spinner=None, placement='l... |
reader.py | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
# See https://en.wikipedia.org/wiki/ISO_42... |
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... |
main.py | import os
import sys
import struct
import subprocess
from multiprocessing import Process
import errno
import cv2
from boundbox import Box, wrap_box
def setBbox():
cmd = "/home/rbccps2080/projects/prajwal/test/TensorRT-Yolov3/build/runYolov3"
subprocess.Popen(cmd)
def getBbox():
path = "/tmp/fifopipe"
... |
server.py | import falcon
import multiprocessing
import pbc.game
from dotenv import load_dotenv
from pathlib import Path
class AnswerResource(object):
def on_get(self, req, res):
"""Handles all get requests"""
res.status = falcon.HTTP_200
res.body = ('Hello, world!')
class StartGameResource(object):
... |
spoof.py | import time
import threading
from scapy.all import ARP, send # pylint: disable=no-name-in-module
from .host import Host
from evillimiter.common.globals import BROADCAST
class ARPSpoofer(object):
def __init__(self, interface, gateway_ip, gateway_mac):
self.interface = interface
self.gateway_ip = g... |
Server.py | import threading
import socket
HOST = ''
PORT = 9000
clients = set()
names = {}
def sendMsg(msg):
for clt in clients:
if clt is not None:
clt.sendall(msg.encode())
def handle(c, address):
name = c.recv(256)
names[address[1]] = name.decode()
c.sendall('Welcome to the server {user... |
exchange_rate.py | from datetime import datetime
import inspect
import requests
import sys
import os
import json
from threading import Thread
import time
import csv
import decimal
from decimal import Decimal
from .bitcoin import COIN
from .i18n import _
from .util import PrintError, ThreadJob
# See https://en.wikipedia.org/wiki/ISO_42... |
slave_allocator.py | from app.util.log import get_logger
from app.util.ordered_set_queue import OrderedSetQueue
from app.util.safe_thread import SafeThread
from app.master.slave import SlaveMarkedForShutdownError
class SlaveAllocator(object):
"""
The SlaveAllocator class is responsible for allocating slaves to prepared builds.
... |
client.py | import pdb
import random
import logging
import json
import sys
import time, datetime
from multiprocessing import Process
from milvus import Milvus, IndexType, MetricType
logger = logging.getLogger("milvus_benchmark.client")
SERVER_HOST_DEFAULT = "127.0.0.1"
SERVER_PORT_DEFAULT = 19530
def time_wrapper(func):
""... |
ping.py | #!/usr/local/bin/python
# -*- coding=utf-8 -*-
from __future__ import print_function
import subprocess
import threading
def is_reacheable(ip):
if subprocess.call(["ping"], "-c", "1", ip):
print("{0} is alive".format(ip))
else:
print("{0} is unreacheable".format(ip))
def main():
# file_obj... |
application.py | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... |
bounded_knsapsack_dqn_main.py | #!/usr/bin/env python3
import time
import torch
import torch.multiprocessing as mp
from torch import optim
import os
import numpy as np
from codes.f_utils.common_utils import make_or_gym_env
from config.names import EnvironmentName, PROJECT_HOME
print(torch.__version__)
from common.fast_rl import actions, value_base... |
alarm.py | # Copyright (c) 2009-2019 Tom Keffer <tkeffer@gmail.com>
# See the file LICENSE.txt for your rights.
"""Example of how to implement an alarm in WeeWX.
*******************************************************************************
To use this alarm, add the following to the weewx configuration file:
[Alarm]
... |
tunnel_tcp.py | import sys
import json
import threading
import websockets
import ssl
import certifi
from .tcp import Client
ssl_context = ssl.create_default_context()
ssl_context.load_verify_locations(certifi.where())
async def open_tcp_tunnel(ws_uri, remote_server_host, local_server_port,local_server_host):
async with websoc... |
thread.py | import threading
def fire_and_forget(f):
"""
Use as such:
Example
----------
.. code-block::
@fire_and_forget
def send_analytics():
...
"""
def wrapped():
threading.Thread(target=f).start()
return wrapped
|
dockable.py | #!/usr/bin/env python3
import finplot as fplt
from functools import lru_cache
from PyQt5.QtWidgets import QApplication, QGridLayout, QMainWindow, QGraphicsView, QComboBox, QLabel
from pyqtgraph.dockarea import DockArea, Dock
from threading import Thread
import yfinance as yf
app = QApplication([])
win = QMainWindow()... |
app.py | # -*- coding: utf-8 -*-
from datetime import datetime
from flask import Flask
from flask import render_template, request
import logging
import telegram
import leancloud
from leancloud import Engine, Query, Object, LeanCloudError
import random
import re
import sys
import urllib2
import json
import threading
reload(sy... |
crlf_injection.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import ninja
import argparse
import timeit
import multiprocessing as mp
import sys
# save_data의 경우는 함수마다 공격의 결과값을 판단하는 패턴이 다르므로 개별로 정의
class crlf(ninja.web):
def save_data(self, method, case, url, payloads, res):
self.collection_saving_results = self.db["report"... |
command.py | # Copyright (c) 2014-present PlatformIO <contact@platformio.org>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... |
pub_sub_test.py | import redis
from assert_helper import *
import time
import threading
from conn import *
def subscribe(channel, master=True):
conn = get_redis_conn(master)
p = conn.pubsub()
p.subscribe(channel)
for item in p.listen():
if item['type'] == "message":
assert (item['data'] == "a")
... |
management.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
.. module:: __init__
:synopsis: module that contains the handlers for the management API.
"""
import os
import re
import json
import copy
import shutil
import logging
import threading
from typing import (
Union,
Tuple, Optional, Awaitable
)
from collections i... |
test_local.py | import interface_c_python_location
import interface_c_python_commands
import logging
import os
import threading
logging.basicConfig(level=logging.DEBUG)
if os.path.exists("socketLocation"):
os.remove("socketLocation")
if os.path.exists("socketCommands"):
os.remove("socketCommands")
interface_loc = interf... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
test_bus.py | """Publish-subscribe bus tests."""
# pylint: disable=redefined-outer-name
import os
import sys
import threading
import time
import unittest.mock
import pytest
from cherrypy.process import wspbus
CI_ON_MACOS = bool(os.getenv('CI')) and sys.platform == 'darwin'
msg = 'Listener %d on channel %s: %s.' # pylint: disab... |
CloakJS.py | import sys
from os.path import isfile, isdir, join, abspath, splitext, basename, exists, dirname, relpath
from os import makedirs, remove as removefile
from subprocess import Popen, PIPE, STDOUT
from threading import Thread
from queue import Queue, Empty
from cloakx import Extension
from cloakx.CloakBase import CloakBa... |
BuildReport.py | ## @file
# Routines for generating build report.
#
# This module contains the functionality to generate build report after
# build all target completes successfully.
#
# Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
## Import Modules
#
import ed... |
silent.py | #!/usr/bin/env python
'''
'''
__docformat__ = 'restructuredtext'
__version__ = '$Id$'
import time
from pyglet.media import AbstractAudioPlayer, AbstractAudioDriver, \
MediaThread, MediaEvent
import pyglet
_debug = pyglet.options['debug_media']
class SilentAudioPacket(object):
def __in... |
__init__.py | # -*- coding: utf-8 -*-
'''
Set up the Salt integration test suite
'''
# Import Python libs
from __future__ import absolute_import, print_function
import os
import re
import sys
import copy
import json
import time
import stat
import errno
import signal
import shutil
import pprint
import atexit
import socket
import lo... |
server.py | import socket
import threading
import time
HOST = '127.0.0.1' # Standard loopback interface address (localhost)
PORT = 65339 # Port to listen on (non-privileged ports are > 1023)
def client(conn,addr,startchat):
with conn:
print('Connected by', addr)
i=0
while i < len(startchat)-1:
... |
start_api_integ_base.py | import shutil
import uuid
from typing import List, Optional, Dict
from unittest import TestCase, skipIf
import threading
from subprocess import Popen, PIPE
import os
import logging
import random
from pathlib import Path
import docker
from docker.errors import APIError
from tests.testing_utils import kill_process
from... |
trex_tui.py | from __future__ import print_function
import termios
import sys
import os
import time
import threading
from collections import OrderedDict, deque
from texttable import ansi_len
import datetime
import readline
if sys.version_info > (3,0):
from io import StringIO
else:
from cStringIO import StringIO
from .... |
middleware.py | """
Here are all the sockets.
There shall not be any sockets outside of this file.
There shall be one socket in one seperate thread (multithreading)
for every tcp connections
also one socket in a thread for the udp socket for broadcast
"""
import uuid
import threading
import socket
import ipaddress
from ti... |
dns_server.py | #!/usr/bin/env python
import sys
import struct
import os
import threading
from scapy.all import *
from scapy.layers.inet import _IPOption_HDR
def get_if():
ifs=get_if_list()
iface=None
for i in get_if_list():
if "eth0" in i:
iface=i
break;
if not iface:
print "... |
py3test_runners.py | # -*- coding: utf-8 -*-
"""
Testing connection observer runner API that should be fullfilled by any runner
- submit
- wait_for
This integration tests check cooperation of the 3 players:
connection_observer - runner - connection
Main focus is on runner and it's correctness.
"""
__author__ = 'Grzegorz Latuszek'
__copy... |
utils.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-11-06 11:50:13
import math
import sys
import codecs
import logging
import hashlib
import datetime
import pickle
import socket
import base64
import wa... |
http-status.py | # -*- coding: utf-8 -*-
# FLEDGE_BEGIN
# See: http://fledge-iot.readthedocs.io/
# FLEDGE_END
""" Weather report from OpenWeatherMap async plugin """
import copy
import asyncio
import json
import logging
from threading import Thread
from aiohttp import web
from fledge.common import logger
from fledge.plugins.common ... |
Task.py | # This is a task
import numpy as np
from threading import Lock, Thread
from openEPhys_DACQ.RPiInterface import RewardControl
from time import time, sleep
from scipy.spatial.distance import euclidean
import random
from PyQt5 import QtWidgets, QtGui
import warnings
from copy import copy, deepcopy
from openEPhys_DACQ.au... |
scheduler.py | # Copyright 2020 The FedLearner 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... |
__init__.py | # coding: utf-8
from multiprocessing import Process
import logging
import signal
import threading
from asyncio_helpers import cancellable
from flatland import Form, String, Enum
from logging_helpers import _L
from zmq_plugin.bin.hub import run_hub
from zmq_plugin.hub import Hub
from zmq_plugin.plugin import Plugin as ... |
bomber.py | #!/usr/bin/env python
from datetime import datetime
import os
import hashlib
import sys
import time
import threading
import string
import random
import base64
import urllib.request
import urllib.parse
try:
import requests
except ImportError:
print('[!] Error: some dependencies are not installed')
print('Ty... |
test_lock.py | """Test the clients `lock` interface."""
from datetime import timedelta
from tempfile import NamedTemporaryFile
from threading import Thread
from time import sleep
import pytest # type: ignore
from throttle_client import Client, heartbeat, Peer, Timeout, lock
from . import BASE_URL, cargo_main, throttle_client
d... |
daq.py | """
This module defines a control interface for the LCLS1 DAQ.
"""
import enum
import functools
import logging
import os
import time
import threading
from importlib import import_module
from ophyd.status import Status
from ophyd.utils import StatusTimeoutError, WaitTimeoutError
from . import ext_scripts
from .ami imp... |
object_tracking.py |
import time
import cv2
import numpy as np
import matplotlib.pyplot as plt
from threading import Thread, Lock
from collections import deque
from deep_sort import preprocessing
from deep_sort import nn_matching
from deep_sort.detection import Detection
from deep_sort.tracker import Tracker
from deep_sort.detection imp... |
surface.py | import tkinter as tk
from tkinter.filedialog import *
from tkinter import ttk
import predict
import cv2
from PIL import Image, ImageTk
import threading
import time
from tkinter import messagebox
import webbrowser
class Surface(ttk.Frame):
pic_path = ""
viewhigh = 600
viewwide = 600
update_time = 0
thread = Non... |
test_redundant_router.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... |
UseTdxImportToH5Thread.py | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2010-2017 fasiondog/hikyuu
#
# 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 r... |
test_tracer.py | # -*- coding: utf-8 -*-
"""
tests for Tracer and utilities.
"""
import contextlib
import multiprocessing
import os
from os import getpid
import threading
from unittest.case import SkipTest
import warnings
import mock
import pytest
import ddtrace
from ddtrace.constants import ENV_KEY
from ddtrace.constants import HOST... |
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 textwrap
import threading
import time
import unitt... |
test_tcp.py | # -*- coding: utf-8 -*-
"""
:codeauthor: Thomas Jackson <jacksontj.89@gmail.com>
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import socket
import threading
import salt.config
import salt.exceptions
import salt.ext.tornado.concurrent
import salt... |
Rerequester.py | # Written by Bram Cohen
# modified for multitracker operation by John Hoffman
# see LICENSE.txt for license information
from horde.BitTornado.zurllib import urlopen, quote
from urlparse import urlparse, urlunparse
from socket import gethostbyname
from btformats import check_peers
from horde.BitTornado.bencode import b... |
thread_safe_datastore.py | import threading
from contextlib import contextmanager
from pymodbus.datastore.store import BaseModbusDataBlock
class ContextWrapper(object):
""" This is a simple wrapper around enter
and exit functions that conforms to the pyhton
context manager protocol:
with ContextWrapper(enter, leave):
d... |
grpcserver.py | import os
import sys
import grpc
import json
import base64
import threading
import importlib
from concurrent import futures
from google.protobuf import json_format
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "art"))
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", "art", "san... |
sleepycat.py | from rdflib.store import Store, VALID_STORE, NO_STORE
from rdflib.term import URIRef
from rdflib.py3compat import b
def bb(u):
return u.encode('utf-8')
try:
from bsddb import db
has_bsddb = True
except ImportError:
try:
from bsddb3 import db
has_bsddb = True
except ImportError:
... |
gui.py | import tkinter as tk
import threading
from QueryGrade.query_grade import query_grade
class Application:
def __init__(self, master=None):
self.master = master
self.master.title('成绩查询')
self.master.resizable(False, False)
self.create_widgets()
self.is_query = False
def c... |
youtubequeue.py | import os
import settings
settings.generateConfigFile()
import soundfile as sf
from pydub import AudioSegment
import generatorclient
from time import sleep
from subprocess import *
import videouploader
from threading import Thread
import pickle
import datetime
from datetime import timedelta
from PIL import Image
import... |
vcenter_firewall.py | # Copyright 2015 Mirantis, 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 a... |
server.py | import grpc
import torch
import numpy as np
import collections
import time
import threading
from marshmallow.exceptions import ValidationError
from . import speech_pb2, speech_pb2_grpc
from patter import ModelFactory
from patter.config import ServerConfiguration
from patter.data import AudioSegment
from patter.decode... |
server.py | #!/usr/bin/python3
import casambi
import yaml
import logging
import logging.handlers
import json
import time
import websocket
import paho.mqtt.client as mqtt
import queue
import multiprocessing
import socket
import re
from time import sleep
from setproctitle import setproctitle
def parse_config(confi... |
session.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... |
take360.py | #!/usr/bin/env python
import os
import io
import time
import sys
from skimage import io
import signal
import struct
import subprocess
import threading
import numpy as np
import argparse
################################################################
# Initialise the Raspberry Pi video
###############################... |
TSocketTest.py | # Copyright (c) Facebook, Inc. and its affiliates.
#
# 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 ... |
Comic2pdfAdv.py | import requests
from colorama import *
import time
import os
import fitz
import threading
import glob
from pyquery import PyQuery as pq
class Comic2PDF():
# 构造函数
def __init__(self):
self.path = "./download/"
self.file_name = ""
self.label = "谨以此软件献给永远的神作----龙珠"
# 获取当前时间戳,这个值无所谓,加... |
test_stim_client_server.py | import threading
import time
from nose.tools import assert_equal, assert_raises, assert_true
from mne.realtime import StimServer, StimClient
from mne.externals.six.moves import queue
from mne.utils import requires_good_network, run_tests_if_main
_server = None
_have_put_in_trigger = False
_max_wait = 10.
@requires... |
executor.py | #!/usr/bin/env python
import os
import pickle
import subprocess
import sys
import threading
import time
from threading import Thread
import mesos
# This function is called in its own thread to actually run the user's command.
# When it finishes, it shuts down the scheduler driver (disconnecting the
# framework) and... |
test.py | import gzip
import json
import logging
import os
import io
import random
import threading
import time
import helpers.client
import pytest
from helpers.cluster import ClickHouseCluster, ClickHouseInstance, get_instances_dir
MINIO_INTERNAL_PORT = 9001
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
CONFIG_PA... |
server.py | import datetime
import os
import json
import time
from threading import Thread
from flask import Flask, request, jsonify, Response, send_from_directory
from flask_cors import CORS
from flask_restx import Api, Resource
from werkzeug.middleware.proxy_fix import ProxyFix
from src import *
from src.connectors import antr... |
test_basic.py | # coding: utf-8
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
from concurrent.futures import ThreadPoolExecutor
import glob
import io
import json
import logging
from multiprocessing import Process
import os
import random
import re
import... |
test_opcua_connector.py | # Copyright 2021. ThingsBoard
# #
# 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 ... |
SServer.py | import socket
import sys
import threading
import colorama
import termcolor
class Server:
def __init__(self,host,port):
self.host = host
self.port = port
def ServerStart(self):
colorama.init()
version = 1 #Every Three New Commands a new version will be made
... |
imageme.py | #!/usr/bin/python
"""
imageMe is a super simple image gallery server.
Run imageme.py from the top level of an image directory to generate gallery
index HTML and run a SimpleHTTPServer on the localhost.
Imported as a module, use imageme.serve_dir(your_path) to do the same for any
directory programmatically. When run a... |
cplib.py | # -*- encoding: utf-8 -*-
import sys
import os.path
import subprocess
from multiprocessing import Process
__version__ = (0, 4, 0)
if 'python.exe' in sys.executable:
PATH = os.path.dirname(os.path.realpath(sys.argv[0]))
else:
PATH = os.path.dirname(os.path.realpath(sys.executable))
DATA = os.path.join(PATH,... |
euler.py | #!/usr/bin/env python3
from ev3dev2.motor import Motor, SpeedRPS, MoveTank
from ev3dev2.sensor.lego import ColorSensor, UltrasonicSensor
from ev3dev2.power import PowerSupply
from math import pi, sin, cos, atan
from threading import Thread
import numpy as np
from time import sleep, time
class sensores_y_bateria:
... |
client.py | import json
import os
import tempfile
import threading
import time
import fedn.common.net.grpc.fedn_pb2 as fedn
import fedn.common.net.grpc.fedn_pb2_grpc as rpc
import grpc
# TODO Remove from this level. Abstract to unified non implementation specific client.
from fedn.utils.dispatcher import Dispatcher
CHUNK_SIZE = ... |
scheduler.py | #!/usr/bin/python
# -*- coding utf-8 -*-
# Project: ProxyPool
# Author: jiangnan
# Mail: jiangnanmax@gmail.com
# Date: 2018/12/6
import time
from multiprocessing import Process
import asyncio
import aiohttp
from aiohttp import ClientProxyConnectionError as ProxyConnectionError,ServerDisconnectedError,ClientResponseEr... |
process.py | from concurrent.futures import ThreadPoolExecutor
from functools import reduce, wraps
import inspect
import io
import logging
import multiprocessing as mp
import os
import queue
import re
import select
import signal
import stat
import subprocess
import sys
import threading
import _thread
import traceback
import psutil... |
__init__.py | # Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Modified BSD License.
import sys
import time
from threading import Thread
from unittest import TestCase
try:
from unittest import SkipTest
except ImportError:
from unittest2 import SkipTest
from pytest import mark
import zmq
from zmq.util... |
custom.py | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... |
scheduler_old.py | '''
This is the application scheduler.
It defines scheduled tasks and runs them as per their defined schedule.
This scheduler is started and stopped when the app is started and stopped.
Unless RUN_SCHEDULE is set to False in the config. In which case it must be started manually / managed by supervisor.
It is presume... |
job_events.py | # Copyright 2019-2021 Hewlett Packard Enterprise Development LP
#
# 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, ... |
ui.py | from ctypes import sizeof
from logging import disable
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkinter.font import Font
from datetime import date
from datetime import datetime as dtime
from openpyxl import load_workbook
from openpyxl.utils import *
from matplotlib.back... |
imagepanel.py | #!/usr/bin/python
##
## MPlot PlotPanel: a wx.Panel for 2D line plotting, using matplotlib
##
import sys
import time
import os
import wx
from threading import Thread
import numpy as np
import matplotlib
import matplotlib.cm as cmap
from matplotlib.figure import Figure
from matplotlib.gridspec import GridSpec
from mat... |
HiwinRA605_socket_ros_20190604112000.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... |
base_touch.py | # -*- coding: utf-8 -*-
import threading
import time
import six
from six.moves import queue
from airtest.utils.logger import get_logger
from airtest.utils.snippet import (on_method_ready, ready_method, reg_cleanup)
LOGGING = get_logger(__name__)
class BaseTouch(object):
"""
A super class for Minitouch or Ma... |
bg.py | # -*- encoding:utf-8 -*-
import os
import io
import sys
import json
import importlib
import traceback
import threading
import zen
import zen.tbw
import zen.misc
import zen.biom
import zen.task
RELEASE = threading.Event()
REPORT = {}
def setInterval(interval):
def decorator(function):
"""Main decorator ... |
build.py | #!/usr/bin/env python
# Copyright 2020 The Defold Foundation
# Licensed under the Defold License version 1.0 (the "License"); you may not use
# this file except in compliance with the License.
#
# You may obtain a copy of the License, together with FAQs at
# https://www.defold.com/license
#
# Unless required by applica... |
email.py | from flask_mail import Message
from app import mail
from flask import render_template
from app import app
# for sending messages in background mode
from threading import Thread
def send_async_email(app, msg):
with app.app_context():
mail.send(msg)
def send_email(subject, sender, recipients, text_body, h... |
ssh.py | import paramiko
import socket
import json
from threading import Thread
class SSH:
def __init__(self, websocker, message):
self.websocker = websocker
self.message = message
def connect(self, host, user, password=None, port=22, timeout=30,
term='xterm', pty_width=80, pty_hei... |
priority_queues.py | import queue
import threading
import time
def do_work(item):
print(f'{threading.current_thread()} removed {item} from the queue')
def worker(queue):
while not queue.empty():
item = queue.get()
if item is None:
print('item is none')
break
do_work(item)
... |
test_run_neon.py | # # NEON AI (TM) SOFTWARE, Software Development Kit & Application Development System
# # All trademark and other rights reserved by their respective owners
# # Copyright 2008-2021 Neongecko.com Inc.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the foll... |
views.py | from django.shortcuts import render,redirect
from django.http import HttpResponse
from .models import ParkingInfo,ParkingSpot
from datetime import datetime,timedelta
from django.contrib.auth.models import User,auth
from django.contrib import messages
from django.utils import timezone
from django.utils.timezone import m... |
bmv2.py | # coding=utf-8
"""
Copyright 2019-present Open Networking Foundation
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 la... |
Scheduler.py | import datetime
import time
from multiprocessing import Process
import json
from src.application_management.CompletenessConstraint import CompletenessConstraint
from src.application_management.StaticTimeout import StaticTimeout
from src.application_management.Publisher import Publisher
# invoked when a process times ... |
views.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import base64
import random
import logging
import time
import threading
import os
from ssshare import app
from ssshare.ascii import birthday_2017, ss_title
from ssshare.ss import crawler
from ssshare import donation
from flask import render_template, send_from_directory, ab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.