nodes: 0, module; 1, function_definition; 2, function_name:getLinkedRequests; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 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 Analysis Requests
  
          :returns: sorted list of ARs, where the latest AR comes first
          """; 18, assignment; 19, assignment; 20, assignment; 21, assignment; 22, call; 23, identifier:rc; 24, call; 25, identifier:refs; 26, call; 27, identifier:ars; 28, call; 29, identifier:ars; 30, call; 31, identifier:sorted; 32, argument_list; 33, attribute; 34, argument_list; 35, attribute; 36, argument_list; 37, identifier:map; 38, argument_list; 39, identifier:filter; 40, argument_list; 41, identifier:ars; 42, keyword_argument; 43, keyword_argument; 44, identifier:api; 45, identifier:get_tool; 46, string:"reference_catalog"; 47, identifier:rc; 48, identifier:getBackReferences; 49, identifier:self; 50, string:"AnalysisRequestAttachment"; 51, lambda; 52, identifier:refs; 53, None; 54, identifier:ars; 55, identifier:key; 56, attribute; 57, identifier:reverse; 58, True; 59, lambda_parameters; 60, call; 61, identifier:api; 62, identifier:get_path; 63, identifier:ref; 64, attribute; 65, argument_list; 66, identifier:api; 67, identifier:get_object_by_uid; 68, attribute; 69, None; 70, identifier:ref; 71, identifier:sourceUID
code: def getLinkedRequests(self):
          """Lookup linked Analysis Requests
  
          :returns: sorted list of ARs, where the latest AR comes first
          """
          rc = api.get_tool("reference_catalog")
          refs = rc.getBackReferences(self, "AnalysisRequestAttachment")
          # fetch the objects by UID and handle nonexisting UIDs gracefully
          ars = map(lambda ref: api.get_object_by_uid(ref.sourceUID, None), refs)
          # filter out None values (nonexisting UIDs)
          ars = filter(None, ars)
          # 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(ars, key=api.get_path, reverse=True)