code: def _dump_to_pages(dump):
      """Extract pages from an xml dump.
  
      Args:
        dump: a unicode string
      Returns:
        a list of unicode strings
      """
      pos = 0
      ret = []
      start_tag = "<page>\n"
      end_tag = "</page>\n"
      while True:
          start_pos = dump.find(start_tag, pos)
          if start_pos == -1:
              break
          start_pos += len(start_tag)
          end_pos = dump.find(end_tag, start_pos)
          if end_pos == -1:
              break
          ret.append(dump[start_pos:end_pos])
          pos = end_pos + len(end_tag)
      return ret
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import subprocess
  import numpy
  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 registry
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: _dump_to_pages(dump) and returns: ret