source
stringlengths
3
86
python
stringlengths
75
1.04M
admin.py
import threading from django.db import transaction from django.contrib import admin, messages from ApolloScanner.dingtalk import dingtalker from Configuration.models import Configuration from VulnerableScan.views import start_scan, debug from VulnerableScan.models import VulnerableScanTasks, ExploitRegister, Vulnerable...
GUI 3.py
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'test3.ui' # # Created by: PyQt5 UI code generator 5.15.4 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. import time import sys f...
ocr_helper.py
import time from pytesseract import Output from services.image_helper import * from services.models import OcrResult from multiprocessing import Process, Queue import pytesseract allowed_tuples = ('1C', '7A', '55', 'BD', 'E9', 'FF') allowed_characters = ('1', '7', '5', '9', 'A', 'B', 'C', 'D', 'E') # Only characters ...
webrepl_client.py
#!/usr/bin/env python from __future__ import print_function import sys import os import struct import time from threading import Thread try: import usocket as socket except ImportError: import socket import webrepl.websocket_helper as websocket_helper import zipfile # Define to 1 to use builtin "uwebsocket" m...
process_shared_memory.py
################################### # File Name : process_shared_memory.py ################################### #!/usr/bin/python3 import multiprocessing def worker(num, num_list): p = multiprocessing.current_process() print ("[%s] num : %s" % (p.name, num.value)) for idx, value in enumerate(num_list): ...
run.py
import sys import signal import threading import asyncio import aiohttp import conf_loader import notifier import bili_sched import printer import bili_statistics from console_cmd import ConsoleCmd from tasks.login import LoginTask from tasks.live_daily_job import ( HeartBeatTask, OpenSilverBoxTask, RecvDai...
settings_20210906113255.py
""" Django settings for First_Wish project. Generated by 'django-admin startproject' using Django 3.2. For more information on this file, see https://docs.djangoproject.com/en/3.2/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/3.2/ref/settings/ """ from pathli...
nmap.py
import os import sys import subprocess import threading import hashlib ####### Nmap Function To add List of Active Hosts on the Network ####### def scan(ip, subnet): print("Starting All Host Discovery") output = subprocess.check_output("sudo nmap -n -sn " + str(ip) + "/" + str(subnet) +" -oG - | awk '/Up$/{pr...
consumer.py
import random import signal import string import sys import time import threading from datetime import datetime from google.protobuf import text_format from colorama import Fore, Back, Style from kafka.errors import NoBrokersAvailable from kafka import KafkaConsumer sys.path.insert(1, 'protocols/src/generated/main/py...
server.py
# ALI server file # Flask imports from flask import render_template from flask import request from flask import redirect from flask import session from flask import Response from database import companies, saveUser, getUser, chart_table,isAdmin, db from database import generateCredentials, stringToBytes, companyIdGene...
test_replica_set_connection.py
# Copyright 2009-2011 10gen, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
Movies.py
#coding: utf-8 from startThreads import ThreadMain from MovieComment import movieComment from MovieInfo import moviesInfo import multiprocessing def moviesMain(): URLS = list(set(ThreadMain())) process1 = multiprocessing.Process(target= moviesInfo, args= (URLS, )) process1.start() process...
MainRunner.py
import datetime import logging import threading import time import traceback from multiprocessing import Process, Value from Telegram import TelegramBotApi import json import utils from BiliLive import BiliLive from BiliLiveRecorder import BiliLiveRecorder from BiliVideoChecker import BiliVideoChecker from DanmuRecord...
bmerawdata.py
import sys import os from bme68x import BME68X import bme68xConstants as BME68XCONST import bsecConstants as BSECCONST import json from time import time, sleep from datetime import datetime from threading import Thread, Lock def io_task(self): while True: try: inpt = input() self.i...
faucet.py
#!/usr/bin/env python3 #phentem facet DEBUG = False PORT = 6464 DISABLED = False disabledMessage = "faucet is disabled" minimumDUCOfromFaucet = 0.1 maximumDUCOfromFaucet = 0.15 # Start import modules import random,math,socket,threading,asyncio,sys,time,os,requests,json from dotenv import load_dotenv...
cvgenetic.py
#!/usr/bin/python from random import randint from threading import Thread from multiprocessing import Process, Queue, Manager import timeit from sys import exit """ Classes and methods for multiprocessing genetic algorithm. To use this tool, the target data stucture class should contains 3 methods which are RandomIndiv...
test_client.py
# Copyright 2009-2014 MongoDB, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writin...
utils.py
import argparse import importlib import subprocess import os import sys import logging import threading import time import copy if __name__ == '__main__': import exceptions # type: ignore else: from chiptools.common import exceptions log = logging.getLogger(__name__) def self_test(modname='chiptools.__init...
server.py
from operator import add import socket import constants from _thread import * from res_maker import handle_request import threading def createNewThread(c, addr): # Make a variable to contain the threading variable, it will use handle_request as the # function to be run thread = threading.Thread(target=ha...
rdma.py
# Windows Azure Linux Agent # # Copyright 2016 Microsoft 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 ...
gps.py
import cv2 import Image from BaseHTTPServer import BaseHTTPRequestHandler,HTTPServer from SocketServer import ThreadingMixIn import StringIO import time from picamera.array import PiRGBArray from picamera import PiCamera import math import numpy as np from common import clock, draw_str import sys import threading from ...
test_chatcommunicate.py
import chatcommunicate import chatcommands from globalvars import GlobalVars from datahandling import _remove_pickle import collections import io import os import os.path import pytest import threading import time from fake import Fake from unittest.mock import Mock, patch def test_parse_room_config(): chatcomm...
document.py
"""Document class.""" import logging import os import subprocess import tempfile from datetime import datetime from shutil import rmtree from threading import Thread from time import sleep from typing import List import attr from mayan_feeder import mayan, utils LOG = logging.getLogger(__name__) @attr.s class Doc...
main.py
from __future__ import unicode_literals import multiprocessing as thr import pathlib from time import sleep from urllib.request import urlopen import rule34 from PIL import Image from asciimatics.effects import Print from asciimatics.renderers import FigletText, ColourImageFile from asciimatics.scene impor...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
luminosity.py
from __future__ import division import logging import os from os import kill, getpid from sys import version_info from ast import literal_eval # @modified 20191115 - Branch #3262: py3 # try: # from Queue import Empty # except: # from queue import Empty from time import time, sleep from threading import Thread...
data_pool.py
# 对文件和数据库数据合并载入内存 from pandas import Timedelta, DataFrame, read_csv, to_datetime from numpy import float32, polyfit, string_ from config import Config, str2array, PARAMS_TABLE_NAME, get_table_name, MINI_EPS, PARAMS_LIST from sql_mapper import SQLMapper from multiprocessing import Process def view_data(data,...
odes.py
from .oauth import check_authentication, session_info from . import util, data from os import environ from urllib.parse import urljoin from operator import itemgetter, attrgetter from threading import Thread from uuid import uuid4 from time import time from datetime import datetime from dateutil.parser import parse a...
ajax.py
import json import logging import os import threading import time import cherrypy import datetime import core from core import config, library, searchresults, searcher, snatcher, notification, plugins, downloaders from core.library import Metadata, Manage from core.movieinfo import TheMovieDatabase, YouTube from core.p...
tegrastats.py
# -*- coding: UTF-8 -*- # This file is part of the jetson_stats package (https://github.com/rbonghi/jetson_stats or http://rnext.it). # Copyright (c) 2019 Raffaello Bonghi. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published...
deploy.py
import cloudforest from forms import MyForm from multiprocessing import Process from flask import Flask, request, render_template application = Flask(__name__) application.config.from_object(__name__) application.config.update( DEBUG=True, SECRET_KEY='...' ) def run_cloudforest(form_options): """Take for...
cluster_multiprocessing_test.py
# Copyright (c) 2018 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 app...
worker.py
#background worker to do jobs import getopt import os import sys import time import threading from multiprocessing import Process from .constants import * from .loggingHelper import * from .jobManager import JobManager from .workerJob import WorkerJob from .feedProcessor import * from .linkProcessor import * from . im...
test_aws_batch_tag_update.py
import threading import time import unittest from unittest import mock import pytest from cloudtik.providers._private.aws.node_provider import AWSNodeProvider from cloudtik.providers._private.aws.node_provider import TAG_BATCH_DELAY def mock_create_tags(provider, batch_updates): # Increment batches sent. pr...
util.py
# # Copyright (C) 2012-2017 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # import codecs from collections import deque import contextlib import csv from glob import iglob as std_iglob import io import json import logging import os import py_compile import re import socket try: import ssl ...
keymap.py
""" 按键映射 """ import platform import threading # import commons import hmi_driver # 全功能键1 M1 = "M1" # 全功能键2 M2 = "M2" # 上 UP = "UP" # 下 DOWN = "DOWN" # 左 LEFT = "LEFT" # 右 RIGHT = "RIGHT" # OK OK = "OK" # power POWER = "POWER" # ALL ALL = "ALL" # 关机 SHUTDOWN = "SHUTDOWN" # 开机完成(用于更新后自动开机) APO = "APO" class KeyEv...
threading_14_actor.py
from queue import Queue from threading import Thread, Event # Sentinel used for shutdown class ActorExit(Exception): pass class Actor: def __init__(self): self._mailbox = Queue() def send(self, msg): ''' Send hardware message to the actor ''' self._mailbox.put(ms...
appointment.py
#!/bin/python3 # -*- coding:utf-8 -*- import data.basedata as basedata,data.peopleinfolist as pl import httpdata.urlinfo as urlinfo, httpdata.httpheader as httpheader import threading, multiprocessing, requests, datetime, time, random from PIL import Image import re as are import cnn.c_cnn as cnn import num...
transcript_etl.py
"""Transcript ETL.""" import datetime import re import logging import multiprocessing import uuid from etl import ETL from etl.helpers import ETLHelper from transactors import CSVTransactor from transactors import Neo4jTransactor class TranscriptETL(ETL): """Transcript ETL.""" logger = logging.getLogger(__n...
spark.py
import datetime, os, sys, time, psutil, re, socket from collections import OrderedDict, namedtuple import socket from pathlib import Path from xutil.database.base import get_conn from xutil.database.hive import HiveConn, Beeline from xutil.database.oracle import OracleConn from xutil.database.postgresql import...
xbox.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import pygame import platform import threading from can_bus import Controller sys_type = platform.system() import serial import serial.tools.list_ports class JoyStick: def __init__(self, ctrl=None, verbose=False, cloc_time=20): self.ctrl = ctrl ...
mq.py
import time from datetime import datetime import jsonpickle from configuration import OmnipyConfiguration from podcomm.pdm import Pdm, PdmLock from podcomm.pod import Pod from podcomm.pr_rileylink import RileyLink from podcomm.definitions import * from logging import FileHandler import simplejson as json from threadi...
add_member.py
# -*- coding: utf-8 -*- import threading from common import utils import time,datetime from common import exceptions as exc # class testAddMember(TestCase): class testAddMember(): def create_pool_member(self,name=None,address=None,protocol_port=None,weight=None,instance_id=None): openstack_client = utils.g...
parallelizer.py
import os, sys, time, multiprocessing, re from .processes import ForkedProcess from .remoteproxy import ClosedError from ..python2_3 import basestring, xrange class CanceledError(Exception): """Raised when the progress dialog is canceled during a processing operation.""" pass class Parallelize(object): "...
scene_layout_sensors.py
import time from threading import Thread import scene_layout as scene_layout_parser # This should come from CARLA path from srunner.scenariomanager.carla_data_provider import CarlaDataProvider def threaded(fn): def wrapper(*args, **kwargs): thread = Thread(target=fn, args=args, kwargs=kwargs) t...
test_pytest_cov.py
import glob import os import subprocess import sys from distutils.version import StrictVersion from itertools import chain import coverage import py import pytest import virtualenv import xdist from fields import Namespace from process_tests import TestProcess as _TestProcess from process_tests import dump_on_error fr...
i2cgui.py
import time import struct import sys import os import re import threading from functools import partial import wx import wx.lib.newevent as NE from i2cdriver import I2CDriver PingEvent, EVT_PING = NE.NewEvent() def ping_thr(win): while True: wx.PostEvent(win, PingEvent()) time.sleep(1) class He...
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...
handler.py
import io import json import logging import socket import struct import threading import traceback import weakref import paramiko import tornado.web from tornado.ioloop import IOLoop from tornado.options import options from webssh.utils import ( is_valid_ip_address, is_valid_port, is_valid_hostname, to_bytes, to_s...
threadpool.py
from threading import Thread, Lock import multiprocessing from queue import Queue, PriorityQueue, Empty import logging import time import itertools import numpy as np class Task(object): ''' Task is a class that wrap the func to be run ''' def __init__(self, func, *, args=None, kwargs=None, clean_up=Fa...
fslock.py
# Copyright 2017-2019 EPAM Systems, Inc. (https://www.epam.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 a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appli...
main.py
import sys import os import subprocess import socket import numpy as np from pynput.keyboard import Key, Controller, KeyCode from threading import Thread class Tracker(): def __init__(self): self.stop = False subprocess.Popen(['./stream/streamer']) self.sock = self.create_connection('127....
ts_util.py
""" Time series utils. """ import datetime import queue import threading import typing import pandas as pd from dateutil.relativedelta import relativedelta import atpy.data.tradingcalendar as tcal def set_periods(df: pd.DataFrame): """ Split the dataset into trading/after hours segments using columns (e.g. ...
pg_process.py
import multiprocessing as mp import queue import signal from time import sleep, time #import pyqtgraph as pg #from PyQt5 import QtWidgets class PGProcess: def __init__(self, updater, max_freq=60): self._queue = mp.Queue() self._exit_event = mp.Event() args = ( ...
mock_web_api_server.py
import json import logging import re import sys import threading import time from http import HTTPStatus from http.server import HTTPServer, SimpleHTTPRequestHandler from multiprocessing.context import Process from typing import Type from unittest import TestCase from urllib.parse import urlparse, parse_qs from urllib....
bird.py
import subprocess, netaddr, time, json, re from Class.templator import Templator from threading import Thread class Bird: def __init__(self,config="hosts.json"): print("Loading",config) with open(config) as handle: self.targets = json.loads(handle.read()) self.templator = Templa...
Soundlocalization_socket_local.py
# # Created on Sat Oct 09 2021 # Author: Owen Yip # Mail: me@owenyip.com # import os, sys import threading import numpy as np import time import zmq import json pwd = os.path.abspath(os.path.abspath(__file__)) father_path = os.path.abspath(os.path.dirname(pwd) + os.path.sep + "..") sys.path.append(father_path) class...
websocket.py
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. """ Synchronized and object-oriented WebSocket class. WebSocket guarantees that messages will not be divided at API level. """ from __future__ import annotations __all__ = ['WebSocket'] import asyncio import logging from threading import Lock...
test.py
import json import os.path as p import random import subprocess import threading import logging import time from random import randrange import pika import pytest from google.protobuf.internal.encoder import _VarintBytes from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster fro...
response.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright 2019 Child Mind Institute MATTER Lab # # Licensed under the Apache License, Version 2.0 ( the "License" ); # you may not use this file except in compliance with the License. # Y...
drone_relloc_fsm.py
#!/usr/bin/env python import copy import math import threading import numpy as np import rospy import smach import smach_ros import PyKDL as kdl import message_filters as mf import tf_conversions as tfc from nav_msgs.msg import Odometry from std_msgs.msg import Bool, UInt8, Duration, Float32, String, ColorRGBA from ...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
trainer.py
from datetime import datetime import os import paddle from player import AlphaGoPlayer import numpy as np from threading import Thread from threading import Lock import go_engine lock = Lock() class Trainer: def __init__(self, epochs=10, learning_rate=1e-3, batch_size=128, temp=1.0, n_playout=100, c_puct=5, ...
v1_test_rest_v1_0_0.py
import json import os import shlex import signal import string import subprocess import sys import time import unittest from collections.abc import Iterable from multiprocessing import Process import requests from dateutil.parser import parse PODMAN_URL = "http://localhost:8080" def _url(path): return PODMAN_UR...
run_callback_receiver.py
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. # Python import logging import signal from uuid import UUID from multiprocessing import Process from multiprocessing import Queue as MPQueue from Queue import Empty as QueueEmpty from Queue import Full as QueueFull import os from kombu import Connection, Excha...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
apkleaks.py
#!/usr/bin/env python3 import io import json import logging.config import os import re import shutil import sys import tempfile import threading from contextlib import closing from distutils.spawn import find_executable from pathlib import Path from pipes import quote from urllib.request import urlopen from zipfile im...
test_processor_service.py
# Copyright 2017 - Nokia # # 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, software...
child_process_executor.py
'''Facilities for running arbitrary commands in child processes.''' import multiprocessing import os import sys from abc import ABCMeta, abstractmethod from collections import namedtuple import six from dagster import check from dagster.utils import get_multiprocessing_context from dagster.utils.error import Seriali...
test.py
import pytest import random import threading import time from helpers.client import QueryRuntimeException from helpers.cluster import ClickHouseCluster from helpers.test_tools import TSV transient_ch_errors = [23, 32, 210] cluster = ClickHouseCluster(__file__) s0r0 = cluster.add_instance( 's0r0', main_confi...
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): app = current_app._get_current_object() msg = Mess...
Storage.py
#Embedded file name: ACEStream\Core\DirectDownload\Storage.pyo import os import time import binascii from threading import Thread, Lock from traceback import print_exc from ACEStream.Core.Utilities.logger import log, log_exc DEBUG = False MAXLOCKSIZE = 1000000000L MAXLOCKRANGE = 3999999999L class Storage: def __i...
plotting.py
"""PyVista plotting module.""" import collections.abc import ctypes from functools import wraps import io import logging import os import pathlib import platform import textwrap from threading import Thread import time from typing import Dict import warnings import weakref import numpy as np import scooby import pyvi...
vcb.py
#!/usr/bin/env python2.7 ### ### Utility to backup VMs from vCenter ### ### (written by Ondrej Holecek <ondrej@holecek.eu>) ### ### License: 3-clause BSD: ### Copyright (c) 2019, Ondrej Holecek ### All rights reserved. ### ### Redistribution and use in source and binary forms, with or without ### mod...
run_outer_tests.py
# coding:utf-8 import os import sys import time import pipes import subprocess import threading import pexpect import signal class ReturnContainer(): def __init__(self): self.value = None self.stdout = "" class Command(object): def __init__(self, cmd, fail_cmd, post_cmd=None, post_delay=0): ...
rtk.py
#!/usr/bin/env python3 # -*- coding:utf-8 -*- # File : rtk.py # Author : bssthu # Project : rtk_trans # Description : socket 转发数据 # import json import log from control_thread import ControlThread from dispatcher_thread import DispatcherThread from gps_thread import GPSThread from basestation_t...
simulation.py
#!/usr/bin/env python ################################################################################ ## ## MIT License ## ## Copyright (c) 2018 Team Roborex, NIT Rourkela ## ## Permission is hereby granted, free of charge, to any person obtaining a copy ## of this software and associated documentation files (the "So...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
main.py
from board import Board from words import WordMatcher from solver import Solver from interface import GraphicalInterface import threading class Prog: def __init__(self): self.board = Board() self.matcher = WordMatcher() self.solver = Solver() self.thread = None self.stoppin...
param_module.py
import tkinter import threading import opros import time shift_Y = 70 # константа сдвига элементов окна по вертикали def full_information_of_module(type_window, what_module): if type_window == '47': window47(what_module) if type_window == '49': window49(what_module) if type_wi...
PC_Miner.py
#!/usr/bin/env python3 ########################################## # Duino-Coin Python PC Miner (v2.2) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © Duino-Coin Community 2019-2021 ########################################## import socket, statistics, threading, multiprocessing, time...
httpd.py
#!/usr/bin/env python """ Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/) See the file 'LICENSE' for copying permission """ from __future__ import print_function import datetime import glob import gzip import hashlib import io import json import mimetypes import os import re import...
test_fft.py
import functools import unittest import pytest import numpy as np import cupy from cupy import testing from cupy.fft import config from cupy.fft.fft import _default_fft_func, _fft, _fftn def nd_planning_states(states=[True, False], name='enable_nd'): """Decorator for parameterized tests with and wihout nd plann...
13_edf_wound_wait_NS.py
from functools import reduce from sys import * import numpy as np import random as r import ping_code as pc import socket import struct import subprocess as sp import threading from threading import Thread import ast import time import datetime as dt import os import psutil import getpass as gp from netifaces import in...
test1.py
from __future__ import print_function import pybedtools import gzip import os, difflib, sys from textwrap import dedent from nose import with_setup from nose.tools import assert_raises, raises from pybedtools.helpers import BEDToolsError from pybedtools import featurefuncs import six import pysam from .tfuncs import se...
rpdb2.py
#! /usr/bin/env python """ rpdb2.py - version 2.4.8 A remote Python debugger for CPython Copyright (C) 2005-2009 Nir Aides This program 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;...
main.py
from flask import Flask, request from src.pendingwork import PendingWork from src.update_metadata.model_update import ModelUpdate from src.ml_thread import initialize_current_node import threading import json import sys import requests import time app = Flask(__name__) import logging log = logging.getLo...
readSerial.py
import serial # import RPi.GPIO as GPIO import datetime from datetime import timedelta import time import threading from DBHelper import DBHelper from Models.Court_usage import Court_usage from Models.serial_data import SerialData def write_to_database(serial_string, end_time): # print serial_data # tokens =...
commander.py
#!/usr/bin/env python # -*- coding:utf-8 -*- from __future__ import unicode_literals from multiprocessing import Process, Queue class Commander(object): def __init__(self): self.queue = Queue() self.rep_queue = Queue() self.outputs = Queue() self.master = Process(target=master, a...
test_enum.py
import enum import doctest import inspect import pydoc import sys import unittest import threading from collections import OrderedDict from enum import Enum, IntEnum, StrEnum, EnumMeta, Flag, IntFlag, unique, auto from enum import STRICT, CONFORM, EJECT, KEEP from io import StringIO from pickle import dumps, loads, Pic...
logging_test.py
# Copyright 2017 The Abseil 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 ...
test_configuration.py
""" Copyright (c) 2015 SONATA-NFV ALL RIGHTS RESERVED. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in...
arska.py
#!/usr/bin/env /usr/bin/python3.9 # coding: utf-8 #from multiprocessing.dummy.connection import families import traceback #error reporting import sys import json import os import signal import argparse import settings as s #file names and functions shared with Telegraf plugins import subprocess # for calling Tele...
test_celstash.py
import celstash from SocketServer import UDPServer, BaseRequestHandler from getpass import getuser from os import makedirs from os.path import isdir, join, isfile from shutil import rmtree from tempfile import gettempdir from threading import Thread from time import sleep import json messages = [] def make_test_dir...
swivel.py
#!/usr/bin/env python # # 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 require...
WeatherWebApp.py
from flask import Flask, jsonify, request import json import threading import logging import os from ..Devalore_Assignment1 import WeatherApi as WAPI app = Flask(__name__) app.logger.disabled = True log = logging.getLogger("werkzeug") log.disabled = True @app.route("/") def get_weather_from_OWM(): ...
controller_connection.py
import paramiko import multiprocessing as mp processes = [] """ Function that establishes the connection to the respective controller. Args: address: The IP address of the controller command: The specific python command used to run the controller status: The specific action that you want to run for instance start, ...
multiprocess_iterator.py
import logging import os from queue import Empty from typing import Iterable, Iterator, List, Optional from torch.multiprocessing import JoinableQueue, Process, Queue, get_logger from allennlp.common.checks import ConfigurationError from allennlp.data.dataset import Batch from allennlp.data.dataset_readers.multiproce...
setup.py
# -*- coding: utf-8 -*- """ bromelia.setup ~~~~~~~~~~~~~~ This module implements the central Diameter application object. It works as per Peer State Machine defined in RFC 6733 in order to establish a Diameter association with another Peer Node. :copyright: (c) 2020-present Henrique Marqu...
test_pdb.py
# -*- coding: utf-8 -*- from __future__ import print_function import bdb import inspect import os.path import re import sys from io import BytesIO import py import pytest try: from itertools import zip_longest except ImportError: from itertools import izip_longest as zip_longest # make sure that we are real...