source
stringlengths
3
86
python
stringlengths
75
1.04M
__init__.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """µWeb3 Framework""" __version__ = '3.0' # Standard modules import configparser import logging import os import re import sys from wsgiref.simple_server import make_server import datetime # Package modules from . import pagemaker, request # Package classes from .response ...
buffer_simple_file_unittest.py
#!/usr/bin/env python3 # # Copyright 2016 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Unittests for simple file-based buffer.""" # TODO(kitching): Add tests that deal with "out of disk space" situations. # TODO(...
test_user_secrets.py
import json import os import threading import unittest from http.server import BaseHTTPRequestHandler, HTTPServer from test.support import EnvironmentVarGuard from urllib.parse import urlparse from google.auth.exceptions import DefaultCredentialsError from google.cloud import bigquery from kaggle_secrets import (_KAGG...
symbolviewer.py
########################################################################### # # Copyright 2019 Samsung Electronics 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 # # htt...
htb.py
#!/usr/bin/python from bs4 import BeautifulSoup import json import threading import requests import time from os.path import realpath, dirname import sys import netifaces as net from chats import apikey args = sys.argv if len(args) == 1: print """\033[96m[+] \033[92mTry These Commands: \033[96m[+] \033[92mhtb chat ...
sockskull.py
########################################### # This Script Is Code By GogoZin # # Can Use In Stress Test # # But Don't Attack Any Gov Site # # If Want Me To Keep Update # ########################################### import requests import random import time import threading from colorama import...
test_connect.py
import pytest import pdb import threading from multiprocessing import Process from utils import * CONNECT_TIMEOUT = 12 class TestConnect: def local_ip(self, args): ''' check if ip is localhost or not ''' if not args["ip"] or args["ip"] == 'localhost' or args["ip"] == "127.0.0.1":...
distancia.py
import RPi.GPIO as GPIO import time import threading GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) ECHO_DIR = 29 TRIG_DIR = 31 ECHO_ESQ = 35 TRIG_ESQ = 37 distancia_cm_esquerda = 0 distancia_cm_direita = 0 def setup_sensor_som(): GPIO.setup(ECHO_DIR, GPIO.IN) GPIO.setup(TRIG_DIR, GPIO.OUT) GPIO.setu...
index.py
from flask import Flask from flask import jsonify, abort from flask import request from flask_limiter import Limiter from flask_limiter.util import get_remote_address, get_ipaddr from flask_cors import CORS, cross_origin from queue import Queue import threading import waitingtimes import hashlib import js...
server.py
from __future__ import print_function from flask import Flask, jsonify, request from flask_socketio import SocketIO, emit from collections import namedtuple from sendgcode import GCodeSender import sys import time import threading import math app = Flask(__name__) app.config['SECRET_KEY'] = 'Idontcareabouts...
1_threads.py
import time from threading import Thread ####### SINGLE THREAD def ask_user(): start = time.time() user_input = input('Enter your name: ') greet = f'Hello, {user_input}' print(greet) print('ask_user: ', time.time() - start) def complex_calculation(): print('Started calculating...') start = time.time() [x**2 ...
utils.py
import builtins import datetime import inspect import threading import time global _c,_pq _c={} _pq=None _tl=threading.Lock() def _print_q(): global _pq lt=time.time() fs=__import__("storage") fs.set_silent("log.log") dt=fs.read("log.log") lc=dt.count(b"\n") while (True): if (len(_pq)>0): _tl.acquire(...
scene_layout_sensors.py
import time from threading import Thread from srunner.scenariomanager.carla_data_provider import CarlaDataProvider import scene_layout as scene_layout_parser # This should come from CARLA path def threaded(fn): def wrapper(*args, **kwargs): thread = Thread(target=fn, args=args, kwargs=kwargs) t...
decorators.py
import functools import uuid import threading from flask import request, make_response, g, jsonify, url_for, \ copy_current_request_context from . import app import kvstore CONSUL_ENDPOINT = app.config.get('CONSUL_ENDPOINT') kv = kvstore.Client(CONSUL_ENDPOINT) def asynchronous(f): """Run the r...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import json import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional, TYPE_CH...
test_search_20.py
import pytest from time import sleep from base.client_base import TestcaseBase from utils.util_log import test_log as log from common import common_func as cf from common import common_type as ct from common.common_type import CaseLabel, CheckTasks from utils.utils import * from common.constants import * prefix = "se...
avatar_protocol.py
from __future__ import unicode_literals from __future__ import print_function from __future__ import division from __future__ import absolute_import from builtins import object from future import standard_library standard_library.install_aliases() import threading import logging from queue import Queue, Empty from avat...
util.py
# util import types from zlib import compress as _compress, decompress import threading import warnings try: from dpark.portable_hash import portable_hash as _hash except ImportError: import pyximport pyximport.install(inplace=True) from dpark.portable_hash import portable_hash as _hash COMPRESS = 'zl...
wsgui.py
#! /usr/bin/env python """Tkinter-based GUI for websucker. Easy use: type or paste source URL and destination directory in their respective text boxes, click GO or hit return, and presto. """ from Tkinter import * import websucker import os import threading import Queue import time VERBOSE = 2 try: class Canc...
Client.py
import socket from typing import Optional, Union import threading import logging from data import Message, MessageListener, CloseListener logger = logging.getLogger('CA-Client') class Client: _socket: socket.socket _host: str = '127.0.0.1' _port: int = 20307 _running: bool = False _messageCallback: MessageListe...
testcases.py
""" Subclasses of unittest.TestCase. """ from __future__ import absolute_import import os import os.path import shutil import threading import unittest from .. import config from .. import core from .. import logging from .. import utils def make_test_case(test_kind, *args, **kwargs): """ Factory function ...
server.py
from threading import Thread from queue import Queue from message import Message, MessageType import socket import select class Connection: def __init__(self, _logger, socket, address="unknown", fileroot='/tmp'): self._logger = _logger self.socket = socket self.address = address # ...
input_output_nums.py
#!/usr/bin/python ## This multithreading program runs five times ## and each time the program takes two numbers as given input ## and print sum of them. import threading import time def MyThread(num1, num2): print("Given Numbers: %s, %s" %(num1, num2)) sum1= int(num1) + int(num2) print("Result: %d" %sum1) ret...
sets.py
from cards import Cards from ethereum import Ethereum from json.decoder import JSONDecodeError from opensea import OpenSea from os.path import exists from pushcontainer import push_container from re import S from singleton import Singleton from threading import Thread from time import time import dearpygui.dearpygui as...
verification.py
import datetime from email.mime.text import MIMEText import csv import smtplib from optparse import OptionParser import os from Queue import Queue from threading import Thread def eliminate_duplicates(csv_file, eid_index, time_index): student_dict = {} for csv_line in csv: eid = csv_line[eid_index] ...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum.util import bfh, bh2u, UserCancelled, UserFacingException from electrum.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum.bip32 import BIP32Node from electrum import constants from electrum.i18n import _ from electrum.transaction im...
full_task.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # Импорт библиотек import math import time import cv2 import numpy as np import rospy import tf try: from clover import srv except: from clever import srv from std_srvs.srv import Trigger from mavros_msgs.srv import CommandBool f...
remote.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...
terminate_the_fuck.py
#A stratum compatible miniminer #based in the documentation #https://slushpool.com/help/#!/manual/stratum-protocol #2017-2019 Martin Nadal https://martinnadal.eu import socket import json import random import traceback import tdc_mine import time from multiprocessing import Process, Queue, cpu_count bfh = bytes.fro...
installwizard.py
# Copyright (C) 2018 The Electrum developers # Distributed under the MIT software license, see the accompanying # file LICENCE or http://www.opensource.org/licenses/mit-license.php import os import sys import threading import traceback from typing import Tuple, List, Callable, NamedTuple, Optional from PyQt5.QtCore i...
data_util.py
''' this file is modified from keras implemention of data process multi-threading, see https://github.com/fchollet/keras/blob/master/keras/utils/data_utils.py ''' import time import numpy as np import threading import multiprocessing try: import queue except ImportError: import Queue as queue class GeneratorE...
server.py
import math import multiprocessing import os import queue import sys import threading import time import uuid from collections import namedtuple from concurrent.futures import ThreadPoolExecutor from threading import Event as ThreadingEventType from time import sleep from typing import NamedTuple import grpc from grpc...
main.py
import argparse from urllib.parse import urlparse import sys import socket import socketserver import http.server import struct import select from multiprocessing import Process, Manager from multiprocessing.managers import BaseManager from time import sleep, time ### Configuration ### # select() timeout timeout = 30...
roputils.py
#!/usr/bin/env python # -*- coding:utf-8 -*- import sys import os import re import struct import socket import select import random import tempfile from pwn import * from subprocess import Popen, PIPE from threading import Thread, Event from telnetlib import Telnet from contextlib import contextmanager #context.log_lev...
test_subprocess.py
import unittest from unittest import mock from test import support import subprocess import sys import signal import io import itertools import os import errno import tempfile import time import traceback import types import selectors import sysconfig import select import shutil import threading import gc import textwr...
pyrep.py
from pyrep.backend import vrep, utils from pyrep.objects.object import Object from pyrep.objects.shape import Shape from pyrep.textures.texture import Texture from pyrep.errors import PyRepError import os import sys import time import threading from threading import Lock from typing import Tuple, List class PyRep(obj...
alpaca_engine.py
import asyncio from datetime import datetime import json import pprint import threading import queue import os import sys import alpaca_trade_api as tradeapi from alpaca_trade_api.polygon.entity import ( Quote, Trade, Agg, Entity, ) from alpaca_trade_api.polygon.stream2 import StreamConn as PolygonStreamConn from ...
clickhouse.py
# -*- coding: utf-8 -*- """ Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available. Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved. BK-BASE 蓝鲸基础平台 is licensed under the MIT License. License for BK-BASE 蓝鲸基础平台: ------------------------------------------...
subscriber.py
# -*- coding: utf-8 -*- # # The MIT License (MIT) # # Copyright (c) 2017 Ivo Tzvetkov # # 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 ri...
server.py
from re import S import select import socket import queue import threading import sys import pickle import base64 import os from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives.ciphers.aead import AESGCM from cryptography.hazmat.primitives.serialization import load_ssh_public_key...
test_service.py
#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(C) 2020-2022 Intel Corporation # Authors: # Hector Blanco Alcaine import multiprocessing import os import socket import sys import time import unittest import unittest.mock from detd import StreamConfiguration from detd import TrafficSpecif...
TFCluster.py
# Copyright 2017 Yahoo Inc. # Licensed under the terms of the Apache 2.0 license. # Please see LICENSE file in the project root for terms. """ This module provides a high-level API to manage the TensorFlowOnSpark cluster. There are three main phases of operation: 1. **Reservation/Startup** - reserves a port for the T...
startstress.py
print('Загрузка...') import os import time import threading try: import requests except: os.system('pip install requests') try: import colorama except: os.system('pip install colorama') if os.sys.platform == 'win32': def clear(): os.system('cls') else: def clear(): os.system('cle...
conditional_accumulator_test.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
graphics_client.py
# -*- coding: utf-8 -*- """ .. invisible: _ _ _____ _ _____ _____ | | | | ___| | | ___/ ___| | | | | |__ | | | |__ \ `--. | | | | __|| | | __| `--. \ \ \_/ / |___| |___| |___/\__/ / \___/\____/\_____|____/\____/ Created on Jan 31, 2014 Contains GraphicsClient cllass, which handlin...
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_xmlrpc.py
import base64 import datetime import sys import time import unittest import xmlrpclib import SimpleXMLRPCServer import mimetools import httplib import socket import StringIO import os import re from test import test_support try: import threading except ImportError: threading = None try: unicode except Nam...
datasets.py
import glob import math import os import random import shutil import time from pathlib import Path from threading import Thread import cv2 import numpy as np import torch from PIL import Image, ExifTags from torch.utils.data import Dataset from tqdm import tqdm from utils.utils import xyxy2xywh, xywh2xyxy img_format...
__init__.py
# AIcells (https://github.com/aicells/aicells) - Copyright 2020 Gergely Szerovay, László Siller # # 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-...
PortDisconnector.py
from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select from xvfbwrapper import Xvfb from selenium.common.exceptions import NoSuchElementException import threading password = 'Put password here' valueList = ['1048614','38','1048611','35','...
server.py
import datetime import re import signal import sys import threading import zlib from arc4 import ARC4 from argparse import ArgumentParser from typing import Any, Dict from dnslib import * from shared import client_to_serv, serv_to_client, get_request_name class Command: def __init__(self, addr): self.ad...
server.py
""" livereload.server ~~~~~~~~~~~~~~~~~ WSGI app server for livereload. :copyright: (c) 2013 - 2015 by Hsiaoming Yang :license: BSD, see LICENSE for more details. """ import os import time import shlex import logging import threading import webbrowser from subprocess import Popen, PIPE from torn...
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import multiprocessing import threading import six try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K f...
main.py
import argparse from concurrent.futures import ThreadPoolExecutor import os import signal import sys import time import threading from proxycache.http_server import AsyncHTTPServer from proxycache.lrucache import LRUCache from proxycache.rate_limiter import Limiter from proxycache.db import RedisKVStore def setup_sig...
client.py
from __future__ import print_function, division __version__ = '0.0.1' import datetime as dt import logging import os.path from threading import Thread, RLock from urllib.parse import urlparse from zeep.client import Client, CachingClient, Settings from zeep.wsse.username import UsernameToken import zeep.helpers from...
sim_smartbox.py
#!/usr/bin/env python """ Simulates a SMARTbox, acting as a Modbus slave and responding to 0x03, 0x06 and 0x10 Modbus commands to read and write registers. Used for testing PaSD code. """ import logging import random import threading import time logging.basicConfig() from pasd import smartbox RETURN_BIAS = 0.005 ...
20a.py
## fib.py def fib(n): if n < 2: return n else: return fib(n-1) + fib(n-2) fib(35) fib(35) print("Done") ## fib_parallel.py from threading import Thread def fib(n): if n < 2: return n else: return fib(n-1) + fib(n-2) t1 = Thread(target=fib, args=(5, )) t1.start() t2 ...
trader.py
#!/usr/bin/env python3 import ccxt from configparser import ConfigParser import json import os import redis import socket import threading import time from random import randint from requests_futures.sessions import FuturesSession CRON_TIME = 15 PANIC_COUNT = 5 BOT_NAME = 'Trader' HOST_NAME = socket.gethostname() CON...
monitor.py
"""Tools for monitoring processing status and memory usage by ceci pipelines""" import time import psutil import threading import datetime class MemoryMonitor: """ A monitor which reports on memory usage by this process throughout the lifetime of a process. The monitor is designed to be run in a thr...
freshStudyTimeX.py
# coding=utf-8 #!/usr/bin/python3 import requests import configparser import threading import os import sys from requests.api import get from requests.packages.urllib3.exceptions import InsecureRequestWarning requests.packages.urllib3.disable_warnings(InsecureRequestWarning) # BASE_DIR = os.path.dirname(os.path.abs...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib im...
autoreload.py
import functools import itertools import logging import os import pathlib import signal import subprocess import sys import threading import time import traceback import weakref from collections import defaultdict from pathlib import Path from types import ModuleType from zipimport import zipimporter from django.apps ...
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 __future__ import with_statement import sys import time import random import unittest from test import test_support as support try: import thread import thre...
utils.py
"""Utilities shared by tests.""" import collections import contextlib import io import logging import os import re import selectors import socket import socketserver import sys import tempfile import threading import time import unittest import weakref from unittest import mock from http.server import HTTPServer fro...
_stack.py
# Copyright 2016-2021, Pulumi 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 t...
NmakeSubdirs.py
# @file NmakeSubdirs.py # This script support parallel build for nmake in windows environment. # It supports Python2.x and Python3.x both. # # Copyright (c) 2018, Intel Corporation. All rights reserved.<BR> # # This program and the accompanying materials # are licensed and made available under the terms and c...
driller.py
import os import re import time import shutil import logging import tarfile import pathlib import tempfile import webbrowser import threading from contextlib import suppress from timeout_decorator.timeout_decorator import TimeoutError from . import utils from . import engines from . import messages from . import decode...
ES_train.py
from __future__ import absolute_import, division, print_function import os from multiprocessing import Process import math import argparse import logging import numpy as np import torch import torch.nn.functional as F import torch.multiprocessing as mp from torch.autograd import Variable from envs import create_env fr...
PyCover.py
from __future__ import print_function import os import sublime import sublime_plugin import subprocess import sys import time import threading SETTINGS = None def plugin_loaded(): global SETTINGS SETTINGS = sublime.load_settings('PyCover.sublime-settings') if SETTINGS and SETTINGS.get('python') is not None: ...
main.py
from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta, timezone from multiprocessing.dummy import Pool as ThreadPool from os import mkdir, path, system, name from random import choice from re import compile from threading import Thread, Lock from time import sleep, strftime, time, g...
graphUiParser.py
## Copyright 2015-2019 Ilgar Lunin, Pedro Cabrera ## 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...
email.py
from flask import Flask,render_template,current_app from flask_mail import Message from threading import Thread #导入线程 from .extensions import mail def async_send_mail(app,msg): #开启程序上下文 with app.app_context(): mail.send(message=msg) #发送邮件 def send_mail(subject,to,tem,**kwargs): """ :param sub...
003b_message_queue (005b).py
import multiprocessing from time import sleep def square_list(mylist, q): print('From process p1 ... creating squared queue') """ function to square a given list """ # append squares of mylist to queue for num in mylist: q.put(num * num) print(f'Queue: {mylist[:]}\n') def print_queue(q): """ function to print...
run-tests.py
#!/usr/bin/env python import argparse import collections import errno import glob import imp import os import platform import posixpath import re import shlex import SimpleHTTPServer import socket import SocketServer import ssl import string import cStringIO as StringIO import subprocess import sys import threading im...
threads_share_varables.py
import threading import time from random import randint url_list=[] def get_url_list(): global url_list # 爬取文章列表页的url:生产者 print("get_url_list begining") while True: for i in range(10): url_list.append("www.studyai.com/"+str(randint(1,2000))+"/") time.sleep(2) print...
audio_utils.py
# This file is a highlly modifed version of the file SWHear.py # from https://github.com/swharden/Python-GUI-examples # http://www.SWHarden.com # The License for this file is MIT License, for the original and for all my modifications. # This was only used to make a profile of the object used in memory. # import memor...
test_process_utils.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...
iSpyGameFSM.py
""" This is a basic class for the Game Controller """ import json import time from GameUtils.AudioRecorder import AudioRecorder from .iSpyTaskController import iSpyTaskController import rospy import _thread as thread # -*- coding: utf-8 -*- # pylint: disable=import-error from transitions import Machine import threadi...
quoteScanner.py
# -*- coding: utf-8 -*- import threading, time import click import pandas as pd from nseta.live.live import get_quote, get_live_quote, get_data_list from nseta.scanner.baseScanner import baseScanner from nseta.common.tradingtime import IST_datetime from nseta.resources.resources import resources from nseta.archives.arc...
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...
utils.py
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
gui.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # GUI module generated by PAGE version 4.17 # In conjunction with Tcl version 8.6 # Nov 05, 2018 02:38:38 AM EST platform: Linux import os import sys import time import re current_directory = os.getcwd() parent_directory = os.path.dirname(current_directory) sys.path...
server.py
import sys import os import time import random import uuid from collections import Counter import logging import threading from flask import Flask, request, jsonify, abort import kubernetes as kube import cerberus import requests from .globals import max_id, pod_name_job, job_id_job, _log_path, _read_file, batch_id_ba...
sql_isolation_testcase.py
""" Copyright (c) 2004-Present VMware, Inc. or its affiliates. This program and the accompanying materials are made available under the terms of the 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://ww...
m_pushover.py
# coding=utf-8 ''' pi@raspberrypi ~ $ echo $LANG zh_TW.UTF-8 ''' import m_settings import logging, threading import datetime, time import httplib, urllib, json import collections, array def pushoverPost(msg): conn = httplib.HTTPSConnection("api.pushover.net:443") conn.request("POST", "/1/messages.json", ...
lambda_executors.py
import os import re import glob import json import time import logging import threading import subprocess import six from multiprocessing import Process, Queue try: from shlex import quote as cmd_quote except ImportError: from pipes import quote as cmd_quote # for Python 2.7 from localstack import config from ...
classmethod_demo.py
""" @author: magician @date: 2019/12/24 @file: classmethod_demo.py """ import os from threading import Thread TEMP_DIR = '/home/magician/Project/python3/data/1.txt' class InputData(object): """ InputData """ def read(self): raise NotImplementedError class PathInputData(InputData...
HB.py
#!/usr/bin import socket import time from threading import Thread my_ip="192.168.1.14" neighbours = ["192.168.1.19"] nodecount=len(neighbours) PORT = 5002 MESSAGE = "alive" print "UDP target IP:", neighbours print "UDP target port:", PORT print "message:", MESSAGE def pulse(): sock = socket.socket(socket.AF_INET...
test_suite.py
#!/usr/bin/env python # Copyright 1996-2020 Cyberbotics Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
collect_transitions.py
# Village People, 2017 # # !! ATTENTION: IPS are written below and they not taken from some # !! Fancy yaml file !! import torch import torch.multiprocessing as mp from multiprocessing import Queue from copy import deepcopy from termcolor import colored as clr from utils import read_config from models import get_mode...
real_time_face_recognition.py
# coding=utf-8 """Performs face detection in realtime. Based on code from https://github.com/shanren7/real_time_face_recognition """ # MIT License # # Copyright (c) 2017 François Gervais # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation fil...
test_logging.py
# Copyright 2001-2013 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permissio...
slack.py
"""Slack adapter for willbot """ # pylint: disable=no-member import json import logging import random import sys import time import traceback import urllib from multiprocessing import Process from threading import Thread from typing import Dict, Optional import slack_sdk from markdownify import MarkdownConverter from ...
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...
spectral.py
import cluster import argparse import multiprocessing as mp import numpy as np import time import pypeline_io as io def get_arguments(): help_str = """ pypeline help string """ prog = 'pypeline' max_cpu = mp.cpu_count() # logger.debug("Getting commandline arguments.") parser = argparse....
web_socket_server.py
# -*- coding: utf-8 -*- import socket import ssl from queue import Queue from threading import Thread from web_socket import WebSocket class WebSocketServer: server_socket = None threads = [] exit_scheduled = False queue = Queue() def __init__(self, listen_ip, port, ping_interval_seconds=20, ...
__init__.py
import sys import threading import json import traceback from importlib import import_module import mesos.interface from mesos.interface import mesos_pb2 from pyrallelsa import group_runner from pyrallelsa import ProblemClassPath from enrique.package import get_package class Enrique(mesos.interface.Executor): d...
main.py
from crypto import * import threading import socket import struct import time import json import uuid import ast import sys import os class Peer(threading.Thread): def __init__(self, host, port, dataDir='storage', maxpeers=100, maxfilesize=10*(10**10), maxnumfiles=200): super(Peer,self).__init__() self.host ...
domain.py
# stdlib from threading import Thread from time import sleep from typing import Dict from typing import Optional # third party from flask import current_app as app import jwt from nacl.signing import SigningKey from nacl.signing import VerifyKey import syft as sy from syft import serialize from syft.core.common.messag...
ws.py
import time import threading import logging import atexit import json import ssl from six.moves.queue import Queue, Empty from six.moves.urllib.parse import urlparse from awxkit.config import config log = logging.getLogger(__name__) class WSClientException(Exception): pass changed = 'changed' limit_reached...