# Path: t5/data/dataset_providers.py
# _DEFAULT_FEATURE_KEYS = ["inputs", "targets"]
# _VALID_TASK_NAME_REGEX = re.compile(r"^[\w\d\._]+$")
# _MAX_EXAMPLES_TO_MEM_CACHE = 10000
# SHUFFLE_BUFFER_SIZE = 1000
# class FunctionTask(seqio.Task):
# class TfdsTask(FunctionTask):
# class TextLineTask(FunctionTask):
# class TFExampleTask(FunctionTask):
# class TaskRegistry(seqio.TaskRegistry):
#   def __init__(self,
#                name,
#                dataset_fn,
#                splits,
#                text_preprocessor,
#                metric_fns=None,
#                postprocess_fn=None,
#                token_preprocessor=None,
#                output_features=None,
#                num_input_examples=None,
#                supports_caching=True,
#                shuffle_buffer_size=SHUFFLE_BUFFER_SIZE,
#                source=None):
#       def postprocess_fn(x, **postprocess_kwargs):  # pylint:disable=function-redefined
#   def __init__(
#       self,
#       name,
#       tfds_name,
#       text_preprocessor,
#       metric_fns,
#       tfds_data_dir=None,
#       splits=None,
#       **task_kwargs):
#   def __init__(
#       self,
#       name,
#       split_to_filepattern,
#       text_preprocessor,
#       metric_fns,
#       skip_header_lines=0,
#       **task_kwargs):
#   def __init__(self,
#                name,
#                split_to_filepattern,
#                feature_description,
#                text_preprocessor,
#                metric_fns,
#                reader=tf.data.TFRecordDataset,
#                **task_kwargs):
#   def add(cls, name: str, task_cls=FunctionTask, **kwargs) -> seqio.Task:


import os
import seqio
import tensorflow.compat.v2 as tf
from absl.testing import absltest
from seqio import test_utils
from t5.data import dataset_providers
    return TaskRegistry.add(
        name,
        cls,
        text_preprocessor=text_preprocessor,
        metric_fns=[],
        output_features=output_features,
        **kwargs)

  def test_tfds_task(self):
    self.add_t5_task(
        "t5_tfds_task",
        dataset_providers.TfdsTask,
        tfds_name="fake:0.0.0")
    print(TaskRegistry._REGISTRY)
    print(seqio.TaskRegistry._REGISTRY)
    self.verify_task_matches_fake_datasets(
        "t5_tfds_task", use_cached=False)

  def test_function_task(self):
    self.add_t5_task(
        "t5_fn_task",
        dataset_providers.FunctionTask,
        splits=("train", "validation"),
        dataset_fn=test_utils.get_fake_dataset)
    self.verify_task_matches_fake_datasets(
        "t5_fn_task", use_cached=False)

  def test_text_line_task(self):
    self.add_t5_task(
        "t5_text_line_task",

# Path: t5/data/dataset_providers.py
# _DEFAULT_FEATURE_KEYS = ["inputs", "targets"]
# _VALID_TASK_NAME_REGEX = re.compile(r"^[\w\d\._]+$")
# _MAX_EXAMPLES_TO_MEM_CACHE = 10000
# SHUFFLE_BUFFER_SIZE = 1000
# class FunctionTask(seqio.Task):
# class TfdsTask(FunctionTask):
# class TextLineTask(FunctionTask):
# class TFExampleTask(FunctionTask):
# class TaskRegistry(seqio.TaskRegistry):
#   def __init__(self,
#                name,
#                dataset_fn,
#                splits,
#                text_preprocessor,
#                metric_fns=None,
#                postprocess_fn=None,
#                token_preprocessor=None,
#                output_features=None,
#                num_input_examples=None,
#                supports_caching=True,
#                shuffle_buffer_size=SHUFFLE_BUFFER_SIZE,
#                source=None):
#       def postprocess_fn(x, **postprocess_kwargs):  # pylint:disable=function-redefined
#   def __init__(
#       self,
#       name,
#       tfds_name,
#       text_preprocessor,
#       metric_fns,
#       tfds_data_dir=None,
#       splits=None,
#       **task_kwargs):
#   def __init__(
#       self,
#       name,
#       split_to_filepattern,
#       text_preprocessor,
#       metric_fns,
#       skip_header_lines=0,
#       **task_kwargs):
#   def __init__(self,
#                name,
#                split_to_filepattern,
#                feature_description,
#                text_preprocessor,
#                metric_fns,
#                reader=tf.data.TFRecordDataset,
#                **task_kwargs):
#   def add(cls, name: str, task_cls=FunctionTask, **kwargs) -> seqio.Task:


# Path: t5/data/dataset_providers_test.py
import os
import seqio
import tensorflow.compat.v2 as tf
from absl.testing import absltest
from seqio import test_utils
from t5.data import dataset_providers

    return TaskRegistry.add(
        name,
        cls,
        text_preprocessor=text_preprocessor,
        metric_fns=[],
        output_features=output_features,
        **kwargs)

  def test_tfds_task(self):
    self.add_t5_task(
        "t5_tfds_task",
        dataset_providers.TfdsTask,
        tfds_name="fake:0.0.0")
    print(TaskRegistry._REGISTRY)
    print(seqio.TaskRegistry._REGISTRY)
    self.verify_task_matches_fake_datasets(
        "t5_tfds_task", use_cached=False)

  def test_function_task(self):
    self.add_t5_task(
        "t5_fn_task",
        dataset_providers.FunctionTask,
        splits=("train", "validation"),
        dataset_fn=test_utils.get_fake_dataset)
    self.verify_task_matches_fake_datasets(
        "t5_fn_task", use_cached=False)

  def test_text_line_task(self):
    self.add_t5_task(
        "t5_text_line_task",

        dataset_providers.TextLineTask,