code: def verify_matcher_realtime_inference(
      matcher, df, verify_embedding=True
  ):
      for i in range(1, 3):
          df_small = df.head(i)
          predictions_default = matcher.predict(
              df_small, as_pandas=False, realtime=False
          )
          predictions_realtime = matcher.predict(
              df_small, as_pandas=False, realtime=True
          )
          npt.assert_equal(predictions_default, predictions_realtime)
          if matcher.problem_type.endswith((BINARY, MULTICLASS)):
              predictions_prob_default = matcher.predict_proba(
                  df_small, as_pandas=False, realtime=False
              )
              predictions_prob_realtime = matcher.predict_proba(
                  df_small, as_pandas=False, realtime=True
              )
              npt.assert_almost_equal(
                  predictions_prob_default,
                  predictions_prob_realtime,
                  decimal=5,
              )
          if verify_embedding:
              embeddings_default = matcher.extract_embedding(
                  df_small, signature=QUERY, realtime=False
              )
              embeddings_realtime = matcher.extract_embedding(
                  df_small, signature=QUERY, realtime=True
              )
              npt.assert_equal(embeddings_default, embeddings_realtime)
              embeddings_default = matcher.extract_embedding(
                  df_small, signature=RESPONSE, realtime=False
              )
              embeddings_realtime = matcher.extract_embedding(
                  df_small, signature=RESPONSE, realtime=True
              )
              npt.assert_equal(embeddings_default, embeddings_realtime)
  
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 2 for calling a global function with example usage: verify_matcher_realtime_inference(matcher, df, verify_embedding) without return types