source
stringlengths
3
86
python
stringlengths
75
1.04M
hello_world_multi.py
#!/usr/bin/python from __future__ import print_function import multiprocessing def thread_task(num): """thread worker function""" print('Hello, World from thread', num) return if __name__ == '__main__': jobs = [] ncore=multiprocessing.cpu_count() for i in range(ncore): p = multiproces...
ocr.py
import threading from pytesseract import pytesseract from PIL import Image class OCR: """ OCR Engine modes (oem parameter): 0 Legacy engine only. 1 Neural nets LSTM engine only. 2 Legacy + LSTM engines. 3 Default, based on what is available. Page segmentation modes (p...
drive_and_listen.py
#record while drive from scavear_main import Listener from scavear_main import Scavear #import multiprocessing as mp from threading import Thread import time from easygopigo3 import EasyGoPiGo3 from datetime import date gpg = EasyGoPiGo3() def drive(seconds = 150): now = time.time() while time.time() - now ...
zbus.py
#encoding=utf8 import inspect import json import logging.config import os import sys from threading import Thread import threading import time import uuid import re import hmac import hashlib from websocket import WebSocketApp try: log_file = 'log.conf' if os.path.exists(log_file): log...
fsfreezer.py
#!/usr/bin/env python # # VM Backup extension # # Copyright 2014 Microsoft Corporation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
proc.py
from __future__ import absolute_import from __future__ import division from __future__ import unicode_literals import pymongo import threading try: from Queue import Queue except ImportError: from queue import Queue from twisted.internet import defer from twisted.python import failure class WorkerStop(object...
wifijammer.py
#!/usr/bin/env python import logging logging.getLogger("scapy.runtime").setLevel(logging.ERROR) # Shut up Scapy from scapy.all import * conf.verb = 0 # Scapy I thought I told you to shut up import os import sys import time from threading import Thread, Lock from subprocess import Popen, PIPE from signal import SIGINT,...
vujade_utils.py
""" Dveloper: vujadeyoon Email: vujadeyoon@gmail.com Github: https://github.com/vujadeyoon/vujade Title: vujade_utils.py Description: Useful utils Acknowledgement: This implementation is highly inspired from Berkeley CS188. """ import sys import inspect import heapq import random import os import glob import subpro...
doer.py
import json import datetime as dt import socket from time import sleep from dataclasses import dataclass from binary_functions import * from managers import DataManager import threading from enum import Enum, auto class UserTiers(Enum): basic = auto() premium = auto() @dataclass class LastRunTimestamps: ...
systemtimer.py
__author__ = "James Clark" __copyright__ = "Copyright 2020, F.R.A.M.E Project" __credits__ = ["James Clark"] __version__ = "1.0" # Import in necessary libraries import threading import time import sqlForGui import gui from datetime import datetime, date current_time_and_date = '' # Function that runs the system tim...
rc_driver.py
__author__ = 'zhengwang' import sys import threading import socketserver import numpy as np import cv2 from model import NeuralNetwork from rc_driver_helper import RCControl from rc_driver_helper import DistanceToCamera from rc_driver_helper import ObjectDetection # distance data measured by ultrasonic sensor se...
Pipeline-08-14-2020.py
import sys import re import os import shutil from multiprocessing import Process #import pandas as pd #import numpy as np #from functools import reduce #from pandas import ExcelWriter #from pandas import ExcelFile #import matplotlib.pyplot as plt #from scipy.stats import ttest_ind ## init gets user input for paramate...
readDiscreteInput.py
import os import threading from System.Core.Global import * from System.Core.Colors import * from System.Core.Modbus import * from System.Lib import ipcalc class Module: info = { 'Name': 'Read Discrete Inputs', 'Author': ['@enddo'], 'Description': ("Fuzzing Read Discrete Inputs Function"), } option...
wsgi.py
from urllib.parse import urlparse, urljoin, parse_qsl, parse_qs import string import random import threading import urllib.parse import lemon.libs.multipart_formdata as mf import lemon.libs.HttpObject import lemon.libs.http_status as http_status import lemon.libs.Date as Date import lemon.libs.route #Libs from use...
exercise23_threading_lock.py
""" --- Exercise statement: N°23 - Lock/RLock (threading) Escriba un programa que lance N procesos hijos. El programa recibirá la cantidad de procesos por argumento con -n. El programa recibirá, mediante el uso del modificador “-f”, un nombre de archivo que deberá crear o, si ya existe, abrir y limpiar. Además, rec...
download.py
#! /usr/bin/env python import sys import os import os.path as path import subprocess from multiprocessing import Process import util as u import config as cfg class IoWrapper(object): """ This class represents """ def __init__(self, io): """ Constructor. io -- A fil...
s3.py
""" Object Store plugin for the Amazon Simple Storage Service (S3) """ import logging import multiprocessing import os import shutil import subprocess import threading import time from datetime import datetime try: # Imports are done this way to allow objectstore code to be used outside of Galaxy. import boto ...
multipletaskparse.py
""" 多线程文件解析的模板 create by swm 20200313 """ """ DNS嗅探 create by judy 2020/03/10 """ import queue import threading import time import uuid from pathlib import Path import base64 import requests class DnsDetect(object): def __init__(self): # 创建需要使用的文件夹 self.input_file_path = Path('./_inputpath') ...
RobotControling.py
# MIT License # Copyright (c) 2019 Nguyen Do Quoc Anh (Cemu0) # 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, mo...
main_window.py
import sys from mercurius.config.AppContext import * from mercurius.logger.coloredLogger import * from logging import FileHandler, DEBUG from mercurius.core.MercuriusProxy import execMercury from mercurius.useful.common import bytedecode from mercurius.gui.qt import * import threading class QtHandler(logging.Handler):...
action.py
#!/usr/bin/env python # # License: BSD # https://raw.githubusercontent.com/splintered-reality/py_trees/devel/LICENSE # ############################################################################## # Documentation ############################################################################## """ .. argparse:: :mo...
DM_Thread_test.py
#extending functionality of existing program: #sets the DM check as a threaded task occuring every 15 minutes #while allowing the temperature/humidty readouts to occur more regularly #also reads/writes DM_ID from a file so that when a new session boots up #the ID from the last time the program ran is available an...
build.py
## @file # build a platform or a module # # Copyright (c) 2014, Hewlett-Packard Development Company, L.P.<BR> # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR> # Copyright (c) 2018, Hewlett Packard Enterprise Development, L.P.<BR> # # SPDX-License-Identifier: BSD-2-Clause-Patent # ...
example2.py
# ch15/example2.py import time import threading COUNT = 50000000 def countdown(n): while n > 0: n -= 1 ########################################################################### start = time.time() countdown(COUNT) print('Sequential program finished.') print(f'Took {time.time() - start : .2f} seconds...
test_utils.py
"""Utilities shared by tests.""" import collections import contextlib import io import logging import os import re import socket import socketserver import sys import tempfile import threading import time import unittest import weakref from unittest import mock from http.server import HTTPServer ...
test_models.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 (t...
com_with_mn.py
from smac.env import StarCraft2Env import numpy as np import time import logging from threading import Thread import argparse import matplotlib.pyplot as plt from mininet.topo import Topo from mininet.net import Mininet from mininet.log import lg from mininet.cli import CLI lg.setLogLevel('info') logging.basicConfig(...
zahmeeth_contigfilterServer.py
#!/usr/bin/env python from wsgiref.simple_server import make_server import sys import json import traceback import datetime from multiprocessing import Process from getopt import getopt, GetoptError from jsonrpcbase import JSONRPCService, InvalidParamsError, KeywordError,\ JSONRPCError, ServerError, InvalidRequestE...
test_stream_xep_0092.py
import threading from sleekxmpp.test import * class TestStreamSet(SleekTest): def tearDown(self): self.stream_close() def testHandleSoftwareVersionRequest(self): self.stream_start(mode='client', plugins=['xep_0030', 'xep_0092']) self.xmpp['xep_0092'].name = 'SleekXMPP' self...
test_action.py
import copy import multiprocessing import os import time import unittest import uuid import mechanize import requests from py4web import abort, action, DAL, Field, Session, Cache, HTTP, Condition from py4web.core import bottle, request, error404, Fixture os.environ["PY4WEB_APPS_FOLDER"] = os.path.sep.join( os.pa...
test_remotenotificationlog.py
import json import threading from abc import abstractmethod from http.client import HTTPConnection from http.server import BaseHTTPRequestHandler, HTTPServer from threading import Event, Thread from typing import Callable, List from unittest.case import TestCase from uuid import UUID from eventsourcing.interface impor...
pytiler.py
from Xlib.display import Display from Xlib.ext.xtest import fake_input from Xlib import X from ewmh import EWMH import asyncio import threading import os from Config import Keys import classes.Window as Window import classes.Workspace as Workspace class PyTiler(): NewWorkspace = Workspace.Workspace ewmh = EW...
test_process.py
# -*- coding: utf-8 -*- from __future__ import absolute_import, print_function, unicode_literals import datetime import functools import io import multiprocessing import os import signal import sys import threading import time import warnings import psutil import salt.utils.platform import salt.utils.process from sal...
zconfig.py
#!/usr/bin/python3 -OO # Copyright 2007-2021 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...
gpufilestream.py
# _____ ______ _____ # / ____/ /\ | ____ | __ \ # | | / \ | |__ | |__) | Caer - Modern Computer Vision # | | / /\ \ | __| | _ / Languages: Python, C, C++, Cuda # | |___ / ____ \ | |____ | | \ \ http://github.com/jasmcaus/caer # \_____\/_/ \_ \______ |_| \_\ # Lic...
UcsHandle_Edit.py
#!/usr/bin/python # Copyright 2013 Cisco Systems, 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 ...
piano.py
from pynput.keyboard import Key, Listener import pygame.midi import turtle import threading # print is not allowed since when java call this file, print statement will break the keyboard listener def _pre_pre_process_key(key): key = str(key).lower() key = key.strip() if key == "'''": return "'" ...
monthly.py
# coding: utf-8 import requests from re import search, findall import os import threading import time import json from queue import Queue import prettytable as pt from loadini import read_config allconfig = read_config() ifproxy = allconfig['ifproxy'] proxy = allconfig['proxy'] proxies = {'http': 'http://%s'%p...
open3d_video.py
import numpy as np import open3d as o3d import open3d.visualization.gui as gui import open3d.visualization.rendering as rendering import os import time import threading SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__)) DATA_DIR = 'E:\\WORKSPACES\\Qr\\Libraries\\Open3D\\examples\\test_data' RGB_DIR = os.path.joi...
flask_server.py
from flask import Flask, render_template from turbo_flask import Turbo from .. import cache_manager import sys, threading, time HOST = '0.0.0.0' PORT = 5000 # Only log errors from Werkzeug import logging log = logging.getLogger('werkzeug') log.setLevel(logging.ERROR) # Suppress Flask start message cli = sys.modules...
wifitranslationhub.py
# !/usr/bin/python3 __author__ = "Simon Blandford" # Try to import any new configuration parameters into user config if missing there import re try: with open("config.py", "r") as config_file: custConfig = config_file.readlines() config_dist_file = open("config_dist.py", "r") missingConfig = [] ...
xla_client_test.py
# Copyright 2017 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...
test_replication.py
"""TestCases for distributed transactions. """ import os import time import unittest from test_all import db, test_support, have_threads, verbose, \ get_new_environment_path, get_new_database_path #---------------------------------------------------------------------- class DBReplication(unitt...
grass_rabbit.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os import random import sys import operator import pygame from pygame import image from pygame.color import THECOLORS import time import threading import numpy as np def weighted_choice(weights): totals = [] running_total = 0 for w in weights: r...
embedding.py
import gzip import io from multiprocessing import Process, Queue, cpu_count from pathlib import Path from urllib.request import urlopen import numpy as np from asreview.utils import get_data_home EMBEDDING_EN = { "url": "https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.en.300.vec.gz", # noqa "name"...
task.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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
procem_data.py
# -*- coding: utf-8 -*- """This module contains a functions to read locally stored Procem data and to send it to IoT-Ticket.""" # Copyright (c) TUT Tampere University of Technology 2015-2018. # This software has been developed in Procem-project funded by Business Finland. # This code is licensed under the MIT license....
__init__.py
from ledfx.utils import BaseRegistry, RegistryLoader, generate_id from ledfx.config import save_config from ledfx.events import DeviceUpdateEvent, Event from abc import abstractmethod import voluptuous as vol import numpy as np import requests import zeroconf import logging import asyncio import socket _LOGGER = loggi...
ms14_068.py
#/usr/bin/env python # -*- coding: utf-8 -*- from psexec import * from wmiexec import * from secretsdump import * from goldenPac import * from Crypto import Random from Crypto.Cipher import AES from Crypto.Hash import MD5 from base64 import b64decode from base64 import b64encode from binascii import unhexlify from cal...
test_socket.py
import unittest from test import support from test.support import os_helper from test.support import socket_helper from test.support import threading_helper import errno import io import itertools import socket import select import tempfile import time import traceback import queue import sys import os import platform...
compute_iou.py
import multiprocessing as mp import numpy as np import cv2 import os def compute_iou(names, num_cls, target_root, gt_root, num_threads=16, arr_=None): _compute_iou = lambda x: np.diag(x) / (x.sum(axis=0) + x.sum(axis=1) - np.diag(x) + 1e-10) if isinstance(names, str): with open(names) as f: ...
threaded.py
from concurrent.futures import Future, TimeoutError from queue import Queue from threading import Timer, Thread from .timing import EventMinder from .protocol import ProtocolDelegate from .machine import EventMachine class RequestTimeout(TimeoutError): def __init__(self, request): self.request = request...
test_controller.py
""" Copyright (c) 2016-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. """ from netaddr import IPNetwo...
test_gluon_utils.py
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
pyminer.py
#!/usr/bin/python # # Copyright (c) 2011 The Bitcoin developers # Distributed under the MIT/X11 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...
network.py
import socket import threading import traceback from http import HTTPStatus def parse_address(address): try: ip = address.split(':')[0] port = int(address.split(':')[1]) return ip, port except: print('Invalid address [{0}]').format(address) print('exception i...
wallet_multiwallet.py
#!/usr/bin/env python3 # Copyright (c) 2017-2020 The Bitkincoin 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 bitkincoind node can load multiple wallet files """ from decimal im...
params.py
#!/usr/bin/env python3 """ROS has a parameter server, we have files. The parameter store is a persistent key value store, implemented as a directory with a writer lock. On Android, we store params under params_dir = /data/params. The writer lock is a file "<params_dir>/.lock" taken using flock(), and data is stored in...
test_client.py
import asyncio import gc import logging import os import pickle import random import subprocess import sys import threading import traceback import warnings import weakref import zipfile from collections import deque from contextlib import suppress from functools import partial from operator import add from threading i...
breathingdemo_video.py
""" Start up the blossom breathing demo with the CLI client. Uses demo video from teachers at the Pacific Autism Center for Education. """ # make sure that prints will be supported import argparse, sys sys.path.append("..") print(sys.path) from blossompy import Blossom from time import sleep import random import cv2 i...
newswrapper.py
#!/usr/bin/python -OO # Copyright 2007-2018 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later...
notes_db.py
# nvPY: cross-platform note-taking app with simplenote syncing # copyright 2012 by Charl P. Botha <cpbotha@vxlabs.com> # new BSD license import codecs import copy import glob import os import json import logging from Queue import Queue, Empty import re import simplenote simplenote.NOTE_FETCH_LENGTH = 100 from simpleno...
networking.py
import ast import asyncio import ipaddress import socket from abc import abstractmethod from argparse import Namespace from threading import Thread from typing import Optional import grpc from jina.logging.logger import JinaLogger from jina.proto import jina_pb2_grpc from jina.types.message import Message from .. imp...
__init__.py
from __future__ import annotations import collections from datetime import datetime from decimal import Decimal from functools import wraps import operator import os import re import string from typing import ( TYPE_CHECKING, Callable, ContextManager, Counter, Iterable, ) import warnings import nu...
mpq.py
__VERSION__ = "0.1.4" import argparse import time import multiprocessing import os import datetime parser = argparse.ArgumentParser() parser.add_argument("--dir", default=".", required=False) parser.add_argument("--run", action="store_true") args = parser.parse_args() DIR = args.dir MODE = args.run PROCESSES = multip...
PythonThreadLocal.py
import threading # 全局 ThreadLocal对象 local_school = threading.local() def process_student(): std = local_school.student print('Hello, %s (in %s)' % (std, threading.current_thread().name)) def process_thread(name): local_school.student = name process_student() t1 = threading.Thread(target=process_t...
coroutine_threadsafe.py
import asyncio import time from threading import Thread from nats.aio.client import Client as NATS from nats.aio.errors import ErrConnectionClosed, ErrTimeout class Component(object): def __init__(self, nc, loop): self.nc = nc self.loop = loop def response_handler(self, msg): print("-...
functional_tests.py
#!/usr/bin/env python import os import sys import shutil import tempfile import re from ConfigParser import SafeConfigParser # Assume we are run from the galaxy root directory, add lib to the python path cwd = os.getcwd() new_path = [ os.path.join( cwd, "lib" ), os.path.join( cwd, "test" ) ] new_path.extend( sys.path...
runtests.py
#!/usr/bin/env python3 # This file is picked from project testa [https://github.com/TimeExceed/testa.git] # Copyright (c) 2013, Taoda (tyf00@aliyun.com) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are...
cli.py
# -*- coding: utf-8 -*- """ flask.cli ~~~~~~~~~ A simple command line application to run flask apps. :copyright: © 2010 by the Pallets team. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import ast import inspect import os import platform import re import...
client.py
import copy import socket from threading import Lock, Thread from engine.const import log, CONST from engine.vector import Vector2 players = {} players_lock = Lock() player_pos = Vector2() player_anim_state = "" player_anim_counter = 0 client_player_lock = Lock() PORT = CONST.port HOST = CONST.host update_thread...
test.py
"""test""" # -*- coding:utf-8 -*- import logging import os import threading import time import traceback from inspect import getattr_static, trace from pympler import asizeof, tracker # https://pympler.readthedocs.io/en/latest/ # https://pympler.readthedocs.io/en/latest/asizeof.html#refs # 第一步,创建一个logger logger = ...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement, unicode_literals import functools import os import sys import copy import time import types import signal import random import logging import threading import tracebac...
atlas2.py
#!/usr/bin/env python #original author: Vladimir Kozbin ( http://github.com/wawaka/texture-atlas-generator ) import os import time import pickle import hashlib import subprocess import math from PIL import Image _BLEEDSIZE = 1 def bleeding_image( image ): border = 1 width = border + image.size[0] + border heigh...
views.py
from threading import Thread import Queue from django.core.urlresolvers import reverse from django.conf import settings from django import forms from django.http import HttpRequest, QueryDict from django.test import TestCase from haystack import connections, connection_router from haystack.forms import model_choices, S...
brute_form_request.py
#!/usr/bin/python # coding=utf-8 import requests import Queue import threading import sys from pyquery import PyQuery as pq from dir_bruter import build_wordlist thread_count = 10 # login form url target_url = 'http://192.168.99.196/wordpress/wp-login.php' # login form action url target_post = 'http://192.168.99.196/...
quote.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ __title__ = '' __author__ = 'HaiFeng' __mtime__ = '2016/9/23' """ import threading import platform import os from .structs import InfoField, Tick from .ctp_quote import Quote from .ctp_struct import CThostFtdcRspUserLoginField, CThostFtdcRspInfoField, CThostFtdcDepthM...
autocast_variable_test.py
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
pytest.py
import time import numpy as np import random from multiprocessing import Process def run(name,i,res): print('%s runing %d' %(name,i)) sum=0 for j in range(0,10): sum+=10*j+j**2 print('%s running end' %name) res[i]=sum res=np.zeros((1,10)) processes = [] start_time=time.time() for i in rang...
parallel_py_environment.py
# coding=utf-8 # Copyright 2018 The TF-Agents 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...
server_events.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # # king_phisher/client/server_events.py # # 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 # not...
minion.py
# -*- coding: utf-8 -*- ''' Routines to set up a minion ''' # Import python libs from __future__ import absolute_import, print_function, with_statement import os import re import sys import copy import time import types import signal import fnmatch import logging import threading import traceback import contextlib impo...
server.py
#!/usr/bin/python # -*- coding: utf-8 -*- """ 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 agre...
ALL_IN_ONE_FIX.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # Импорт библиотек import math import rospy import time from sensor_msgs.msg import Image from sensor_msgs.msg import CameraInfo from std_msgs.msg import Int32, Header, Float32 from cv_bridge import CvBridge, CvBridgeError import cv2 import numpy as np from threading impo...
whatsapp.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import sys; sys.dont_write_bytecode = True; import os; import signal; import base64; from threading import Thread, Timer import math; import time; import datetime; import json; import io; from time import sleep; from threading import Thread; from Crypto.Cipher import AES;...
run-tests.py
#!/usr/bin/env python3 # # 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 "L...
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...
WiredQT5GUI6_10_2021_4_19_36.py
from PyQt5 import QtCore, QtWidgets from PyQt5.QtGui import * from wired_module import * import Scintilla from PyQt5.Qsci import QsciScintilla, QsciLexerPython from copy import deepcopy from shutil import copyfile import os import platform import sys from subprocess import PIPE, Popen, STDOUT from threading impo...
email.py
"""Module with functions to send email. There are two functions which send using python built-in libraries and two ones which use flask-mail. All them send message in a separate thread to prevent from blocking. It is strongly recommended to use flask-mail implementation.""" import smtplib from email.mime.multipart impo...
main.py
from requests import get from random import choice import pytesseract as tess from PIL import Image from user_agent import generate_navigator from string import ascii_lowercase from json import dump, dumps, loads from os import remove, getcwd from datetime import datetime import face_recognition from time import sleep ...
http.py
""" Implementation of Cobra using HTTP """ import os import json import time import types import urllib import base64 import Cookie import httplib import logging import urlparse import traceback import BaseHTTPServer import cobra as c_cobra from threading import currentThread,Thread,RLock from SocketServer import Th...
data_utils.py
# Lint as python3 # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless r...
test_messaging.py
#!/usr/bin/env python3 import os import capnp import multiprocessing import numbers import random import threading import time import unittest from parameterized import parameterized from cereal import log, car import cereal.messaging as messaging from cereal.services import service_list events = [evt for evt in log....
discord_wb.py
from discord_webhook import DiscordWebhook, DiscordEmbed from queue import Queue import threading, os from time import sleep import selenium from libs.configuration import Configuration class Discord(object): def __init__(self, url:str): self.client = DiscordWebhook(url) self.queue = Queue()...
wifi_rx_gps.py
#!/usr/bin/env python2 # -*- coding: utf-8 -*- ################################################## # GNU Radio Python Flow Graph # Title: Wifi Rx # Generated: Thu May 6 08:24:53 2021 ################################################## from distutils.version import StrictVersion if __name__ == '__main__': import ct...
launch.py
"""Launching tool for DGL distributed training""" import os import stat import sys import subprocess import argparse import signal import logging import time import json from threading import Thread def execute_remote(cmd, ip, thread_list): """execute command line on remote machine via ssh""" cmd = 'ssh -o Str...
Builder.py
# encoding: utf-8 # Copyright 2012 Red Hat, 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 applica...
codec.py
# # Copyright (c) 2016-2017, The OpenThread 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 re...
ContinuousAudit.py
#!/usr/bin/python3 import datetime import argparse import ipaddress import os import socket import subprocess import sys import threading import glob from queue import Queue ############################################################################# # Configurations ####################################...
newswrapper.py
#!/usr/bin/python3 -OO # Copyright 2007-2020 The SABnzbd-Team <team@sabnzbd.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any late...