def code(sentence, pad='  ', format='army'):
    '''
    Transform a sentence using the code spelling alphabet, multiple
    international code alphabets are supported.

    ====== ====================================================================
    format description
    ====== ====================================================================
    army   US (international) army code alphabet
    faa    Federal Aviation Administration code alphabet, as described in "ICAO
           Phonetics in the FAA ATC Manual, §2-4-16"
    icao   International Civil Aviation Organization, as described in "Annex 10
           to the Convention on International Civil Aviation, Volume II (Fifth
           edition, 1995), Chapter 5, 38–40"
    itu    International Telecommunication Union Roman alphabet, as described
           in "ITU Phonetic Alphabet and Figure Code"
    morse  International morse code, as described in "International Morse code
           Recommendation ITU-R M.1677-1", http://itu.int/
    word   International Civil Aviation Organization, as described in "Annex 10
           to the Convention on International Civil Aviation, Volume II (Fifth
           edition, 1995), Chapter 5, 38–40"
    ====== ====================================================================

    :param sentence: input sentence
    :param pad: default ``None`` (reside to per-alphabet defaults)
    :param format: default ``army``

    >>> print(code('Python'))
    PAH pah  YANG kee  TANG go  HO tell  OSS car  NOH vem ber
    >>> print(code('Python', format='faa'))
    PAHPAH  YANGKEY  TANGGO  HOHTELL  OSSCAH  NOVEMBER

    >>> print(code('Python', format='icao'))
    PAH PAH  YANG KEY  TANG GO  HOH TELL  OSS CAH  NO VEM BER

    >>> print(code('Python', format='itu'))
    PAH PAH  YANG KEY  TANG GO  HOH TELL  OSS CAH  NO VEM BER

    >>> print(code('Python', format='morse'))
    .--.  -.--  -  ....  ---  -.

    >>> print(code('Python', format='word'))
    papa  yankee  tango  hotel  oscar  november

    '''
    try:
        return ALPHABET['code'][format](sentence, pad or CODE_PADDING[format])
    except KeyError:
        raise TypeError('Unsupported code alphabet "%s"' % (format,))
Transform a sentence using the code spelling alphabet, multiple
    international code alphabets are supported.

    ====== ====================================================================
    format description
    ====== ====================================================================
    army   US (international) army code alphabet
    faa    Federal Aviation Administration code alphabet, as described in "ICAO
           Phonetics in the FAA ATC Manual, §2-4-16"
    icao   International Civil Aviation Organization, as described in "Annex 10
           to the Convention on International Civil Aviation, Volume II (Fifth
           edition, 1995), Chapter 5, 38–40"
    itu    International Telecommunication Union Roman alphabet, as described
           in "ITU Phonetic Alphabet and Figure Code"
    morse  International morse code, as described in "International Morse code
           Recommendation ITU-R M.1677-1", http://itu.int/
    word   International Civil Aviation Organization, as described in "Annex 10
           to the Convention on International Civil Aviation, Volume II (Fifth
           edition, 1995), Chapter 5, 38–40"
    ====== ====================================================================

    :param sentence: input sentence
    :param pad: default ``None`` (reside to per-alphabet defaults)
    :param format: default ``army``

    >>> print(code('Python'))
    PAH pah  YANG kee  TANG go  HO tell  OSS car  NOH vem ber
    >>> print(code('Python', format='faa'))
    PAHPAH  YANGKEY  TANGGO  HOHTELL  OSSCAH  NOVEMBER

    >>> print(code('Python', format='icao'))
    PAH PAH  YANG KEY  TANG GO  HOH TELL  OSS CAH  NO VEM BER

    >>> print(code('Python', format='itu'))
    PAH PAH  YANG KEY  TANG GO  HOH TELL  OSS CAH  NO VEM BER

    >>> print(code('Python', format='morse'))
    .--.  -.--  -  ....  ---  -.

    >>> print(code('Python', format='word'))
    papa  yankee  tango  hotel  oscar  november