code: func formatNsnWithCarrier(
  	number string,
  	metadata *PhoneMetadata,
  	numberFormat PhoneNumberFormat,
  	carrierCode string) string {
  	var intlNumberFormats []*NumberFormat = metadata.GetIntlNumberFormat()
  	// When the intlNumberFormats exists, we use that to format national
  	// number for the INTERNATIONAL format instead of using the
  	// numberDesc.numberFormats.
  	var availableFormats []*NumberFormat = metadata.GetIntlNumberFormat()
  	if len(intlNumberFormats) == 0 || numberFormat == NATIONAL {
  		availableFormats = metadata.GetNumberFormat()
  	}
  	var formattingPattern *NumberFormat = chooseFormattingPatternForNumber(
  		availableFormats, number)
  	if formattingPattern == nil {
  		return number
  	}
  	return formatNsnUsingPatternWithCarrier(
  		number, formattingPattern, numberFormat, carrierCode)
  }
docs: // Note in some regions, the national number can be written in two
  // completely different ways depending on whether it forms part of the
  // NATIONAL format or INTERNATIONAL format. The numberFormat parameter
  // here is used to specify which format to use for those cases. If a
  // carrierCode is specified, this will be inserted into the formatted
  // string to replace $CC.