class_docstr: Completer which wraps around several other completers, and calls any the
  one that corresponds with the first word of the input.
  
  By combining multiple `NestedCompleter` instances, we can achieve multiple
  hierarchical levels of autocompletion. This is useful when `WordCompleter`
  is not sufficient.
  
  If you need multiple levels, check out the `from_nested_dict` classmethod.
class_docstr_tok: ["Completer","which","wraps","around","several","other","completers",",","and","calls","any","the","one","that","corresponds","with","the","first","word","of","the","input",".","By","combining","multiple","`","NestedCompleter","`","instances",",","we","can","achieve","multiple","hierarchical","levels","of","autocompletion",".","This","is","useful","when","`","WordCompleter","`","is","not","sufficient",".","If","you","need","multiple","levels",",","check","out","the","`","from_nested_dict","`","classmethod","."]
docstr: Create a `NestedCompleter`, starting from a nested dictionary data
  structure, like this:
  
  .. code::
  
      data = {
          'show': {
              'version': None,
              'interfaces': None,
              'clock': None,
              'ip': {'interface': {'brief'}}
          },
          'exit': None
          'enable': None
      }
  
  The value should be `None` if there is no further completion at some
  point. If all values in the dictionary are None, it is also possible to
  use a set instead.
  
  Values in this data structure can be a completers as well.
docstr_tok: ["Create","a","`","NestedCompleter","`",",","starting","from","a","nested","dictionary","data","structure",",","like","this",":","..","code",":",":","data","=","{","'show","'",":","{","'version","'",":","None",",","'interfaces","'",":","None",",","'clock","'",":","None",",","'ip","'",":","{","'interface","'",":","{","'brief","'","}","}","}",",","'exit","'",":","None","'enable","'",":","None","}","The","value","should","be","`","None","`","if","there","is","no","further","completion","at","some","point",".","If","all","values","in","the","dictionary","are","None",",","it","is","also","possible","to","use","a","set","instead",".","Values","in","this","data","structure","can","be","a","completers","as","well","."]
code: def from_nested_dict(cls, data: NestedDict) -> NestedCompleter:
      """
      Create a `NestedCompleter`, starting from a nested dictionary data
      structure, like this:
  
      .. code::
  
          data = {
              'show': {
                  'version': None,
                  'interfaces': None,
                  'clock': None,
                  'ip': {'interface': {'brief'}}
              },
              'exit': None
              'enable': None
          }
  
      The value should be `None` if there is no further completion at some
      point. If all values in the dictionary are None, it is also possible to
      use a set instead.
  
      Values in this data structure can be a completers as well.
      """
      options: dict[str, Completer | None] = {}
      for key, value in data.items():
          if isinstance(value, Completer):
              options[key] = value
          elif isinstance(value, dict):
              options[key] = cls.from_nested_dict(value)
          elif isinstance(value, set):
              options[key] = cls.from_nested_dict(
                  {item: None for item in value}
              )
          else:
              assert value is None
              options[key] = None
  
      return cls(options)
  
file_path: catboost/contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/nested.py
imports: from __future__ import annotations
  from typing import Any, Iterable, Mapping, Set, Union
  from prompt_toolkit.completion import CompleteEvent, Completer, Completion
  from prompt_toolkit.completion.word_completer import WordCompleter
  from prompt_toolkit.document import Document
label_desc: Use image node_id 3 for calling the NestedCompleter obj's underlying member method code with example usage: obj.from_nested_dict(cls, data) and returns: cls