# Path: sunds/typing.py



import abc
import copy
import tensorflow as tf
import tensorflow_datasets as tfds
from typing import Any, Dict, Optional
from sunds.typing import FeatureSpecsHint, Split, Tree, TreeDict  # pylint: disable=g-multiple-import

    Args:
      split: The dataset split to load (e.g. 'train', 'train[80%:]',...)
      decoders: Optional decoders (e.g. to skip the image decoding)
      pipeline_kwargs: Additional kwargs to forward to the pipeline function.
      **kwargs: Kwargs to forward to `tfds.core.DatasetBuilder.as_dataset`.

    Returns:
       ds: The dataset
    """
    # Scene understanding datasets have many features. Only a very small subset
    # are required for a specific task.
    frame_specs = self.frame_specs
    if callable(frame_specs):
      raise ValueError(
          f'Invalid frame_specs={frame_specs!r}. Did you forgot `@property` ?')
    if frame_specs is not None:
      decoders = tfds.decode.PartialDecoding(frame_specs, decoders=decoders)

    ds = self.frame_builder.as_dataset(
        split=split,
        decoders=decoders,
        **kwargs,
    )

    # Apply eventual post-processing on the dataset.
    return self.pipeline(ds, **(pipeline_kwargs or {}))

  @property
  @abc.abstractmethod

# Path: sunds/typing.py



# Path: sunds/core/tasks.py
import abc
import copy
import tensorflow as tf
import tensorflow_datasets as tfds
from typing import Any, Dict, Optional
from sunds.typing import FeatureSpecsHint, Split, Tree, TreeDict  # pylint: disable=g-multiple-import


    Args:
      split: The dataset split to load (e.g. 'train', 'train[80%:]',...)
      decoders: Optional decoders (e.g. to skip the image decoding)
      pipeline_kwargs: Additional kwargs to forward to the pipeline function.
      **kwargs: Kwargs to forward to `tfds.core.DatasetBuilder.as_dataset`.

    Returns:
       ds: The dataset
    """
    # Scene understanding datasets have many features. Only a very small subset
    # are required for a specific task.
    frame_specs = self.frame_specs
    if callable(frame_specs):
      raise ValueError(
          f'Invalid frame_specs={frame_specs!r}. Did you forgot `@property` ?')
    if frame_specs is not None:
      decoders = tfds.decode.PartialDecoding(frame_specs, decoders=decoders)

    ds = self.frame_builder.as_dataset(
        split=split,
        decoders=decoders,
        **kwargs,
    )

    # Apply eventual post-processing on the dataset.
    return self.pipeline(ds, **(pipeline_kwargs or {}))

  @property
  @abc.abstractmethod

  def frame_specs(self) -> Optional[FeatureSpecsHint]: