def _get_networks_for_instance(self, context, instance_id, project_id,
                                   requested_networks=None):
        # TODO(tr3buchet) maybe this needs to be updated in the future if
        #                 there is a better way to determine which networks
        #                 a non-vlan instance should connect to
        if requested_networks is not None and len(requested_networks) != 0:
            network_uuids = [uuid for (uuid, fixed_ip) in requested_networks]
            networks = self.db.network_get_all_by_uuids(context,
                                                    network_uuids)
        else:
            try:
                networks = self.db.network_get_all(context)
            except exception.NoNetworksFound:
                return []
        # return only networks which are not vlan networks
        return [network for network in networks if
                not network['vlan']]
Determine & return which networks an instance should connect to.
dataset/ETHPy150Open nii-cloud/dodai-compute/nova/network/manager.py/NetworkManager._get_networks_for_instance