def _pack_into_dict(value_or_dict, expected_keys, allow_subset = False):
    """
    Used for when you want to either
        a) Distribute some value to all predictors
        b) Distribute different values to different predictors and check that the names match up.
    :param value_or_dict: Either
        a) A value
        b) A dict<predictor_name: value_for_predictor>
    :param expected_keys: Names of predictors
    :return: A dict<predictor_name: value_for_predictor>
    """
    if not isinstance(value_or_dict, dict):
        output_dict = {predictor_name: value_or_dict for predictor_name in expected_keys}
    else:
        output_dict = value_or_dict
        if allow_subset:
            assert set(value_or_dict.keys()).issubset(expected_keys), 'Expected a subset of: %s.  Got %s' % (expected_keys, value_or_dict.keys())
        else:
            assert set(expected_keys) == set(value_or_dict.keys()), 'Expected keys: %s.  Got %s' % (expected_keys, value_or_dict.keys())
    return output_dict