code: def test_upstream_trials(sagemaker_session):
      sagemaker_session.sagemaker_client.query_lineage.return_value = {
          "Vertices": [
              {
                  "Arn": "B" + str(i),
                  "Type": "DataSet",
                  "LineageType": "Artifact",
              }
              for i in range(10)
          ],
          "Edges": [
              {
                  "SourceArn": "arn1",
                  "DestinationArn": "arn2",
                  "AssociationType": "Produced",
              }
          ],
      }
      sagemaker_session.sagemaker_client.search.return_value = {
          "Results": [
              {
                  "TrialComponent": {
                      "TrialComponentName": "tc-1",
                      "TrialComponentArn": "arn::tc-1",
                      "DisplayName": "TC1",
                      "Parents": [{"TrialName": "test-trial-name"}],
                  }
              }
          ]
      }
  
      obj = artifact.Artifact(
          sagemaker_session=sagemaker_session,
          artifact_arn="test-arn",
          artifact_name="foo",
          properties={"k1": "v1", "k2": "v2"},
          properties_to_remove=["r1"],
      )
  
      result = obj.upstream_trials()
  
      expected_trials = ["test-trial-name"]
  
      assert expected_trials == result
  
      expected_calls = [
          unittest.mock.call(
              Direction="Ascendants",
              Filters={"LineageTypes": ["TrialComponent"]},
              IncludeEdges=False,
              MaxDepth=10,
              StartArns=["test-arn"],
          ),
      ]
      assert (
          expected_calls
          == sagemaker_session.sagemaker_client.query_lineage.mock_calls
      )
  
file_path: sagemaker-python-sdk/tests/unit/sagemaker/lineage/test_artifact.py
imports: from __future__ import absolute_import
  import datetime
  import unittest.mock
  from sagemaker.lineage import artifact, _api_types
label_desc: Use image node_id 14 for calling a global function with example usage: test_upstream_trials(sagemaker_session) without return types