source
stringlengths
3
86
python
stringlengths
75
1.04M
extract_frames_from_videos.py
import argparse import os import cv2 import tb_file_utils as utils from multiprocessing import Process import random def partition (list_in, n): random.shuffle(list_in) return [list_in[i::n] for i in range(n)] def process(scan_list, machine_num, args): i = 0 for scan in scan_list: utils.extrac...
jfx_bridge_jeb_server.py
import importlib import logging import subprocess import threading from jfx_bridge import bridge from jfx_bridge_jeb_port import DEFAULT_SERVER_PORT """ Need to manually import all of the JEB API packages to ensure they're loaded in the namespace. From our client, <javapackage>.<unimported javapackage> doesn't wo...
2.Multiprocessing.Pipe.py
# -*- coding: utf-8 -*- import multiprocessing import time def proc1(pipe): while True: for i in xrange(10000): print "send: %s" %(i) pipe.send(i) time.sleep(1) def proc2(pipe): while True: print "proc2 rev:", pipe.recv() time.sleep(1...
reconscan.py
#!/usr/bin/env python ############################################################################################################### ## [Title]: reconscan.py -- a recon/enumeration script ## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift ##---------------------------------------------------------------------------...
test_concurrent_futures.py
import test.support # Skip tests if _multiprocessing wasn't built. test.support.import_module('_multiprocessing') # Skip tests if sem_open implementation is broken. test.support.import_module('multiprocessing.synchronize') from test.support.script_helper import assert_python_ok import contextlib import itertools imp...
execute_test_content.py
import os import sys from threading import Thread import requests from demisto_sdk.commands.test_content.ParallelLoggingManager import \ ParallelLoggingManager from demisto_sdk.commands.test_content.TestContentClasses import ( BuildContext, ServerContext) SKIPPED_CONTENT_COMMENT = 'The following integrations...
Peer.py
from p2pnetwork.node import Node import commands import time from threading import Thread from utils import merge_operations class Peer(Node): def __init__(self, host, port): super(Peer, self).__init__(host, port, None) self.__counter = 1 self.operations = [] self.__shutdown = Fals...
sanitylib.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...
motion_database_handlers.py
#!/usr/bin/env python # # Copyright 2019 DFKI GmbH. # # 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, merg...
audio_service.py
import os import re import time import wave import commons import multiprocessing import network_service as nS def aduio_service(serial_dict, sock, sock_lock): recordProcess = multiprocessing.Process(target=record_audio, args=(serial_dict, sock, sock_lock)) if __name__ == '__main__': recordProcess.sta...
cli.py
# -*- coding: utf-8 -*- """ flask.cli ~~~~~~~~~ A simple command line application to run flask apps. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import sys from threading import Lock, Thread from functools import update_wrapper import click ...
shufflemilky.py
#!/usr/bin/env python3 # # Uses python-vlc -> https://github.com/oaubert/python-vlc # # File : shufflemilky.py # Author : Sam Uel <samuelfreitas@linuxmail.org> # Date : 30 dec 2016 # Last Modified Date: 25 nov 2018 # Last Modified By : Sam Uel <samuelfreitas@linuxmail.org> import...
sockets.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 import socket import sys import threading from ptvsd.common import log def crea...
dataloader.py
import os import torch from torch.autograd import Variable import torch.utils.data as data import torchvision.transforms as transforms from PIL import Image, ImageDraw from SPPE.src.utils.img import load_image, cropBox, im_to_torch from opt import opt from yolo.preprocess import prep_image, prep_frame, inp_to_i...
prepare_data.py
''' Prepare KITTI data for 3D object detection. Author: Charles R. Qi Date: September 2017 Modified by Zhixin Wang ''' import argparse import os import pickle import sys import cv2 import numpy as np from PIL import Image from multiprocessing import Process BASE_DIR = os.path.dirname(os.path.abspath(__file__)) ROO...
commander.py
#!/usr/bin/env python # # Author Jack Baker (https://github.com/qwokka/smbcommander) # # This product includes software developed by # SecureAuth Corporation (https://www.secureauth.com/)." # import argparse import curses import cmd import logging import ntpath import os import string import sys import time from thre...
runtime_manager_dialog.py
#!/usr/bin/env python """ Copyright (c) 2015, Nagoya University 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 notice, this ...
GUI.py
#! /usr/bin/env python # GUI module generated by PAGE version 4.9 # libraries and dependencies # ---------------------------------------------------------------------------- # import sys, os, threading, time, cv2, keyboard import pandas as pd import driving_assistant.user_interface.gui_utils as gui_utils from driving...
win32gui_start.pyw
import win32api import win32gui import win32con import os import start_services import settings from multiprocessing import Process class MainWindow: def __init__(self): msg_task_bar_restart = win32gui.RegisterWindowMessage("Hope") message_map = { msg_task_bar_restart: self.on_rest...
routes.py
from threading import Thread from flask import render_template, redirect, flash, url_for, make_response import env from just4me import app from just4me import just4me from just4me import logger from just4me.forms import CouponWebsiteLoginForm from just4me.websites import UserPass @app.route(rule='/') def index(): ...
server.py
import os import socket import threading class Server: def __init__(self): self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) self.connections = [] self.sock.bind(('0.0.0.0', 10000)) self.sock.listen(1) def handler(self, c, a): while True: try: ...
main_multi_objective.py
#!/usr/bin/env python # ------------------------------------------------------------------------------------------------------% # Created by "Thieu" at 14:18, 22/01/2021 % # ...
conftest.py
import pytest import multiprocessing import subprocess import time from random import randint from pade.core import new_ams from pade.core.sniffer import Sniffer from pade.misc.utility import start_loop class start_loop_test: """ Start and stops reactor thread for agents under test """ def __ini...
clang_format.py
#! /usr/bin/env python """ A script that provides: 1. Ability to grab binaries where possible from LLVM. 2. Ability to download binaries from MongoDB cache for clang-format. 3. Validates clang-format is the right version. 4. Has support for checking which files are to be checked. 5. Supports validating and updating a s...
select_ticket_info.py
# -*- coding=utf-8 -*- import datetime import random import os import socket import sys import threading import time import TickerConfig import wrapcache from agency.cdn_utils import CDNProxy, open_cdn_file from config import urlConf, configCommon from config.TicketEnmu import ticket from config.configCommon import sea...
moretg.py
import asyncio import subprocess import os import sys import nest_asyncio import threading import time import re from modules.control import run_rclone from config import aria2, BOT_name from pyrogram.types import InlineKeyboardMarkup,InlineKeyboardButton nest_asyncio.apply() os.system("df -lh") async def start_dow...
deepracer_memory.py
from threading import Thread, Event, Lock import pickle import time import queue import redis import logging from rl_coach.memories.backend.memory import MemoryBackend from rl_coach.core_types import Episode from markov.utils import Logger, json_format_logger, build_system_error_dict from markov.utils import SIMAPP_M...
test_session.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 1999-2021 Alibaba Group Holding 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-...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
parallel_dl_slickguns.py
import sys import json import time import os import requests import shutil from Queue import * from threading import Thread #basepath="/srv/skaraman/weapons/" #website="gunsamerica" imagecat=json.load(open('imagecat_conf.json','rt')) nb_threads=16 def mkpath(outpath): pos_slash=[pos for pos,c in enumerate(outpath)...
Zydra.py
#!/usr/bin/env python import optparse import zipfile import rarfile # need unrar tools import itertools import string import os import crypt import pyfiglet from termcolor import cprint, colored import time import term # py-term from datetime import timedelta import sys import threading import shutil import subproce...
dbcounter.py
import json import logging import os import threading import time import queue import sqlalchemy from sqlalchemy.engine import CreateEnginePlugin from sqlalchemy import event # https://docs.sqlalchemy.org/en/14/core/connections.html? # highlight=createengineplugin#sqlalchemy.engine.CreateEnginePlugin LOG = logging.g...
athenad.py
#!/usr/bin/env python3 import base64 import hashlib import io import json import os import queue import random import select import socket import threading import time from collections import namedtuple from functools import partial from typing import Any import requests from jsonrpc import JSONRPCResponseManager, dis...
queues.py
# # Module implementing queues # # multiprocessing/queues.py # # Copyright (c) 2006-2008, R Oudkerk # Licensed to PSF under a Contributor Agreement. # # Modifications Copyright (c) 2020 Cloudlab URV __all__ = ['Queue', 'SimpleQueue', 'JoinableQueue'] import sys import os import threading import collections import tim...
test_local_task_job.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...
Network.py
import argparse import random import socket import threading from time import sleep import RDT ## Provides an abstraction for the network layer class NetworkLayer: #configuration parameters prob_pkt_loss = .5 prob_byte_corr = 0 prob_pkt_reorder = 0 #class variables sock = None conn = Non...
marshal.py
# Copyright 2019 Atalaya Tech, 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, ...
pre_processing_executor.py
import threading import time from Queue import Queue from src.server.ml.pre_processing.text_pre_processing_utils import load_pp_html_to_db, clean_pp_html_records, \ split_or_bypass_pp, load_pp_from_db from src.server.utils.db.tools import db_utils # Limit the size of the queue between the producer and the consume...
__init__.py
"""Library to handle connection with Xiaomi Gateway""" import socket import json import logging import platform import struct from collections import defaultdict from threading import Thread from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_bac...
environment.py
import time from environment_server.actor_data import ActorData import traceback def replay_buffer_process(params, batch_sizes, batch_addresses, transition_queue, replay_lock): try: from replay_buffer import replay_client import random batch_data = [ActorData(params, b, a) for b, a in zip(...
autoban.py
import requests import time import json import re import os import threading import sys import toml class AutomaticBan(object): def __init__(self): self.config = toml.load('config.toml') self.session = requests.session() self.host = 'https://drrr.com/room/?ajax=1' self.flood = {} ...
utils.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # # Copyright 2020 Alibaba Group Holding Limited. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache...
async_eaas.py
from __future__ import annotations from collections.abc import Callable from threading import Thread from typing import Any import uuid from eaas import Client, Config class AsyncEaaSRequest: def __init__(self, eaas_client: AsyncEaaSClient, request_id: str): self._eaas_client = eaas_client self....
test_acs_translation.py
#!/usr/bin/env python3 ############################################################################# # NOTICE # # # # This software (or technical data) was produced for the U.S. G...
gmail.py
""" File: gmail.py -------------- Home to the main Gmail service object. Currently supports sending mail (with attachments) and retrieving mail with the full suite of Gmail search options. """ import base64 # for base64.urlsafe_b64decode # MIME parts for constructing a message from email.mime.audio import MIME...
cluster.py
# Standard import ast import importlib import signal import socket import traceback import uuid from multiprocessing import Event, Process, Value, current_process, get_start_method from time import sleep # External import arrow # Django from django import db, core from django.apps.registry import apps try: SPAWN ...
mpd_connection.py
import threading from mpd import MPDClient from time import sleep class ControlMPD: def __init__(self, host, port=None): """ Creates a MPD client to control :param host: hostname for the MPD server :param port: port to communicate with the MPD server """ if isinst...
PyShell.py
#! /usr/bin/env python3 import getopt import os import os.path import re import socket import subprocess import sys import threading import time import tokenize import io import linecache from code import InteractiveInterpreter from platform import python_version, system try: from tkinter import * except ImportE...
api_chess.py
""" Defines the process which will listen on the pipe for an observation of the game state and return a prediction from the policy and value network. """ from multiprocessing import connection, Pipe from threading import Thread import numpy as np from ..config import Config class ChessModelAPI: """ Defines th...
Village-Spider-Test.py
# coding: utf-8 # # 居委会信息获取爬虫测试 # 由于居委会的数据量过大,我这里用很小的数据测试其代码是否正确。 import requests from lxml import etree import csv import time import pandas as pd from queue import Queue from threading import Thread from fake_useragent import UserAgent # 下面加入了num_retries这个参数,经过测试网络正常一般最多retry一次就能获得结果 def getUrl(url,num_retries = 5...
__init__.py
"""Hermes MQTT server for Rhasspy wakeword with snowboy""" import asyncio import logging import queue import socket import threading import typing from dataclasses import dataclass from pathlib import Path from rhasspyhermes.audioserver import AudioFrame from rhasspyhermes.base import Message from rhasspyhermes.client...
multiproc.py
import contextlib import functools import inspect import multiprocessing as mp import pickle import sys import threading import time import traceback import types from collections import defaultdict from multiprocessing.pool import Pool from multiprocessing.reduction import AbstractReducer from queue import Empty from ...
jupyter-lab-tray-script.pyw
import jupyterlab.labapp server = None def shutdown(tray): global server if server is not None: server.io_loop.add_callback_from_signal(server.io_loop.stop) else: print('Server is not initialized') def tray_thread(): import win32tray hover_text = "Jupyter Lab Server" menu_op...
volvox_REST_names_test.py
import threading import unittest from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.keys import Keys import name_server from jbrowse_selenium import JBrowseTest class VolvoxRestTest( JBrowseTest ): data_dir = 'tests/data/names_REST&tracks=Genes,CDS' def setUp( self...
toolbox.py
from multiprocessing import Process, Queue from .featuregenerator import * from .model import * from .inference import * from .gradient import * from .optimizer import * from .dataformat import * import time class toolbox: def __init__(self, config, *args): self.config = config if len(args)==2: ...
AD_VINAServer.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import datetime import json import os import random as _random import sys import traceback from getopt import getopt, GetoptError from multiprocessing import Process from os import environ from wsgiref.simple_server import make_server import requests as _requests from json...
__init__.py
import json from datetime import datetime from threading import Thread from warnings import warn from . import utils from .mywarnings import * __version__ = '0.1.2' def check_outdated(package, version): """ Given the name of a package on PyPI and a version (both strings), checks if the given version is ...
testclient.py
import asyncio import http import inspect import io import json import queue import threading import types import typing from urllib.parse import unquote, urljoin, urlsplit try: import httpx as r except ImportError: import requests as r from starlette.types import Message, Receive, Scope, Send from starlette...
test_e2e.py
import asyncio import threading import unittest from asyncio import StreamReader, StreamWriter from Crypto.PublicKey import RSA from bfcp.connection import SocketConnection from bfcp.node import BFCNode from bfcp.protocol import pubkey_to_proto from config import HTTPProxyServerConfig from event_server import EventSe...
kinetics-dl.py
import youtube_dl import pandas as pd import requests import os import zipfile from threading import Thread url = 'https://deepmind.com/documents/66/kinetics_train.zip' meta_path = 'meta' video_path = 'video' thread_num = 5 ydl_opts = ({'format': '18/134/135', 'proxy': '127.0.0.1:1080', # 默认HTTP代理 'outtmpl': os.p...
tests.py
# -*- coding: utf-8 -*- from __future__ import with_statement import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..')) import pickle from threading import Thread, Semaphore import unittest from decimal import Decimal import flask from datetime import datetime, timedelta import flask_bab...
02-mp-simple.py
# based on: https://github.com/pytorch/examples/tree/main/mnist_hogwild import os from PIL import Image import torch import torch.multiprocessing as mp import torch.nn as nn import torch.nn.functional as F # noqa: N812 import torch.optim as optim from torchvision import transforms import wandb SEED = 1 BATCH_SIZE =...
main.py
import http.server import os import pathlib import queue import sys import threading import boto3 import elasticsearch from . import api_endpoint from . import elasticsearch_shipper from . import elb_log_fetcher from . import elb_log_parse from . import stats def start_server(): parser_stats = stats.ParserStats...
pyNetUQ.py
import os import shutil import numpy as np import multiprocessing from aria_component import aria_component import sync_times import time import logging def run_point(network, idx, qdpt, workdir): return_code = network.execute_quadrature_point(idx, qdpt, workdir) assert(return_code == 0) class network(): ...
spotfinder.py
import numpy as np import imageio from pathlib import Path import multiprocessing as mp from starfish import data, FieldOfView from starfish.types import Axes, Features from starfish.image import Filter from starfish.core.imagestack.imagestack import ImageStack from starfish.spots import DecodeSpots, FindSpots from st...
ssd_model.py
# coding=utf-8 # Copyright 2019 The Google Research 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 applicab...
gui.py
from tkinter import * from tkinter.ttk import * import main as main import azure_vm as azure_virtual from tkinter import filedialog from tkinter import messagebox from PIL import ImageTk, Image import os import threading import logging from main import exc_info from requests import get from webbrowser import open_new_t...
audio_server.py
#!/usr/bin/env python # encoding: utf-8 # Copyright 2014 Xinyu, He <legendmohe@foxmail.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...
core.py
# -*- coding: utf-8 -*- # # 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 #...
test_fetcher.py
# coding=utf-8 # Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import (absolute_import, division, generators, nested_scopes, print_function, unicode_literals, with_statement) import BaseHTTPServe...
__init__.py
# vim: sw=4:ts=4:et # # ACE Collectors # These objects collect things for remote ACE nodes to analyze. # import logging import os, os.path import pickle import shutil import signal import socket import threading import uuid import ace_api import saq from saq.database import use_db, \ execute...
gui.py
import Tkinter as tk import traceback import sys import tkMessageBox import gui_widgets as gw from collections import namedtuple from Queue import Queue, Empty from threading import Thread from dumper_engine import do_post_job fill = tk.N+tk.S+tk.E+tk.W #A lightweight data type for sending data to a job thread Job = ...
test_gc.py
import unittest from test.support import (verbose, refcount_test, run_unittest, strip_python_stderr, cpython_only, start_threads, temp_dir, requires_type_collecting, TESTFN, unlink, import_module) from test.support.script_helper import assert...
test_interrupt.py
import os import signal import tempfile import time from threading import Thread import pytest from dagster import ( DagsterEventType, Failure, Field, ModeDefinition, RetryPolicy, String, execute_pipeline, execute_pipeline_iterator, job, op, pipeline, reconstructable, ...
download_manager_test.py
# coding=utf-8 # Copyright 2019 The TensorFlow Datasets 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 appl...
test_rpc.py
import os import time import socket import dgl import backend as F import unittest, pytest import multiprocessing as mp from numpy.testing import assert_array_equal if os.name != 'nt': import fcntl import struct INTEGER = 2 STR = 'hello world!' HELLO_SERVICE_ID = 901231 TENSOR = F.zeros((10, 10), F.int64, F....
jlnk.py
import os import pickle import win32api from multiprocessing import Process from os import readlink from sys import stdout storefile = '.\\store.bin' def jlnk(path: str) -> bool: try: return bool(readlink(path)) except OSError: return False def write_over(line): stdout.write('\r{txt}'.format(txt=line)) de...
generate_breakpad_symbols.py
#!/usr/bin/env python # Copyright 2013 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. """A tool to generate symbols for a binary suitable for breakpad. Currently, the tool only supports Linux, Android, and Mac. Support f...
test_executor.py
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 eNovance # # 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/LIC...
test_extending.py
import math import operator import sys import pickle import multiprocessing import ctypes import warnings from distutils.version import LooseVersion import re import numpy as np from numba import njit, jit, vectorize, guvectorize, objmode from numba.core import types, errors, typing, compiler, cgutils from numba.core...
ch05_listing_source.py
# coding: utf-8 import bisect import contextlib import csv from datetime import datetime import functools import json import logging import random import threading import time import unittest import uuid import redis QUIT = False SAMPLE_COUNT = 100 config_connection = None # 代码清单 5-1 # <start id="recent_log"/> # ...
monitor.py
#!/usr/bin/env python import roslib; roslib.load_manifest('smach_ros') import rospy import rostest import unittest from actionlib import * from actionlib.msg import * from std_msgs.msg import Empty from smach import * from smach_ros import * from smach_msgs.msg import * def pinger(): pub = rospy.Publisher('/...
tester.py
# Copyright (c) 2014-2015 Dropbox, 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...
test_client.py
import os import pytest import time import sys import logging import threading import _thread import ray.util.client.server.server as ray_client_server from ray.tests.client_test_utils import create_remote_signal_actor from ray.util.client.common import ClientObjectRef from ray.util.client.ray_client_helpers import co...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. import multiprocessing import os import socket import shutil import s...
tracker.py
import funcs import threading import queue from config import HOST, PORT send_lock = threading.Lock() send_queues = [] def client_receive(client_socket,client_address,q): print("connected to " + str(client_socket) + " " ) with send_lock: send_queues.append(q) th = threading.Thread(target = send_to_client,args =...
gitcloner.py
# Copyright 2020-present Tae Hwan Jung # # 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_topic.py
# -*- coding: utf-8 -*- # ---------------------------------------------------------------------- # Test NSQ TopicQueue # ---------------------------------------------------------------------- # Copyright (C) 2007-2019 The NOC Project # See LICENSE for details # ----------------------------------------------------------...
wifi_link_layer.py
#from gossip_layer import Gossip import socket import time import os import threading import binascii import select class Wifi_Link_Layer: def __init__(self, receive_msg_cb): print("Initializing Link Layer...") self.receive_msg_cb = receive_msg_cb self.msg_buffer_list = [] self.i...
queue.py
from sbf import * import threading def dispatch(queue): queue.dispatch() class QueueDelegate1(SbfQueueDelegate): def onQueueItem(self): print("Queue Delegate 1") class QueueDelegate2(SbfQueueDelegate): def onQueueItem(self): print("Queue Delegate 2") log = SbfLog () log.setLevel (SBF_LO...
taskmanager.py
# Copyright 2019 Red Hat # # 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, sof...
ontology.py
""" This is in charge of taking the output of the `intake` script and transforming that output into the intermediate representation. The function of the intermediate representation is to make the ontology explicit, and provide a unified set of methods for transforming the data and loading it into a database. """ impor...
icalevents.py
from threading import Lock, Thread from .icalparser import parse_events from .icaldownload import ICalDownload # Lock for event data event_lock = Lock() # Event data event_store = {} # Threads threads = {} def events( url=None, file=None, string_content=None, start=None, end=None, fix_apple...
test_sync_clients.py
# ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # -------------------------------------------------------------------------- import py...
producer.py
import requests import time import json from kafka import KafkaProducer import threading import credentials as cred key = cred.login['private_key'] def send_Mumbai(): url = 'https://api.weatherbit.io/v2.0/history/subhourly?&city=Mumbai&country=IN&start_date=2021-09-24&end_date=2021-09-26&key={}'.format(key) d...
blueimudisplay.py
#!/usr/bin/env python3 ''' blueimudisplay.py - graphical demo of MSPPG Attitude messages over Bluetooth Copyright (C) Alec Singer and Simon D. Levy 2016 This code is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Fou...
shape_rgb.py
import time import numpy as np import matplotlib.pyplot as plt import matplotlib.patches as patches import paddle from matplotlib.image import imread import math import cv2 import os import dlib from PIL import Image, ImageFont import paddlehub as hub import threading from test_model import Facenet ...
app.py
#!/usr/bin/python3 import array import colour import collections import enum import itertools import math import numpy import os import random import sys import threading import time import timeit from PyQt5.QtCore import * from PyQt5.QtGui import * from PyQt5.QtWidgets import * ENTITY_RADIUS = 0 ENTITY_POSITION...
x11.py
# Copyright (C) 2014-2017 New York University # This file is part of ReproZip which is released under the Revised BSD License # See file LICENSE for full license details. """Utility functions dealing with X servers. """ from __future__ import division, print_function, unicode_literals import contextlib import loggin...
api_server.py
#!/usr/bin/env python3 """ API server to run the JSON-RPC and REST API. Uses neo.api.JSONRPC.JsonRpcApi and neo.api.REST.RestApi Print the help and all possible arguments: ./api-server.py -h Run using TestNet with JSON-RPC API at port 10332 and REST API at port 8080: ./api-server.py --testnet --port-rpc 10...