code: def ResetHandler(self, name):
          '''
          Method which assigns handler to the tag encountered before the current, or else
          sets it to None
  
          :param name: name of the latest tag
  
          :return:
          '''
          if name in self.tags:
              if len(self.tags) > 1:
                  key = len(self.tags) - 2
                  self.handler = None
                  while key >= 0:
                      if self.tags[key] in self.structure:
                          self.handler = self.structure[self.tags[key]]
                          break
                      key -= 1
  
              else:
                  self.handler = Nonf ResetHandler(self, name):
          '''
          Method which assigns handler to the tag encountered before the current, or else
          sets it to None
  
          :param name: name of the latest tag
  
          :return:
          '''
          if name in self.tags:
              if len(self.tags) > 1:
                  key = len(self.tags) - 2
                  self.handler = None
                  while key >= 0:
                      if self.tags[key] in self.structure:
                          self.handler = self.structure[self.tags[key]]
                          break
                      key -= 1
  
              else:
                  self.handler = None
docs: Method which assigns handler to the tag encountered before the current, or else
          sets it to None
  
          :param name: name of the latest tag
  
          :return: