code: def format_national_number_with_carrier_code(numobj, carrier_code):
      
      country_code = numobj.country_code
      nsn = national_significant_number(numobj)
      if not _has_valid_country_calling_code(country_code):
          return nsn
      # Note region_code_for_country_code() is used because formatting
      # information for regions which share a country calling code is contained
      # by only one region for performance reasons. For example, for NANPA
      # regions it will be contained in the metadata for US.
      region_code = region_code_for_country_code(country_code)
      # Metadata cannot be None because the country calling code is valid
      metadata = PhoneMetadata.metadata_for_region_or_calling_code(country_code, region_code)
      formatted_number = _format_nsn(nsn,
                                     metadata,
                                     PhoneNumberFormat.NATIONAL,
                                     carrier_code)
      formatted_number = _maybe_append_formatted_extension(numobj,
                                                           metadata,
                                                           PhoneNumberFormat.NATIONAL,
                                                           formatted_number)
      formatted_number = _prefix_number_with_country_calling_code(country_code,
                                                                  PhoneNumberFormat.NATIONAL,
                                                                  formatted_number)
      return formatted_number
docs: Format a number in national format for dialing using the specified carrier.
  
      The carrier-code will always be used regardless of whether the phone
      number already has a preferred domestic carrier code stored. If
      carrier_code contains an empty string, returns the number in national
      format without any carrier code.
  
      Arguments:
      numobj -- The phone number to be formatted
      carrier_code -- The carrier selection code to be used
  
      Returns the formatted phone number in national format for dialing using
      the carrier as specified in the carrier_code.