It is well known that for a set of $n$ elements, say $\{1,\ldots, n\}$, the total number of possible partitions of this set is equal to $B_n$, where $B_n$ is the Bell number, and a set partition is a grouping of the $n$ elements into non-empty subsets.
For the more general problem when we have a set with $k_1$ elements of 1, $k_2$ elements of 2, and $k_n$ elements of $n$, so the set has $k = k_1+\ldots+k_n$ elements. How do we figure out how many set partitions are there? More importantly, is there a simple algorithm to enumerate the entire set partitions for this set of $k$ numbers with repeated elements?