def METHOD_NAME(batch):
    def padding(indice, max_length, pad_idx=0):
        pad_indice = [
            item + [pad_idx] * max(0, max_length - len(item)) for item in indice
        ]
        return torch.tensor(pad_indice)
    input_ids = [data["input_ids"] for data in batch]
    max_length = max([len(t) for t in input_ids])
    input_ids = padding(input_ids, max_length)[:,:maxlen]
    data = {
        "input_ids": input_ids,
        "labels": input_ids
    }
    return data