code: def avg(cp, size):
      _check_params(len(cp), size)
      sample_count = _sample_count(cp, size)
      if sample_count == 0:
          return 0
      return sum(_get_samples(cp, size)) / sample_count
  
imports: import math
  import struct
  from ctypes import create_string_buffer
label_desc: Use image node_id 15 for calling a global function with example usage: avg(cp, size) and returns: unknown, int