code: def random_mini_batches(X, Y, minibatch_size, seed=None):
    
    d    = X.shape[1]
    size = minibatch_size
    minibatches = []
  
    if Y is None:
        Y = np.zeros((1, d))
  
    np.random.seed(seed)
    perm = np.random.permutation(d)
  
    for t in range(0, d, size):
        subset = perm[t: t+size]
        minibatches.append((X[:, subset], Y[:, subset]))
  
    return minibatches
docs: Compute a list of minibatches from inputs X and targets Y.
    A datapoint is expected to be represented as a column in 
    the data matrices X and Y.