class_docstr: An iterator dedicated to ParallelCorpus.
  
  Args:
      corpus (ParallelCorpus): corpus to iterate;
      transform (TransformPipe): transforms to be applied to corpus;
      skip_empty_level (str): security level when encouter empty line;
      stride (int): iterate corpus with this line stride;
      offset (int): iterate corpus with this line offset.
class_docstr_tok: ["An","iterator","dedicated","to","ParallelCorpus",".","Args",":","corpus","(","ParallelCorpus",")",":","corpus","to","iterate",";","transform","(","TransformPipe",")",":","transforms","to","be","applied","to","corpus",";","skip_empty_level","(","str",")",":","security","level","when","encouter","empty","line",";","stride","(","int",")",":","iterate","corpus","with","this","line","stride",";","offset","(","int",")",":","iterate","corpus","with","this","line","offset","."]
code: def _process(self, stream):
      for i, example in enumerate(stream):
          example["src"] = example["src"].strip("\n").split()
          example["src_original"] = (
              example["src_original"].strip("\n").split()
          )
          if "src_feats" in example:
              example["src_feats"] = [
                  feat.strip("\n").split()
                  for feat in example["src_feats"]
              ]
          line_number = i * self.stride + self.offset
          example["cid_line_number"] = line_number
          example["cid"] = self.cid
          if "align" in example:
              example["align"] = example["align"].strip("\n").split()
          if example["tgt"] is not None:
              example["tgt"] = example["tgt"].strip("\n").split()
              example["tgt_original"] = (
                  example["tgt_original"].strip("\n").split()
              )
              if (
                  len(example["src"]) == 0
                  or len(example["tgt"]) == 0
                  or ("align" in example and example["align"] == 0)
              ):
                  # empty example: skip
                  empty_msg = (
                      f"Empty line  in {self.cid}#{line_number}."
                  )
                  if self.skip_empty_level == "error":
                      raise IOError(empty_msg)
                  elif self.skip_empty_level == "warning":
                      logger.warning(empty_msg)
                  if (
                      len(example["src"]) == 0
                      and len(example["tgt"]) == 0
                  ):
                      yield (example, self.transform, self.cid)
                  continue
          yield (example, self.transform, self.cid)
      report_msg = self.transform.stats()
      if report_msg != "":
          logger.info(
              "* Transform statistics for {}({:.2f}%):\n{}\n".format(
                  self.cid, 100 / self.stride, report_msg
              )
          )
  
imports: import os
  from onmt.utils.logging import logger
  from onmt.constants import CorpusName, CorpusTask
  from onmt.transforms import TransformPipe
  from onmt.inputters.text_utils import process, parse_features, append_features_to_text
  from contextlib import contextmanager
  import itertools
label_desc: Use image node_id 2 for calling the ParallelCorpusIterator obj's underlying member method code with example usage: obj._process(stream) without return types