code: def do_execute(self):
          
          if isinstance(self.input.payload, Instance):
              inst = self.input.payload
              data = Instances.template_instances(inst.dataset, 1)
              data.add_instance(inst)
          else:
              inst = None
              data = self.input.payload
          relname = data.relationname
          keep = self.resolve_option("keep_relationname")
  
          if inst is None:
              if (self._filter is None) or self._header.equal_headers(data) is not None:
                  self._header = Instances.template_instances(data)
                  self._filter = filters.Filter.make_copy(self.resolve_option("setup"))
                  self._filter.inputformat(data)
              filtered = self._filter.filter(data)
              if keep:
                  filtered.relationname = relname
              self._output.append(Token(filtered))
          else:
              if (self._filter is None) or self._header.equal_headers(data) is not None:
                  self._header = Instances.template_instances(data)
                  self._filter = filters.Filter.make_copy(self.resolve_option("setup"))
                  self._filter.inputformat(data)
                  filtered = self._filter.filter(data)
                  if keep:
                      filtered.relationname = relname
                  self._output.append(Token(filtered.get_instance(0)))
              else:
                  self._filter.input(inst)
                  self._filter.batch_finished()
                  filtered = self._filter.output()
                  if keep:
                      filtered.dataset.relationname = relname
                  self._output.append(Token(filtered))
  
          return None
docs: The actual execution of the actor.
  
          :return: None if successful, otherwise error message
          :rtype: str