source
stringlengths
3
86
python
stringlengths
75
1.04M
VLANHopperDTP.py
#!/usr/bin/python # # This script is performing DTP Trunk mode detection and VLAN Hopping # attack automatically, running sniffer afterwards to collect any other # VLAN available. # # This script works best in Unix/Linux environment as the script utilizes # following applications: # - 8021q.ko # - vconfig # - ...
QCWY.py
from model import Qcwy __author__ = 'Joynice' from utils.utils import get_header, get_time import requests import queue from lxml import etree import threading import os import csv class QCWY(object): ''' 前程无忧 :param 传入参数:关键字、城市、线程数 传出:csv文件 ''' def __init__(self, keyword, city='北京', thr...
spaceapi.py
#!/usr/bin/env python # -*- coding: utf-8 -*- # pylint: disable=C0111,R0903 """Displays the state of a Space API endpoint Space API is an API for hackspaces based on JSON. See spaceapi.io for an example. Requires the following libraries: * requests Parameters: * spaceapi.url: String representation of the ap...
degasser.py
# =============================================================================== # Copyright 2013 Jake Ross # # 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/licens...
tracker.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...
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...
utils.py
# Copyright 2019 Atalaya Tech, Inc. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, ...
captcha.py
# coding=utf-8 import random import sys import threading import time import requests, json, datetime, time, BeautifulSoup, pickle # How many threads? Hthreads = 10 sitekeyEnabled = False repeat = True repeatTime = '17:30' #end of the loop # To-Add, how many does it have to run, False True, d is showing hour and minu...
test_sockets.py
# Copyright 2013 The Emscripten Authors. All rights reserved. # Emscripten is available under two separate licenses, the MIT license and the # University of Illinois/NCSA Open Source License. Both these licenses can be # found in the LICENSE file. from __future__ import print_function import multiprocessing import o...
player.py
import time import threading import pyaudio import numpy as np _v = np.__version__ __all__ = ["Player"] class Player(object): def __init__(self, buffer, chunk_size=None, rate=None, live=None): self.rate = rate self.buffer_size = buffer.size / 2 assert chunk_size < self.buffer_size ...
cscollector.py
from multiprocessing import Process import time import htcondor import redis import json import config import logging def setup_redis_connection(): r = redis.StrictRedis(host=config.redis_host, port=config.redis_port, db=config.redis_db, password=config.redis_password) return r def resources_producer(testrun=...
bot.py
import logging import threading import asyncio import unicodedata from decouple import config import discord from . import xkcd from discord.utils import get from django.core.validators import validate_email from django.core.exceptions import ValidationError from .utils import send_verify_mail intents = discord.Intent...
local_state_collector.py
"""Collecting the states of the local system""" from datetime import datetime import os import re import signal import threading import time import psutil import yaml from forch.proto.process_state_pb2 import ProcessState from forch.proto.shared_constants_pb2 import State from forch.proto.system_state_pb2 import Sta...
runfuzzer.py
import subprocess import shlex import time import threading from threading import Timer import config import pickle import os import operators import random from operator import itemgetter import time import shutil import inspect import glob import sys from collections import Counter from datetime import datetime impor...
blink_pwm.py
''' @author: Vikram Udyawer @date: 25th March 2017 Saturday @summary: PWM controlled RGB LED @description: Code for a Raspberry Pi to switch ON an RGB LED its different colors using PWM. ''' import RPi.GPIO as GPIO import threading import time ...
mp_synchronize.py
# # A test file for the `multiprocessing` package # # Copyright (c) 2006-2008, R Oudkerk # All rights reserved. # import time, sys, random from queue import Empty import multiprocessing # may get overwritten #### TEST_VALUE def value_func(running, mutex): random.seed() time.sleep(random.rando...
trezor.py
from binascii import hexlify, unhexlify import traceback import sys from electrum_ltc.util import bfh, bh2u, versiontuple, UserCancelled from electrum_ltc.bitcoin import (b58_address_to_hash160, xpub_from_pubkey, deserialize_xpub, TYPE_ADDRESS, TYPE_SCRIPT, is_address) from electrum_l...
freetests.py
#!/usr/bin/env python3 # coding: utf-8 # Copyright 2013 Abram Hindle # # 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 ...
threading_demo.py
import threading from time import sleep def install_wordpress(customer): """code to mimic some heavy work""" print(f"Start installation for {customer}") sleep(3) print(f"All done for {customer}") def developers_day(customers): """using threading ensure every thread dont comflict""" lock = thr...
spam.py
import os import secrets import threading import time from concurrent.futures import ThreadPoolExecutor from colorama import Fore, init from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.firefox.options import Options as FirefoxOptions init(autoreset=True) URL = 'h...
videoio.py
from pathlib import Path from enum import Enum from collections import deque import subprocess import threading import logging import cv2 class Protocol(Enum): FILE = 0 CSI = 1 V4L2 = 2 RTSP = 3 class VideoIO: """ Class for video capturing from video files or cameras, and writing video files...
mqtt.py
"""Support for MQTT input/output.""" import json import socket import threading import time from collections import defaultdict from queue import Queue from typing import Any, Dict, List, Optional import pydash from rhasspy.actor import RhasspyActor # -----------------------------------------------------------------...
STWebServer.py
#Copyright (C) 2021 Andrew Palardy #See LICENSE file for complete license terms #WebServer class #This file manages the web interface and web api endpoints import cv2 import numpy as np from datetime import datetime import json import random import threading from http.server import BaseHTTPRequestHandler, HTTPServer im...
test_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...
game.py
from game_components import Character, Room, Loot # from models import Session, Room, Connection, Monster, Loot from player import Player from LURKp import LURKprot from random import randint import queue, threading, time, models class Game: def __init__(self): self.settings = { 'landlord': '...
command_listener.py
"""Support for voice command recording.""" import json import math import os import subprocess import threading import uuid from datetime import timedelta from typing import Any, Dict, List, Optional, Type import webrtcvad from rhasspy.actor import RhasspyActor, WakeupMessage from rhasspy.events import (AudioData, Li...
03.lock_concurrent.py
import threading lock = threading.Lock() class Account: def __init__(self, balance): self.balance = balance def draw(account, amount): with lock: if account.balance >= amount: print(threading.current_thread().name, "交易成功") account.balance -= amount ...
mistyPy.py
import requests import json import threading import time import websocket try: import thread except ImportError: import _thread as thread from random import* class Robot: def __init__(self,ip): self.ip = ip self.images_saved = [] self.audio_saved = [] self.faces_saved = [...
RecvImgandSendSig.py
#!/usr/bin/env python3 # *_* coding: UTF-8 *_* # @File : test.py # @Author: Frank1126lin # @Date : 2020/11/1 import os import time import shutil import socket import threading def s1(): ss1 = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # 创建socket对象 host = socket.gethostbyname(socket.geth...
helpers.py
""" Helper functions file for OCS QE """ import base64 import random import datetime import hashlib import json import logging import os import re import statistics import tempfile import threading import time import inspect from concurrent.futures import ThreadPoolExecutor from itertools import cycle from subprocess i...
index_es_7.py
from src.models import DBSession, Base, Colleague, ColleagueLocus, Dbentity, Locusdbentity, Filedbentity, FileKeyword, LocusAlias, Dnasequenceannotation, So, Locussummary, Phenotypeannotation, PhenotypeannotationCond, Phenotype, Goannotation, Go, Goslimannotation, Goslim, Apo, Straindbentity, Strainsummary, Reservednam...
ldbscan.py
#!/usr/bin/env python import subprocess import multiprocessing from multiprocessing import Process, Queue import os import time def lbd(domain): domain = domain.strip() print "INFO: Running general ldb scans for " + domain # lbdSCAN = "lbd %s" % (domain) # results = subprocess.check_output(lbdSCAN, shell...
flist-uploader.py
import os import sys import shutil import json import threading import time import hub.itsyouonline import hub.threebot import hub.security from stat import * from flask import Flask, Response, request, redirect, url_for, render_template, abort, make_response, send_from_directory, session from werkzeug.utils import sec...
client.py
import re import socket import threading from functools import partial from .action import Action, LoginAction, LogoffAction, SimpleAction from .event import Event, EventListener from .response import Response, FutureResponse import logging import sys, traceback _logger = logging.getLogger(__name__) try: unicod...
common.py
"""Test the helper method for writing tests.""" import asyncio import collections from collections import OrderedDict from contextlib import contextmanager from datetime import timedelta import functools as ft from io import StringIO import json import logging import os import sys import threading import time import uu...
idf_monitor.py
#!/usr/bin/env python # # esp-idf serial output monitor tool. Does some helpful things: # - Looks up hex addresses in ELF file with addr2line # - Reset ESP32 via serial RTS line (Ctrl-T Ctrl-R) # - Run "make (or idf.py) flash" (Ctrl-T Ctrl-F) # - Run "make (or idf.py) app-flash" (Ctrl-T Ctrl-A) # - If gdbstub output is...
filelock.py
############################################################################### # lazyflow: data flow based lazy parallel computation framework # # Copyright (C) 2011-2014, the ilastik developers # <team@ilastik.org> # # This program is free software; you can redistribute it and/o...
remote_droneID.py
import subprocess from time import sleep from threading import Thread import yaml class DRI: # ROS node to convert to hex format # <element id><len><oui><vendor ie> # standards-oui.ieee.org/oui/oui.txt # QC OUI: 88-12-4E or 00-A0-C6 or 64-9c-81 ... # BRCM OUI: BC-97-E1 or 00-1B-E9 or 00-05-B5 ... ...
decode.py
# coding=utf-8 # # Yu Wang (University of Yamanashi) # Apr, 2021 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by appl...
kraken.py
from befh.restful_api_socket import RESTfulApiSocket from befh.exchanges.gateway import ExchangeGateway from befh.market_data import L2Depth, Trade from befh.instrument import Instrument from befh.util import Logger import time import threading from functools import partial from datetime import datetime class ExchGwK...
slicer_gui.py
import threading import numpy as np import json import sys import pyqtgraph as pg from pyqtgraph.Qt import QtGui, QtCore from pyqtgraph.Point import Point import traceback from slicer_constants import MIN_X, MAX_X, POS, SET_SPOTS, SET_REGION, PLAYBACK_MARKER, TIME_IN_HISTORY spots = [{POS: [0, 0]}, {POS: [2, 1]}] reg...
foo.py
# Python 3.3.3 and 2.7.6 # python fo.py from threading import Thread import threading # Potentially useful thing: # In Python you "import" a global variable, instead of "export"ing it when you declare it # (This is probably an effort to make you feel bad about typing the word "global") i = 0 i_lock = threading.Lo...
ubertooth.py
from scapy.all import * import struct from mirage.libs.bt_utils.ubertooth import * from mirage.libs.ble_utils.constants import * from mirage.libs.ble_utils import helpers from mirage.libs import utils,io,wireless class BLEUbertoothDevice(BtUbertoothDevice): ''' This device allows to communicate with an Ubertooth De...
det.py
from __future__ import print_function import os import random import threading import hashlib import argparse import sys import string import time import json import signal import struct import tempfile from random import randint from os import listdir from os.path import isfile, join from Crypto.Cipher import AES from...
natgw.py
# coding=utf-8 import os import json import sys import time from optparse import OptionParser from threading import Thread SERVER_CODE = r'''# coding=utf-8 import select import socket import time from Queue import Queue from threading import Thread ADDRESS = ('%s', 8080) class LogThread(Thread):...
SpotterNetPositionSend.py
#!/usr/bin/env python3 import json import logging import requests import threading import time import socket import sys from datetime import datetime from SpotterNetPositionObject import SNPosObject TCP_IP = '127.0.0.1' TCP_PORT = 2947 BUFFER_SIZE = 1024 START_MESSAGE = "?WATCH={\"enable\":true,\"json\":true}" STOP_M...
common.py
import inspect import json import os import random import subprocess import ssl import time import requests import ast import paramiko import rancher import pytest from urllib.parse import urlparse from rancher import ApiError from lib.aws import AmazonWebServices from copy import deepcopy from threading import Lock fr...
wxRavenIPFSUploaderLogic.py
''' Created on 5 janv. 2022 @author: slinux ''' from .wxRavenIPFSDesign import wxRavenIPFSFileUploaderDialog import threading import time import wx from wxRavenGUI.application.wxcustom.CustomLoading import * class wxRavenIPFSFileUploader(wxRavenIPFSFileUploaderDialog): ''' classdocs ''' view_bas...
comb_queue_thread.py
import queue import threading import time def func(q, thread_no): while True: task = q.get() time.sleep(2) q.task_done() print(f'Thread #{thread_no} is doing task #{task} in the queue.') q = queue.Queue() for i in range(4): worker = threading.Thread(target=func, args=(q, i,)...
__init__.py
# -*- coding: UTF-8 -*- from __future__ import absolute_import # Operates on sound fragments consisting of signed integer samples 8, 16 # or 32 bits wide, stored in Python strings. import audioop from contextlib import contextmanager from ctypes import CFUNCTYPE, c_char_p, c_int, cdll from threading import Thread im...
test_randomstate.py
import hashlib import pickle import sys import warnings import numpy as np import pytest from numpy.testing import ( assert_, assert_raises, assert_equal, assert_warns, assert_no_warnings, assert_array_equal, assert_array_almost_equal, suppress_warnings ) from numpy.random import MT199...
21-xspress3.py
from ophyd.device import (Component as Cpt) from hxntools.detectors.xspress3 import (Xspress3FileStore, Xspress3Channel) from hxntools.detectors.hxn_xspress3 import HxnXspress3DetectorBase import threading from ophyd import DeviceStatus class HxnXspress3Detector(HxnXspress3De...
__init__.py
DEBUG = False import sys import re import threading import os import time if True: from tkinter import * import tkinter.filedialog as tkFileDialog import tkinter.messagebox as tkMessageBox import tkinter.font as tkFont _next_method_name = '__next__' import Pmw from pymol.wizard import cleanup f...
utils_test.py
import asyncio import collections import copy import functools import gc import inspect import io import itertools import logging import logging.config import os import queue import re import shutil import signal import socket import subprocess import sys import tempfile import threading import uuid import warnings 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. # --------------------------------------------------------------------...
manager.py
import argparse # noqa import atexit # noqa import codecs # noqa import copy # noqa import errno # noqa import fnmatch # noqa import hashlib # noqa import os # noqa import shutil # noqa import signal # noqa import sys # noqa import threading # noqa import traceback # noqa from contextlib import contextmana...
node.py
# Ant # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # 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, m...
semihost.py
""" mbed CMSIS-DAP debugger Copyright (c) 2015 ARM Limited 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 o...
filemanager.py
""" File Manager ============ Copyright (c) 2019 Ivanov Yuri For suggestions and questions: <kivydevelopment@gmail.com> This file is distributed under the terms of the same license, as the Kivy framework. A simple manager for selecting directories and files. Example ------- from kivymd.app import MDApp from kivy....
netcat.py
import argparse import socket import shlex import subprocess import sys import textwrap import threading def execute(cmd): cmd = cmd.strip() if not cmd: return output = subprocess.check_output(shlex.split(cmd),stderr=subprocess.STDOUT) return output.decode() class NetCat: def __init__(sel...
viewer.py
''' @ Harris Christiansen (Harris@HarrisChristiansen.com) January 2016 Generals.io Automated Client - https://github.com/harrischristiansen/generals-bot Game Viewer ''' import pygame import threading import time # Color Definitions BLACK = (0,0,0) GRAY_DARK = (110,110,110) GRAY = (160,160,160) WHITE = (255,255,25...
custom.py
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # --------------------------------------------------------------------...
eventgen_core.py
#!/usr/bin/env python3 # encoding: utf-8 import imp import logging import logging.config import os import sys import time from queue import Empty, Queue import signal from threading import Thread, Event import multiprocessing from splunk_eventgen.lib.eventgenconfig import Config from splunk_eventgen.lib.eventgenexcept...
jablo_dongle.py
""" homeassistant.components.jablo_dongle ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Implements support for Turris Dongle by Jablotron Alarms, a.s. """ from enum import Enum import logging import threading from threading import Condition, Lock from pydispatch import dispatcher import serial from serial.serialutil import ...
contractor.py
#!/usr/bin/env python #coding:utf-8 """ Author: --<v1ll4n> Purpose: Provide some useful thread utils Created: 2016/10/29 """ import uuid import time import unittest from Queue import Queue import threading from threading import Thread import inspect #-----------------------------------------------------------...
punctuation_capitalization_dataset.py
# Copyright (c) 2020, 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 appli...
test_gluon_model_zoo.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...
check_mongodb.py
#!/usr/bin/env python #coding:utf-8 import os import sys import string import time import datetime import MySQLdb import pymongo import bson import logging import logging.config logging.config.fileConfig("etc/logger.ini") logger = logging.getLogger("wlblazers") path='./include' sys.path.insert(0,path) import functions ...
main.py
#import RPi.GPIO as GPIO import time import ctypes as ct import shutil import os import glob import numpy as np import math import logging import json import cv2 import utm import matplotlib.pyplot as plt from PIL import Image import datetime import multiprocessing from pathlib import Path import sys detection = False...
test_crash_recovery.py
from base import pipeline, clean_db import os import random import signal from subprocess import check_output, CalledProcessError import threading import time def _get_pids(grep_str): try: out = check_output('ps aux | grep "postgres" | grep "%s"' % grep_str, shell=True).split('\n') except Calle...
main.py
import datetime import json import os import sys import time import traceback from consumer import KafkaConsumer from processor import BagheeraMessageProcessor import Queue import threading import config import codecs sys.path.extend(['log4j.properties']) sys.stdout = codecs.getwriter('utf-8')(sys.stdout) from jav...
LoginPage.py
# -- coding: utf-8 -- import tkinter as tk import tkinter.ttk as ttk import tkinter.messagebox import requests, json, re import threading import queue import time import main_part class LoginPage(object): def __init__(self, root): self.root = root self.root.geometry("255x255+561+268") sel...
server_latency_test.py
import threading from time import time from network import receive, send class ServerLatencyTest: def __init__(self, to_client_connections: dict, from_client_connections: dict) -> None: self._to_client_connections = to_client_connections self._from_client_connections = from_client_connections ...
graphicsCrawlerDisplay.py
# graphicsCrawlerDisplay.py # ------------------------- import Tkinter import pendulum as pendulum import qlearningAgents import time import threading import sys import crawler # import pendulum import math from math import pi as PI robotType = 'crawler' class Application: def sigmoid(self, x): retur...
parallel_processor.py
""" ParallelProcessor utilizes multiple CPU cores to process compute-intensive tasks. If you have a some time-consuming statements in a for-loop and no state is shared among loops, you can map these statements to different processes. Assume you need to process a couple of files, you can do this in parallel:: def...
server.py
import os import socket import threading from copy import deepcopy HOST = '' PORT = 8000 BUFFER = 1024 ADDR = (HOST, PORT) ADDRS = [] ADDR_CONN = {} FILE_RECV = [] s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(ADDR) s.listen(10) def msg_handle(data, conn: socket.socket, addr: tuple): try: ...
server.py
import socket import threading HEADER = 64 PORT = 5050 FORMAT = "utf-8" DISCONNECT_MESSAGE = "!DISCONNECT" # SERVER = socket.gethostbyname(socket.gethostname()) # Get the IP address automatically SERVER = "192.168.0.114" ADDR = (SERVER,PORT) server = socket.socket(socket.AF_INET,socket.SOCK_STREAM) server.bind(ADDR) ...
beat.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """Task Beat This module define function which can execute muti-asyn-task and dispatch tasks. Use stack to sort the date of task which will be executing.Min_time is the Main processing sleeping time that can compute more quick to execute task . pool = db_instanc...
recover_ssnamenr.py
#!/usr/bin/env python """ Recover missing columns in the archive database from UW tarballs """ import datetime import itertools import io import logging import multiprocessing import tarfile import time import queue import fastavro import requests from ampel.pipeline.t0.alerts.TarAlertLoader import TarAlertLoader f...
swimmer-v2.py
import os, sys, signal import random import numpy as np from multiprocessing import Process, Queue, current_process, freeze_support import argparse parser = argparse.ArgumentParser() parser.add_argument('--pgmorl', default=False, action='store_true') parser.add_argument('--ra', default=False, action='store_true') pars...
TProcessPoolServer.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...
server.py
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
main.py
from multiprocessing.context import Process from threading import Thread import schedule import telebot import time from db import dbstart, db_update, isNewClient, columnLists from manageControl import new_user, mainmenu, barber_list, select_barber, select_day, select_time, new_order, waiting, \ set_mark, add_mar...
test_venv.py
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import import errno import multiprocessing import os import shutil import subprocess import sys import tempfile from subprocess import CalledProcessError f...
tests.py
from hstest.stage_test import StageTest from hstest.test_case import TestCase from hstest.check_result import CheckResult from threading import Thread from time import sleep import socket import random CheckResult.correct = lambda: CheckResult(True, '') CheckResult.wrong = lambda feedback: CheckResult(False, feedback)...
vfs_m1_screenshot_sender.py
""" This script has been modified for Modeling 1. GT Screenshot Sender - Send images to your instructor. @Guilherme Trevisan - TrevisanGMW@gmail.com - 2021-01-05 - github.com/TrevisanGMW Tested on Maya 2018, 2019, 2020 - Windows 10 1.1 - 2021-01-12 Changed method to viewport only for better compatibilit...
monte_carlo.py
""" For each path of simulation, the final price is: St = spot * exp((b - vol*vol/2) * T + vol * rand * sqrt(T)) where rand is a random number in (0, 1) call option: each_price = max(St - strike, 0) put option: each_price = max(strike - St, 0) The overall price is: sum(each_price)...
scdlbot.py
# -*- coding: utf-8 -*- """Main module.""" import gc import pathlib import random import shelve import shutil from datetime import datetime from multiprocessing import Process, Queue from queue import Empty from subprocess import PIPE, TimeoutExpired # skipcq: BAN-B404 from urllib.parse import urljoin, urlparse from...
server_engine.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 ...
bridge.py
#!/usr/bin/env python3 import argparse import math import threading import time import os from multiprocessing import Process, Queue from typing import Any import carla # pylint: disable=import-error import numpy as np import pyopencl as cl import pyopencl.array as cl_array from lib.can import can_function import ce...
test_mturk_agent.py
# Copyright (c) 2017-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 unittest import os ...
host_state.py
""" Global shared state about the host. """ import threading import utils import time import sys CLIENT_VERSION = '1.0.3' class HostState(object): def __init__(self): self.host_ip = None self.host_mac = None self.gateway_ip = None self.packet_processor = None self.user...
spambot.py
from requests.sessions import Session from requests import get from random import choice from multiprocessing import Process from colorama import init,Style,Fore BANNER = """ ____ __ __ ____ _ _ _ __ __ / ___| \ \ / / | __ ) | | | | | | \ \ / / | | \ V / | _ \ | | | | | | \ V ...
gui.py
import random from multiprocessing import Process from threading import Thread from socket import * from tkinter import * from tkinter import ttk from _thread import * print(sys.version) class SenderConnection: def __init__(self): self.host = None self.port = None self.addr = (self.host, ...
deadlock.py
import threading import time import logging format = "%(asctime)s: %(message)s" logging.basicConfig(format=format, level=logging.INFO, datefmt="%H:%M:%S") def acquire_a_b(a, b): logging.info("t1 wants to acquire a") a.acquire() logging.info("t1 acquires a") time.sleep(1) logging.info("t1 wa...
Dddos.py
import os from queue import Queue from optparse import OptionParser import time, sys, socket, threading, logging, urllib.request, random os.system ('clear') def user_agent(): global uagent uagent=[] uagent.append("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.0) Opera 12.14") uagent.append("Mozilla/5.0 (...
asynx.py
from functools import wraps from multiprocessing import Process, get_context from multiprocessing.queues import Queue from threading import Thread import time from multiprocessing import Lock class BlockedQueue(Queue): def __init__(self, maxsize=-1, block=True, timeout=None): self.block = block s...
pyqt5_fullscreen.py
import os import sys import tempfile from multiprocessing import Process import numpy as np from PyQt5 import QtWidgets, QtGui, QtCore def resize(image, size): import importlib is_pillow_available = importlib.util.find_spec("PIL") is not None width, height = size if is_pillow_available: from ...
db.py
# Copyright 2017 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
SimulatedSendPackets.py
#coding=utf-8 import random import threading from time import ctime,sleep import json import requests import time def random_mac(): macList = [] for i in range(1, 7): randStr = "".join(random.sample("0123456789abcdef",2)) macList.append(randStr) randMac = ":".join(macList) return randMac...