code: def test_list_by_type(artifact_objs, sagemaker_session):
      slack = datetime.timedelta(
          minutes=CREATION_VERIFICATION_WINDOW_MINUTES
      )
      now = datetime.datetime.now(datetime.timezone.utc)
      expected_name = list(
          filter(
              lambda x: x.artifact_type == "SDKIntegrationTestType2",
              artifact_objs,
          )
      )[0].artifact_name
      artifact_names = [art.artifact_name for art in artifact_objs]
  
      artifact_names_listed = [
          artifact_listed.artifact_name
          for artifact_listed in artifact.Artifact.list(
              created_after=now - slack,
              artifact_type="SDKIntegrationTestType2",
              sagemaker_session=sagemaker_session,
          )
          if artifact_listed.artifact_name in artifact_names
      ]
  
      assert len(artifact_names_listed) == 1
      assert artifact_names_listed[0] == expected_name
  
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 6 for calling a global function with example usage: test_list_by_type(artifact_objs, sagemaker_session) without return types