code: def test_list(
      mock_tc_search,
      mock_tc_list,
      mock_tc_load,
      run_obj,
      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)
      tc_list_len = 20
      tc_list_len_half = int(tc_list_len / 2)
      mock_tc_search.side_effect = [
          [
              TrialComponentSearchResult(
                  trial_component_name=Run._generate_trial_component_name(
                      "a" + str(i), TEST_EXP_NAME
                  ),
                  trial_component_arn="b" + str(i),
                  display_name="C" + str(i),
                  creation_time=creation_time
                  + datetime.timedelta(hours=i),
                  last_modified_time=last_modified_time
                  + datetime.timedelta(hours=i),
                  last_modified_by={},
                  tags=[RUN_TC_TAG] if i < tc_list_len_half else None,
              )
          ]
          for i in range(tc_list_len)
      ]
      mock_tc_list.return_value = [
          TrialComponentSummary(
              trial_component_name=Run._generate_trial_component_name(
                  "A" + str(i), TEST_EXP_NAME_MIXED_CASE
              ),
              trial_component_arn="b" + str(i),
              display_name="C" + str(i),
              source_arn="D" + str(i),
              status=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(tc_list_len)
      ]
      mock_tc_load.side_effect = [
          (
              _TrialComponent(
                  trial_component_name=Run._generate_trial_component_name(
                      "a" + str(i), TEST_EXP_NAME_MIXED_CASE
                  ),
                  trial_component_arn="b" + str(i),
                  display_name="C" + str(i),
                  source_arn="D" + str(i),
                  status=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={},
              ),
              True,
          )
          for i in range(tc_list_len_half)
      ]
  
      run_list = list_runs(
          experiment_name=TEST_EXP_NAME_MIXED_CASE,
          sort_by=SortByType.CREATION_TIME,
          sort_order=SortOrderType.ASCENDING,
          sagemaker_session=sagemaker_session,
      )
  
      mock_tc_list.assert_called_once_with(
          experiment_name=TEST_EXP_NAME_MIXED_CASE,
          created_before=None,
          created_after=None,
          sort_by="CreationTime",
          sort_order="Ascending",
          sagemaker_session=sagemaker_session,
          max_results=None,
          next_token=None,
      )
      assert len(run_list) == tc_list_len_half
      for i in range(tc_list_len_half):
          run = run_list[i]
          assert run.experiment_name == TEST_EXP_NAME
          assert run.run_name == "a" + str(i)
          assert run._experiment
          assert run._trial
          assert isinstance(run._trial_component, _TrialComponent)
          assert (
              run._trial_component.trial_component_name
              == Run._generate_trial_component_name(
                  "a" + str(i), TEST_EXP_NAME
              )
          )
          assert run._in_load is False
          assert run._inside_load_context is False
          assert run._inside_init_context is False
          assert run._artifact_uploader
          assert run._lineage_artifact_tracker
          assert run._metrics_manager
  
imports: from __future__ import absolute_import
  import datetime
  import unittest
  import cloudpickle
  from math import inf, nan
  from unittest.mock import patch, Mock, MagicMock
  import dateutil
  import pytest
  from sagemaker.experiments import _environment, SortOrderType
  from sagemaker.experiments._api_types import TrialComponentArtifact, TrialComponentSummary, TrialComponentStatus, _TrialComponentStatusType, TrialComponentSearchResult
  from sagemaker.experiments.experiment import Experiment
  from sagemaker.experiments.run import TRIAL_NAME_TEMPLATE, MAX_RUN_TC_ARTIFACTS_LEN, MAX_NAME_LEN_IN_BACKEND, EXPERIMENT_NAME, RUN_NAME, TRIAL_NAME, DELIMITER, RUN_TC_TAG, SortByType
  from sagemaker.experiments import Run, load_run, list_runs
  from sagemaker.experiments.trial import _Trial
  from sagemaker.experiments.trial_component import _TrialComponent
  from sagemaker.experiments._helper import _DEFAULT_ARTIFACT_PREFIX
  from tests.unit.sagemaker.experiments.helpers import mock_trial_load_or_create_func, mock_tc_load_or_create_func, TEST_EXP_NAME, TEST_EXP_NAME_MIXED_CASE, TEST_RUN_NAME, TEST_EXP_DISPLAY_NAME, TEST_RUN_DISPLAY_NAME, TEST_ARTIFACT_BUCKET, TEST_ARTIFACT_PREFIX, TEST_TAGS
label_desc: Use image node_id 43 for calling a global function with example usage: test_list(mock_tc_search, mock_tc_list, mock_tc_load, run_obj, sagemaker_session) without return types