def get_instances(self, data_type: str = "train"):
        """
        Returns a tuple of inputs and outputs from all datasets. Lengths of
        and outputs are equal to the size of the largest dataset. Smaller
        datasets are padded with Nones until their sizes are equal to the size of the
        largest dataset.
        Args:
            data_type: can be either 'train', 'test', or 'valid'
        Returns:
            A tuple of all inputs for a data type and all expected outputs
            for a data type.
        """

        max_task_data_len = max(
            [
                len(iter_.get_instances(data_type)[0])
                for iter_ in self.task_iterators.values()
            ]
        )
        x_instances = []
        y_instances = []
        for task_name, iter_ in self.task_iterators.items():
            x, y = iter_.get_instances(data_type)
            n_repeats = math.ceil(max_task_data_len / len(x))
            x *= n_repeats
            y *= n_repeats
            x_instances.append(x[:max_task_data_len])
            y_instances.append(y[:max_task_data_len])
        error_msg = f'Len of x_instances {len(x_instances)} and y_instances {len(y_instances)} dont match'
        if len(x_instances) != len(y_instances):
            raise Exception(error_msg)
        instances = (tuple(zip(*x_instances)), tuple(zip(*y_instances)))
        return instances

        Returns a tuple of inputs and outputs from all datasets. Lengths of
        and outputs are equal to the size of the largest dataset. Smaller
        datasets are padded with Nones until their sizes are equal to the size of the
        largest dataset.
        Args:
            data_type: can be either 'train', 'test', or 'valid'
        Returns:
            A tuple of all inputs for a data type and all expected outputs
            for a data type.
        
deeppavlov/dataset_iterators/multitask_iterator.py