source
stringlengths
3
86
python
stringlengths
75
1.04M
multip_thread_rtsp_one_socket_server.py
# coding:utf-8 # 服务端 import os import socket import threading import time # 接收的方法 # def clientThreadIn(conn, nick): # while True: # try: # temp = conn.recv(1024) # if not temp: # conn.close() # return # print("temp len = ", len(temp)) # ...
learner.py
import torch import torch.utils.data import torch.optim as optim import torch.nn as nn import numpy as np from collections import deque import random import gym import os from copy import deepcopy from time import time, sleep import torch.multiprocessing as mp from models import ActorNet, CriticNet import pickle from...
test_comms.py
import asyncio import os import sys import threading import types import warnings from functools import partial import pkg_resources import pytest from tornado import ioloop from tornado.concurrent import Future import dask import distributed from distributed.comm import ( CommClosedError, connect, get_a...
sdca_ops_test.py
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
sh.py
""" http://amoffat.github.io/sh/ """ # =============================================================================== # Copyright (C) 2011-2020 by Andrew Moffat # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to de...
OutputController.py
import threading import time running_threads = [] DIGITAL_PORT_MAPPER = { 'GEARS': 2, 'LEFT_PEDAL': 3, 'RIGHT_PEDAL': 4, 'FLAPS': 5, 'BRAKE': 6, 'AIR_BRAKE': 7, 'BOMB': 8, ...
objective.py
# Copyright (c) 2016, the GPyOpt Authors # Licensed under the BSD 3-clause license (see LICENSE.txt) import time import numpy as np from ...util.general import spawn #from ...util.general import get_d_moments # import GPy # import GPyOpt class Objective(object): """ General class to handle the objective funct...
scanner1.0.py
# coding=utf-8 ''' Author:joe Description: scanner of InterNet servers 1、模块 argparse(Generic Operation System Services) 2、获取命令行输入的目标地址和端口 :Host,Port 3、-H host -p port 4、多线程 加锁 ''' import argparse import socket import threading SCREEN_LOCK = threading.Semaphore(value=1) def get_tgthostandport(): ''' 获取命令行输入的...
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...
simple_rp_main.py
import argparse import os import socket import threading import time import traceback import RPi.GPIO as GPIO # start pigpiod service # os.system('sudo pigpiod') import pigpio from fuzzy_system.simple_fuzzy_system import SimpleFuzzySystem from misc.connection_helper import ConnectionHelper from misc.motor_controller...
create_tfrecords.py
""" Create the tfrecord files for a dataset. A lot of this code comes from the tensorflow inception example, so here is their license: # 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...
__init__.py
import time import socket import sys import os from threading import Thread class Barotrauma: def __init__(self, stdinpath, udspath, writetimeout=0.1, responsetime=0.1, buffersize=128): self.stdinpath = stdinpath self.udspath = udspath self.writetimeout = writetimeout self.responset...
HiwinRA605_socket_ros_test_20190625195259.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...
stereo_camera.py
# MIT License # Copyright (c) 2019,2020 JetsonHacks # See license # A very simple code snippet # Using two CSI cameras (such as the Raspberry Pi Version 2) connected to a # NVIDIA Jetson Nano Developer Kit (Rev B01) using OpenCV # Drivers for the camera and OpenCV are included in the base image in JetPack 4.3+ # This...
KitchenPlanner.py
# Copyright 2015 Ciara Kamahele-Sanfratello # # 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...
ping_thread_basic.py
#!/usr/bin/env python from threading import Thread import subprocess from queue import Queue num_threads = 3 queue = Queue() ips = ["10.0.1.1", "10.0.1.3", "10.0.1.11", "10.0.1.51"] def pinger(i, q): """Pings subnet""" while True: ip = q.get() print("Thread %s: Pinging %s" % (i, ip)) r...
iombian_serial_communication_handler.py
#!/usr/bin/env python3 import json import logging import serial import threading logger = logging.getLogger(__name__) class IoMBianSerialConfiguratorHandler(): SAVE_CONFIG_DELAY = 2 def __init__(self, file_config_handler, port="/dev/ttyGS0", baudrate=115200, timeout=0.1): self.file_config_handler ...
process_manager.py
import logging import queue as queue_lib import signal import sys from multiprocessing import Process, Queue import GPUtil from tornado.ioloop import IOLoop import utils.constants as c class ProcessManager(): """A ProcessManager class is used for controlling the multi-processing features of this application. ...
test_engine_py3k.py
import asyncio from sqlalchemy import Column from sqlalchemy import create_engine from sqlalchemy import delete from sqlalchemy import event from sqlalchemy import exc from sqlalchemy import func from sqlalchemy import inspect from sqlalchemy import Integer from sqlalchemy import select from sqlalchemy import String f...
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...
main.py
import sys import os import yaml import logging import multiprocessing from irrad_control.utils.proc_manager import ProcessManager from ps_monitor.monitor import main as DoTheMonitoringThing from ps_monitor import logger logging.getLogger().setLevel("INFO") def _configure_rpi_server(config, pm): # Prepare RPi ...
app.py
import logging import os import sys from sys import stdout import json from unicodedata import name import urllib3 import certifi import io from typing import List import requests from time import sleep from fastapi import FastAPI import xarray as xr from models import MerraClientRequest import matplotlib.pyplot as plt...
SceneNodeTest.py
########################################################################## # # Copyright (c) 2012, John Haddon. All rights reserved. # Copyright (c) 2013, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that ...
nexar_token.py
"""Main entry point to the service.""" import base64 import hashlib import os import re import webbrowser from multiprocessing import Process from urllib.parse import parse_qs, urlparse import requests from oauthlib.oauth2 import BackendApplicationClient from oauthlib.oauth2.rfc6749.errors import MissingTokenError fro...
locusts.py
# encoding: utf-8 import io import multiprocessing import os import sys from httprunner.logger import color_print from httprunner import loader from locust.main import main def parse_locustfile(file_path): """ parse testcase file and return locustfile path. if file_path is a Python file, assume it is a ...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make flash" (Ctrl-T Ctrl-F) # - Run "make app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is detected, gdb is automa...
_channel.py
# Copyright 2016 gRPC 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 law or agreed to in writing...
train_single_label_dist_imagenet1k.py
# -------------------------------------------------------- # ImageNet-21K Pretraining for The Masses # Copyright 2021 Alibaba MIIL (c) # Licensed under MIT License [see LICENSE file for details] # Written by Tal Ridnik # -------------------------------------------------------- import argparse import time import torch...
mock_server.py
import logging import queue import traceback from http.server import BaseHTTPRequestHandler, HTTPServer from multiprocessing import Process, Queue from .pact_request_handler import PactRequestHandler _providers = {} log = logging.getLogger(__name__) def getMockServer(pact): if pact.provider.name not in _provi...
rdd.py
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
connection.py
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # TH...
embedGO.py
#!/usr/bin/env python3 # The original source code of Poincare Embedding can be found in https://github.com/facebookresearch/poincare-embeddings # This source code is partially modified for the application to HiG2Vec. import torch as th import numpy as np import logging import argparse from hype.sn import Embedding, i...
build_mscoco_data.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...
main.py
from typing import Tuple, Dict, Any, List, Optional, Callable, Union, Sequence from dataclasses import dataclass, field from distutils.version import LooseVersion import functools import multiprocessing import os import pickle import time import threading import warnings import re import inspect import numpy as np im...
vk.py
# -*- coding: utf-8 -*- import asyncio import collections import functools import json import time from typing import List, Optional from threading import Thread from vk_api import VkApi from vk_api.bot_longpoll import VkBotEventType, VkBotLongPoll from vk_api.execute import VkFunction from vk_api.upload import VkUplo...
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...
labels.py
import hashlib import requests import threading import json import sys import traceback import base64 from electrum_civx.plugin import BasePlugin, hook from electrum_civx.crypto import aes_encrypt_with_iv, aes_decrypt_with_iv from electrum_civx.i18n import _ class LabelsPlugin(BasePlugin): def __init__(self, p...
thread.py
#!/usr/bin/env python import cv2 as cv from threading import Thread import time from umucv.util import putText from umucv.stream import autoStream def work(img): r = img for _ in range(10): r = cv.medianBlur(r,17) return r frame = None goon = True def fun(): global frame, goon, key for...
YearDialog.py
from kivymd.uix.dialog import MDDialog from kivymd.uix.button import MDFlatButton from kivymd.uix.screen import MDScreen from kivymd.uix.list import OneLineListItem from kivymd.app import MDApp from kivy.uix.recycleview import RecycleView from kivy.lang import Builder kv = """ #:import Thread threading.Thread <Custom...
QtExecuteSignal.py
############################################################################## # # # Copyright (C) 2017, goatpig # # Distributed under the MIT license # # S...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
test_fsm.py
"""Unit tests for fsm.py""" import datetime import logging import socket from struct import pack import threading import time import pytest from pynetdicom import AE, build_context, evt, debug_logger from pynetdicom.association import Association from pynetdicom import fsm as FINITE_STATE from pynetdicom.fsm import ...
utils.py
import collections import json import logging from threading import Thread import requests from tensorflow.python.keras.layers import Concatenate from .activations import * from .layers import * from .sequence import * try: from packaging.version import parse except ImportError: from pip._vendor.packaging.ve...
batcher.py
#Most of this file is copied form https://github.com/abisee/pointer-generator/blob/master/batcher.py import queue import time from random import shuffle from threading import Thread import numpy as np import tensorflow as tf import config from . import data import random random.seed(1234) class Example(object): ...
act4ste2.py
#Name: Quy Nguyen #python3 import sys import requests import ipaddress import threading openProxyList = [] threads = [] ipList = [] #check an ip for open proxy #https :1080 #ftp :3128 def checkOpenProxy(ip): try: req = requests.get("http://csec.rit.edu",timeout = 1, proxies={"http":"http://"+str(ip)+":3128"})...
client.py
#!/usr/bin/env python3 import socket import struct import threading SERVER_SOCKET_PATH = "./socket" FMT = "!L" def read_number_from_socket(connection): return struct.unpack(FMT, connection.recv(4))[0] def write_number_to_socket(connection, number): connection.send(struct.pack(FMT, number)) def client(t_id...
dataloader.py
import random import torch import torch.multiprocessing as multiprocessing from torch._C import _set_worker_signal_handlers, \ _remove_worker_pids, _error_if_any_worker_fails from packaging import version if version.Version(torch.__version__) >= version.Version('1.0.0'): from torch._C import _set_worker_pids...
agent_code_block.py
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2019 Fetch.AI Limited # # 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 ...
threading.py
# Copyright (C) 2015-2018 Regents of the University of California # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
TFLite_detection_webcam.py
######## Webcam Object Detection Using Tensorflow-trained Classifier ######### # # Author: Evan Juras # Date: 10/27/19 # Description: # This program uses a TensorFlow Lite model to perform object detection on a live webcam # feed. It draws boxes and scores around the objects of interest in each frame from the #...
client.py
import base64 import hashlib import hmac import logging import socket import sys import json try: import ssl except ImportError: ssl = None from multiprocessing import pool from queue import Queue from threading import RLock, Thread from datetime import datetime import time try: # python3.6 from http...
data_store_test.py
#!/usr/bin/env python # -*- mode: python; encoding: utf-8 -*- """These are basic tests for the data store abstraction. Implementations should be able to pass these tests to be conformant. """ import csv import functools import hashlib import inspect import logging import operator import os import random import strin...
test_eap_proto.py
# EAP protocol tests # Copyright (c) 2014-2015, Jouni Malinen <j@w1.fi> # # This software may be distributed under the terms of the BSD license. # See README for more details. import binascii import hashlib import hmac import logging logger = logging.getLogger() import select import struct import threading import time...
a_sfVisualize.py
""" Main file that interacts with the user. """ import tkinter as tk from b_viewCube import ViewCube from c_wifiInterface import * """ 0 - network_btn 1 - cube_btn 2 - fusedData_btn 3 - rawData_btn A button is in ON state if the default task it is mapped to is being executed. """ is_btn_on = [False, ...
stream.py
import time from queue import Queue, Full, Empty from concurrent.futures import Executor, ThreadPoolExecutor, ProcessPoolExecutor from concurrent.futures.process import _get_chunks, _process_chunk from functools import partial import sys import contextlib import threading import itertools class StreamExecutor(Executo...
videostream.py
import os, logging, time import cv2 from queue import Queue, Full, Empty import threading logging.basicConfig(format='%(asctime)s %(levelname)-10s %(message)s', datefmt="%Y-%m-%d-%H-%M-%S", level=logging.INFO) class VideoStream: default_fps = 30. def __init__(self, stream_source, interval=0....
perf.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # perf.py # A performance problem with threads import dis # Disassembler for Python bytecode import time import threading def count(n): # Consider this CPU-bound function while n > 0: n -= 1 print(dis.dis(count)) # Sequential Execution...
socksserver.py
#!/usr/bin/env python # Copyright (c) 2013-2016 CORE Security Technologies # # This software is provided under under a slightly modified version # of the Apache Software License. See the accompanying LICENSE file # for more information. # # SOCKS proxy server/client # # Author: # Alberto Solino (@agsolino) # # Descrip...
youtube-dl-server.py
import json import subprocess from queue import Queue import io import sys from pathlib import Path import re from datetime import date from bottle import run, Bottle, request, static_file, response, redirect, template, get from threading import Thread from bottle_websocket import GeventWebSocketServer from bottle_web...
run_tests.py
#!/usr/bin/python import multiprocessing import optparse import StringIO import sys import time import warnings # Install the Python unittest2 package before you run this script. import unittest2 USAGE = """%prog -s SDK_PATH -t TEST_PATTERN Run unit tests for App Engine apps. The SDK Path is probably /usr/local/googl...
http_server.py
import os import posixpath import urllib import threading from pkg_resources import resource_filename from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler BASE = resource_filename('globeplot', '') # ROOT = os.path.join(os.path.split(BASE)[0], 'webgl_globe') ROOT = os.path.join(BA...
dataloader_iter.py
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
community_manager.py
# This file is part of OctoBot (https://github.com/Drakkar-Software/OctoBot) # Copyright (c) 2021 Drakkar-Software, All rights reserved. # # OctoBot is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either ...
stacks.py
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See LICENSE in the project root # for license information. from __future__ import absolute_import, division, print_function, unicode_literals """Provides facilities to dump all stacks of all threads in the process. ""...
set_vc_vars.py
import sublime import sublime_plugin from threading import Thread from subprocess import Popen, PIPE from os import environ # Related reading; # https://stackoverflow.com/questions/39881091/how-to-run-sublimetext-with-visual-studio-environment-enabled/ # For the unfamiliar, Visual Studio ships with a batch file ...
beatBoard.py
from tkinter import * from playsound import playsound from threading import Thread class padSound: def __init__(self, soundLocation): self.soundLocation = soundLocation def given_sound(self): playsound(self.soundLocation) def play_sound(self,event): sound = Thread(target=self.giv...
competition_example.py
#!/usr/bin/env python3 import ffai import socket from ffai.ai.competition import PythonSocketClient, PythonSocketServer from multiprocessing import Process import time import secrets import ffai import socket def run_agent(registration_name, port, token): """ Starts a server that hosts an agent. """ ...
cifar10_to_mr.py
# Copyright 2019 Huawei Technologies Co., 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 applicable law or agreed to...
cgitsync.py
#!/usr/bin/env python3 """Cgit mirror and sync utility. This is a simple utility that allows easy cloning and updating of a git repository that is defined in a cgitrepos configuration file. Multiple cgit sections can be specified that point at specific provider. When a repo is added to a section this utility will cl...
handpose_local_app.py
#-*-coding:utf-8-*- ''' DpCas-Light |||| ||||| |||| || ||||||| || || || || || || |||| || || || || || || || || || || || || || || || || ||====|| |||||| || || ||||| || || ||======|| || || || || |...
keepalive.py
from flask import Flask from threading import Thread from gevent.pywsgi import WSGIServer import os app = Flask(__name__) @app.route('/', methods=['GET']) def home(): return "I'm alive" def run(): """ Serves the purpose of keeping the repl instance alive trough a webhook. Setting the webhook pinger part ...
start.py
#!/usr/bin/env python3 from concurrent.futures import ThreadPoolExecutor, as_completed from contextlib import suppress from itertools import cycle from json import load from logging import basicConfig, getLogger, shutdown from math import log2, trunc from multiprocessing import RawValue from os import urandom as randb...
webcam_detector.py
from itertools import count from threading import Thread from queue import Queue import os import cv2 import numpy as np import time import torch import torch.multiprocessing as mp from loguru import logger from alphapose.utils.presets import SimpleTransform from multiprocessing.synchronize import Event as...
task_runner.py
import datetime import os import glob from typing import Any, Optional, Union from gherkin.token_scanner import TokenScanner from gherkin.parser import Parser from .junit_report import JUnitReport from .feedback_adapter import FeedbackAdapter from .scenario_result import ScenarioResult from .feedback_schema import F...
run_peek_worker.py
#!/usr/bin/env python """ Copyright Synerty Pty Ltd 2013 This software is proprietary, you are not free to copy or redistribute this code in any format. All rights to this software are reserved by Synerty Pty Ltd """ import logging import threading from threading import Thread from peek_platform import ...
diplomacyBot.py
import re import time import random import pickle import threading from diplomacyMap import Map from diplomacyLogic import * from slackclient import SlackClient from slackbot_settings import API_TOKEN, DIPLOMACY_CHANNEL RTM_READ_DELAY = 0 # 1 second delay between reading from RTM MENTION_REGEX = "^<@(|[WU].+?)>(.*)" ...
test.py
#!/usr/bin/python # stress test the sqlite writing with several threads from multiprocessing import Process, Lock, current_process def proc_func(lock, counter): from sqlalchemy import create_engine from sqlalchemy.orm import sessionmaker from sqlalchemy_declarative import Address, Base, Person engin...
threads.py
import logging import socket from os import kill import signal from multiprocessing import Process, Queue from subprocess import Popen, STDOUT, PIPE from PyQt5.QtCore import QThread, pyqtSignal, pyqtSlot, QProcess, QObject from wifipumpkin3.core.packets.dhcpserver import DHCPProtocol from wifipumpkin3.core.utility.prin...
workbench.py
# -*- coding: utf-8 -*- import ast import collections import importlib import logging import os.path import pkgutil import platform import queue import re import socket import sys import tkinter as tk import tkinter.font as tk_font import traceback from threading import Thread from tkinter import messagebox, ttk from ...
nurest_push_center.py
# -*- coding: utf-8 -*- # # Copyright (c) 2015, Alcatel-Lucent 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: # * Redistributions of source code must retain the above copyright # no...
tests.py
import time import traceback from datetime import date, datetime, timedelta from threading import Thread from django.core.exceptions import FieldError from django.db import DatabaseError, IntegrityError, connection from django.test import ( SimpleTestCase, TestCase, TransactionTestCase, skipUnlessDBFeature, ) fro...
atari.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # File: atari.py # Author: Yuxin Wu <ppwwyyxxc@gmail.com> import numpy as np import time, os import cv2 from collections import deque import threading import six from six.moves import range from tensorpack.utils import (get_rng, logger, get_dataset_path, execute_only_once)...
browser.py
# Released under the MIT License. See LICENSE for details. # """UI for browsing available co-op levels/games/etc.""" # FIXME: Break this up. # pylint: disable=too-many-lines from __future__ import annotations import copy from typing import TYPE_CHECKING import _ba import ba from bastd.ui.store.button import StoreBut...
mp.py
import multiprocessing as mp import time import os import random q = mp.Queue() #FIFO a_list = [] def worker(a_list): a_list_square = [val ** 2 for val in a_list] q.put(a_list_square) if __name__ == '__main__': nums = [random.randint(1, 50) for i in range(10**7)] chunk = len(nums) // 8 procs = [...
run.py
#!/usr/bin/env python3 import os import sys import csv import glob import time import json import logging import resource import threading import subprocess # constants ------------------------------------------------ THREADS=1 TIMEOUT=900 INSTR_MAX=4000000000000000000 # globals --------------------------------------...
feature_shutdown.py
#!/usr/bin/env python3 # Copyright (c) 2018-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test bitcoind shutdown.""" from test_framework.test_framework import BitcoinTestFramework from test_fr...
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 ...
DAT Texture Wizard.py
#!/usr/bin/python # This file's encoding: UTF-8, so that non-ASCII characters can be used in strings. # ------------------------------------------------------------------- # # ~ ~ Written by DRGN of SmashBoards (Daniel R. Cappel) ~ ~ # # - - - - [ Feb., 2015 ] ...
email.py
from threading import Thread from flask import current_app, render_template 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, **kwargs): kwargs['subject'] = subject app = current_app._get...
Main.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # from __future__ import absolute_import # from __future__ import division # from __future__ import print_function import argparse import io import re import time import sys import json import picamera import subprocess from mbp_client import MBPclient from ImageRecogni...
test_core.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...
mturk_manager.py
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import logging import math import os import pickle import threading import time import uuid import errno import requests...
monitor.py
#!/usr/bin/env python3 """ This module specifies class Monitored designated for processing of cryptocurrencies blocks """ import threading import logging from timeit import default_timer as timer from datetime import datetime, timedelta from .coin import BTC, BCH, DASH, ZEC, LTC, ETH from .database import Database from...
start.py
import sys import os import time import requests import socket import subprocess import threading import logging logging.basicConfig(level=logging.INFO, format='%(asctime)s.%(msecs)03d %(levelname)s: %(message)s', datefmt="%Y-%m-%d %H:%M:%S") ROLE = os.getenv("ROLE") HOST_NAME = os.getenv("HOSTNAME") # exported by ...
socket_io.py
''' A socket.io bridge for Python This gives Python users access to socket.io, a node.js library. This library provides simple and efficient bidirectional communication between browsers and servers over a message-oriented socket. Transport is normalized over various technologies including WebSockets, Flash sockets, an...
keepkey.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_vestx.util import bfh, bh2u, UserCancelled, UserFacingException from electrum_vestx.bitcoin import TYPE_ADDRESS, TYPE_SCRIPT from electrum_vestx.bip32 import BIP32Node from electrum_vestx import constants from electrum_vestx.i18n import ...
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 namedtuple import os import pickle import platform import random import re import subprocess import sys import sysconfig import textwrap import ti...
progress_bar.py
# -*- coding: utf-8 -*- import sys, time from qtpy import QtCore, QtGui, QtWidgets from multiprocessing import Process, Queue, cpu_count, Pipe import os import numpy as np __all__ = [] tic=time.time() class ProcessLauncher(QtCore.QThread): status_update=QtCore.Signal(str) def __init__(self,parent): Q...
engine.py
# !/usr/bin/env python # -*- coding: utf-8 -*- import multiprocessing import time import random import os import string from flask import Flask from flask import jsonify from flask import request as flask_request from flask import render_template from flask import abort from flask import Response from flask import mak...
snet_test_client.py
# Tested on python3.6 import logging import multiprocessing as mp import grpc import pem import time import datetime from service_spec_node_importance import network_analytics_node_importance_pb2 from service_spec_node_importance import network_analytics_node_importance_pb2_grpc import subprocess import yaml de...