class_docstr: Information about a dataset.
  
  `DatasetInfo` documents datasets, including its name, version, and features.
  See the constructor arguments and properties for a full list.
  
  Not all fields are known on construction and may be updated later.
  
  Attributes:
      description (`str`):
          A description of the dataset.
      citation (`str`):
          A BibTeX citation of the dataset.
      homepage (`str`):
          A URL to the official homepage for the dataset.
      license (`str`):
          The dataset's license. It can be the name of the license or a paragraph containing the terms of the license.
      features ([`Features`], *optional*):
          The features used to specify the dataset's column types.
      post_processed (`PostProcessedInfo`, *optional*):
          Information regarding the resources of a possible post-processing of a dataset. For example, it can contain the information of an index.
      supervised_keys (`SupervisedKeysData`, *optional*):
          Specifies the input feature and the label for supervised learning if applicable for the dataset (legacy from TFDS).
      builder_name (`str`, *optional*):
          The name of the `GeneratorBasedBuilder` subclass used to create the dataset. Usually matched to the corresponding script name. It is also the snake_case version of the dataset builder class name.
      config_name (`str`, *optional*):
          The name of the configuration derived from [`BuilderConfig`].
      version (`str` or [`Version`], *optional*):
          The version of the dataset.
      splits (`dict`, *optional*):
          The mapping between split name and metadata.
      download_checksums (`dict`, *optional*):
          The mapping between the URL to download the dataset's checksums and corresponding metadata.
      download_size (`int`, *optional*):
          The size of the files to download to generate the dataset, in bytes.
      post_processing_size (`int`, *optional*):
          Size of the dataset in bytes after post-processing, if any.
      dataset_size (`int`, *optional*):
          The combined size in bytes of the Arrow tables for all splits.
      size_in_bytes (`int`, *optional*):
          The combined size in bytes of all files associated with the dataset (downloaded files + Arrow files).
      task_templates (`List[TaskTemplate]`, *optional*):
          The task templates to prepare the dataset for during training and evaluation. Each template casts the dataset's [`Features`] to standardized column names and types as detailed in `datasets.tasks`.
      **config_kwargs (additional keyword arguments):
          Keyword arguments to be passed to the [`BuilderConfig`] and used in the [`DatasetBuilder`].
class_docstr_tok: ["Information","about","a","dataset",".","`","DatasetInfo","`","documents","datasets",",","including","its","name",",","version",",","and","features",".","See","the","constructor","arguments","and","properties","for","a","full","list",".","Not","all","fields","are","known","on","construction","and","may","be","updated","later",".","Attributes",":","description","(","`","str","`",")",":","A","description","of","the","dataset",".","citation","(","`","str","`",")",":","A","BibTeX","citation","of","the","dataset",".","homepage","(","`","str","`",")",":","A","URL","to","the","official","homepage","for","the","dataset",".","license","(","`","str","`",")",":","The","dataset","'s","license",".","It","can","be","the","name","of","the","license","or","a","paragraph","containing","the","terms","of","the","license",".","features","(","[","`","Features","`","]",",","*","optional","*",")",":","The","features","used","to","specify","the","dataset","'s","column","types",".","post_processed","(","`","PostProcessedInfo","`",",","*","optional","*",")",":","Information","regarding","the","resources","of","a","possible","post-processing","of","a","dataset",".","For","example",",","it","can","contain","the","information","of","an","index",".","supervised_keys","(","`","SupervisedKeysData","`",",","*","optional","*",")",":","Specifies","the","input","feature","and","the","label","for","supervised","learning","if","applicable","for","the","dataset","(","legacy","from","TFDS",")",".","builder_name","(","`","str","`",",","*","optional","*",")",":","The","name","of","the","`","GeneratorBasedBuilder","`","subclass","used","to","create","the","dataset",".","Usually","matched","to","the","corresponding","script","name",".","It","is","also","the","snake_case","version","of","the","dataset","builder","class","name",".","config_name","(","`","str","`",",","*","optional","*",")",":","The","name","of","the","configuration","derived","from","[","`","BuilderConfig","`","]",".","version","(","`","str","`","or","[","`","Version","`","]",",","*","optional","*",")",":","The","version","of","the","dataset",".","splits","(","`","dict","`",",","*","optional","*",")",":","The","mapping","between","split","name","and","metadata",".","download_checksums","(","`","dict","`",",","*","optional","*",")",":","The","mapping","between","the","URL","to","download","the","dataset","'s","checksums","and","corresponding","metadata",".","download_size","(","`","int","`",",","*","optional","*",")",":","The","size","of","the","files","to","download","to","generate","the","dataset",",","in","bytes",".","post_processing_size","(","`","int","`",",","*","optional","*",")",":","Size","of","the","dataset","in","bytes","after","post-processing",",","if","any",".","dataset_size","(","`","int","`",",","*","optional","*",")",":","The","combined","size","in","bytes","of","the","Arrow","tables","for","all","splits",".","size_in_bytes","(","`","int","`",",","*","optional","*",")",":","The","combined","size","in","bytes","of","all","files","associated","with","the","dataset","(","downloaded","files","+","Arrow","files",")",".","task_templates","(","`","List","[","TaskTemplate","]","`",",","*","optional","*",")",":","The","task","templates","to","prepare","the","dataset","for","during","training","and","evaluation",".","Each","template","casts","the","dataset","'s","[","`","Features","`","]","to","standardized","column","names","and","types","as","detailed","in","`","datasets.tasks","`",".","*","*","config_kwargs","(","additional","keyword","arguments",")",":","Keyword","arguments","to","be","passed","to","the","[","`","BuilderConfig","`","]","and","used","in","the","[","`","DatasetBuilder","`","]","."]
docstr: Write `DatasetInfo` and license (if present) as JSON files to `dataset_info_dir`.
  
  Args:
      dataset_info_dir (`str`):
          Destination directory.
      pretty_print (`bool`, defaults to `False`):
          If `True`, the JSON will be pretty-printed with the indent level of 4.
      fs (`fsspec.spec.AbstractFileSystem`, *optional*):
          Instance of the remote filesystem used to download the files from.
  
          <Deprecated version="2.9.0">
  
          `fs` was deprecated in version 2.9.0 and will be removed in 3.0.0.
          Please use `storage_options` instead, e.g. `storage_options=fs.storage_options`.
  
          </Deprecated>
  
      storage_options (`dict`, *optional*):
          Key/value pairs to be passed on to the file-system backend, if any.
  
          <Added version="2.9.0"/>
  
  Example:
  
  ```py
  >>> from datasets import load_dataset
  >>> ds = load_dataset("rotten_tomatoes", split="validation")
  >>> ds.info.write_to_directory("/path/to/directory/")
  ```
docstr_tok: ["Write","`","DatasetInfo","`","and","license","(","if","present",")","as","JSON","files","to","`","dataset_info_dir","`",".","Args",":","dataset_info_dir","(","`","str","`",")",":","Destination","directory",".","pretty_print","(","`","bool","`",",","defaults","to","`","False","`",")",":","If","`","True","`",",","the","JSON","will","be","pretty-printed","with","the","indent","level","of","4.","fs","(","`","fsspec.spec.AbstractFileSystem","`",",","*","optional","*",")",":","Instance","of","the","remote","filesystem","used","to","download","the","files","from",".","<","Deprecated","version=","''","2.9.0","''",">","`","fs","`","was","deprecated","in","version","2.9.0","and","will","be","removed","in","3.0.0",".","Please","use","`","storage_options","`","instead",",","e.g",".","`","storage_options=fs.storage_options","`",".","<","\/Deprecated",">","storage_options","(","`","dict","`",",","*","optional","*",")",":","Key\/value","pairs","to","be","passed","on","to","the","file-system","backend",",","if","any",".","<","Added","version=","''","2.9.0","''","\/",">","Example",":","``","`","py",">",">",">","from","datasets","import","load_dataset",">",">",">","ds","=","load_dataset","(","``","rotten_tomatoes","''",",","split=","''","validation","''",")",">",">",">","ds.info.write_to_directory","(","``","\/path\/to\/directory\/","''",")","``","`"]
code: def write_to_directory(
      self,
      dataset_info_dir,
      pretty_print=False,
      fs="deprecated",
      storage_options: Optional[dict] = None,
  ):
      """Write `DatasetInfo` and license (if present) as JSON files to `dataset_info_dir`.
  
      Args:
          dataset_info_dir (`str`):
              Destination directory.
          pretty_print (`bool`, defaults to `False`):
              If `True`, the JSON will be pretty-printed with the indent level of 4.
          fs (`fsspec.spec.AbstractFileSystem`, *optional*):
              Instance of the remote filesystem used to download the files from.
  
              <Deprecated version="2.9.0">
  
              `fs` was deprecated in version 2.9.0 and will be removed in 3.0.0.
              Please use `storage_options` instead, e.g. `storage_options=fs.storage_options`.
  
              </Deprecated>
  
          storage_options (`dict`, *optional*):
              Key/value pairs to be passed on to the file-system backend, if any.
  
              <Added version="2.9.0"/>
  
      Example:
  
      ```py
      >>> from datasets import load_dataset
      >>> ds = load_dataset("rotten_tomatoes", split="validation")
      >>> ds.info.write_to_directory("/path/to/directory/")
      ```
      """
      if fs != "deprecated":
          warnings.warn(
              "'fs' was deprecated in favor of 'storage_options' in version 2.9.0 and will be removed in 3.0.0.\n"
              "You can remove this warning by passing 'storage_options=fs.storage_options' instead.",
              FutureWarning,
          )
          storage_options = fs.storage_options
  
      fs: fsspec.AbstractFileSystem
      fs, _, _ = fsspec.get_fs_token_paths(
          dataset_info_dir, storage_options=storage_options
      )
      with fs.open(
          posixpath.join(
              dataset_info_dir, config.DATASET_INFO_FILENAME
          ),
          "wb",
      ) as f:
          self._dump_info(f, pretty_print=pretty_print)
      if self.license:
          with fs.open(
              posixpath.join(dataset_info_dir, config.LICENSE_FILENAME),
              "wb",
          ) as f:
              self._dump_license(f)
  
imports: import copy
  import dataclasses
  import json
  import os
  import posixpath
  import warnings
  from dataclasses import dataclass
  from pathlib import Path
  from typing import ClassVar, Dict, List, Optional, Union
  import fsspec
  from huggingface_hub import DatasetCard, DatasetCardData
  from .None import config
  from .features import Features, Value
  from .splits import SplitDict
  from .tasks import TaskTemplate, task_template_from_dict
  from .utils import Version
  from .utils.logging import get_logger
  from .utils.py_utils import asdict, unique_values
label_desc: Use image node_id 2 for calling the DatasetInfo obj's underlying member method code with example usage: obj.write_to_directory(dataset_info_dir, pretty_print, fs, storage_options) without return types