class_docstr: A large-scale and high-quality dataset of annotated musical notes.
docstr: Returns splits.
docstr_tok: ["Returns","splits","."]
code: def _split_generators(self, dl_manager):
      """Returns splits."""
  
      dl_urls = {}
      dl_urls["examples"] = {
          split: _BASE_DOWNLOAD_PATH + "%s.tfrecord.tar" % split
          for split in _SPLITS
      }
      dl_urls["instrument_labels"] = (
          _BASE_DOWNLOAD_PATH + "instrument_labels.txt"
      )
      if self.builder_config.gansynth_subset:
          dl_urls["gansynth_splits"] = (
              _BASE_DOWNLOAD_PATH + "gansynth_splits.csv"
          )
      dl_paths = dl_manager.download_and_extract(dl_urls)
  
      with tf.io.gfile.GFile(dl_paths["instrument_labels"]) as f:
          instrument_labels = f.read().strip().splitlines()
      self.info.features["instrument"][
          "label"
      ].names = instrument_labels
  
      split_ids = {s: set() for s in _SPLITS}
      split_dirs = {s: [dl_paths["examples"][s]] for s in _SPLITS}
      if self.builder_config.gansynth_subset:
          # Generator needs to see all original splits for each new split.
          split_dirs = {
              s: dl_paths["examples"].values() for s in _SPLITS
          }
          with tf.io.gfile.GFile(dl_paths["gansynth_splits"]) as f:
              reader = csv.DictReader(f)
              for row in reader:
                  split_ids[row["split"]].add(row["id"])
  
      return [
          tfds.core.SplitGenerator(  # pylint: disable=g-complex-comprehension
              name=split,
              gen_kwargs={
                  "tfrecord_dirs": split_dirs[split],
                  "ids": split_ids[split],
                  "split": split,
              },
          )
          for split in _SPLITS
      ]
  
file_path: datasets/tensorflow_datasets/datasets/nsynth/nsynth_dataset_builder.py
imports: from __future__ import annotations
  import csv
  import os
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling the Builder obj's underlying member method code with example usage: obj._split_generators(dl_manager) and returns: unknown