class_docstr: Base model container class, for easier definition of containers. Ensures consistent format
  before being turned into a dataframe row.
  
  Parameters
  ----------
  id : str
      ID used as index.
  name : str
      Full display name.
  class_def : type
      The class used for the model, eg. LogisticRegression.
  eq_function : type, default = None
      Function to use to check whether an object (model) can be considered equal to the model
      in the container. If None, will be ``is_instance(x, class_def)`` where x is the object.
  args : dict, default = {} (empty dict)
      The arguments to always pass to constructor when initializing object of class_def class.
  is_special : bool, default = False
      Is the model special (not intended to be used on its own, eg. VotingClassifier).
  
  Attributes
  ----------
  id : str
      ID used as index.
  name : str
      Full display name.
  class_def : type
      The class used for the model, eg. LogisticRegression.
  eq_function : type
      Function to use to check whether an object (model) can be considered equal to the model
      in the container. Must take the checked object as the sole parameter.
      If None, will be ``is_instance(x, class_def)`` where x is the object.
  args : dict
      The arguments to always pass to constructor when initializing object of class_def class.
  is_special : bool
      Is the model special (not intended to be used on its own, eg. VotingClassifier).
class_docstr_tok: ["Base","model","container","class",",","for","easier","definition","of","containers",".","Ensures","consistent","format","before","being","turned","into","a","dataframe","row",".","Parameters","--","--","--","--","--","id",":","str","ID","used","as","index",".","name",":","str","Full","display","name",".","class_def",":","type","The","class","used","for","the","model",",","eg",".","LogisticRegression",".","eq_function",":","type",",","default","=","None","Function","to","use","to","check","whether","an","object","(","model",")","can","be","considered","equal","to","the","model","in","the","container",".","If","None",",","will","be","``","is_instance","(","x",",","class_def",")","``","where","x","is","the","object",".","args",":","dict",",","default","=","{","}","(","empty","dict",")","The","arguments","to","always","pass","to","constructor","when","initializing","object","of","class_def","class",".","is_special",":","bool",",","default","=","False","Is","the","model","special","(","not","intended","to","be","used","on","its","own",",","eg",".","VotingClassifier",")",".","Attributes","--","--","--","--","--","id",":","str","ID","used","as","index",".","name",":","str","Full","display","name",".","class_def",":","type","The","class","used","for","the","model",",","eg",".","LogisticRegression",".","eq_function",":","type","Function","to","use","to","check","whether","an","object","(","model",")","can","be","considered","equal","to","the","model","in","the","container",".","Must","take","the","checked","object","as","the","sole","parameter",".","If","None",",","will","be","``","is_instance","(","x",",","class_def",")","``","where","x","is","the","object",".","args",":","dict","The","arguments","to","always","pass","to","constructor","when","initializing","object","of","class_def","class",".","is_special",":","bool","Is","the","model","special","(","not","intended","to","be","used","on","its","own",",","eg",".","VotingClassifier",")","."]
docstr: Sets the engine to use for a particular model based on what is set in
  the experiment.
  
  Parameters
  ----------
  id : str
      Identifier for the model for which the engine should be set, e.g.
      "auto_arima"
  experiment : _PyCaretExperiment
      The experiment object to which the model belongs. The engine to use
      for this model is extracted from this experiment object.
  severity : str, optional
      How to handle incorrectly specified engines. Allowed values are "error"
      and "warning". If set to "warning", the existing engine is left
      unchanged if the specified engine is not correct., by default "error".
  
  Raises
  ------
  ValueError
      (1) If specified engine is not in the allowed list of engines and
          severity is set to "error"
      (2) If the value of "severity" is not one of the allowed values
docstr_tok: ["Sets","the","engine","to","use","for","a","particular","model","based","on","what","is","set","in","the","experiment",".","Parameters","--","--","--","--","--","id",":","str","Identifier","for","the","model","for","which","the","engine","should","be","set",",","e.g",".","``","auto_arima","''","experiment",":","_PyCaretExperiment","The","experiment","object","to","which","the","model","belongs",".","The","engine","to","use","for","this","model","is","extracted","from","this","experiment","object",".","severity",":","str",",","optional","How","to","handle","incorrectly","specified","engines",".","Allowed","values","are","``","error","''","and","``","warning","''",".","If","set","to","``","warning","''",",","the","existing","engine","is","left","unchanged","if","the","specified","engine","is","not","correct.",",","by","default","``","error","''",".","Raises","--","--","--","ValueError","(","1",")","If","specified","engine","is","not","in","the","allowed","list","of","engines","and","severity","is","set","to","``","error","''","(","2",")","If","the","value","of","``","severity","''","is","not","one","of","the","allowed","values"]
code: def _set_engine(
      self,
      id: str,
      experiment: _PyCaretExperiment,
      severity: str = "error",
  ):
      """Sets the engine to use for a particular model based on what is set in
      the experiment.
  
      Parameters
      ----------
      id : str
          Identifier for the model for which the engine should be set, e.g.
          "auto_arima"
      experiment : _PyCaretExperiment
          The experiment object to which the model belongs. The engine to use
          for this model is extracted from this experiment object.
      severity : str, optional
          How to handle incorrectly specified engines. Allowed values are "error"
          and "warning". If set to "warning", the existing engine is left
          unchanged if the specified engine is not correct., by default "error".
  
      Raises
      ------
      ValueError
          (1) If specified engine is not in the allowed list of engines and
              severity is set to "error"
          (2) If the value of "severity" is not one of the allowed values
      """
      engine_to_use = experiment.get_engine(id)
      # If not specified, use the default engine
      if engine_to_use is None:
          engine_to_use = self.default_engine
  
      if (
          engine_to_use is not None
          and engine_to_use not in self.allowed_engines
      ):
          msg = (
              f"Engine '{engine_to_use}' for estimator '{id}' is not allowed.\n"
              f"Allowed values are '{self.allowed_engines}'."
          )
  
          if severity == "error":
              raise ValueError(msg)
          elif severity == "warning":
              self.logger.warning(msg)
              print(msg)
          else:
              raise ValueError(
                  "Error in calling set_engine, severity "
                  f'argument must be "error" or "warning", got "{severity}".'
              )
  
      self.engine = engine_to_use
  
file_path: pycaret/pycaret/containers/models/base_model.py
imports: from typing import Any, Dict, List, Optional
  from pycaret.containers.base_container import BaseContainer
  from pycaret.internal.distributions import CategoricalDistribution
  from pycaret.internal.pycaret_experiment.pycaret_experiment import _PyCaretExperiment
  from pycaret.utils.generic import get_allowed_engines, get_logger
label_desc: Use image node_id 4 for calling the ModelContainer obj's underlying member method code with example usage: obj._set_engine(id, experiment, severity) without return types