code: def _get_dataset_from_filename(
      instruction: _Instruction,
      do_skip: bool,
      do_take: bool,
      file_format: file_adapters.FileFormat,
      add_tfds_id: bool,
      override_buffer_size: Optional[int] = None,
  ) -> tf.data.Dataset:
      """Returns a tf.data.Dataset instance from given instructions."""
      ds = file_adapters.ADAPTER_FOR_FORMAT[file_format].make_tf_data(
          instruction.filepath, buffer_size=override_buffer_size
      )
      if do_skip:
          ds = ds.skip(instruction.skip)
      if do_take:
          ds = ds.take(instruction.take)
      if add_tfds_id:  # For each example, generate a unique id.
          id_ds = _make_id_dataset(
              filename=instruction.tfds_id_prefix,
              start_index=instruction.skip if do_skip else 0,
          )
          ds = tf.data.Dataset.zip(_IdExample(id=id_ds, example=ds))
      return ds
  
imports: from __future__ import annotations
  import functools
  import os
  import re
  from typing import Any, Callable, List, NamedTuple, Optional, Sequence
  from absl import logging
  import numpy
  from tensorflow_datasets.core import example_parser
  from tensorflow_datasets.core import file_adapters
  from tensorflow_datasets.core import splits
  from tensorflow_datasets.core import tf_compat
  from tensorflow_datasets.core import utils
  from tensorflow_datasets.core.utils import file_utils
  from tensorflow_datasets.core.utils import read_config
  from tensorflow_datasets.core.utils import shard_utils
  from tensorflow_datasets.core.utils import tree_utils
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
label_desc: Use image node_id 1 for calling a global function with example usage: _get_dataset_from_filename(instruction, do_skip, do_take, file_format, add_tfds_id, override_buffer_size) and returns: ds