from unittest.mock import Mock


def mock_multi_apm(mock_parameter_manager):
    """Mock a multi-dataset parameter manager."""
    multi_apm = Mock()
    multi_apm.apm_list = [mock_parameter_manager, mock_parameter_manager]
    n_params = mock_parameter_manager.n_active_params
    multi_apm.n_active_params = n_params * 2
    multi_apm.apm_data = {
        0: {"start_idx": 0, "end_idx": n_params},
        1: {"start_idx": n_params, "end_idx": n_params * 2},
    }
    return multi_apm