code: def save_load_add_rai_insights(
      manager_type,
      data_train,
      data_test,
      target_name,
      categorical_features,
      feature_columns,
      feature_range_keys,
      feature_metadata,
      model,
  ):
      rai_insights = RAIInsights(
          model,
          data_train,
          data_test,
          target_name,
          categorical_features=categorical_features,
          task_type=ModelTask.CLASSIFICATION,
          feature_metadata=feature_metadata,
      )
  
      with TemporaryDirectory() as tmpdir:
          save_1 = Path(tmpdir) / "first_save"
          save_2 = Path(tmpdir) / "second_save"
  
          # Save it
          rai_insights.save(save_1)
  
          # Load
          rai_2 = RAIInsights.load(save_1)
  
          # Call a single manager
          if manager_type == ManagerNames.CAUSAL:
              rai_2.causal.add(
                  treatment_features=["age", "hours_per_week"]
              )
          elif manager_type == ManagerNames.COUNTERFACTUAL:
              rai_2.counterfactual.add(
                  total_CFs=10,
                  desired_class="opposite",
                  feature_importance=False,
              )
          elif manager_type == ManagerNames.DATA_BALANCE:
              rai_2._data_balance_manager.add(
                  cols_of_interest=categorical_features
              )
          elif manager_type == ManagerNames.ERROR_ANALYSIS:
              rai_2.error_analysis.add()
          elif manager_type == ManagerNames.EXPLAINER:
              rai_2.explainer.add()
          else:
              raise ValueError(
                  "Bad manager_type: {0}".format(manager_type)
              )
  
          rai_2.compute()
  
          # Validate, but this isn't the main check
          validate_rai_insights(
              rai_2,
              data_train,
              data_test,
              target_name,
              ModelTask.CLASSIFICATION,
              categorical_features=categorical_features,
              feature_range_keys=feature_range_keys,
              feature_columns=feature_columns,
              feature_metadata=feature_metadata,
          )
  
          # Save again (this is where Issue #1046 manifested)
          rai_2.save(save_2)
  
imports: import os
  from pathlib import Path
  from tempfile import TemporaryDirectory
  import numpy
  import pandas
  import pytest
  from tests.common_utils import ADULT_CATEGORICAL_FEATURES_AFTER_DROP, ADULT_DROPPED_FEATURES, create_iris_data
  from rai_test_utils.datasets.tabular import create_binary_classification_dataset
  from rai_test_utils.models.lightgbm import create_lightgbm_classifier
  from rai_test_utils.models.sklearn import create_complex_classification_pipeline
  from raiutils.models import ModelTask
  from responsibleai import RAIInsights
  from responsibleai._internal.constants import ManagerNames, SerializationAttributes
  from responsibleai.feature_metadata import FeatureMetadata
label_desc: Use image node_id 1 for calling a global function with example usage: save_load_add_rai_insights(manager_type, data_train, data_test, target_name, categorical_features, feature_columns, feature_range_keys, feature_metadata, model) without return types