code: def split_codes_by_offsets(
      codes: cpy.CodeArray, offsets: cpy.OffsetArray
  ) -> list[cpy.CodeArray]:
      """Split a code array at locations specified by an offset array into a list of code arrays."""
      check_code_array(codes)
      check_offset_array(offsets)
  
      if len(offsets) > 2:
          return np.split(codes, offsets[1:-1])
      else:
          return [codes]
  
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 18 for calling a global function with example usage: split_codes_by_offsets(codes, offsets) and returns: np, list