code: def traverse_graph_back(start_arn, sagemaker_session):
      def visit(arn, visited: set):
          visited.add(arn)
          associations = (
              sagemaker_session.sagemaker_client.list_associations(
                  DestinationArn=arn
              )["AssociationSummaries"]
          )
          for association in associations:
              if association["SourceArn"] not in visited:
                  ret.append(association)
                  visit(association["SourceArn"], visited)
  
          return ret
  
      ret = []
      return visit(start_arn, set())
  
file_path: sagemaker-python-sdk/tests/integ/sagemaker/lineage/helpers.py
imports: from __future__ import absolute_import
  import uuid
  import time
  from datetime import datetime
label_desc: Use image node_id 3 for calling a global function with example usage: traverse_graph_back(start_arn, sagemaker_session) and returns: visit, ret