parameters: (self, d, i)
return_statement: return i
docstring: Collects nodes in pre-order traversal.
docstring_summary: Collects nodes in pre-order traversal.
docstring_tokens: Collects nodes in pre - order traversal .
function: def traversal_rec(self, d, i):
      """Collects nodes in pre-order traversal."""
      if self.fields is None:
        d[self] = i
        i += 1
      else:
        for field in self.fields:
          i = field.traversal_rec(d, i)
      return i
function_tokens: def traversal_rec ( self , d , i ) : if self . fields is None : d [ self ] = i i += 1 else : for field in self . fields : i = field . traversal_rec ( d , i ) return i