def generate_graph(edges):
    """ Generate a graph as dict using edges generator.

        Args:
            edges (generator): generator of edges.

        Returns:
            dict. the graph as
                {
                    "node": ["dependencies"],
                    ...
                }
    """
    graph = {}
    for edge in list(edges):
        if not edge[0] in graph:
            graph[edge[0]] = []

        if edge[1] and not edge[0] == edge[1]:
            graph[edge[0]].append(edge[1])
    return graph