<commit_before># -*- coding: utf-8 -*-
"""
Connected components and strongly connected components.
"""
__authors__ = """<NAME>\n<NAME> (<EMAIL>)"""
___revision__ = ""
#    Copyright (C) 2004-2007 by 
#    <NAME> <<EMAIL>>
#    <NAME> <<EMAIL>>
#    <NAME> <<EMAIL>>
#    Distributed under the terms of the GNU Lesser General Public License
#    http://www.gnu.org/copyleft/lesser.html
import networkx
from networkx.path import \
     single_source_shortest_path,\
     single_source_shortest_path_length
#from networkx.search import \
#     dfs_postorder,dfs_preorder

def dfs_preorder(G,source=None,reverse_graph=False):
    """
    Return list of nodes connected to source in DFS preorder.
    Traverse the graph G with depth-first-search from source.
    Non-recursive algorithm.
    """
    if source is None:
        nlist=G.nodes() # process entire graph
    else:
        nlist=[source]  # only process component with source

    if reverse_graph==True:
        try:<commit_msg>adjust author contact info<commit_after># -*- coding: utf-8 -*-
"""
Connected components and strongly connected components.
"""
__authors__ = """<NAME> (<EMAIL>)\n<NAME> (<EMAIL>)"""
___revision__ = ""
#    Copyright (C) 2004-2007 by 
#    <NAME> <<EMAIL>>
#    <NAME> <<EMAIL>>
#    <NAME> <<EMAIL>>
#    Distributed under the terms of the GNU Lesser General Public License
#    http://www.gnu.org/copyleft/lesser.html
import networkx
from networkx.path import \
     single_source_shortest_path,\
     single_source_shortest_path_length
#from networkx.search import \
#     dfs_postorder,dfs_preorder

def dfs_preorder(G,source=None,reverse_graph=False):
    """
    Return list of nodes connected to source in DFS preorder.
    Traverse the graph G with depth-first-search from source.
    Non-recursive algorithm.
    """
    if source is None:
        nlist=G.nodes() # process entire graph
    else:
        nlist=[source]  # only process component with source

    if reverse_graph==True:
        try:
{'fraction_non_alphanumeric': 0.11841445057701956, 'fraction_numerical': 0.009031610637230306, 'mean_word_length': 3.401766004415011, 'pattern_counts': {'":': 0, '<': 28, '<?xml version=': 0, '>': 28, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6775862', 'n_tokens_mistral': 642, 'n_tokens_neox': 618, 'n_words': 175}