(e)
A helper for ordered() which returns the node count of ``e`` which
    for Basic object is the number of Basic nodes in the expression tree
    but for other object is 1 (unless the object is an iterable or dict
    for which the sum of nodes is returned).
A helper for ordered() which returns the node count of ``e`` which
    for Basic object is the number of Basic nodes in the expression tree
    but for other object is 1 (unless the object is an iterable or dict
    for which the sum of nodes is returned).
A helper for ordered () which returns the node count of e which for Basic object is the number of Basic nodes in the expression tree but for other object is 1 ( unless the object is an iterable or dict for which the sum of nodes is returned ) .
def _nodes(e):
    """
    A helper for ordered() which returns the node count of ``e`` which
    for Basic object is the number of Basic nodes in the expression tree
    but for other object 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
def _nodes ( e ) : 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