<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _generate_idx(n, seed, n_train, n_test):
 """Generate train, test indices for a length-n array. Parameters n : int The length of the array seed : int Seed for a RandomState n_train, n_test : int, 0 < n_train, n_test < n Number of samples to use for the train or test index. Notes ----- """

    idx = check_random_state(seed).permutation(n)

    ind_test = idx[:n_test]
    ind_train = idx[n_test : n_train + n_test]
    return ind_train, ind_test