<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_nodes(search="unsigned"):
 """ List all connected nodes """

    nodes = nago.core.get_nodes()
    if search == "all":
        return map(lambda x: {x[0]: x[1].data}, nodes.items())
    elif search == 'unsigned':
        result = {}
        for token, node in nodes.items():
            if node.get('access') is None:
                result[token] = node.data
        return result
    else:
        result = {}
        for token, node in nodes.items():
            host_name = node.get('host_name')
            if search in (token, host_name):
                result[token] = node.data
        return result