code: def close(self):
          
          try:
              logger.debug('%s - closing', self._resource_name,
                           extra=self._logging_extra)
              self.before_close()
              self.visalib.close(self.session)
              logger.debug('%s - is closed', self._resource_name,
                           extra=self._logging_extra)
              self.session = None
          except errors.InvalidSession:
              pass
docs: Closes the VISA session and marks the handle as invalid.