from typing import Type
from pydantic import BaseModel  # noqa: E0611
from typing import Dict


def map_with_dataset_id(create_model: Type[BaseModel], json_dict: Dict, dataset_id: int):
    """
    Maps a json dict to a dict with the ref_dataset key set to the given dataset_id.
    """
    json_dict["ref_dataset"] = dataset_id
    return create_model.parse_obj(json_dict)