code: def close(self):
          
          self.clearException()
          try:
              if self._isOpen:
                  logger.debug("Closing {}".format(self))
                  self._closeResources()
                  self._isOpen = False
              else:
                  logger.debug("Resources already closed (ignored): {}".format(self))
  
              if self.model:
                  self.model.sigItemChanged.emit(self)
              else:
                  logger.warning("Model not set yet: {}".format(self))
  
          except Exception as ex:
              if DEBUGGING:
                  raise
              logger.error("Error during tree item close: {}".format(ex))
              self.setException(ex)
docs: Closes underlying resources and un-sets the isOpen flag.
              Any exception that occurs is caught and put in the exception property.
              This method calls _closeResources, which does the actual resource cleanup. Descendants
              should typically override the latter instead of this one.