def removesuffix(string: str, suffix: str) -> str:
    """Remove a suffix from a string.

    Backport of `str.removesuffix` for Python < 3.9
    """
    if string.endswith(suffix):
        return string[: -len(suffix)]
    return string
Remove a suffix from a string.

    Backport of `str.removesuffix` for Python < 3.9
    
src/anthropic/_utils/_utils.py