import itertools


def is_clique(old_graph, vertices):
    """
    Tests if vertices induce a clique in the graph
    Multigraphs are reduced to normal graphs

    Parameters
    ----------
    graph : networkx.Graph or networkx.MultiGraph
          graph
    vertices : list
          vertices which are tested
    Returns
    -------
    bool
        True if vertices induce a clique
    """
    subgraph = old_graph.subgraph(vertices)

    # Remove selfloops so the clique is well defined
    have_edges = set(subgraph.edges()) - set(subgraph.selfloop_edges())

    # Sort all edges to be in the (low, up) order
    have_edges = set([tuple(sorted(edge, key=int))
                      for edge in have_edges])

    want_edges = set([
        tuple(sorted(edge, key=int))
        for edge in itertools.combinations(vertices, 2)
    ])
    return want_edges == have_edges