code: def comb_w_rep(n, k):
      """Combinations with repetition
  
      Returns the list of k combinations with repetition from n objects.
      """
      if k == 0:
          return [[]]
      combs = [[i] for i in range(n)]
      for i in range(k - 1):
          curr = []
          for p in combs:
              for m in range(p[-1], n):
                  curr.append(p + [m])
          combs = curr
      return combs
  
imports: from sympy import Matrix, pprint, Rational, symbols, Symbol, zeros
label_desc: Use image node_id 2 for calling a global function with example usage: comb_w_rep(n, k) and returns: combs, list