import networkx


def NetXGraphObject(molobj):
    """ Return graph object created from "mol" object connect data
    
    :param obj molobj: 'mol' object
    :return: netx(obj) - networkx class
             G(object) - graph object
    """
    G=networkx.Graph()
    nodelst=[]; edgelst=[]
    for atom in molobj.atm:
        i=atom.seqnmb
        nodelst.append(i)
        for j in atom.conect:
            if j > i: continue
            edgelst.append([i,j])
    G.add_nodes_from(nodelst)
    G.add_edges_from(edgelst)

    return networkx,G