The code from the book "The Python Standard Library By Example"