code: def _worth_extracting(element: pyparsing.ParserElement) -> bool:
      """
      Returns true if this element is worth having its own sub-diagram. Simply, if any of its children
      themselves have children, then its complex enough to extract
      """
      children = element.recurse()
      return any(child.recurse() for child in children)
  
imports: import railroad
  import pyparsing
  import typing
  from typing import List, NamedTuple, Generic, TypeVar, Dict, Callable, Set, Iterable
  from jinja2 import Template
  from io import StringIO
  import inspect
label_desc: Use image node_id 5 for calling a global function with example usage: _worth_extracting(element) and returns: any