nodes: 0, module; 1, function_definition; 2, function_name:getLinkedAnalyses; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, comment:# Fetch the linked Analyses UIDs; 8, expression_statement; 9, comment:# fetch the objects by UID and handle nonexisting UIDs gracefully; 10, expression_statement; 11, comment:# filter out None values (nonexisting UIDs); 12, expression_statement; 13, comment:# sort by physical path, so that attachments coming from an AR with a; 14, comment:# higher "-Rn" suffix get sorted correctly.; 15, comment:# N.B. the created date is the same, hence we can not use it; 16, return_statement; 17, comment:"""Lookup linked Analyses
  
          :returns: sorted list of ANs, where the latest AN comes first
          """; 18, assignment; 19, assignment; 20, assignment; 21, call; 22, identifier:refs; 23, call; 24, identifier:ans; 25, call; 26, identifier:ans; 27, call; 28, identifier:sorted; 29, argument_list; 30, identifier:get_backreferences; 31, argument_list; 32, identifier:map; 33, argument_list; 34, identifier:filter; 35, argument_list; 36, identifier:ans; 37, keyword_argument; 38, keyword_argument; 39, identifier:self; 40, string:"AnalysisAttachment"; 41, lambda; 42, identifier:refs; 43, None; 44, identifier:ans; 45, identifier:key; 46, attribute; 47, identifier:reverse; 48, True; 49, lambda_parameters; 50, call; 51, identifier:api; 52, identifier:get_path; 53, identifier:uid; 54, attribute; 55, argument_list; 56, identifier:api; 57, identifier:get_object_by_uid; 58, identifier:uid; 59, None
code: def getLinkedAnalyses(self):
          """Lookup linked Analyses
  
          :returns: sorted list of ANs, where the latest AN comes first
          """
          # Fetch the linked Analyses UIDs
          refs = get_backreferences(self, "AnalysisAttachment")
          # fetch the objects by UID and handle nonexisting UIDs gracefully
          ans = map(lambda uid: api.get_object_by_uid(uid, None), refs)
          # filter out None values (nonexisting UIDs)
          ans = filter(None, ans)
          # sort by physical path, so that attachments coming from an AR with a
          # higher "-Rn" suffix get sorted correctly.
          # N.B. the created date is the same, hence we can not use it
          return sorted(ans, key=api.get_path, reverse=True)