def roget_graph():
    # open file roget_dat.txt.gz (or roget_dat.txt)
    import gzip
    fh=gzip.open('roget_dat.txt.gz','r')

    G=DiGraph()

    for line in fh.readlines():
        line = line.decode()
        if line.startswith("*"): # skip comments
            continue
        if line.startswith(" "): # this is a continuation line, append
            line=oldline+line
        if line.endswith("\\\n"): # continuation line, buffer, goto next
            oldline=line.strip("\\\n")
            continue

        (headname,tails)=line.split(":")

        # head
        numfind=re.compile("^\d+") # re to find the number of this word
        head=numfind.findall(headname)[0] # get the number

        G.add_node(head)

        for tail in tails.split():
            if head==tail:
                print("skipping self loop",head,tail, file=sys.stderr)
            G.add_edge(head,tail)

    return G
Copies the content of the specified message into the current message.
dataset/ETHPy150Open networkx/networkx/examples/graph/roget.py/roget_graph--crossover with--dataset/ETHPy150Open AppScale/appscale/AppServer/google/net/proto2/python/public/message.py/Message.CopyFrom