class_docstr: Caltech Birds 2010 dataset.
code: def _split_generators(self, dl_manager):
      download_path = dl_manager.download(
          [
              self._caltech_birds_info.split_url,
              self._caltech_birds_info.annotations_url,
              self._caltech_birds_info.images_url,
          ]
      )
      extracted_path = dl_manager.download_and_extract(
          [
              self._caltech_birds_info.split_url,
              self._caltech_birds_info.annotations_url,
          ]
      )
  
      train_path = os.path.join(extracted_path[0], "lists/train.txt")
      test_path = os.path.join(extracted_path[0], "lists/test.txt")
  
      with epath.Path(train_path).open() as f:
          train_list = f.read().splitlines()
  
      with epath.Path(test_path).open() as f:
          test_list = f.read().splitlines()
  
      attributes = collections.defaultdict(list)
  
      scipy = tfds.core.lazy_imports.scipy
  
      def process_file(path: epath.Path):
          # Parsing the .mat files which have the image annotations
          with path.open(mode="rb") as f:
              mat = scipy.io.loadmat(
                  f, squeeze_me=True, variable_names=["bbox", "seg"]
              )
          key = path.name.split(".")[0]
          attributes[key].append(mat["bbox"])
          attributes[key].append(mat["seg"])
  
      with concurrent.futures.ThreadPoolExecutor(
          max_workers=_WORKERS
      ) as executor:
          futures = []
          for root, _, fnames in tf.io.gfile.walk(extracted_path[1]):
              root = epath.Path(root)
              for fname in fnames:
                  if not fname.endswith(".mat"):
                      continue
                  future = executor.submit(
                      process_file, path=root / fname
                  )
                  futures.append(future)
      for future in concurrent.futures.as_completed(futures):
          future.result()
  
      return [
          tfds.core.SplitGenerator(
              name=tfds.Split.TRAIN,
              gen_kwargs={
                  "archive": dl_manager.iter_archive(download_path[2]),
                  "file_names": train_list,
                  "annotations": attributes,
              },
          ),
          tfds.core.SplitGenerator(
              name=tfds.Split.TEST,
              gen_kwargs={
                  "archive": dl_manager.iter_archive(download_path[2]),
                  "file_names": test_list,
                  "annotations": attributes,
              },
          ),
      ]
  
imports: import collections
  import concurrent.futures
  import os
  import re
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the CaltechBirds2010 obj's underlying member method code with example usage: obj._split_generators(dl_manager) and returns: list