code: def _shorten(s, maxlen):
      # Shortens the string down to maxlen, by replacing the middle part with
      # a 3-dots string '...'.
      ellipsis = "..."
      if len(s) <= maxlen:
          return s
      n1 = (maxlen - len(ellipsis)) // 2
      n2 = maxlen - len(ellipsis) - n1
      s = s[:n1] + ellipsis + s[-n2:]
      assert len(s) == maxlen
      return s
  
file_path: cupy/cupy/testing/_parameterized.py
imports: import itertools
  import types
  import unittest
  from cupy.testing import _bundle
  from cupy.testing import _pytest_impl
label_desc: Use image node_id 2 for calling a global function with example usage: _shorten(s, maxlen) and returns: s, s