def METHOD_NAME(date_range: timedelta, high_fidelity: bool) -> str:
    # This matches what's defined in app/components/charts/utils.tsx
    if date_range >= timedelta(days=60):
        return "4h" if high_fidelity else "1d"
    if date_range >= timedelta(days=30):
        return "1h" if high_fidelity else "4h"
    if date_range > timedelta(days=1):
        return "30m" if high_fidelity else "1h"
    if date_range > timedelta(hours=1):
        return "1m" if high_fidelity else "5m"
    return "5m" if high_fidelity else "15m"