code: def vandermonde(order, dim=1, syms="a b c d"):
      """Computes a Vandermonde matrix of given order and dimension.
  
      Define syms to give beginning strings for temporary variables.
  
      Returns the Matrix, the temporary variables, and the terms for the
      polynomials.
      """
      syms = syms.split()
      n = len(syms)
      if n < dim:
          new_syms = []
          for i in range(dim - n):
              j, rem = divmod(i, n)
              new_syms.append(syms[rem] + str(j))
          syms.extend(new_syms)
      terms = []
      for i in range(order + 1):
          terms.extend(comb_w_rep(dim, i))
      rank = len(terms)
      V = zeros(rank)
      generators = [symbol_gen(syms[i]) for i in range(dim)]
      all_syms = []
      for i in range(rank):
          row_syms = [next(g) for g in generators]
          all_syms.append(row_syms)
          for j, term in enumerate(terms):
              v_entry = 1
              for k in term:
                  v_entry *= row_syms[k]
              V[i * rank + j] = v_entry
      return V, all_syms, terms
  
imports: from sympy import Matrix, pprint, Rational, symbols, Symbol, zeros
label_desc: Use image node_id 3 for calling a global function with example usage: vandermonde(order, dim, syms) and returns: V,  all_syms,  terms