code: def _auresize_before(audio_arr, size, channel_first):
      if not isinstance(audio_arr, np.ndarray):
          raise ValueError(
              "the input audio_arr for auresize must be numpy.ndarray."
          )
  
      if not isinstance(size, (list, tuple)):
          raise ValueError("size must be list or tuple")
  
      if len(size) != 2:
          raise ValueError("size must be (samples, channels) liked")
  
      if audio_arr.dtype not in [np.uint8, np.int16]:
          audio_arr = np.asarray(audio_arr, np.float32)
  
      if channel_first and len(audio_arr.shape) == 2:
          audio_arr = audio_arr.transpose((1, 0))
  
      return audio_arr
  
file_path: nnabla/python/src/nnabla/utils/audio_utils/common.py
imports: from __future__ import division, absolute_import
  import os
  import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: _auresize_before(audio_arr, size, channel_first) and returns: audio_arr