class_docstr: Provides a read-only view of the ``foldermap.json`` file in
  the datasets bucket. The folder map is a nested mapping of
  dataset parameters to their path, relative to the ``foldermap.json``
  file.
  
  A dictionary in the folder map can optionally specify a default
  paramater using the '__default' key. This view hides that
  key, and allows the default parameter to be accessed.
  
  For example, the underlying foldermap data will look like
  this:
  
      {
          "__params": {
              "qchem": ["molname", "basis", "bondlength"]
          },
          "qchem": {
              "O2": {
                  "__default": "STO-3G",
                  "STO-3G": {
                      "__default": "0.5",
                      "0.5": "qchem/O2/STO-3G/0.5.h5",
                      "0.6": "qchem/O2/STO-3G/0.6.h5"
                  }
              },
              "H2": {
                  "__default": "STO-3G",
                  "STO-3G": {
                      "__default": "0.7",
                      "0.7": "qchem/H2/STO-3G/0.7.h5"
                  }
              }
          },
      }
  
  When accessed through ``FolderMapView``, the '__default' and '__params'
  keys will be hidden.
class_docstr_tok: ["Provides","a","read-only","view","of","the","``","foldermap.json","``","file","in","the","datasets","bucket",".","The","folder","map","is","a","nested","mapping","of","dataset","parameters","to","their","path",",","relative","to","the","``","foldermap.json","``","file",".","A","dictionary","in","the","folder","map","can","optionally","specify","a","default","paramater","using","the","'__default","'","key",".","This","view","hides","that","key",",","and","allows","the","default","parameter","to","be","accessed",".","For","example",",","the","underlying","foldermap","data","will","look","like","this",":","{","``","__params","''",":","{","``","qchem","''",":","[","``","molname","''",",","``","basis","''",",","``","bondlength","''","]","}",",","``","qchem","''",":","{","``","O2","''",":","{","``","__default","''",":","``","STO-3G","''",",","``","STO-3G","''",":","{","``","__default","''",":","``","0.5","''",",","``","0.5","''",":","``","qchem\/O2\/STO-3G\/0.5.h5","''",",","``","0.6","''",":","``","qchem\/O2\/STO-3G\/0.6.h5","''","}","}",",","``","H2","''",":","{","``","__default","''",":","``","STO-3G","''",",","``","STO-3G","''",":","{","``","__default","''",":","``","0.7","''",",","``","0.7","''",":","``","qchem\/H2\/STO-3G\/0.7.h5","''","}","}","}",",","}","When","accessed","through","``","FolderMapView","``",",","the","'__default","'","and","'__params'","keys","will","be","hidden","."]
docstr: Returns a 2-tuple of dataset description and paths, for each dataset that
  matches ``params``.
docstr_tok: ["Returns","a","2-tuple","of","dataset","description","and","paths",",","for","each","dataset","that","matches","``","params","``","."]
code: def find(
      self,
      data_name: str,
      missing_default: Optional[ParamArg] = ParamArg.DEFAULT,
      **params: Union[typing.Iterable[ParamVal], ParamArg],
  ) -> List[Tuple[Description, DataPath]]:
      """Returns a 2-tuple of dataset description and paths, for each dataset that
      matches ``params``."""
  
      try:
          data_names_to_params = self.__curr_level["__params"]
      except KeyError as exc:
          raise RuntimeError(
              "Can only call find() from top level of foldermap"
          ) from exc
  
      try:
          param_names: List[str] = data_names_to_params[data_name]
      except KeyError as exc:
          raise ValueError(
              f"No datasets with data name: '{data_name}'"
          ) from exc
  
      curr: List[Tuple[Description, Union[FolderMapView, DataPath]]] = [
          (Description(()), self[data_name])
      ]
      todo: List[
          Tuple[Description, Union[FolderMapView, DataPath]]
      ] = []
      done: List[Tuple[Description, DataPath]] = []
  
      for param_name in param_names:
          param_arg = params.get(param_name, missing_default)
  
          while curr:
              curr_description, curr_level = curr.pop()
  
              if param_arg == ParamArg.FULL:
                  next_params = curr_level
              elif param_arg == ParamArg.DEFAULT:
                  default = curr_level.get_default_key()
                  if default is None:
                      raise ValueError(
                          f"No default available for parameter '{param_name}'"
                      )
                  next_params = (default,)
              elif isinstance(param_arg, str):
                  next_params = (param_arg,)
              else:
                  next_params = param_arg
  
              for next_param in next_params:
                  try:
                      fmap_next = curr_level[next_param]
                  except KeyError:
                      continue
  
                  todo.append(
                      (
                          Description(
                              (
                                  *curr_description.items(),
                                  (param_name, next_param),
                              )
                          ),
                          fmap_next,
                      )
                  )
  
          if len(todo) == 0:
              # None of the parameters matched
              param_arg_repr = (
                  repr([param_arg])
                  if isinstance(param_arg, (str, ParamArg))
                  else repr(list(param_arg))
              )
              raise ValueError(
                  f"{param_name} value(s) {param_arg_repr} are not available. Available values are: {list(curr_level)}"
              )
  
          curr, todo = todo, curr
  
      done.extend(curr)
  
      return done
  
file_path: pennylane/pennylane/data/data_manager/foldermap.py
imports: import typing
  from collections.abc import Mapping
  from pathlib import PurePosixPath
  from typing import Any, List, Literal, Optional, Tuple, Union
  from .params import Description, ParamArg, ParamVal
label_desc: Use image node_id 3 for calling the FolderMapView obj's underlying member method code with example usage: obj.find(data_name, missing_default) and returns: done