def is_possible_short_number_for_region(short_number, region_dialing_from):
 if isinstance(short_number, PhoneNumber):
  short_number = national_significant_number(short_number)
 metadata = PhoneMetadata.short_metadata_for_region(region_dialing_from)
 if (metadata is None):
  return False
 general_desc = metadata.general_desc
 return _is_number_possible_for_desc(short_number, general_desc)

def is_possible_short_number_for_region ( short_number , region_dialing_from ) : if isinstance ( short_number , PhoneNumber ) : short_number = national_significant_number ( short_number ) metadata = PhoneMetadata . short_metadata_for_region ( region_dialing_from ) if ( metadata is None ) : return False general_desc = metadata . general_desc return _is_number_possible_for_desc ( short_number , general_desc )
check whether a short number is a possible number when dialled from a region .