def dfs(self, node, bucket=None, order="<STR_LIT>"):
if self[node].discovered:<EOL><INDENT>return bucket<EOL><DEDENT>self[node].discovered = True<EOL>nodes_ = sorted(self[node].iternodes(), cmp=self.cmp_branch)<EOL>for node_ in nodes_:<EOL><INDENT>self.dfs(node_, bucket, order)<EOL><DEDENT>getattr(bucket, order)(node)<EOL>self[node].examined = True<EOL>return bucket<EOL>
Recursive depth first search. By default ("order" = ``"append"``) this 
returns the **node objects** in the reverse postorder. To change this 
into the preorder use a ``collections.deque`` as "bucket" and 
``"appendleft"`` as "order".

Arguments:

  - bucket(``list`` or ``collections.dequeue``) [default: ``None``] The
    user *must* provide a new ``list`` or ``collections.dequeue`` to 
    store the nodes.
  - order(``str``) [default: ``"append"``] Method of the "bucket" which 
    will be called with the **node object** that has been examined. 
    Other valid options might be ``"appendleft"`` for a 
    ``collections.dequeue``.