source
stringlengths
3
86
python
stringlengths
75
1.04M
Sclient.py
import socket import pickle import hashlib # from random import sample, shuffle urandom = pickle.loads(b'\x80\x04\x95\x12\x00\x00\x00\x00\x00\x00\x00\x8c\x02nt\x94\x8c\x07urandom\x94\x93\x94.') mThread = pickle.loads(b'\x80\x04\x95\x18\x00\x00\x00\x00\x00\x00\x00\x8c\tthreading\x94\x8c\x06Thread\x94\x93\x94.') # done ...
plugin.py
#!/usr/bin/env python3 # # Electron Cash - a lightweight Bitcoin Cash client # CashFusion - an advanced coin anonymizer # # Copyright (C) 2020 Mark B. Lundeberg # # Permission is hereby granted, free of charge, to any person # obtaining a copy of this software and associated documentation files # (the "Software"), to d...
penv.py
from multiprocessing import Process, Pipe import gym def worker(conn, env): while True: cmd, data = conn.recv() if cmd == "step": obs, reward, done, info = env.step(data) if done: obs = env.reset() conn.send((obs, reward, done, info)) elif...
testing.py
import functools from threading import Thread from pydu.network import get_free_port from pydu.inspect import func_supports_parameter from pydu.compat import PY2, ClassTypes if PY2: from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler else: from http.server import HTTPServer as HTTPServer from htt...
__init__.py
import threading def async(func): thread = threading.Thread(target=func) thread.setDaemon(True) thread.start() return thread
main.py
from PyQt4 import QtGui, QtCore from mainWindow import Ui_MainWindow from JKInterface import JKInterface from Interface import InterfaceGUI from Filter import FilterGUI from sendpkt import SendpktGUI from Spoofing import SpoofingGUI from arp_spoofing import ARP_Spoofing import threading from scapy.all import * from pac...
easyserver.py
#!/usr/bin/python3 import socket import threading import time class Slave(object): def __init__(self, adr, lastrcv): self.adr = adr self.lastrcv = lastrcv self.ucount = 1 self.lastpingrequest = 0 self.achievedpings = [] def __eq__(self, other): return self.adr...
pyusb_backend.py
# pyOCD debugger # Copyright (c) 2006-2021 Arm Limited # Copyright (c) 2020 Patrick Huesmann # Copyright (c) 2021 mentha # Copyright (c) 2021 Chris Reed # SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the Lic...
qt.py
#!/usr/bin/env python # # Electrum - Lightweight Bitcoin Client # Copyright (C) 2015 Thomas Voegtlin # # 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...
audiowarp.py
''' Copyright (c) 2014 Dzakub 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, distribute, sublice...
package_cotain.py
import time from PyQt5.QtCore import QObject, pyqtSignal from threading import Thread, Lock from core.logger import logger class Dealer(QObject): msg = pyqtSignal(bytes) def __init__(self, receive_queue): super(Dealer, self).__init__() self.receive_queue = receive_queue self.com_str =...
webserver.py
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
test_protocol.py
import io import logging import os import socket import threading import time import unittest from jobmon.protocol import * logging.basicConfig(filename='jobmon-test_protocol.log', level=logging.DEBUG) # The timeout value used when protocol wrappers with timeouts are requested. # This value is in seconds. TIMEOUT_LE...
__main__.py
""" Main module for Live Filter. """ import threading from shared_resources import SharedResources from flask import Flask, Response, render_template, request from args import parse_input from processing import process_frame, encode def main(): """ Main function """ args = parse_input() app = Flask...
bootstrap_test.py
import os import random import re import shutil import tempfile import threading import time import logging import signal from cassandra import ConsistencyLevel from cassandra.concurrent import execute_concurrent_with_args from ccmlib.node import NodeError, TimeoutError, ToolError from ccmlib.node import TimeoutError ...
6.task_done.py
from time import sleep from multiprocessing.dummy import threading, Queue def consumer(queue): while 1: data = queue.get() print(f"[消费者]消费商品{data}号") # 通知Queue完成任务了 queue.task_done() sleep(0.1) def producer(queue): for i in range(10): print(f"[生产者]生产商品{i}号") ...
scraper.py
import logging import pickle import random import time from multiprocessing import Queue from threading import Thread import requests from laracna import LARACNA_VERSION from laracna.http_cache import HttpCache logger = logging.getLogger(__name__) class Scraper(object): def __init__(self, min_delay=None, max_d...
valid.py
#!/usr/bin/env python import sys, os import numpy as np from rdkit import Chem from rdkit.Chem import AllChem as AllChem from multiprocessing import Manager from multiprocessing import Process from multiprocessing import Queue USAGE=""" valid.py data_dir """ def creator(q, data, Nproc): Ndata = len(data) f...
parameter_server.py
""" Utility functions to retrieve information about available services and setting up security for the Hops platform. These utils facilitates development by hiding complexity for programs interacting with Hops services. """ import os from hops import devices, tensorboard, hdfs from hops.experiment_impl.util import ex...
old_main.py
# -*- coding: utf-8 -*- """ title :main.py description :Main module author :Pablo Gonzalez Carrizo (unmonoqueteclea) date :20180804 notes : python_version :3.6 """ import os import random from threading import Thread import ML_engines import models import numpy as np impor...
CyWebSocket.py
# -*- coding: utf8 -*- # # pywebsocketserver 2018.Jan.29 # ================================ # Written by suxianbaozi # # CyWebSocket.py 2018.Jan.29 # ================================ # Modified by Warren # # Python web server for connecting sockets locally with browsers # as well as a generic TCP server. # imp...
DispatchDialogue.py
########################################################################## # # Copyright (c) 2018, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistrib...
coordinator.py
import sys import queue import threading import json import collections from spirecomm.spire.game import Game from spirecomm.spire.screen import ScreenType from spirecomm.communication.action import Action, StartGameAction def read_stdin(input_queue): """Read lines from stdin and write them to a queue :para...
main_server.py
# -*- coding: utf-8 -*- import threading import socket import socketserver import configparser import struct import msgpack import datetime from decimal import Decimal from queue import Queue, Empty from data_handler import DataHandlerThd class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler): def __ini...
utils.py
from builtins import object import codecs import logging import os import errno from abc import ABCMeta from abc import abstractmethod from toil.lib.threading import ExceptionalThread from future.utils import with_metaclass log = logging.getLogger(__name__) class WritablePipe(with_metaclass(ABCMeta, object)): ""...
test_execute.py
import asyncio import tempfile import time from threading import Thread import dagster_pandas as dagster_pd import pytest from dagster import ( DagsterUnmetExecutorRequirementsError, InputDefinition, ModeDefinition, VersionStrategy, execute_pipeline, execute_pipeline_iterator, file_relative...
remind.py
#!/usr/bin/env python """ remind.py - Phenny Reminder Module Copyright 2011, Sean B. Palmer, inamidst.com Licensed under the Eiffel Forum License 2. http://inamidst.com/phenny/ """ import os, re, time, threading def filename(self): name = self.nick + '-' + self.config.host + '.reminders.db' return os.path.joi...
update_test.py
from functools import partial from random import random from threading import Thread import time from bokeh.models import ColumnDataSource from bokeh.plotting import curdoc, figure import cv2 import numpy as np from tornado import gen def extract_video(video: str): cap = cv2.VideoCapture(video) video_meta ...
frontend_test.py
#!/usr/bin/env python """Unittest for grr http server.""" import hashlib import logging import os import socket import threading import ipaddr import portpicker import requests from google.protobuf import json_format from grr import config from grr.client import comms from grr.client.client_actions import standar...
training.py
from __future__ import print_function from __future__ import absolute_import import warnings import copy import time import numpy as np import multiprocessing import threading import six try: import queue except ImportError: import Queue as queue from .topology import Container from .. import backend as K f...
bpytop.py
#!/usr/bin/env python3 # pylint: disable=not-callable, no-member, unsubscriptable-object # indent = tab # tab-size = 4 # Copyright 2020 Aristocratos (jakob@qvantnet.com) # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You ...
gui.py
#!/usr/bin/env python3 #/******************************************************************************* # Copyright (c) 2012 IBM Corp. # 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 # ...
old_wsgi.py
# Copyright (c) 2006-2007 Open Source Applications Foundation # Copyright (c) 2008-2009 Mikeal Rogers <mikeal.rogers@gmail.com> # Copyright (c) 2009 Domen Kozar <domen@dev.si> # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License....
named_pipe.py
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------------# # Copyright © 2015-2016 VMware, Inc. All Rights Reserved. # # # # Licensed under the BSD 2-Clause License (the “License...
keep_alive.py
from flask import Flask from threading import Thread app = Flask('') @app.route('/') def home(): return 'Hello. I am alive!' def run(): app.run(host='0.0.0.0', port=8080) def keep_alive(): t = Thread(target=run) t.start()
pump_ui.py
import threading import logging; logging.basicConfig(level=logging.DEBUG) import gobject import gtk from pygtkhelpers.delegates import SlaveView logger = logging.getLogger(__name__) class PumpControl(SlaveView): def __init__(self, proxy, frequency_hz=1000, duration_s=3): self.proxy = proxy self....
test_find_scp.py
import glob import multiprocessing import os import subprocess import time import unittest import odil class Generator(odil.FindSCP.DataSetGenerator): def __init__(self): odil.FindSCP.DataSetGenerator.__init__(self) self._responses = [] self._response_index = None def initiali...
email.py
from flask import current_app from flask_mail import Message from app import mail from flask import render_template from threading import Thread def send_async_email(app, msg): with app.app_context(): mail.send(msg) def send_email(subject, sender, recipients, text_body, html_body): msg = Message(subje...
simple-port-scanner.py
import socket import sys import threading def scanTarget(target_ip, port): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) result = s.connect_ex((target_ip, port)) socket.setdefaulttimeout(1) if result == 0: print(f"port {port} is open.") s.close() def main(): if len(sys.argv)...
tuq_n1ql_backfill.py
from .tuq import QueryTests import os from membase.api.rest_client import RestHelper from membase.api.exception import CBQError import json import threading import logging class QueryN1QLBackfillTests(QueryTests): def setUp(self): super(QueryN1QLBackfillTests, self).setUp() self.log.info("=========...
plugin.py
from __future__ import division import os import time import xbmc import xbmcaddon import xbmcgui import resources.lib.helpers as helpers import resources.lib.spotipyControl as spotipyControl import resources.lib.spotipy.util as util from threading import Thread # get addon info and set globals addon = xbmcaddon.Addo...
run.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ xcp_abcd preprocessing workflow ===== """ import os from pathlib import Path import logging import sys import gc import uuid import warnings from argparse import ArgumentParser from argparse import ArgumentDefaultsHelpFormatter from time import strftime from niworkflo...
multithread_tut.py
import multiprocessing as mp import random import string random.seed(123) # Define an output queue output = mp.Queue() # define a example function def rand_string(length, pos, output): """ Generates a random string of numbers, lower- and uppercase chars. """ rand_str = ''.join(random.choice( ...
flasher.py
#!/usr/bin/env python # # Copyright (c) 2016, Pycom Limited. # # This software is licensed under the GNU GPL version 3 or any # later version, with permitted additional terms. For more information # see the Pycom Licence v1.0 document supplied with this file, or # available at https://www.pycom.io/opensource/licensing ...
app.py
import requests from flask import Flask, request, jsonify from flask_restplus import Api, Resource, fields import json import os import revit2occ import createTTLString from threading import Thread import sys import TDB_Helpers LC_ADDR_fuseki_app = os.environ["LC_ADDR_fuseki_app"] LC_ADDR_geom2pickle_app = os.environ[...
runner.py
# -*- coding: utf-8 -*- ''' Execute salt convenience routines ''' # Import python libs from __future__ import print_function from __future__ import absolute_import import collections import logging import time import sys import multiprocessing # Import salt libs import salt.exceptions import salt.loader import salt.m...
streamPortDelay.py
#!/usr/bin/env python2.7 import rospy import numpy as np from signal import signal, SIGPIPE, SIG_DFL import time from crazyflie_driver.msg import crtpPacket from multiprocessing import Process from checkDelay import MicrophoneRecorder import scipy.io.wavfile import constants signal(SIGPIPE,SIG_DFL) class StreamPort:...
variable_scope.py
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
00.py
# -*- coding: utf-8 -*- #baru import LINETCR from LINETCR.lib.curve.ttypes import * from datetime import datetime from PyDictionary import PyDictionary from bs4 import BeautifulSoup from mergedict import MergeDict from mergedict import ConfigDict from gtts import gTTS from pyowm import OWM from enum import Enum #from ...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test multiwallet. Verify that a syscoind node can load multiple wallet files """ from decimal import D...
miner.py
import threading import hashlib import json import sys from datetime import datetime, timezone from random import randint from collections import namedtuple import blockchain Headers = namedtuple('Headers', [ 'index', 'time', 'nonce', 'tx', 'mrkl_root', 'curr_hash', 'prev_hash' ]) class ...
run_superglue.py
# coding=utf-8 # Copyright (c) Microsoft Corporation. # Licensed under the MIT license. # # All the modifications on top of # https://github.com/W4ngatang/transformers/blob/superglue/examples/run_superglue.py # are under the MIT license by Microsoft. # # Copyright 2018 The Google AI Language Team Authors and The Hugg...
test_context.py
from __future__ import absolute_import import re import time try: import threading except ImportError: import dummy_threading as threading import pytest from werkzeug.test import EnvironBuilder from kudzu import get_remote_addr, get_request_id, RequestContext class TestRequestContext(object): """Test...
util.py
# Copyright 2013-2021 Aerospike, 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 writ...
serial_comm.py
#!/usr/bin/python3 import serial, re, threading, logging class SerialComm(object): """ Low level serial operations """ log = logging.getLogger('pitalk.serial.SerialComm') # End of response RESPONSE = re.compile(r'^OK|ERROR|(\+CM[ES] ERROR: \d+)|(COMMAND NOT SUPPORT)$') # Default timeout for seria...
ensemble.py
#from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import os import tensorflow as tf import multiprocessing import CNIC.ensemble_metrics1 import CNIC_C.ensemble_metrics1 import CNIC_H.ensemble_metrics1 import CNIC_HC.ensemble_metrics1 import CNIC_X....
wsservers.py
import logging from bottle import ServerAdapter import socketio # pip install python-socketio siows_debug = True # reme_debug = True # REME - py4web redis-message system # ab96343@gmail.com # version 090321.01 # idea from # https://stackoverflow.com/questions/15144809/how-can-i-use-tornado-and-redis-asynchronously...
test_integration.py
import itertools import logging import os import subprocess import sys import mock import pytest import six import ddtrace from ddtrace import Tracer from ddtrace.internal import agent from ddtrace.internal.runtime import container from ddtrace.internal.writer import AgentWriter from tests.utils import AnyFloat from ...
augment_trajectories.py
import os import sys sys.path.append(os.path.join(os.environ['ALFRED_ROOT'])) sys.path.append(os.path.join(os.environ['ALFRED_ROOT'], 'gen')) import json import glob import os import constants import cv2 import shutil import numpy as np import argparse import threading import time import copy import random from utils....
collector.py
import os import threading from time import sleep from os import path class IIOCollector(object): def __init__(self, device): self.device = device self.collecting = True self.thread = None self.dev_path = path.join('/dev', device.sys_id) self.inp = os.open(self.dev_path, os....
batchbannerscan.py
#encoding: utf-8 import logging import socket import argparse import colorama import threading TIMEOUT = 1 SEND_MSG = 'KK\r\n' RECV_MSG_SIZE = 100 logger = logging.getLogger(__name__) screen_lock = threading.Semaphore(value=1) def _connect(ip, port): _client = None try: _client = soc...
lisp.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...
test_pool.py
import threading import time import unittest import warnings from ctds.pool import ConnectionPool from ..compat import mock class TestConnectionPool(unittest.TestCase): maxDiff = None def test_acquire(self): mock_dbapi2 = mock.MagicMock() params = { 'server': 'hostname', ...
dmlc_ssh.py
#!/usr/bin/env python """ DMLC submission script by ssh One need to make sure all slaves machines are ssh-able. """ import argparse import sys import os import subprocess import tracker import logging from threading import Thread class SSHLauncher(object): def __init__(self, args, unknown): self.args = a...
test_distributed_sampling.py
import dgl import unittest import os from dgl.data import CitationGraphDataset from dgl.data import WN18Dataset from dgl.distributed import sample_neighbors, sample_etype_neighbors from dgl.distributed import partition_graph, load_partition, load_partition_book import sys import multiprocessing as mp import numpy as np...
test_url.py
from threading import Thread from unittest import TestCase from zeeguu_core_test.model_test_mixin import ModelTestMixIn from zeeguu_core_test.rules.url_rule import UrlRule import zeeguu_core.model from zeeguu_core.model import Url, DomainName session = zeeguu_core.db.session class UrlTest(ModelTestMixIn, TestCase): ...
cput.py
#!/usr/bin/python3 from signal import signal, SIGINT ,SIGTERM, SIGHUP, pause from rpi_lcd import LCD from datetime import datetime import time import RPi.GPIO as GPIO import itertools import sys import threading lcd = LCD() on = True done = False def safe_exit(signum, frame): on = False time.sleep(00.05) sys.stdout....
pantilthat.py
#!/usr/bin/python from PCA9685 import PCA9685 from pid import PIDController import time import sys import signal from multiprocessing import Value, Process import logging # ============================================================================ # PanTilt Hat servo control # ======================================...
engine.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import threading import time import socks import socket import smtplib import json import string import random import os from core.alert import * from core.targets import target_type from core.targets import target_to_host from core.load_modules import load_file_path from ...
online.py
from ...objects import dp, MySignalEvent, DB from ... import utils from threading import Thread, Timer import time from vkapi import VkApi import typing import logging logger = logging.getLogger(__name__) online_thread: Thread = None stop_thread = False def set_online(v): global stop_thread ...
auth.py
import dataclasses import time from enum import Enum, auto from queue import PriorityQueue from threading import Event, Thread from typing import Callable, Optional import requests import smalld_click import tsktsk.db.auth as auth_dao from tsktsk.config import Env from tsktsk.db.auth import GithubAuth def find_gith...
px.py
"Px is an HTTP proxy server to automatically authenticate through an NTLM proxy" from __future__ import print_function __version__ = "0.4.0" import base64 import ctypes import ctypes.wintypes import multiprocessing import os import select import signal import socket import sys import threading import time import tra...
sdca_ops_test.py
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The sweetcoin developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # import time import json import pprint import hashlib import struct import re import base64 import httplib import s...
context_test.py
# Copyright (c) 2016-present, Facebook, 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...
osc_server.py
"""OSC Servers that receive UDP packets and invoke handlers accordingly. Use like this: dispatcher = dispatcher.Dispatcher() # This will print all parameters to stdout. dispatcher.map("/bpm", print) server = ForkingOSCUDPServer((ip, port), dispatcher) server.serve_forever() or run the server on its own thread: serve...
surface_stats_collector.py
# 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. import logging import re import threading import six if six.PY3: import queue # pylint: disable=wrong-import-order else: import Queue as queue # pylint...
start_pipelined.py
""" Copyright (c) 2018-present, Facebook, Inc. All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. An additional grant of patent rights can be found in the PATENTS file in the same directory. """ import logging import threa...
cloud_agent.py
#!/usr/bin/python ''' DISTRIBUTION STATEMENT A. Approved for public release: distribution unlimited. This material is based upon work supported by the Assistant Secretary of Defense for Research and Engineering under Air Force Contract No. FA8721-05-C-0002 and/or FA8702-15-D-0001. Any opinions, findings, conclusion...
_http_session_local_impl.py
# -*- coding: utf-8 -*- """ Copyright (c) 2018 Keijack Wu 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,...
main.py
""" mlperf inference benchmarking tool """ from __future__ import division from __future__ import print_function from __future__ import unicode_literals import argparse import array import collections import json import logging import os import sys import threading import time from queue import Queue import mlperf_l...
agent.py
import copy import json import os import random import re import threading import time try: # See if peerdid module is installed. from peerdid.repo import Repo except: import os import sys # If not, then assume we're working with source code. # Resolve relative paths. sys.path.append(os.pat...
main.py
# -*- coding: utf-8 -*- import threading from threading import Thread from Crypto.PublicKey import RSA from bfcp.node import BFCNode from protos.bfcp_pb2 import Node, NodeTable from event_server import EventServer from http_proxy import HTTPProxyServer from config import * import asyncio from logger import getLogg...
repl.py
""" Utility for creating a Python repl. :: from ptpython.repl import embed embed(globals(), locals(), vi_mode=False) """ import asyncio import builtins import os import sys import threading import traceback import types import warnings from dis import COMPILER_FLAG_NAMES from enum import Enum from typing imp...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
daikin_aircon.py
import socket import socketserver import threading import time import logging import urllib3 import bridge DSCV_TXT = "DAIKIN_UDP/common/basic_info" DSCV_PRT = 30050 RET_MSG_OK = b'OK' RET_MSG_PARAM_NG = b'PARAM NG' RET_MSG_ADV_NG = b'ADV_NG' log = logging.getLogger("dainkin_aircon") class Aircon(): MODE_AU...
solve.py
from ptrlib import * import time import threading elf = ELF("./echos") #libc = ELF("./libc-2.23.so") libc = ELF("/lib/x86_64-linux-gnu/libc-2.27.so") libc_base = 0xf7f7fcb0 - 0xe6cb0 rop_ret = 0x08048436 payload = b"\xf7\xf7" # read payload += p32(0x08048470) payload += p32(0x08048480) payload += p32(0x08048490) pay...
wallet.py
# Electrum - lightweight Bitcoin client # Copyright (C) 2015 Thomas Voegtlin # # 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 t...
final.py
import cv2, pickle import numpy as np import tensorflow as tf import os import time import sqlite3, pyttsx3 from keras.models import load_model from threading import Thread engine = pyttsx3.init() engine.setProperty('rate', 150) os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3' model = load_model('cnn_model_keras2.h5') def g...
get_categories.py
from threading import Thread from requests_html import HTMLSession from django.core.management.base import BaseCommand from django.utils.text import slugify from catalog.models import Category def crawler(url): with HTMLSession() as session: response = session.get(url) cat_urls = response.html.xpat...
UnderlyingDataProvider.py
import yfinance as yf import threading from threading import Lock import time import logging from UnderlyingData import UnderlyingData class UnderlyingDataProvider: logging.basicConfig(filename='./log/UnderlyingDataProvider.log', level=logging.INFO) logger = logging.getLogger(__name__) def __...
daqmx.py
from collections import namedtuple from fixate.core.common import ExcThread from queue import Queue, Empty # Basic Functions from PyDAQmx import ( byref, DAQmxResetDevice, TaskHandle, numpy, int32, uInt8, float64, uInt64, c_char_p, uInt32, ) # Tasks from PyDAQmx import ( D...
rpycs.py
from socketserver import BaseRequestHandler, TCPServer import socket import time import platform from threading import Thread from rpyc.utils.server import ThreadedServer from rpyc.core.service import SlaveService from .utils.video_stream import VideoStream from .utils.rtsp_packet import RTSPPacket from .utils.rtp_p...
launch.py
#!/usr/bin/python from __future__ import print_function import os import re import subprocess import threading import sys import time from functools import reduce class PropagatingThread(threading.Thread): """ propagate exceptions to the parent's thread refer to https://stackoverflow.com/a/31614591/9601110 ...
utils.py
import inspect import ctypes import urllib.parse import urllib.request from contextlib import contextmanager import requests def http_post(url: str, data: dict = {})->bytes: with requests.post(url, data=data) as urlf: # data = urlf.read() return urlf.content def decode_json(obj): ...
flask_display.py
import argparse from typing import Optional from urllib.parse import urlparse from flask import Flask, Response from pipert.contrib.metrics_collectors.prometheus_collector import PrometheusCollector from pipert.core.component import BaseComponent from pipert.contrib.metrics_collectors.splunk_collector import SplunkCol...
audioDemo.py
import threading import math from queue import Queue import sys import numpy as np import matplotlib.pyplot as plt import pyaudio as pa import wave from scipy import signal, fftpack from audioIO import decodePCM, load from visual import fft_bar_data, plotSpect, plotWav # def consum(out_q, bar_no_idx): # bar_size ...
multi_camera_multi_target_tracking_demo.py
#!/usr/bin/env python3 """ Copyright (c) 2019-2022 Intel 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 applicab...
multi_echo_server.py
#!/usr/bin/env python3 import socket import time from multiprocessing import Process HOST = "" PORT = 8001 BUFFER_SIZE = 1024 def main(): with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((HOST, PORT)) s.listen(2) ...
utils.py
import base64 import json import logging import os import shlex import signal import subprocess import sys import threading import time from pathlib import Path from typing import List, Dict, Optional, Union, Any import bitcoinx import colorama import psutil import tailer from electrumsv_node import electrumsv_node f...