code: def build_err_msg(
      arrays,
      err_msg,
      header="Geometries are not equal:",
      verbose=True,
      names=("x", "y"),
      precision=8,
  ):
      msg = ["\n" + header]
      if err_msg:
          if err_msg.find("\n") == -1 and len(err_msg) < 79 - len(
              header
          ):
              msg = [msg[0] + " " + err_msg]
          else:
              msg.append(err_msg)
      if verbose:
          for i, a in enumerate(arrays):
              if isinstance(a, np.ndarray):
                  # precision argument is only needed if the objects are ndarrays
                  r_func = partial(np.array_repr, precision=precision)
              else:
                  r_func = repr
  
              try:
                  r = r_func(a)
              except Exception as exc:
                  r = f"[repr failed for <{type(a).__name__}>: {exc}]"
              if r.count("\n") > 3:
                  r = "\n".join(r.splitlines()[:3])
                  r += "..."
              msg.append(f" {names[i]}: {r}")
      return "\n".join(msg)
  
file_path: shapely/shapely/testing.py
imports: from functools import partial
  import numpy
  import shapely
label_desc: Use image node_id 6 for calling a global function with example usage: build_err_msg(arrays, err_msg, header, verbose, names, precision) and returns: str