code: def clear(self, session):
          
          try:
              sess = self.sessions[session]
          except KeyError:
              return constants.StatusCode.error_invalid_object
          return sess.clear()
docs: Clears a device.
  
          Corresponds to viClear function of the VISA library.
  
          :param session: Unique logical identifier to a session.
          :return: return value of the library call.
          :rtype: :class:`pyvisa.constants.StatusCode`