code: def interior(array, channel_first):
      array = np.array(array)
      channel_dim = 0 if channel_first else len(array.shape) - 1
      r = []
      for d in range(len(array.shape)):
          if d == channel_dim or array.shape[d] <= 2:
              r.append(slice(array.shape[d]))
          else:
              r.append(slice(1, -1))
      return array[tuple(r)]
  
imports: import cv2
  import functools
  import math
  import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.types
  import os.path
  from nvidia.dali import Pipeline, pipeline_def
  from nvidia.dali.data_node import DataNode
  from test_utils import check_batch, get_dali_extra_path, as_array
  import PIL.Image
label_desc: Use image node_id 10 for calling a global function with example usage: interior(array, channel_first) and returns: array