class_docstr: Structure containing information required to fetch a dataset.
  
  Attributes:
    root_path: Root directory of the dataset package (e.g.
      `gs://.../my_dataset/`, `github://.../my_dataset/`)
    filenames: Content of the dataset package
docstr: Exports to JSON.
docstr_tok: ["Exports","to","JSON","."]
code: def to_json(self) -> utils.JsonValue:
      """Exports to JSON."""
      if len(self.filenames) == 1:
          return os.fspath(self.root_path / self.filenames[0])
      else:
          return {
              "root_path": os.fspath(self.root_path),
              "filenames": self.filenames,
          }
  
file_path: datasets/tensorflow_datasets/core/community/dataset_sources.py
imports: import dataclasses
  import os
  from typing import List
  from etils import epath
  from tensorflow_datasets.core import utils
label_desc: Use image node_id 2 for calling the DatasetSource obj's underlying member method code with example usage: obj.to_json() and returns: os, dict