def _edge_list_to_sframe(ls, src_column_name, dst_column_name):
    """
    Convert a list of edges into an SFrame.
    """
    sf = SFrame()

    if type(ls) == list:
        cols = reduce(set.union, (set(v.attr.keys()) for v in ls))
        sf[src_column_name] = [e.src_vid for e in ls]
        sf[dst_column_name] = [e.dst_vid for e in ls]
        for c in cols:
            sf[c] = [e.attr.get(c) for e in ls]

    elif type(ls) == Edge:
        sf[src_column_name] = [ls.src_vid]
        sf[dst_column_name] = [ls.dst_vid]

    else:
        raise TypeError('Edges type {} is Not supported.'.format(type(ls)))

    return sf
Convert a list of edges into an SFrame.