code: def test_list(artifact_objs, sagemaker_session):
      slack = datetime.timedelta(minutes=1)
      now = datetime.datetime.now(datetime.timezone.utc)
      artifact_names = [art.artifact_name for art in artifact_objs]
  
      for sort_order in ["Ascending", "Descending"]:
          artifact_names_listed = [
              artifact_listed.artifact_name
              for artifact_listed in artifact.Artifact.list(
                  created_after=now - slack,
                  created_before=now + slack,
                  sort_by="CreationTime",
                  sort_order=sort_order,
                  sagemaker_session=sagemaker_session,
              )
              if artifact_listed.artifact_name in artifact_names
          ]
  
      if sort_order == "Descending":
          artifact_names_listed = artifact_names_listed[::-1]
      assert artifact_names == artifact_names_listed
      # sanity check
      assert artifact_names
  
file_path: sagemaker-python-sdk/tests/integ/sagemaker/lineage/test_artifact.py
imports: from __future__ import absolute_import
  import datetime
  import logging
  import time
  import pytest
  from sagemaker.lineage import artifact
  from sagemaker.utils import retry_with_backoff
label_desc: Use image node_id 5 for calling a global function with example usage: test_list(artifact_objs, sagemaker_session) without return types