code: def _create_local_explanation(
      expected_values=None,
      classification=True,
      text_explanation=False,
      image_explanation=False,
      explanation_id=None,
      **kwargs,
  ):
      """Dynamically creates an explanation based on local type and specified data.
  
      :param expected_values: The expected values of the model.
      :type expected_values: list
      :param classification: Indicates if this is a classification or regression explanation.
      :type classification: bool
      :param text_explanation: Indicates if this is a text explanation.
      :type text_explanation: bool
      :param image_explanation: Indicates if this is an image explanation.
      :type image_explanation: bool
      :param explanation_id: If specified, puts the local explanation under a preexisting explanation object.
          If not, a new unique identifier will be created for the explanation.
      :type explanation_id: str
      :return: A model explanation object. It is guaranteed to be a LocalExplanation. If expected_values is not None, it
          will also have the properties of the ExpectedValuesMixin. If classification is set to True, it will have the
          properties of the ClassesMixin. If text_explanation is set to True, it will have the properties of
          TextExplanation.
      :rtype: DynamicLocalExplanation
      """
      exp_id = explanation_id or str(uuid.uuid4())
      if text_explanation:
          mixins = [TextExplanation]
      else:
          mixins = [LocalExplanation]
      if expected_values is not None:
          mixins.append(ExpectedValuesMixin)
          kwargs[ExplanationParams.EXPECTED_VALUES] = expected_values
      if classification:
          mixins.append(ClassesMixin)
      DynamicLocalExplanation = type(
          Dynamic.LOCAL_EXPLANATION, tuple(mixins), {}
      )
      local_explanation = DynamicLocalExplanation(
          explanation_id=exp_id, **kwargs
      )
      return local_explanation
  
file_path: interpret-text/python/interpret_text/experimental/explanation.py
imports: import numpy
  import uuid
  from interpret_community.common.explanation_utils import _sort_values, _order_imp
  from interpret_community.common.constants import Dynamic, ExplanationParams, ExplainParams
  from interpret_community.explanation.explanation import LocalExplanation, ExpectedValuesMixin, ClassesMixin
label_desc: Use image node_id 1 for calling a global function with example usage: _create_local_explanation(expected_values, classification, text_explanation, image_explanation, explanation_id) and returns: local_explanation