code: def do_execute(self):
          
          result = None
  
          data = self.input.payload
          if isinstance(self._input.payload, Instance):
              inst = self.input.payload
              data = inst.dataset
          elif isinstance(self.input.payload, Instances):
              data = self.input.payload
              inst = None
  
          append = True
          if self._header is None or (self._header.equal_headers(data) is not None):
              self._header = Instances.template_instances(data, 0)
              outstr = str(data)
              append = False
          elif inst is not None:
              outstr = str(inst)
          else:
              outstr = str(data)
  
          f = None
          try:
              if append:
                  f = open(str(self.resolve_option("output")), "a")
              else:
                  f = open(str(self.resolve_option("output")), "w")
              f.write(outstr)
              f.write("\n")
          except Exception as e:
              result = self.full_name + "\n" + traceback.format_exc()
          finally:
              if f is not None:
                  f.close()
          return result
docs: The actual execution of the actor.
  
          :return: None if successful, otherwise error message
          :rtype: str