code: def offsets_from_codes(codes: cpy.CodeArray) -> cpy.OffsetArray:
      """Determine offsets from codes using locations of MOVETO codes."""
      check_code_array(codes)
  
      return np.append(
          np.nonzero(codes == MOVETO)[0], len(codes)
      ).astype(offset_dtype)
  
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 13 for calling a global function with example usage: offsets_from_codes(codes) and returns: np