def length_of_national_destination_code(numobj):
 if (numobj.extension is not None):
  copied_numobj = PhoneNumber()
  copied_numobj.merge_from(numobj)
  copied_numobj.extension = None
 else:
  copied_numobj = numobj
 nsn = format_number(copied_numobj, PhoneNumberFormat.INTERNATIONAL)
 number_groups = re.split(NON_DIGITS_PATTERN, nsn)
 if (len(number_groups) <= 3):
  return 0
 if (number_type(numobj) == PhoneNumberType.MOBILE):
  mobile_token = country_mobile_token(numobj.country_code)
  if (mobile_token != U_EMPTY_STRING):
   return (len(number_groups[2]) + len(number_groups[3]))
 return len(number_groups[2])

def length_of_national_destination_code ( numobj ) : if ( numobj . extension is not None ) : copied_numobj = PhoneNumber ( ) copied_numobj . merge_from ( numobj ) copied_numobj . extension = None else : copied_numobj = numobj nsn = format_number ( copied_numobj , PhoneNumberFormat . INTERNATIONAL ) number_groups = re . split ( NON_DIGITS_PATTERN , nsn ) if ( len ( number_groups ) <= 3 ) : return 0 if ( number_type ( numobj ) == PhoneNumberType . MOBILE ) : mobile_token = country_mobile_token ( numobj . country_code ) if ( mobile_token != U_EMPTY_STRING ) : return ( len ( number_groups [ 2 ] ) + len ( number_groups [ 3 ] ) ) return len ( number_groups [ 2 ] )
return length of the national destination code code for a number .