code: def _remove_extra_dimensions(arr):
      shape = arr.shape
      if len(shape) == 0 or 0 in shape:
          # 0 dimensional items exist, but are weird/unexpected. len fails, shape is length 0.
          # arrays with dimension having 0 length exist, but cannot contain anything
          return np.empty(0, arr.dtype)
  
      shape = [x for x in arr.shape if x != 1]
      if len(shape) == 0:
          shape = (1,)
  
      # reshape returns a view
      return arr.reshape(shape)
  
file_path: interpret/python/interpret-core/interpret/utils/_clean_simple.py
imports: import numpy
  import numpy.ma
  from sklearn.base import is_classifier, is_regressor
  from ._clean_x import preclean_X
  from ._link import link_func
  import logging
label_desc: Use image node_id 1 for calling a global function with example usage: _remove_extra_dimensions(arr) and returns: arr, np