def clean_graph(graph):
    """
    Check the missing attributes of every node, and add a "No" when it is not
    present. With this you can, for example, use the attribute for graph
    partitioning in Gephi
    """
    for i in graph.nodes():
        graph.node[i]['Label'] = str(i)
        if 'owner' not in graph.node[i]:
            graph.node[i]['owner'] = 'No'
        if 'committer' not in graph.node[i]:
            graph.node[i]['committer'] = 'No'
        if 'forker' not in graph.node[i]:
            graph.node[i]['forker'] = 'No'
        if 'stargazer' not in graph.node[i]:
            graph.node[i]['stargazer'] = 'No'
        if 'contributor' not in graph.node[i]:
            graph.node[i]['contributor'] = 'No'
        if 'collaborator' not in graph.node[i]:
            graph.node[i]['collaborator'] = 'No'
        if 'watcher' not in graph.node[i]:
            graph.node[i]['watcher'] = 'No'
        if 'subscriber' not in graph.node[i]:
            graph.node[i]['subscriber'] = 'No'
        if 'issue creator' not in graph.node[i]:
            graph.node[i]['issue creator'] = 'No'
        if 'issue commenter' not in graph.node[i]:
            graph.node[i]['issue commenter'] = 'No'
        if 'pull request assignee' not in graph.node[i]:
            graph.node[i]['pull request assignee'] = 'No'
        if 'issue assignee' not in graph.node[i]:
            graph.node[i]['issue assignee'] = 'No'
        if 'email' not in graph.node[i]:
            graph.node[i]['email'] = 'None'
        if 'avatar_url' not in graph.node[i]:
            graph.node[i]['avatar_url'] = 'None'
    for v in graph.nodes_iter(data=True):
        for attrib in v[1]:
            if v[1][attrib] is None:
                graph.node[v[0]][attrib] = 'None'
        if v[0] == 'None' or v[0] is None:
            graph.remove_node(v[0])
    return graph
