code: def generate_artifacts(sagemaker_session):
      artifacts = []  # for resource cleanup
  
      try:
          # Search returns 10 results by default. Add 20 trials to verify pagination.
          for i in range(20):
              artifact_name = "experiment-" + str(uuid.uuid4())
              obj = artifact.Artifact.create(
                  artifact_name="SDKAnalyticsIntegrationTest",
                  artifact_type="SDKAnalyticsIntegrationTest",
                  source_uri=artifact_name,
                  properties={"k1": "v1"},
                  sagemaker_session=sagemaker_session,
              )
              artifacts.append(obj)
              logging.info(f"Created {artifact_name}")
              time.sleep(1)
  
          # wait for search to get updated
          time.sleep(15)
          yield
      finally:
          _delete_resources(artifacts)
  
file_path: sagemaker-python-sdk/tests/integ/test_artifact_analytics.py
imports: from __future__ import absolute_import
  import time
  import uuid
  from contextlib import contextmanager
  import pytest
  import botocore
  from sagemaker.analytics import ArtifactAnalytics
  from sagemaker.lineage import artifact
  import logging
  from sagemaker.session import Session
label_desc: Use image node_id 2 for calling a global function with example usage: generate_artifacts(sagemaker_session) without return types