code: def _prepare_batch_normalization_axes(axes, ndim):
      if axes == "per-activation":
          axes = (0,)
      elif axes == "spatial":
          axes = (0,) + tuple(range(2, ndim))
      elif isinstance(axes, (tuple, list, np.ndarray)):
          axes = tuple(int(a) for a in axes)
      else:
          raise ValueError("invalid axes: %s", str(axes))
      axes = tuple(sorted(axes))
      if len(axes) == 0:
          raise ValueError(
              "there should be at least one normalization axis"
          )
      if min(axes) < 0 or max(axes) >= ndim:
          raise ValueError(
              "axes should be less than ndim (<%d), but %s given"
              % (ndim, str(axes))
          )
      non_bc_axes = tuple(i for i in range(ndim) if i not in axes)
      return axes, non_bc_axes
  
imports: from __future__ import absolute_import, print_function, division
  import numpy
  import theano
  from theano import Apply, Op
  from theano.gof import local_optimizer
  from theano.gof.opt import copy_stack_trace
  from theano.tensor import as_tensor_variable, TensorType
  from theano.tensor import basic
  from theano.tensor.opt import register_specialize_device
  from theano.scalar import Composite, as_common_dtype
  from theano.scalar import add, sub, true_div, mul
label_desc: Use image node_id 2 for calling a global function with example usage: _prepare_batch_normalization_axes(axes, ndim) and returns: axes,  non_bc_axes