def METHOD_NAME(minibatch, pad_id=0, dtype=np.int64):
    """Pad sequences to text_ids to the largest length and batch them.
    Args:
        minibatch (List[np.ndarray]): list of rank-1 arrays, shape(T,), dtype np.int64, text_ids.
        pad_id (int, optional): the id which correspond to the special pad token. Defaults to 0.
        dtype (np.dtype, optional): the data dtype of the output. Defaults to np.int64.
    Returns:
        np.ndarray: rank-2 array of text_ids, shape(B, T), B stands for batch_size, T stands for length. The output batch.
    """
    peek_example = minibatch[0]
    assert len(peek_example.shape) == 1, "text example is an 1D tensor"
    # assume (channel, n_samples) or (n_samples, )
    lengths = [example.shape[0] for example in minibatch]
    max_len = np.max(lengths)
    batch = []
    for example in minibatch:
        pad_len = max_len - example.shape[0]
        batch.append(
            np.pad(
                example, [(0, pad_len)],
                mode='constant',
                constant_values=pad_id))
    return np.array(batch, dtype=dtype), np.array(lengths, dtype=np.int64)