def format_national_number_with_preferred_carrier_code(numobj, fallback_carrier_code):
 if (numobj.preferred_domestic_carrier_code is not None):
  carrier_code = numobj.preferred_domestic_carrier_code
 else:
  carrier_code = fallback_carrier_code
 return format_national_number_with_carrier_code(numobj, carrier_code)

def format_national_number_with_preferred_carrier_code ( numobj , fallback_carrier_code ) : if ( numobj . preferred_domestic_carrier_code is not None ) : carrier_code = numobj . preferred_domestic_carrier_code else : carrier_code = fallback_carrier_code return format_national_number_with_carrier_code ( numobj , carrier_code )
formats a phone number in national format for dialing using the carrier as specified in the preferred_domestic_carrier_code field of the phonenumber object passed in .