class_docstr: The layout for a prompt_toolkit
  :class:`~prompt_toolkit.application.Application`.
  This also keeps track of which user control is focused.
  
  :param container: The "root" container for the layout.
  :param focused_element: element to be focused initially. (Can be anything
      the `focus` function accepts.)
class_docstr_tok: ["The","layout","for","a","prompt_toolkit",":","class",":","`","~prompt_toolkit.application.Application","`",".","This","also","keeps","track","of","which","user","control","is","focused",".",":","param","container",":","The","``","root","''","container","for","the","layout",".",":","param","focused_element",":","element","to","be","focused","initially",".","(","Can","be","anything","the","`","focus","`","function","accepts",".",")"]
docstr: Return the parent container for the given container, or ``None``, if it
  wasn't found.
docstr_tok: ["Return","the","parent","container","for","the","given","container",",","or","``","None","``",",","if","it","was","n't","found","."]
code: def get_parent(self, container: Container) -> Container | None:
      """
      Return the parent container for the given container, or ``None``, if it
      wasn't found.
      """
      try:
          return self._child_to_parent[container]
      except KeyError:
          return None
  
imports: from __future__ import annotations
  from typing import Generator, Iterable, Union
  from prompt_toolkit.buffer import Buffer
  from .containers import AnyContainer, ConditionalContainer, Container, Window, to_container
  from .controls import BufferControl, SearchBufferControl, UIControl
label_desc: Use image node_id 26 for calling the Layout obj's underlying member method code with example usage: obj.get_parent(container) and returns: self, None