code: def test_list(sagemaker_session):
      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)
  
      sagemaker_session.sagemaker_client.list_contexts.side_effect = [
          {
              "ContextSummaries": [
                  {
                      "ContextName": "A" + str(i),
                      "ContextArn": "B" + str(i),
                      "Source": {
                          "SourceUri": "test-source-uri" + str(i),
                          "SourceType": "test-source-type" + str(i),
                      },
                      "ContextType": "test-context-type",
                      "CreationTime": creation_time
                      + datetime.timedelta(hours=i),
                      "LastModifiedTime": last_modified_time
                      + datetime.timedelta(hours=i),
                      "LastModifiedBy": {},
                  }
                  for i in range(10)
              ],
              "NextToken": "100",
          },
          {
              "ContextSummaries": [
                  {
                      "ContextName": "A" + str(i),
                      "ContextArn": "B" + str(i),
                      "Source": {
                          "SourceUri": "test-source-uri" + str(i),
                          "SourceType": "test-source-type" + str(i),
                      },
                      "ContextType": "test-context-type",
                      "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.ContextSummary(
              context_name="A" + str(i),
              context_arn="B" + str(i),
              source=_api_types.ContextSource(
                  source_uri="test-source-uri" + str(i),
                  source_type="test-source-type" + str(i),
              ),
              context_type="test-context-type",
              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(
          context.Context.list(
              source_uri="foo",
              sagemaker_session=sagemaker_session,
              sort_by="CreationTime",
              sort_order="Ascending",
          )
      )
  
      assert expected == result
      expected_calls = [
          unittest.mock.call(
              SortBy="CreationTime",
              SortOrder="Ascending",
              SourceUri="foo",
          ),
          unittest.mock.call(
              NextToken="100",
              SortBy="CreationTime",
              SortOrder="Ascending",
              SourceUri="foo",
          ),
      ]
      assert (
          expected_calls
          == sagemaker_session.sagemaker_client.list_contexts.mock_calls
      )
  
imports: from __future__ import absolute_import
  import datetime
  import unittest.mock
  import pytest
  from sagemaker.lineage import context, _api_types
  from sagemaker.lineage.action import Action
  from sagemaker.lineage.lineage_trial_component import LineageTrialComponent
  from sagemaker.lineage.query import LineageQueryDirectionEnum
label_desc: Use image node_id 7 for calling a global function with example usage: test_list(sagemaker_session) without return types