code: def test_set_tag(sagemaker_session):
      sagemaker_session.sagemaker_client.create_action.return_value = {
          "ActionArn": "action-arn",
      }
      obj = action.Action.create(
          action_name="foo",
          source_uri="bar",
          sagemaker_session=sagemaker_session,
      )
      tag = {"Key": "foo", "Value": "bar"}
      sagemaker_session.sagemaker_client.add_tags.return_value = {
          "Tags": [tag]
      }
      obj.set_tag(tag=tag)
  
      sagemaker_session.sagemaker_client.add_tags.assert_called_with = {
          "ResourceArn": "action-arn",
          "Tags": [{"Key": "foo", "Value": "bar"}],
      }
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/lineage/test_action.py
imports: from __future__ import absolute_import
  import datetime
  import unittest.mock
  from sagemaker.lineage import action, _api_types
  from sagemaker.lineage._api_types import ActionSource
label_desc: Use image node_id 2 for calling a global function with example usage: test_set_tag(sagemaker_session) without return types