def normalize_axes(self, args, axis):

    if isinstance(axis, Expr) and isinstance(axis.type, TupleT):
      axis = self.tuple_elts(axis)
          
      
    # unpack the axis argument into a tuple,  
    # if only one axis was given, then repeat it as many times as we have args 
    if isinstance(axis, (list, tuple)):
      axes = tuple([unwrap_constant(elt) for elt in axis])
    elif isinstance(axis, Expr):
      axes = (unwrap_constant(axis),) * len(args) 
    else:
      assert axis is None or isinstance(axis, (int,long)), "Invalid axis %s" % axis
      axes = (axis,) * len(args)
    
    assert len(axes) == len(args), "Wrong number of axes (%d) for %d args" % (len(axes), len(args))
    
    if self.rank(max_rank_arg(args)) < 2:
        # if we don't actually have any multidimensional arguments, 
        # might as well make the axes just 0  
      axes = tuple(0 if axis is None else axis for axis in axes)
    return axes
Given a list of arguments to an adverb and some value 
dataset/ETHPy150Open iskandr/parakeet/parakeet/builder/adverb_builder.py/AdverbBuilder.normalize_axes