code: def write(self, session, data):
          
  
          # from the session handle, dispatch to the write method of the session object.
          try:
              ret = self.sessions[session].write(data)
          except KeyError:
              return 0, StatusCode.error_invalid_object
  
          if ret[1] < 0:
              raise errors.VisaIOError(ret[1])
  
          return ret
docs: Writes data to device or interface synchronously.
  
          Corresponds to viWrite function of the VISA library.
  
          :param session: Unique logical identifier to a session.
          :param data: data to be written.
          :type data: str
          :return: Number of bytes actually transferred, return value of the library call.
          :rtype: int, VISAStatus