source
stringlengths
3
86
python
stringlengths
75
1.04M
app.py
# coding:utf-8 import threading from flask import Flask, request, Response, send_from_directory, make_response import json import gevent.monkey from gevent.pywsgi import WSGIServer import redis gevent.monkey.patch_all() # 内部引用 from wifilist.startwifiserver import CONTROL from wifilist.getwifihandshake import HANDSHAKE ...
_run.py
from profil3r.core.colors import Colors import threading def run(self): self.print_logo() # No argument if not len(self.items): print('''Profil3r is an OSINT tool that allows you to find potential profiles of a person on social networks, as well as their email addresses. This program also alerts y...
test.py
import json import os.path as p import random import socket import subprocess import threading import time import avro.schema from confluent_kafka.avro.cached_schema_registry_client import CachedSchemaRegistryClient from confluent_kafka.avro.serializer.message_serializer import MessageSerializer import kafka.errors i...
train.py
#!/usr/bin/env python """Train models.""" import os import signal import torch import onmt.opts as opts import onmt.utils.distributed from onmt.utils.misc import set_random_seed from onmt.utils.logging import init_logger, logger from onmt.train_single import main as single_main from onmt.utils.parse import ArgumentPa...
certutils_test.py
"""Test routines to generate dummy certificates.""" import BaseHTTPServer import os import shutil import ssl import tempfile import threading import unittest import certutils class Server(BaseHTTPServer.HTTPServer): def __init__(self, https_root_ca_cert_path): BaseHTTPServer.HTTPServer.__init__( self,...
trader_composer.py
# -*- coding: utf-8 -*- from multiprocessing import Process import dash import dash_core_components as dcc import dash_html_components as html from dash.dependencies import Input, Output, State from zvt.charts.dcc_components import get_trader_detail_figures from zvt.charts.html_components import cls_to_input_list fro...
lisp-core.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...
run down battery.py
#!/usr/bin/env python3 import math import time from threading import Thread from ev3dev2 import * from ev3dev2.button import Button from ev3dev2.motor import MoveTank, OUTPUT_B, OUTPUT_C from ev3dev2.sensor.lego import ColorSensor, TouchSensor, UltrasonicSensor from ev3dev2.sound import Sound class Robot: def __...
drick.py
########### Reload - Nivel Maçon 2.2 ############ # Desenvolvido por Wandrew Tischler import time import random import socket import os import requests import threading import hashlib import string import re import urllib ############# Funções ################ ####### Testar host ON/OFF def ping():...
cloudxfd.py
#!/usr/bin/env python import multiprocessing from flask import Flask, render_template, request, redirect, url_for, flash import time import zmq import socket import os CLOUD_XFD_DATA = "/home/pi/extremefeedbacklamp/cloud-xfd.data" def get_url(): """Get the url stored in the data file""" if not os.path.isfile...
test_weakref.py
import gc import sys import unittest import collections import weakref import operator import contextlib import copy import threading import time from test import support from test.support import script_helper # Used in ReferencesTestCase.test_ref_created_during_del() . ref_from_del = None # Used by FinalizeTestCase...
tor_manager.py
#!/usr/bin/env python """ # TOR manager module developed by Marios Kourtesis <name.surname@gmail.com> """ import commands import socket import time from multiprocessing import Process from framework.dependency_management.dependency_resolver import BaseComponent from framework.lib.general import cprint class TOR_man...
twisterlib.py
#!/usr/bin/env python3 # vim: set syntax=python ts=4 : # # Copyright (c) 2018 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import os import contextlib import string import mmap import sys import re import subprocess import select import shutil import shlex import signal import threading import concurrent.fu...
test_urllib.py
"""Regression tests for what was in Python 2's "urllib" module""" import urllib.parse import urllib.request import urllib.error import http.client import email.message import io import unittest from unittest.mock import patch from test import support import os try: import ssl except ImportError: ssl = None imp...
conftest.py
import os import multiprocessing from threading import Thread import pytest from rst_lsp.server.jsonrpc import start_io_lang_server, RstLanguageServer CALL_TIMEOUT = 10 @pytest.fixture(autouse=True) def mock_env_cache_dir(tmp_path): os.environ["RST_LSP_CACHE_DIR"] = str(tmp_path / "lsp_cache") yield os...
test_websockets.py
import asyncio import functools import threading import requests import pytest import websockets from contextlib import contextmanager from uvicorn.protocols import http def run_loop(loop): loop.run_forever() loop.close() @contextmanager def run_server(app): asyncio.set_event_loop(None) loop = async...
simulation2.py
""" Simulate large amount of games with probabilistic ai, multithreaded. """ from core import player, probabilistic_ai, field_utils from multiprocessing import Queue, Process import sys def child(name, q, samples, parameters): """ thread for running probabilistic AI simulations """ print("starting:",...
Spain RFS funds.py
# -*- coding: utf-8 -*- """ Created on Mon Jul 24 12:59:09 2017 @author: Lloyd Jackman """ import bs4 import requests import pandas as pd from fuzzywuzzy import process from qdb import qdb5 import numpy as np import threading import multiprocessing as mp from itertools import repeat def pullpage(n, fund_details_lis...
test_hybrid_mlp.py
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "Thieu" at 11:31, 08/07/2021 % # ...
Nitro.py
from random import choices, choice from threading import Thread from time import sleep, time import requests, os requests.packages.urllib3.util.ssl_.DEFAULT_CIPHERS = "TLS13-CHACHA20-POLY1305-SHA256:TLS13-AES-128-GCM-SHA256:TLS13-AES-256-GCM-SHA384:ECDHE:!COMPLEMENTOFDEFAULT" class Main: def __init__(...
main.py
from ray import tune from utils.Agent import Agent import gym import numpy as np import torch import time from torch.multiprocessing import Value, Event, Process from utils.ExperienceReplay import ReplayBuffer from utils.others import NormalizedActions, NoisyActionWrapper import threading import random from multiproces...
chat.py
#! /usr/bin/python3 ### Created by Shashi Prakash ### github.com/sspeedy99 ### Date 02-June-2019 import sched import sys import threading import time import os from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.act...
Control.py
#! /usr/bin/env python # coding: utf-8 import sys import time from threading import Thread from datetime import datetime from Tools.Mysql_db import DB # from JYTools import EmailManager from .Dev import DevManager from .APIStatus import StatusManager from .Bug import BugManager from .Log import LogManager from .IP imp...
parallel_work.py
from ShareDB import ShareDB from multiprocessing import Process, cpu_count from itertools import chain import numpy as np import time import shutil ''' This example shows the use of ShareDB in parallel computing of linear discrete convolution of vector pairs. The vectors generated are rather large, so...
dl.py
import os import json import requests from PIL import Image import threading import time # https:// i.hamreus.com/ps2/0-9/7jingang_wy3qy/01/seemh-001-a3d0.JPG?cid=246197&md5=WDl0h-vggXtaIXp099AuKQ # curl -e "https://tw.manhuagui.com/" "https://i.hamreus.com/ps2/0-9/7jingang_wy3qy/22/seemh-101-e5f6.jpg?cid=246218&md5...
core.py
import socket import sys import logging import atexit import platform from logging import handlers from multiprocessing import Queue as mpQueue, current_process from queue import Queue as thQueue from threading import Thread, main_thread import pickle import socketserver import struct import select from .capture impo...
face_recognition.py
#----------------------------------------------------------------------------------------------------------------------------------------------- # PiCamera modules from picamera.array import PiRGBArray from picamera import PiCamera from threading import Thread # ------------------------------------- # GPIO modules imp...
base_crash_reporter.py
# Electrum - lightweight Bitcoin client # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to deal in the Software without restriction, # including without limitation the rights to use, copy, modify, merge, # publish...
proctest.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...
main.py
#!env python # -*- coding: utf-8 from time import sleep from threading import Thread from render import Render from monitor import validate_nginx_config from utils import init_global_config def main(): try: init_global_config() r = Thread(target=Render().render) r.daemon = True r....
utils.py
#!/usr/bin/env python # Copyright (c) 2022 SMHI, Swedish Meteorological and Hydrological Institute. # License: MIT License (see LICENSE.txt or http://opensource.org/licenses/mit). """ Created on 2022-02-02 18:00 @author: johannes """ import numpy as np import datetime from pathlib import Path from collections import M...
test_wrapt_timeout_decorator.py
"""Timeout decorator tests.""" # STDLIB import sys from threading import Thread import time from typing import Any # EXT from dill import PicklingError # type: ignore import pytest # type: ignore # OWN from wrapt_timeout_decorator import * from wrapt_timeout_decorator.wrapt_timeout_decorato...
garbage_collect.py
import multiprocessing as mp import os import time from datetime import datetime, timedelta from pymongo import MongoClient def seconds_till_next_hour(): '''Returns the seconds left until the next hour. If now is 14H:25M:17S, this returns the seconds left until 15H:00M:00S ''' now = datetime.utcnow() ...
llamaLogs.py
import threading import traceback import schedule from llamalogs.logAggregator import LogAggregator from llamalogs.log import Log from llamalogs.returnLog import ReturnLog from llamalogs.stat import Stat from llamalogs.llamaProxy import LlamaProxy class LlamaLogs: globalAccountKey = '' globalGraphName = '' ...
bitbot.py
from telegram import InlineKeyboardButton, InlineKeyboardMarkup, ReplyKeyboardMarkup, KeyboardButton from telegram.ext import Updater from telegram.ext import CommandHandler, MessageHandler, Filters, CallbackQueryHandler from lbc import get_balance, get_deposit, get_listings, auto_pick, is_trade, read_messages, open...
main.py
import os import torch from pycocotools import coco import queue import threading from model_image import build_model, weights_init from tools import custom_print from data_processed import train_data_producer from train import train import time import argparse torch.backends.cudnn.benchmark = True if __name__ == '__...
test_fx.py
import builtins import contextlib import copy import functools import inspect import math import numbers import operator import os import pickle import sys import torch import traceback import typing import types import warnings import unittest from math import sqrt from torch.multiprocessing import Process from torch....
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...
dumping_callback_test.py
# Copyright 2019 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...
wallpaper_daemon.py
"""Wallpaper changer This is wallpaper changer, module for changing desktop background by rules """ __author__ = "ales lerch" import os import time import numpy import random import horizon import analyzer import database from wallpaper import Wallpaper from subprocess import Popen, PIPE from multiprocessing import P...
gui.py
from PIL import Image, ImageTk import logging import os, re, gc import sys import tkinter as tk import tkinter.filedialog as filedialog from threading import Thread # Import our own functions from pixelart.processing import PixelartProcessor PATH_FORMATS = [str, bytes, os.PathLike, int] INTERP_DESCRIPTIONS = dict( ...
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(...
averager.py
""" A background process that averages your tensors with peers """ from __future__ import annotations import asyncio import contextlib import ctypes import multiprocessing as mp import os import threading import weakref from dataclasses import asdict from typing import Any, AsyncIterator, Dict, Optional, Sequence, Tu...
test_imperative_signal_handler.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...
preprocess.py
# coding=utf8 import argparse, os, json, string from collections import Counter from Queue import Queue from threading import Thread, Lock from math import floor import h5py import numpy as np from scipy.misc import imread, imresize """ This file expects a JSON file containing ground-truth regions and captions in t...
client.py
#!/usr/bin/python3 """SOCKETCHAT by J. Krajewski, 2020, All rights reserved. -+- Spin up server.py, connect to it with client.py and chat via the cli. -+- Works out of the box with Python3. No libraries needed. """ import os import sys import socket from threading import Thread from chat_util import ping BUFFSIZE = ...
dataengine-service_configure.py
#!/usr/bin/python # ***************************************************************************** # # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The A...
tf_util.py
import numpy as np import tensorflow as tf # pylint: ignore-module import copy import os import functools import collections import multiprocessing from tensorflow.python.training.saver import Saver def switch(condition, then_expression, else_expression): """Switches between two operations depending on a scalar...
comms.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 """Various means of communication with the debuggee.""" import threading import s...
tpmmd.py
# -*- coding: utf-8 -*- """ Created on Tue Jul 1 10:20:10 2020 @author: rachev """ import threading import queue import time import logging import asyncio import uuid #from database import * from config import * from consume_tpmmd_api import * logger = logging.getLogger(__file__) sendThread = threading.Thread() re...
memcached.py
#!/usr/bin/env python3 # MIT License # # Copyright (C) 2019-2020, Entynetproject. All Rights Reserved. # # 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 withou...
liveLMA.py
import numpy as np from collections import deque import threading # # # Header data is packed in a structure: # # # # typedef struct { # # time_t header_second; # # int num_sources; # # short num_passes; # # short num_stations; # # short min_num_stations; # # float max_chisq1; # # float max_chisq2; # # short...
dockerTest.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...
app_manager.py
# ======================================================================= # # Copyright (C) 2018, Hisilicon Technologies Co., Ltd. All Rights Reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1 Re...
DataFetcher.py
import requests import logging from threading import Thread from queue import Queue import json def getData(req_data): data={} sups = ['url1','url2', 'url3', 'url4', 'url5', 'url6', 'url7', 'url8','url9', 'url10'] q = Queue(maxsize=0) num_theads = min(50, len(sups)) results = [{} for x in sups] ...
Arduino_Miner.py
#!/usr/bin/env python3 ########################################## # Duino-Coin PC Miner (v1.5) # https://github.com/revoxhere/duino-coin # Distributed under MIT license # © revox, MrKris7100 2020 ########################################## import socket, statistics, threading, time, random, re, subprocess, hashlib, pl...
test_process.py
# coding:utf-8 from __future__ import absolute_import, unicode_literals from multiprocessing import JoinableQueue, Process, freeze_support import time __author__ = "golden" __date__ = '2017/5/26' import multiprocessing, sys, time def main_loop(l): time.sleep(4) l.acquire() # raise an EOFError, I don't ...
cli.py
import os import sys import threading from contextlib import contextmanager from typing import Optional import click from dagster import check from dagster.cli.utils import get_instance_for_service from dagster.cli.workspace import ( get_workspace_process_context_from_kwargs, workspace_target_argument, ) from ...
cluster_multiprocessing_2_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...
eventgen_core.py
#!/usr/bin/env python # encoding: utf-8 import imp import logging import logging.config import os import sys import time import signal from Queue import Empty, Queue from threading import Thread from lib.eventgenconfig import Config from lib.eventgenexceptions import PluginNotLoaded from lib.eventgentimer import Timer...
viewerClient.py
from multiprocessing import Process, Lock from multiprocessing.sharedctypes import Value, Array from ctypes import c_double import pinocchio as pin import numpy as np import time class NonBlockingViewerFromRobot(): def __init__(self,robot,dt=0.01): # a shared c_double array self.dt = dt self...
multiprocesstest.py
#!/usr/bin/env python import multiprocessing as mp import time def foo(q): time.sleep(10) q.put('hello') time.sleep(5) def bar(): q = mp.Queue() p = mp.Process(target=foo, args=(q,)) p.start() print(q.get()) p.join()
git_common.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Monkeypatch IMapIterator so that Ctrl-C can kill everything properly. # Derived from https://gist.github.com/aljungberg/626518 import multiprocessing.pool ...
threaded_server.py
# threaded_server.py # Fib microservice: as demoed in the video clip from socket import * from fib import fib from threading import Thread def fib_server(address): sock = socket(AF_INET, SOCK_STREAM) sock.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) sock.bind(address) sock.listen(5) while True: ...
dalton.py
#!/usr/local/bin/python """ Dalton - a UI and management tool for submitting and viewing IDS jobs """ # Copyright 2017 Secureworks # # 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...
wifideauth.py
from wifipumpkin3.core.common.terminal import ModuleUI from wifipumpkin3.core.config.globalimport import * from wifipumpkin3.core.utility.printer import ( display_messages, setcolor, display_tabulate, ) from random import randrange import time, signal, sys from multiprocessing import Process from scapy.all ...
logistic_parallel.py
from multiprocessing import Process, Manager import pandas as pd from scipy.stats import logistic import numpy as np import argparse import matplotlib.pyplot as plt #Initialize argument parser parser = argparse.ArgumentParser() parser.add_argument("-f", "--filename", help="input file name") parser.add_argument("-l", "...
main.py
#!/usr/bin/env python3 # Required packages # - paho-mqtt # - flask # - flask-Restful # - flask-Cors # - requests # - pymongo # - jsonpatch # - flask-HTTPAuth VERSION = "1.10" import time from threading import Thread from mqtt.CommandIO import CommandIO from rest.RestIO import RestIO from control.Injector import Inje...
web.py
from flask import Flask import threading import motor #from root_path = '/gpio' app = Flask(__name__) @app.route(root_path) def hello(): return 'Hello World!' @app.route(root_path + '/left') def left(): motor.move(7.5, 7.5) return 'left' @app.route(root_path + '/right') def right(): motor.stop() ...
run_ICAIPose_FPGA.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Nov 30 09:35:29 2021 @author: nunigan """ from ctypes import * from typing import List import cv2 import numpy as np import vart import pathlib import xir import os import math import threading import time import sys import argparse import queue import...
failure_test.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import json import os import ray import sys import tempfile import threading import time from ray.parameter import RayParams import ray.ray_constants as ray_constants from ray.utils import _...
GUI_multiple_threads_starting_a_thread.py
''' May 2017 @author: Burkhard A. Meier ''' #====================== # imports #====================== import tkinter as tk from tkinter import ttk from tkinter import scrolledtext from tkinter import Menu from tkinter import messagebox as msg from tkinter import Spinbox from time import sleep import Ch04_Code...
separate_transactions_raw.py
#!/usr/bin/env python from __future__ import print_function import sys import threading import htcondor import utils def do_submit(txn, submit): ident = threading.get_ident() submit["JobBatchName"] = str(ident) result = submit.queue(txn, 1) print(ident, result) def test_separate_transactions_raw...
multi_gpu_extract.py
from __future__ import print_function import os import glob import sys from multiprocessing import Pool, current_process import multiprocessing as mp import argparse import time import numpy as np def dump_frames(vid_path): import cv2 video = cv2.VideoCapture(vid_path) vid_name = vid_path.split("/")[-1]....
test_basic.py
# coding: utf-8 from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from concurrent.futures import ThreadPoolExecutor import json import logging from multiprocessing import Process import os import random import re import setproctitle import s...
multi_proxy_server.py
#!/usr/bin/env python3 import socket, time, sys from multiprocessing import Process HOST = "" PORT = 8001 BUFFER_SIZE = 1024 #get host information def get_remote_ip(host): print(f'Getting IP for {host}') try: remote_ip = socket.gethostbyname( host ) except socket.gaierror: print ('Hostname...
test_queue.py
# Some simple queue module tests, plus some failure conditions # to ensure the Queue locks remain stable. import queue import sys import threading import time import unittest from test import support QUEUE_SIZE = 5 def qfull(q): return q.maxsize > 0 and q.qsize() == q.maxsize # A thread to run a function that un...
ssh_cpython_backend.py
"""Intermediate process for communicating with the remote Python via SSH""" import os.path import sys import threading from threading import Thread import thonny from thonny.backend import ( SshMixin, BaseBackend, interrupt_local_process, RemoteProcess, ensure_posix_directory, ) from thonny.common ...
conftest.py
import threading import pytest @pytest.fixture(scope="session") def eth_coinbase(): from ethereum import tester return tester.encode_hex(tester.accounts[0]) @pytest.yield_fixture() def rpc_server(): from testrpc.__main__ import create_server from testrpc.testrpc import evm_reset server = creat...
upload_to_ibm_cos.py
# # (C) Copyright IBM Corp. 2021 # # 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 writi...
start_orig.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...
orgsyncattendance.py
import os import requests from datetime import datetime from dateutil.parser import parse from pytz import timezone from datetime import timedelta from threading import Thread from overlord import celery from utils import Event, Email, headers import StringIO from email.mime.application import MIMEApplication from e...
DatasetLoader.py
#! /usr/bin/python # -*- encoding: utf-8 -*- import torch import numpy import random import pdb import os import threading import time import math from scipy.io import wavfile from queue import Queue def round_down(num, divisor): return num - (num%divisor) def loadWAV(filename, max_frames, evalmode=True, num_eva...
server.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ usage: server.py [-h] [-i IP] [-p PORT] [-P PLACES] Tartu Night Life Backend by Bruno Produit, Basar Turgut, Abel Mesfin, Saumitra Bagchi, version 0.1 optional arguments: -h, --help show this help message and exit -i IP, --ip IP Listen address. Def...
03-calculate-metrics.py
# The MIT License (MIT) # # Copyright (c) 2020 Aibolit # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, m...
purpleair.py
#!/usr/bin/env python # CONFIGURE THIS # Open up PurpleAir in a web browser. Then open up developer tools -> Network -> XHR # Click on a single station near you. # You should see requests being made to a URL that looks like: https://www.purpleair.com/json?show=12345 # Enter the number here: purpleair_station = "12345"...
rpicam_ai_interface.py
#!/usr/bin/python3 import queue import threading import time import sys import rclpy from rclpy.parameter import Parameter from rclpy.node import Node from sensor_msgs.msg import Image from std_msgs.msg import Float32MultiArray, MultiArrayDimension, String, Int32 import cv2 import numpy as np from perspectiveImage imp...
connection_test.py
import demistomock as demisto from Active_Directory_Query import main import socket import ssl from threading import Thread import time import os import pytest import json from IAMApiModule import * BASE_TEST_PARAMS = { 'server_ip': '127.0.0.1', 'secure_connection': 'None', 'page_size': '500', 'credent...
tests.py
# Unit tests for cache framework # Uses whatever cache backend is set in the test settings file. import copy import io import os import pickle import re import shutil import sys import tempfile import threading import time import unittest from pathlib import Path from unittest import mock, skipIf from django.conf impo...
_background_server.py
# Copyright 2018 Google LLC # # 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, ...
test_tracer.py
# -*- coding: utf-8 -*- """ tests for Tracer and utilities. """ import contextlib import multiprocessing import os from os import getpid import threading from unittest.case import SkipTest import warnings import mock import pytest import six import ddtrace from ddtrace.constants import ENV_KEY from ddtrace.constants ...
request_signature.py
import argparse import base64 import json import logging import os import sys import threading import time from typing import Any import uuid import stomp from operatorcert.logger import setup_logger from operatorcert.umb import start_umb_client LOGGER = logging.getLogger("operator-cert") def setup_argparser() -> ...
__init__.py
import importlib import logging import sys import threading from threading import Thread from platypush.bus import Bus from platypush.config import Config from platypush.utils import get_message_class_by_type, set_timeout, clear_timeout from platypush.message import Message from platypush.message.event import Event, ...
server.py
#!/usr/bin/env python """ A dummy web server used to test the LendingClub API requests """ """ The MIT License (MIT) Copyright (c) 2013 Jeremy Gillick 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 Sof...
server.py
import os import yaml import json import time import base64 import random import hashlib import asyncio import requests import markdown import threading import subprocess import tornado.web import tornado.ioloop import tornado.options import tornado.httpserver from tools import make_json, solr_tools from robot import c...
trainer.py
# Lint as: python3 # 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 ...
utils.py
# Copyright (C) 2011-2020 ycmd contributors # # This file is part of ycmd. # # ycmd 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 version 3 of the License, or # (at your option) any later version. # #...
test_local_blob_manager.py
# # Copyright 2022 The AI Flow 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 w...
othello.py
import argparse import gc import os import random import traceback from multiprocessing import Pool, Process import numpy as np import tensorflow.compat.v1 as tf import api import board import config import gui import net import tree from util import log, plane_2_line class SelfPlayGame: def __init__(self, work...
NormalFattree.py
# Copyright (C) 2016 Huang MaChi at Chongqing University # of Posts and Telecommunications, China. # Copyright (C) 2016 Li Cheng at Beijing University of Posts # and Telecommunications. www.muzixing.com # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance ...