code: def search_ancestor(
      node: "NodeOrLeaf", *node_types: str
  ) -> "Optional[BaseNode]":
      """
      Recursively looks at the parents of a node and returns the first found node
      that matches ``node_types``. Returns ``None`` if no matching node is found.
  
      This function is deprecated, use :meth:`NodeOrLeaf.search_ancestor` instead.
  
      :param node: The ancestors of this node will be checked.
      :param node_types: type names that are searched for.
      """
      n = node.parent
      while n is not None:
          if n.type in node_types:
              return n
          n = n.parent
      return None
  
imports: from abc import abstractmethod, abstractproperty
  from typing import List, Optional, Tuple, Union
  from parso.utils import split_lines
label_desc: Use image node_id 1 for calling a global function with example usage: search_ancestor(node) and returns: None, n