The statement of the formula is kind of cryptic to me. In particular, I don't understand how the formula relates the probability of an object, designated by the index i, occurring $n_i$ times since the formula isn't in terms of the index i at all.
Perhaps it's best to demonstrate how much I know about the formula through a usage case:
Let $S = \{1,2,3,4,5,6\}$ and suppose you're rolling an unfair die such that
$P(1)=1/6$
$P(2)=2/6$
$P(3)=3/6$
$P(4)=P(5)=P(6)=0$
You roll the die 10 times in "trials", with different number of rolls in each trial:
Trial 1: 1
Trial 2: 2
Trial 3: 3
Trial 4: 4
Would the formula allow me to find the probability of rolling the number 2, say 7 times?
SOURCES: 2 (at the very bottom)

Hope it answers your question.