code: def verify_matcher_save_load(
      matcher, df, verify_embedding=True, cls=MultiModalPredictor
  ):
      with tempfile.TemporaryDirectory() as root:
          matcher.save(root)
          predictions = matcher.predict(df, as_pandas=False)
          loaded_matcher = cls.load(root)
          predictions2 = loaded_matcher.predict(df, as_pandas=False)
          predictions2_df = loaded_matcher.predict(df, as_pandas=True)
          npt.assert_equal(predictions, predictions2)
          npt.assert_equal(predictions2, predictions2_df.to_numpy())
          if matcher.problem_type.endswith((BINARY, MULTICLASS)):
              print("\nverifying predict and predict_proba...\n")
              predictions_prob = matcher.predict_proba(
                  df, as_pandas=False
              )
              predictions2_prob = loaded_matcher.predict_proba(
                  df, as_pandas=False
              )
              predictions2_prob_df = loaded_matcher.predict_proba(
                  df, as_pandas=True
              )
              npt.assert_equal(predictions_prob, predictions2_prob)
              npt.assert_equal(
                  predictions2_prob, predictions2_prob_df.to_numpy()
              )
          if verify_embedding:
              query_embeddings = matcher.extract_embedding(
                  df, signature=QUERY
              )
              response_embeddings = matcher.extract_embedding(
                  df, signature=RESPONSE
              )
              assert query_embeddings.shape[0] == len(df)
              assert response_embeddings.shape[0] == len(df)
  
file_path: autogluon/multimodal/tests/unittests/others/test_matcher.py
imports: import copy
  import os
  import pickle
  import shutil
  import tempfile
  import numpy.testing
  import pytest
  from autogluon.multimodal import MultiModalPredictor
  from autogluon.multimodal.constants import BINARY, MULTICLASS, QUERY, RESPONSE, UNIFORM_SOUP
  from autogluon.multimodal.utils import convert_data_for_ranking, semantic_search
  from ..utils.unittest_datasets import Flickr30kDataset, IDChangeDetectionDataset
  from ..utils.utils import get_home_dir
label_desc: Use image node_id 1 for calling a global function with example usage: verify_matcher_save_load(matcher, df, verify_embedding, cls) without return types