code: def prepare_descendant(next, token):
      try:
          token = next()
      except StopIteration:
          return
      if token[0] == "*":
          tag = "*"
      elif not token[0]:
          tag = token[1]
      else:
          raise SyntaxError("invalid descendant")
  
      if _is_wildcard_tag(tag):
          select_tag = _prepare_tag(tag)
  
          def select(context, result):
              def select_child(result):
                  for elem in result:
                      for e in elem.iter():
                          if e is not elem:
                              yield e
  
              return select_tag(context, select_child(result))
  
      else:
          if tag[:2] == "{}":
              tag = tag[2:]  # '{}tag' == 'tag'
  
          def select(context, result):
              for elem in result:
                  for e in elem.iter(tag):
                      if e is not elem:
                          yield e
  
      return select
  
file_path: catboost/contrib/tools/python3/src/Lib/xml/etree/ElementPath.py
imports: import re
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_descendant(next, token) and returns: select, select_tag