<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def random_mini_batches(X, Y, minibatch_size, seed=None):
 """ 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. """

  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