class_docstr: Stanford Dogs dataset.
class_docstr_tok: ["Stanford","Dogs","dataset","."]
code: def _split_generators(self, dl_manager):
      images_path = dl_manager.download(_IMAGES_URL)
      split_path, annotation_path = dl_manager.download_and_extract(
          [_SPLIT_URL, _ANNOTATIONS_URL]
      )
      xml_file_list = collections.defaultdict(str)
  
      # Parsing the mat file which contains the list of train/test images
      scipy = tfds.core.lazy_imports.scipy
  
      def parse_mat_file(file_name):
          with tf.io.gfile.GFile(file_name, "rb") as f:
              parsed_mat_arr = scipy.io.loadmat(f, squeeze_me=True)
          file_list = [
              os.path.split(element)[-1]
              for element in parsed_mat_arr["file_list"]
          ]
  
          return file_list, parsed_mat_arr
  
      for fname in tf.io.gfile.listdir(split_path):
          # Train-test split using train_list.mat and test_list.mat
          full_file_name = os.path.join(split_path, fname)
  
          if "train" in fname:
              train_list, train_mat_arr = parse_mat_file(full_file_name)
              label_names = set(
                  [  # Set to remove duplicates
                      os.path.split(element)[
                          -2
                      ].lower()  # Extract path/label/img.jpg
                      for element in train_mat_arr["file_list"]
                  ]
              )
          elif "test" in fname:
              test_list, _ = parse_mat_file(full_file_name)
  
      self.info.features["label"].names = sorted(label_names)
  
      for root, _, files in tf.io.gfile.walk(annotation_path):
          # Parsing the XML file which have the image annotations
          for fname in files:
              annotation_file_name = os.path.join(root, fname)
              with tf.io.gfile.GFile(annotation_file_name, "rb") as f:
                  xml_file_list[fname] = ET.parse(f)
  
      return [
          tfds.core.SplitGenerator(
              name=tfds.Split.TRAIN,
              gen_kwargs={
                  "archive": dl_manager.iter_archive(images_path),
                  "file_names": train_list,
                  "annotation_files": xml_file_list,
              },
          ),
          tfds.core.SplitGenerator(
              name=tfds.Split.TEST,
              gen_kwargs={
                  "archive": dl_manager.iter_archive(images_path),
                  "file_names": test_list,
                  "annotation_files": xml_file_list,
              },
          ),
      ]
  
file_path: datasets/tensorflow_datasets/datasets/stanford_dogs/stanford_dogs_dataset_builder.py
imports: import collections
  import os
  import re
  import xml.etree.ElementTree
  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: list, file_list,  parsed_mat_arr