https://github.com/x4nth055/pythoncode-tutorials/blob/ed6d8faccd6f598065611564f360396cda0d978a/general/gmail-api/read_emails.py#L69 `msg` is not defined in that context