def METHOD_NAME(req_instance_resources, instance_resources_id_map):
    """验证前端传过了的待实例化资源是否是该版本的资源"""
    if not req_instance_resources:
        return instance_resources_id_map
    instance_entity = {}
    for res_name, res_info in req_instance_resources.items():
        res_id_list = [res["id"] for res in res_info]
        valid_id_list = instance_resources_id_map.get(res_name, [])
        invalid_id_list = list(set(res_id_list) - set(valid_id_list))
        if invalid_id_list:
            raise ValidationError(f"id {invalid_id_list} is invalid for the entity")
        instance_entity[res_name] = res_id_list
    return instance_entity