code: def get_parent(self, context):
          
          parent = self.parent_name.resolve(context)
          # If parent is a template object, just return it.
          if hasattr(parent, "render"):
              return parent
          template = self.find_template(parent, context)
          for node in template.nodelist:
              if (isinstance(node, ExtendsNode) and
                      node.parent_name.resolve(context) == parent):
                  return self.find_template(parent, context, peeking=True)
          return template
docs: Load the parent template using our own ``find_template``, which
          will cause its absolute path to not be used again. Then peek at
          the first node, and if its parent arg is the same as the
          current parent arg, we know circular inheritance is going to
          occur, in which case we try and find the template again, with
          the absolute directory removed from the search list.