code: def concat_points_with_nan(
      list_of_points: list[cpy.PointArray],
  ) -> cpy.PointArray:
      """Concatenate a list of points into a single point array with NaNs used to separate each line."""
      if not list_of_points:
          raise ValueError(
              "Empty list passed to concat_points_with_nan"
          )
  
      if len(list_of_points) == 1:
          return list_of_points[0]
      else:
          nan_spacer = np.full((1, 2), np.nan, dtype=point_dtype)
          list_of_points = [
              list_of_points[0],
              *list(
                  chain(*((nan_spacer, x) for x in list_of_points[1:]))
              ),
          ]
          return concat_points(list_of_points)
  
imports: from __future__ import annotations
  from itertools import chain
  from typing import TYPE_CHECKING
  import numpy
  from contourpy.typecheck import check_code_array, check_offset_array, check_point_array
  from contourpy.types import CLOSEPOLY, LINETO, MOVETO, code_dtype, offset_dtype, point_dtype
label_desc: Use image node_id 11 for calling a global function with example usage: concat_points_with_nan(list_of_points) and returns: list_of_points, concat_points