

def normalize_digits_only(number, keep_non_digits=False):
    'Normalizes a string of characters representing a phone number.\n\n    This converts wide-ascii and arabic-indic numerals to European numerals,\n    and strips punctuation and alpha characters (optional).\n\n    Arguments:\n    number -- a string representing a phone number\n    keep_non_digits -- whether to keep non-digits\n\n    Returns the normalized string version of the phone number.\n    '
    number = unicod(number)
    number_length = len(number)
    normalized_digits = U_EMPTY_STRING
    for ii in range(number_length):
        d = unicode_digit(number[ii], (- 1))
        if (d != (- 1)):
            normalized_digits += unicod(d)
        elif normalized_digits:
            normalized_digits += number[ii]
    return normalized_digits

dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py normalize_digits_only/VarMisuse@80/242 `keep_non_digits`->`normalized_digits`