def _get_indentation(value: str) -> int:
    """Calculates the number of leading spaces in a string.

    Args:
        value: the string to check for leading spaces.

    Returns:
        An integer indicating the number of leading spaces in the string.
    """
    return len(value) - len(value.lstrip())