def paths_to_edges(paths, repeat=False):
    """Chops a list of paths into its edges.

    Parameters
    ----------
    paths: list of tuples
        list of the paths.

    repeat: bool (False)
        include edges repeats?

    Returns
    -------
    edges: list
        List of edges
    """
    edges = []
    for path in paths:
        edges += [(path[i], path[i+1]) for i in range(len(path)-1)]

    # Return a list of edges with repeats
    if repeat:
        return edges

    # Else remove repeats
    else:
        return list(set(edges))