code: def test_next_token(sagemaker_session, datetime_obj):
      experiment_obj = experiment.Experiment(sagemaker_session)
      client = sagemaker_session.sagemaker_client
      client.list_trials.side_effect = [
          {
              "TrialSummaries": [
                  {
                      "Name": "trial-foo-1",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  },
                  {
                      "Name": "trial-foo-2",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  },
              ],
              "NextToken": "foo",
          },
          {
              "TrialSummaries": [
                  {
                      "Name": "trial-foo-3",
                      "CreationTime": datetime_obj,
                      "LastModifiedTime": datetime_obj,
                  }
              ]
          },
      ]
  
      assert list(experiment_obj.list_trials()) == [
          TrialSummary(
              name="trial-foo-1",
              creation_time=datetime_obj,
              last_modified_time=datetime_obj,
          ),
          TrialSummary(
              name="trial-foo-2",
              creation_time=datetime_obj,
              last_modified_time=datetime_obj,
          ),
          TrialSummary(
              name="trial-foo-3",
              creation_time=datetime_obj,
              last_modified_time=datetime_obj,
          ),
      ]
  
      client.list_trials.assert_any_call(**{})
      client.list_trials.assert_any_call(NextToken="foo")
  
imports: from __future__ import absolute_import
  import botocore.exceptions
  import pytest
  import unittest.mock
  import datetime
  from unittest.mock import patch
  from sagemaker import Session
  from sagemaker.experiments import experiment
  from sagemaker.experiments._api_types import TrialSummary
label_desc: Use image node_id 12 for calling a global function with example usage: test_next_token(sagemaker_session, datetime_obj) without return types