Given a list of GO objects, return: paths, user GOs as ints, all GO terms paths.

def get_paths_goobjs(go_objs, go_top=None, go2obj=None):
    """Given a list of GO objects, return: paths, user GOs as ints, all GO terms paths."""
    go_paths = []  # Collect all paths for go_objs
    go_all = set() # Collect all GO terms in all paths
    pathobj = GoPaths()
    for go_obj in go_objs:
        #print "?FIND PATHS FOR {}?".format(go_obj.id)
        if go_obj.id not in go_all: # GO not yet seen in paths already found
            #print "!FIND PATHS FOR {}!".format(go_obj.id)
            paths_curr = pathobj.get_paths_from_to(go_obj, go_top, True)
            if paths_curr:
                for path_goobjs in paths_curr:
                    for path_goobj in path_goobjs:
                        goid = path_goobj.id
                        if goid not in go_all:
                            go_all.add(goid)
                            go2obj[goid] = path_goobj
                # go_all.update(GO.id for path in paths_curr for GO in path)
                go_paths.extend(path for path in paths_curr)
    return go_paths, go_all