from unittest.mock import Mock


def mock_unrestrained_apm(mock_unrestrained_component):
    """Mock a parameter manager to handle no restrained components."""
    apm = Mock()
    apm.components = {
        "unrestrained": {
            "object": mock_unrestrained_component,
            "n_params": mock_unrestrained_component.n_params,
            "start_idx": 0,
        }
    }
    apm.n_active_params = mock_unrestrained_component.n_params
    return apm