code: def test_tags(action_obj, sagemaker_session):
      tags = [{"Key": "foo1", "Value": "bar1"}]
      action_obj.set_tags(tags)
  
      while True:
          actual_tags = sagemaker_session.sagemaker_client.list_tags(
              ResourceArn=action_obj.action_arn
          )["Tags"]
          if actual_tags:
              break
          time.sleep(5)
      # When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
      # length of actual tags will be greater than 1
      assert len(actual_tags) > 0
      assert [actual_tags[-1]] == tags
  
file_path: sagemaker-python-sdk/tests/integ/sagemaker/lineage/test_action.py
imports: from __future__ import absolute_import
  import datetime
  import logging
  import time
  import pytest
  from sagemaker.lineage import action
  from sagemaker.lineage.query import LineageQueryDirectionEnum
label_desc: Use image node_id 7 for calling a global function with example usage: test_tags(action_obj, sagemaker_session) without return types