'Retrieve and return a list of the active networks.'

def _get_active_networks(self, context, **kwargs):

    host = kwargs.get('host')
    plugin = directory.get_plugin()
    if utils.is_extension_supported(plugin, constants.DHCP_AGENT_SCHEDULER_EXT_ALIAS):
        if cfg.CONF.network_auto_schedule:
            plugin.auto_schedule_networks(context, host)
        nets = plugin.list_active_networks_on_active_dhcp_agent(context, host)
    else:
        filters = dict(admin_state_up=[True])
        nets = plugin.get_networks(context, filters=filters)
    return nets
