code: def evaluate_filter_expression(  # pylint: disable=too-many-return-statements
      model_filter: ModelFilter,
      cached_model_value: Optional[
          Union[str, bool, int, float, Dict[str, Any], List[Any]]
      ],
  ) -> BooleanValues:
      """Evaluates model filter with cached model spec value, returns boolean.
  
      Args:
          model_filter (ModelFilter): The model filter for evaluation.
          cached_model_value (Any): The value in the model manifest/spec that should be used to
              evaluate the filter.
      """
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[FilterOperators.EQUALS]
      ):
          return _evaluate_filter_expression_equals(
              model_filter, cached_model_value
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[FilterOperators.NOT_EQUALS]
      ):
          return _negate_boolean(
              _evaluate_filter_expression_equals(
                  model_filter, cached_model_value
              )
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[FilterOperators.IN]
      ):
          return _evaluate_filter_expression_in(
              model_filter, cached_model_value
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[FilterOperators.NOT_IN]
      ):
          return _negate_boolean(
              _evaluate_filter_expression_in(
                  model_filter, cached_model_value
              )
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[FilterOperators.INCLUDES]
      ):
          return _evaluate_filter_expression_includes(
              model_filter, cached_model_value
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[
              FilterOperators.NOT_INCLUDES
          ]
      ):
          return _negate_boolean(
              _evaluate_filter_expression_includes(
                  model_filter, cached_model_value
              )
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[
              FilterOperators.BEGINS_WITH
          ]
      ):
          return _evaluate_filter_expression_begins_with(
              model_filter, cached_model_value
          )
  
      if (
          model_filter.operator
          in FILTER_OPERATOR_STRING_MAPPINGS[FilterOperators.ENDS_WITH]
      ):
          return _evaluate_filter_expression_ends_with(
              model_filter, cached_model_value
          )
  
      raise RuntimeError(f"Bad operator: {model_filter.operator}")
  
imports: from __future__ import absolute_import
  from ast import literal_eval
  from enum import Enum
  from typing import Dict, List, Optional, Union, Any
  from sagemaker.jumpstart.types import JumpStartDataHolderType
label_desc: Use image node_id 8 for calling a global function with example usage: evaluate_filter_expression(model_filter, cached_model_value) and returns: _evaluate_filter_expression_equals, _negate_boolean, _evaluate_filter_expression_in, _negate_boolean, _evaluate_filter_expression_includes, _negate_boolean, _evaluate_filter_expression_begins_with, _evaluate_filter_expression_ends_with