human
Complete this python program:
def add_ls_data(script):
assistant
#Here is the Python code you requested.

    """This function calls the appropriate `add_*_data()` function to
    convert output from scripts that do not include a structured
    output to a structured output similar to the one provided by the
    "ls" NSE module.
    See https://nmap.org/nsedoc/lib/ls.html
    """
    def notimplemented(script):
        utils.LOGGER.warning('Migration    not    implemented    for    script    %r', script['id'])
        raise NotImplementedError
    return {'smb-ls': add_smb_ls_data, 'nfs-ls': add_nfs_ls_data, 'afp-ls': add_afp_ls_data, 'ftp-anon': add_ftp_anon_data}.get(script['id'], notimplemented)(script)