<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delay_embedding(data, emb_dim, lag=1):
 """ Perform a time-delay embedding of a time series Args: data (array-like):
 the data that should be embedded emb_dim (int):
 the embedding dimension Kwargs: lag (int):
 the lag between elements in the embedded vectors Returns: emb_dim x m array: matrix of embedded vectors of the form for i in 0 to m-1 (m = len(data)-(emb_dim-1)*lag) """

  data = np.asarray(data)
  min_len = (emb_dim - 1) * lag + 1
  if len(data) < min_len:
    msg = "cannot embed data of length {} with embedding dimension {} " \
        + "and lag {}, minimum required length is {}"
    raise ValueError(msg.format(len(data), emb_dim, lag, min_len))
  m = len(data) - min_len + 1
  indices = np.repeat([np.arange(emb_dim) * lag], m, axis=0)
  indices += np.arange(m).reshape((m, 1))
  return data[indices]