def addNodeMI(nm_dict, node, value):
    """
    Add motif information to node dictionary.
    
    Input:
        nm_dict:    (dictionary) the dictionary of node motif degree
        node:       (int) the id of node
        value:      (int) the change value of node
    Output:
        nm_dict:   (dictionary) changed node motif degree dictionary
    """

    if node not in nm_dict.keys():
        nm_dict[node] = value
    else:
        nm_dict[node] += value
    
    return nm_dict