def METHOD_NAME(nodes, kinds, recursive = False, verbose = False):
  result = []
  for i in nodes:
    if verbose:
      print("test node ", i.spelling, i.kind, end="")
      if i.kind in kinds:
        print(" selected!")
      else:
        print()
    if i.kind in kinds:
      result.append(i)
    if recursive:
      result += METHOD_NAME(i.get_children(), kinds, True, verbose)
  return result