def get_list_outvar(node):
    """Given a statement parse node for a `list()` command, inspect the
     subcommand and extract the token corresponding to the output
     variable name."""
    semtoks = node.argtree.parg_groups[0].get_tokens(kind='semantic')
    listcmd = semtoks[0].spelling
    if listcmd.upper() in ('LENGTH', 'GET', 'JOIN', 'SUBLIST'):
        return semtoks[-1]
    return None
