code: def reverse(cp, size):
      _check_params(len(cp), size)
      sample_count = _sample_count(cp, size)
  
      result = create_string_buffer(len(cp))
      for i, sample in enumerate(_get_samples(cp, size)):
          _put_sample(result, size, sample_count - i - 1, sample)
  
      return result.raw
  
imports: import math
  import struct
  from ctypes import create_string_buffer
label_desc: Use image node_id 29 for calling a global function with example usage: reverse(cp, size) and returns: result