class_docstr: subclass of repr.Repr that limits the resulting size of repr()
  and includes information on exceptions raised during the call.
class_docstr_tok: ["subclass","of","repr.Repr","that","limits","the","resulting","size","of","repr","(",")","and","includes","information","on","exceptions","raised","during","the","call","."]
code: def repr_unicode(self, x, level):
      # Strictly speaking wrong on narrow builds
      def repr(u):
          if "'" not in u:
              return "'%s'" % u
          elif '"' not in u:
              return '"%s"' % u
          else:
              return "'%s'" % u.replace("'", r"\'")
  
      s = repr(x[: self.maxstring])
      if len(s) > self.maxstring:
          i = max(0, (self.maxstring - 3) // 2)
          j = max(0, self.maxstring - 3 - i)
          s = repr(x[:i] + x[len(x) - j :])
          s = s[:i] + "..." + s[len(s) - j :]
      return s
  
file_path: catboost/contrib/python/pytest/py2/_pytest/_io/saferepr.py
imports: import pprint
  from six.moves import reprlib
label_desc: Use image node_id 2 for calling the SafeRepr obj's underlying member method code with example usage: obj.repr_unicode(x, level) and returns: s, unknown, unknown, unknown