code: def get_parent_ar(self, ar):
          
          parent = ar.getParentAnalysisRequest()
  
          # Return immediately if we have no parent
          if parent is None:
              return None
  
          # Walk back the chain until we reach the source AR
          while True:
              pparent = parent.getParentAnalysisRequest()
              if pparent is None:
                  break
              # remember the new parent
              parent = pparent
  
          return parent
docs: Returns the parent AR