code: def _text_repr(text, max_len=1000):
      
      if text is None:
          text_repr = 'None'
      elif len(text) > max_len:
          text_repr = repr(text[0:max_len]) + '...'
      else:
          text_repr = repr(text)
      return text_repr
docs: Return the input text as a Python string representation (i.e. using repr())
      that is limited to a maximum length.