code: def _preprocess_sgm(line, is_sgm):
      """Preprocessing to strip tags in SGM files."""
      if not is_sgm:
          return line
      # In SGM files, remove <srcset ...>, <p>, <doc ...> lines.
      if line.startswith("<srcset") or line.startswith("</srcset"):
          return ""
      if line.startswith("<doc") or line.startswith("</doc"):
          return ""
      if line.startswith("<p>") or line.startswith("</p>"):
          return ""
      # Strip <seg> tags.
      line = line.strip()
      if line.startswith("<seg") and line.endswith("</seg>"):
          i = line.index(">")
          return line[i + 1 : -6]
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import gzip
  import os
  import tarfile
  import zipfile
  from tensor2tensor.data_generators import cleaner_en_xx
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import problem
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.utils import bleu_hook
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import mlperf_log
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: _preprocess_sgm(line, is_sgm) and returns: line, str, str, str, line