code: def get_axis_padding(padding):
      
      if isinstance(padding, tuple):
          if len(padding) == 2:
              xpad, ypad = padding
              zpad = 0
          elif len(padding) == 3:
              xpad, ypad, zpad = padding
          else:
              raise ValueError('Padding must be supplied as an number applied '
                               'to all axes or a length two or three tuple '
                               'corresponding to the x-, y- and optionally z-axis')
      else:
          xpad, ypad, zpad = (padding,)*3
      return (xpad, ypad, zpad)
docs: Process a padding value supplied as a tuple or number and returns
      padding values for x-, y- and z-axis.