def is_valid_ip_address(addr: str) -> bool:
    """Check if given string is a valid IP address."""
    try:
        _ = ipaddress.ip_address(addr)
        return True
    except ValueError:
        return False
Check if given string is a valid IP address.
src/bentoml/_internal/configuration/helpers.py