from __future__ import annotations import json import logging import math