code: def test_AnomalyDetectorAnalysis__explain_rows_fn(dataset):
      a = AnomalyDetectorAnalysis()
      detector = MagicMock()
      train_data = pd.DataFrame({"train_data": np.arange(4)})
      ds_data = pd.DataFrame({dataset: np.arange(4)})
  
      kwargs = {} if dataset == "train_data" else {dataset: ds_data}
      args = AnalysisState(train_data=train_data, **kwargs)
  
      result = a.explain_rows_fn(
          args,
          detector=detector,
          dataset=dataset,
          dataset_row_ids=[1, 3],
      )
  
      # np.int64 is required for running tests on Windows
      assert_frame_equal(
          result["rows"].astype(np.int64),
          pd.DataFrame({dataset: [1, 3]}, index=[1, 3]).astype(
              np.int64
          ),
      )
      result.pop("rows")
  
      assert result["train_data"] is train_data
      result.pop("train_data")
  
      assert result == {
          "model": detector,
      }
  
file_path: autogluon/eda/tests/unittests/analysis/test_anomaly.py
imports: from unittest.mock import MagicMock
  import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from pyod.models.lof import LOF
  from autogluon.eda import AnalysisState
  from autogluon.eda.analysis import AnomalyDetector, AnomalyDetectorAnalysis
label_desc: Use image node_id 8 for calling a global function with example usage: test_AnomalyDetectorAnalysis__explain_rows_fn(dataset) without return types