def _reduce_digits(number: int) -> int:
    """
    Sum of digits of a number until sum becomes single digit.

    Example:
        658 => 6 + 5 + 8 = 19 => 1 + 9 = 10 => 1
    """
    if number == 0:
        return 0
    if number % 9 == 0:
        return 9

    return number % 9

    Sum of digits of a number until sum becomes single digit.

    Example:
        658 => 6 + 5 + 8 = 19 => 1 + 9 = 10 => 1
    
faker/providers/ssn/es_MX/__init__.py