def METHOD_NAME(self, samples, **extra_args):
    if len(samples) == 0:
        return samples
    dataset_ids = [s[0] for s in samples]
    samples = [s[1] for s in samples]
    if hasattr(self.datasets[0], "collater"):
        samples = self.datasets[0].METHOD_NAME(samples, **extra_args)
    else:
        samples = default_collate(samples, **extra_args)
    if len(self.new_src_eos) > 0:
        if self.left_pad_source:
            assert (
                samples["net_input"]["src_tokens"][:, -1] != self.src_eos
            ).sum() == 0
            samples["net_input"]["src_tokens"][:, -1] = self.new_src_eos[
                dataset_ids
            ]
        else:
            eos_idx = samples["net_input"]["src_lengths"] - 1
            assert (
                samples["net_input"]["src_tokens"][
                    torch.arange(eos_idx.size(0)), eos_idx
                ]
                != self.src_eos
            ).sum() == 0
            samples["net_input"]["src_tokens"].scatter_(
                1, eos_idx.view(-1, 1), self.new_src_eos[dataset_ids].view(-1, 1)
            )
    if len(self.new_tgt_bos) > 0 and "prev_output_tokens" in samples["net_input"]:
        if self.left_pad_target:
            # TODO: support different padding direction on target side
            raise NotImplementedError(
                "TransformEosLangPairDataset does not implement --left-pad-target True option"
            )
        else:
            assert (
                samples["net_input"]["prev_output_tokens"][:, 0] != self.tgt_bos
            ).sum() == 0
            samples["net_input"]["prev_output_tokens"][:, 0] = self.new_tgt_bos[
                dataset_ids
            ]
    return samples