def METHOD_NAME(self, index):
    """Return an example's length (number of tokens), used for batching."""
    # TODO make it configurable whether to use max() or sum() here
    return max(
        dataset.METHOD_NAME(self._map_index(key, index))
        for key, dataset in self.datasets.items()
    )