code: def test_list(sagemaker_session):
      start_time = datetime.datetime.now(
          datetime.timezone.utc
      ) + datetime.timedelta(hours=1)
      end_time = datetime.datetime.now(
          datetime.timezone.utc
      ) + datetime.timedelta(hours=2)
      creation_time = datetime.datetime.now(
          datetime.timezone.utc
      ) + datetime.timedelta(hours=3)
      last_modified_time = datetime.datetime.now(
          datetime.timezone.utc
      ) + datetime.timedelta(hours=4)
  
      client = sagemaker_session.sagemaker_client
      client.list_trial_components.side_effect = [
          {
              "TrialComponentSummaries": [
                  {
                      "TrialComponentName": "A" + str(i),
                      "TrialComponentArn": "B" + str(i),
                      "DisplayName": "C" + str(i),
                      "SourceArn": "D" + str(i),
                      "Status": {
                          "PrimaryStatus": _TrialComponentStatusType.InProgress.value,
                          "Message": "E" + str(i),
                      },
                      "StartTime": start_time
                      + datetime.timedelta(hours=i),
                      "EndTime": end_time + datetime.timedelta(hours=i),
                      "CreationTime": creation_time
                      + datetime.timedelta(hours=i),
                      "LastModifiedTime": last_modified_time
                      + datetime.timedelta(hours=i),
                      "LastModifiedBy": {},
                  }
                  for i in range(10)
              ],
              "NextToken": "100",
          },
          {
              "TrialComponentSummaries": [
                  {
                      "TrialComponentName": "A" + str(i),
                      "TrialComponentArn": "B" + str(i),
                      "DisplayName": "C" + str(i),
                      "SourceArn": "D" + str(i),
                      "Status": {
                          "PrimaryStatus": _TrialComponentStatusType.InProgress.value,
                          "Message": "E" + str(i),
                      },
                      "StartTime": start_time
                      + datetime.timedelta(hours=i),
                      "EndTime": end_time + datetime.timedelta(hours=i),
                      "CreationTime": creation_time
                      + datetime.timedelta(hours=i),
                      "LastModifiedTime": last_modified_time
                      + datetime.timedelta(hours=i),
                      "LastModifiedBy": {},
                  }
                  for i in range(10, 20)
              ]
          },
      ]
  
      expected = [
          _api_types.TrialComponentSummary(
              trial_component_name="A" + str(i),
              trial_component_arn="B" + str(i),
              display_name="C" + str(i),
              source_arn="D" + str(i),
              status=_api_types.TrialComponentStatus(
                  primary_status=_TrialComponentStatusType.InProgress.value,
                  message="E" + str(i),
              ),
              start_time=start_time + datetime.timedelta(hours=i),
              end_time=end_time + datetime.timedelta(hours=i),
              creation_time=creation_time + datetime.timedelta(hours=i),
              last_modified_time=last_modified_time
              + datetime.timedelta(hours=i),
              last_modified_by={},
          )
          for i in range(20)
      ]
      result = list(
          _TrialComponent.list(
              sagemaker_session=sagemaker_session,
              source_arn="foo",
              sort_by="CreationTime",
              sort_order="Ascending",
          )
      )
  
      assert expected == result
      expected_calls = [
          unittest.mock.call(
              SortBy="CreationTime",
              SortOrder="Ascending",
              SourceArn="foo",
          ),
          unittest.mock.call(
              NextToken="100",
              SortBy="CreationTime",
              SortOrder="Ascending",
              SourceArn="foo",
          ),
      ]
      assert expected_calls == client.list_trial_components.mock_calls
  
imports: from __future__ import absolute_import
  import datetime
  import unittest.mock
  from unittest.mock import patch
  import botocore
  from sagemaker import Session
  from sagemaker.experiments import _api_types
  from sagemaker.experiments._api_types import TrialComponentSearchResult, Parent, _TrialComponentStatusType
  from sagemaker.experiments.trial_component import _TrialComponent
label_desc: Use image node_id 7 for calling a global function with example usage: test_list(sagemaker_session) without return types