def _maybe_strip_i18n_prefix_and_normalize(number, possible_idd_prefix):
 if (len(number) == 0):
  return (CountryCodeSource.FROM_DEFAULT_COUNTRY, number)
 m = _PLUS_CHARS_PATTERN.match(number)
 if m:
  number = number[m.end():]
  return (CountryCodeSource.FROM_NUMBER_WITH_PLUS_SIGN, _normalize(number))
 idd_pattern = re.compile(possible_idd_prefix)
 number = _normalize(number)
 (stripped, number) = _parse_prefix_as_idd(idd_pattern, number)
 if stripped:
  return (CountryCodeSource.FROM_NUMBER_WITH_IDD, number)
 else:
  return (CountryCodeSource.FROM_DEFAULT_COUNTRY, number)

def _maybe_strip_i18n_prefix_and_normalize ( number , possible_idd_prefix ) : if ( len ( number ) == 0 ) : return ( CountryCodeSource . FROM_DEFAULT_COUNTRY , number ) m = _PLUS_CHARS_PATTERN . match ( number ) if m : number = number [ m . end ( ) : ] return ( CountryCodeSource . FROM_NUMBER_WITH_PLUS_SIGN , _normalize ( number ) ) idd_pattern = re . compile ( possible_idd_prefix ) number = _normalize ( number ) ( stripped , number ) = _parse_prefix_as_idd ( idd_pattern , number ) if stripped : return ( CountryCodeSource . FROM_NUMBER_WITH_IDD , number ) else : return ( CountryCodeSource . FROM_DEFAULT_COUNTRY , number )
strips any international prefix present in the number provided .