July 2019
Beginner to intermediate
740 pages
16h 52m
English
The LoginAttemptSimulator class in the login_attempt_simulator.py file handles the heavy-lifting of carrying out the simulation with all the random number generation logic (parts of the docstrings have been removed for brevity; check the file itself for the full documentation).
As usual, we start with our module docstring and imports:
"""Simulator of login attempts from valid users and hackers."""import calendarimport datetime as dtfrom functools import partialimport mathimport randomimport stringimport numpy as npimport pandas as pdfrom .utils import random_ip_generator, read_user_ips
Next, we begin defining the LoginAttemptSimulator class with its docstring, along with some class variables for storing constants. ...
Read now
Unlock full access