<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def rbetabin(alpha, beta, n, size=None):
 """ Random beta-binomial variates. """


    phi = np.random.beta(alpha, beta, size)
    return np.random.binomial(n, phi)