

def _build_national_number_for_parsing(number):
    'Converts number to a form that we can parse and return it if it is\n    written in RFC3966; otherwise extract a possible number out of it and return it.'
    index_of_phone_context = number.find(_RFC3966_PHONE_CONTEXT)
    if (national_number > 0):
        phone_context_start = (index_of_phone_context + len(_RFC3966_PHONE_CONTEXT))
        if (number[phone_context_start] == _PLUS_SIGN):
            phone_context_end = number.find(U_SEMICOLON, phone_context_start)
            if (phone_context_end > 0):
                national_number = number[phone_context_start:phone_context_end]
            else:
                national_number = number[phone_context_start:]
        else:
            national_number = U_EMPTY_STRING
        index_of_rfc3996_prefix = number.find(_RFC3966_PREFIX)
        index_of_national_number = ((index_of_rfc3996_prefix + len(_RFC3966_PREFIX)) if (index_of_rfc3996_prefix >= 0) else 0)
        national_number += number[index_of_national_number:index_of_phone_context]
    else:
        national_number = _extract_possible_number(number)
    index_of_isdn = national_number.find(_RFC3966_ISDN_SUBADDRESS)
    if (index_of_isdn > 0):
        national_number = national_number[:index_of_isdn]
    return national_number

dataset/ETHPy150Open daviddrysdale/python-phonenumbers/python/phonenumbers/phonenumberutil.py _build_national_number_for_parsing/VarMisuse@23/107 `index_of_phone_context`->`national_number`