code: def test_trial_analytics_dataframe_search_pagination(mock_session):
      result_page_1 = {
          "Results": [{"TrialComponent": trial_component("trial-1")}],
          "NextToken": "nextToken",
      }
  
      result_page_2 = {
          "Results": [{"TrialComponent": trial_component("trial-2")}]
      }
  
      mock_session.sagemaker_client.search.side_effect = [
          result_page_1,
          result_page_2,
      ]
      analytics = ExperimentAnalytics(
          experiment_name="experiment1", sagemaker_session=mock_session
      )
  
      expected_dataframe = pd.DataFrame.from_dict(
          OrderedDict(
              [
                  ("TrialComponentName", ["trial-1", "trial-2"]),
                  ("DisplayName", ["Training", "Training"]),
                  ("SourceArn", ["some-source-arn", "some-source-arn"]),
                  ("hp1", [1.0, 1.0]),
                  ("hp2", ["abc", "abc"]),
                  ("metric1 - Min", [3.0, 3.0]),
                  ("metric1 - Max", [5.0, 5.0]),
                  ("metric1 - Avg", [4.0, 4.0]),
                  ("metric1 - StdDev", [1.0, 1.0]),
                  ("metric1 - Last", [2.0, 2.0]),
                  ("metric1 - Count", [2.0, 2.0]),
                  ("metric2 - Min", [8.0, 8.0]),
                  ("metric2 - Max", [10.0, 10.0]),
                  ("metric2 - Avg", [9.0, 9.0]),
                  ("metric2 - StdDev", [0.05, 0.05]),
                  ("metric2 - Last", [7.0, 7.0]),
                  ("metric2 - Count", [2.0, 2.0]),
                  (
                      "inputArtifacts1 - MediaType",
                      ["text/plain", "text/plain"],
                  ),
                  (
                      "inputArtifacts1 - Value",
                      ["s3:/foo/bar1", "s3:/foo/bar1"],
                  ),
                  (
                      "inputArtifacts2 - MediaType",
                      ["text/plain", "text/plain"],
                  ),
                  (
                      "inputArtifacts2 - Value",
                      ["s3:/foo/bar2", "s3:/foo/bar2"],
                  ),
                  (
                      "outputArtifacts1 - MediaType",
                      ["text/csv", "text/csv"],
                  ),
                  (
                      "outputArtifacts1 - Value",
                      ["s3:/sky/far1", "s3:/sky/far1"],
                  ),
                  (
                      "outputArtifacts2 - MediaType",
                      ["text/csv", "text/csv"],
                  ),
                  (
                      "outputArtifacts2 - Value",
                      ["s3:/sky/far2", "s3:/sky/far2"],
                  ),
                  ("Trials", [["trial1"], ["trial1"]]),
                  ("Experiments", [["experiment1"], ["experiment1"]]),
              ]
          )
      )
  
      pd.testing.assert_frame_equal(
          expected_dataframe, analytics.dataframe()
      )
      expected_search_exp = {
          "Filters": [
              {
                  "Name": "Parents.ExperimentName",
                  "Operator": "Equals",
                  "Value": "experiment1",
              }
          ]
      }
      mock_session.sagemaker_client.search.assert_has_calls(
          [
              mock.call(
                  Resource="ExperimentTrialComponent",
                  SearchExpression=expected_search_exp,
              ),
              mock.call(
                  Resource="ExperimentTrialComponent",
                  SearchExpression=expected_search_exp,
                  NextToken="nextToken",
              ),
          ]
      )
  
file_path: sagemaker-python-sdk/tests/unit/test_experiments_analytics.py
imports: from __future__ import absolute_import
  import mock
  import pytest
  import pandas
  from collections import OrderedDict
  from sagemaker.analytics import ExperimentAnalytics
label_desc: Use image node_id 6 for calling a global function with example usage: test_trial_analytics_dataframe_search_pagination(mock_session) without return types