code: def mark_finished_req(self, eos_id, engine_max_output_len):
      has_new_finish = False
      for req in self.reqs:
          if req.stop_sequences_matched():
              req.has_generate_finished = True
              has_new_finish = True
          if len(req.output_ids) >= engine_max_output_len:
              req.has_generate_finished = True
              has_new_finish = True
          if (
              req.output_ids[-1] == eos_id
              and req.sample_params.ignore_eos == False
          ):
              req.has_generate_finished = True
              has_new_finish = True
          if len(req.output_ids) >= req.max_output_len or req.aborted:
              req.has_generate_finished = True
              has_new_finish = True
      return has_new_finish
  
imports: from typing import Dict, List, Tuple
  from .sampling_params import SamplingParams
label_desc: Use image node_id 5 for calling the Batch obj's underlying member method code with example usage: obj.mark_finished_req(eos_id, engine_max_output_len) and returns: has_new_finish