def _is_number_match_OS(numobj1, number2):
 try:
  numobj2 = parse(number2, UNKNOWN_REGION)
  return _is_number_match_OO(numobj1, numobj2)
 except NumberParseException:
  (_, exc, _) = sys.exc_info()
  if (exc.error_type == NumberParseException.INVALID_COUNTRY_CODE):
   region1 = region_code_for_country_code(numobj1.country_code)
   try:
    if (region1 != UNKNOWN_REGION):
     numobj2 = parse(number2, region1)
     match = _is_number_match_OO(numobj1, numobj2)
     if (match == MatchType.EXACT_MATCH):
      return MatchType.NSN_MATCH
     else:
      return match
    else:
     numobj2 = parse(number2, None, keep_raw_input=False, _check_region=False, numobj=None)
     return _is_number_match_OO(numobj1, numobj2)
   except NumberParseException:
    return MatchType.NOT_A_NUMBER
 return MatchType.NOT_A_NUMBER

def _is_number_match_OS ( numobj1 , number2 ) : try : numobj2 = parse ( number2 , UNKNOWN_REGION ) return _is_number_match_OO ( numobj1 , numobj2 ) except NumberParseException : ( _ , exc , _ ) = sys . exc_info ( ) if ( exc . error_type == NumberParseException . INVALID_COUNTRY_CODE ) : region1 = region_code_for_country_code ( numobj1 . country_code ) try : if ( region1 != UNKNOWN_REGION ) : numobj2 = parse ( number2 , region1 ) match = _is_number_match_OO ( numobj1 , numobj2 ) if ( match == MatchType . EXACT_MATCH ) : return MatchType . NSN_MATCH else : return match else : numobj2 = parse ( number2 , None , keep_raw_input = False , _check_region = False , numobj = None ) return _is_number_match_OO ( numobj1 , numobj2 ) except NumberParseException : return MatchType . NOT_A_NUMBER return MatchType . NOT_A_NUMBER
wrapper variant of _is_number_match_oo that copes with one phonenumber object and one string .