<commit_before>import networkx as nx
import numpy
import pydot

def random_walk_graph(nsteps, absorbing = False):
    G = nx.grid_2d_graph(1, nsteps)
    G = G.to_directed()
    G = nx.convert_node_labels_to_integers(G)
    n = [ i for i in G.nodes() if G.out_degree(i) == 1 ]
    M = nx.to_numpy_matrix(G)
    for i in n:
        M[i, :] = 0
        M[i, i] = 1
    return nx.DiGraph(M)

<commit_msg>additional examples<commit_after>import networkx as nx
import numpy
import pydot

def random_walk_graph(nsteps, absorbing = False):
    G = nx.grid_2d_graph(1, nsteps)
    G = G.to_directed()
    G = nx.convert_node_labels_to_integers(G)
    n = [ i for i in G.nodes() if G.out_degree(i) == 1 ]
    M = nx.to_numpy_matrix(G)
    for i in n:
        M[i, :] = 0
        M[i, i] = 1
    return nx.DiGraph(M)

def stock_market():
    """Transition Matrix for the bull-bear-stagnant market from wikipedia
    """
    return numpy.array([ 
        [0.9,  0.075,  0.025], 
        [0.15,   0.8,   0.05], 
        [0.25,  0.25,   0.5 ] 
    ])

def simple_weather():
    """Transition Matrix for the simple weather example on wikipedia
    """
    return numpy.array([
        [0.9, 0.1], 
        [0.5, 0.5], 
    ])

# TODO - land of oz example
{'fraction_non_alphanumeric': 0.13306451612903225, 'fraction_numerical': 0.035483870967741936, 'mean_word_length': 2.354054054054054, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2802926', 'n_tokens_mistral': 519, 'n_tokens_neox': 486, 'n_words': 126}