<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_aggregated_node_list(self, data):
 """ Returns list of main and secondary mac addresses. """

        node_list = []
        for node in data:
            local_addresses = [node['primary']]
            if 'secondary' in node:
                local_addresses += node['secondary']
            node_list.append(local_addresses)
        return node_list