code: def cross(cp, size):
      _check_params(len(cp), size)
  
      crossings = 0
      last_sample = 0
      for sample in _get_samples(cp, size):
          if sample <= 0 < last_sample or sample >= 0 > last_sample:
              crossings += 1
          last_sample = sample
  
      return crossings
  
imports: import math
  import struct
  from ctypes import create_string_buffer
label_desc: Use image node_id 23 for calling a global function with example usage: cross(cp, size) and returns: crossings