docs: def _nodes(e):
      """
      A helper for ordered() which returns the node count of ``e`` which
      for Basic objects is the number of Basic nodes in the expression tree
      but for other objects is 1 (unless the object is an iterable or dict
      for which the sum of nodes is returned).
      """
      from .basic import Basic
  
      if isinstance(e, Basic):
          return e.count(Basic)
      elif iterable(e):
          return 1 + sum(_nodes(ei) for ei in e)
      elif isinstance(e, dict):
          return 1 + sum(_nodes(k) + _nodes(v) for k, v in e.items())
      else:
          return 1