class_docstr: Base class to define a dataset collection.
  
  Subclasses should overwrite `info` to return populated DatasetCollectionInfo.
  
  Subclasses should also overwrite `datasets` to return a dictionary of versions
  to the datasets included in that collection's version.
class_docstr_tok: ["Base","class","to","define","a","dataset","collection",".","Subclasses","should","overwrite","`","info","`","to","return","populated","DatasetCollectionInfo",".","Subclasses","should","also","overwrite","`","datasets","`","to","return","a","dictionary","of","versions","to","the","datasets","included","in","that","collection","'s","version","."]
docstr: Returns the requested versioned dataset collection.
  
  Args:
    version: The requested version. If no version is specified, returns the
      most recently added version.
  
  Returns:
    The requested dataset collection.
docstr_tok: ["Returns","the","requested","versioned","dataset","collection",".","Args",":","version",":","The","requested","version",".","If","no","version","is","specified",",","returns","the","most","recently","added","version",".","Returns",":","The","requested","dataset","collection","."]
code: def get_collection(
      self,
      version: Union[None, str, version_lib.Version] = None,
  ) -> Mapping[str, naming.DatasetReference]:
      """Returns the requested versioned dataset collection.
  
      Args:
        version: The requested version. If no version is specified, returns the
          most recently added version.
  
      Returns:
        The requested dataset collection.
      """
      if not version:
          return self.datasets[self.get_latest_version()]
  
      if isinstance(version, version_lib.Version):
          version = str(version)
      for v in reversed(self.all_versions):
          if v.match(version):
              return self.datasets[str(v)]
  
      raise ValueError(
          f"No datasets could be retrieved for version {version}"
      )
  
imports: import dataclasses
  import inspect
  from typing import Any, List, Mapping, Optional, Type, Union
  from etils import epath
  from tensorflow_datasets.core import naming
  from tensorflow_datasets.core import registered
  from tensorflow_datasets.core.utils import version
label_desc: Use image node_id 6 for calling the DatasetCollection obj's underlying member method code with example usage: obj.get_collection(version) and returns: self, self