code: def _ellipsize(s: str, maxsize: int) -> str:
      if len(s) > maxsize:
          i = max(0, (maxsize - 3) // 2)
          j = max(0, maxsize - 3 - i)
          return s[:i] + "..." + s[len(s) - j :]
      return s
  
file_path: pytest/src/_pytest/_io/saferepr.py
imports: import pprint
  import reprlib
  from typing import Optional
label_desc: Use image node_id 3 for calling a global function with example usage: _ellipsize(s, maxsize) and returns: s, unknown