code: def rolldim(P, n=1):
      
      dim = P.dim
      shape = P.shape
      dtype = P.dtype
      A = dict(((key[n:]+key[:n],P.A[key]) for key in P.keys))
      return Poly(A, dim, shape, dtype)
docs: Roll the axes.
  
      Args:
          P (Poly) : Input polynomial.
          n (int) : The axis that after rolling becomes the 0th axis.
  
      Returns:
          (Poly) : Polynomial with new axis configuration.
  
      Examples:
          >>> x,y,z = variable(3)
          >>> P = x*x*x + y*y + z
          >>> print(P)
          q0^3+q1^2+q2
          >>> print(rolldim(P))
          q0^2+q2^3+q1