class_docstr: Defines the base class RAIBaseInsights for the top-level API.
  
  This class is abstract and should not be instantiated.
class_docstr_tok: ["Defines","the","base","class","RAIBaseInsights","for","the","top-level","API",".","This","class","is","abstract","and","should","not","be","instantiated","."]
docstr: Save the model and the serializer (if any).
  
  :param path: The directory path to save the RAIBaseInsights to.
  :type path: str
docstr_tok: ["Save","the","model","and","the","serializer","(","if","any",")",".",":","param","path",":","The","directory","path","to","save","the","RAIBaseInsights","to",".",":","type","path",":","str"]
code: def _save_model(self, path):
      """Save the model and the serializer (if any).
  
      :param path: The directory path to save the RAIBaseInsights to.
      :type path: str
      """
      top_dir = Path(path)
      if self._serializer is not None:
          # save the model
          self._serializer.save(self.model, top_dir)
          # save the serializer
          with open(top_dir / _SERIALIZER, "wb") as file:
              pickle.dump(self._serializer, file)
      else:
          if self.model is not None:
              has_setstate = hasattr(self.model, "__setstate__")
              has_getstate = hasattr(self.model, "__getstate__")
              if not (has_setstate and has_getstate):
                  warnings.warn(
                      "Model does not have __setstate__ and "
                      + "__getstate__, pickle may fail"
                  )
          try:
              with open(top_dir / _MODEL_PKL, "wb") as file:
                  pickle.dump(self.model, file)
          except Exception as e:
              raise UserConfigValidationException(
                  "Model must be picklable or a custom serializer must"
                  " be specified"
              ) from e
  
imports: import json
  import os
  import pickle
  import warnings
  from abc import ABC, abstractmethod
  from pathlib import Path
  from typing import Any, Optional
  import pandas
  import responsibleai
  from raiutils.exceptions import UserConfigValidationException
  from responsibleai._internal._served_model_wrapper import ServedModelWrapper
  from responsibleai._internal.constants import FileFormats, Metadata, ModelServingConstants, SerializationAttributes
label_desc: Use image node_id 13 for calling the RAIBaseInsights obj's underlying member method code with example usage: obj._save_model(path) without return types