code: def short_repr(x, n=64):
      """A shortened repr of ``x`` which is guaranteed to be ``unicode``::
  
      >>> short_repr("foo")
      u"foo"
      >>> short_repr("123456789", n=4)
      u"12...89"
      """
  
      x_repr = to_text(repr(x))
      if len(x_repr) > n:
          x_repr = (
              x_repr[: n // 2] + "..." + x_repr[len(x_repr) - n // 2 :]
          )
      return x_repr
  
imports: import re
  import sys
  import inspect
  import warnings
  from typing import Iterable
  from functools import wraps
  from types import MethodType
  from collections import namedtuple
  from unittest import TestCase
label_desc: Use image node_id 7 for calling a global function with example usage: short_repr(x, n) and returns: x_repr