code: def truncate(self, id1, id2, seqlen):
      len1 = len(id1)
      len2 = len(id2)
      half = seqlen // 2
      if len1 > len2:
          len1_truncated, len2_truncated = max(
              half, seqlen - len2
          ), min(half, len2)
      else:
          len1_truncated, len2_truncated = min(
              half, seqlen - len1
          ), max(half, seqlen - len1)
      return id1[:len1_truncated], id2[:len2_truncated]
  
file_path: PaddleHub/modules/text/text_generation/reading_pictures_writing_poems_for_midautumn/MidAutumnPoetry/model/tokenizing_ernie.py
imports: import six
  import re
  import logging
  from functools import partial
  import numpy
  import io
label_desc: Use image node_id 4 for calling the ErnieTokenizer obj's underlying member method code with example usage: obj.truncate(id1, id2, seqlen) and returns: id1,  id2