'Return a network list available for the tenant.
The list contains networks owned by the tenant and public networks.
If net_ids specified, it searches networks with requested IDs only.'

def _get_available_networks(self, context, project_id, net_ids=None, neutron=None, auto_allocate=False):

    if (not neutron):
        neutron = get_client(context)
    if net_ids:
        search_opts = {'id': net_ids}
        nets = neutron.list_networks(**search_opts).get('networks', [])
    else:
        search_opts = {'tenant_id': project_id, 'shared': False}
        if auto_allocate:
            search_opts['admin_state_up'] = True
        nets = neutron.list_networks(**search_opts).get('networks', [])
        search_opts = {'shared': True}
        nets += neutron.list_networks(**search_opts).get('networks', [])
    _ensure_requested_network_ordering((lambda x: x['id']), nets, net_ids)
    return nets
