<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_initial_array(events, slots, seed=None):
 """ Obtain a random initial array. """

    if seed is not None:
        np.random.seed(seed)

    m = len(events)
    n = len(slots)
    X = np.zeros((m, n))
    for i, row in enumerate(X):
        X[i, i] = 1
    np.random.shuffle(X)
    return X