code: def roll(vari, shift, axis=None):
      
      if isinstance(vari, Poly):
          core = vari.A.copy()
          for key in vari.keys:
              core[key] = roll(core[key], shift, axis)
          return Poly(core, vari.dim, None, vari.dtype)
  
      return numpy.roll(vari, shift, axis)
docs: Roll array elements along a given axis.