code: def fd_weights_all(x, x0=0, n=1):
      
      m = len(x)
      _assert(n < m, 'len(x) must be larger than n')
  
      weights = np.zeros((m, n + 1))
      _fd_weights_all(weights, x, x0, n)
      return weights.T
docs: Return finite difference weights for derivatives of all orders up to n.
  
      Parameters
      ----------
      x : vector, length m
          x-coordinates for grid points
      x0 : scalar
          location where approximations are to be accurate
      n : scalar integer
          highest derivative that we want to find weights for
  
      Returns
      -------
      weights :  array, shape n+1 x m
          contains coefficients for the j'th derivative in row j (0 <= j <= n)
  
      Notes
      -----
      The x values can be arbitrarily spaced but must be distinct and len(x) > n.
  
      The Fornberg algorithm is much more stable numerically than regular
      vandermonde systems for large values of n.
  
      See also
      --------
      fd_weights
  
      References
      ----------
      B. Fornberg (1998)
      "Calculation of weights_and_points in finite difference formulas",
      SIAM Review 40, pp. 685-691.
  
      http://www.scholarpedia.org/article/Finite_difference_method