def has_circles(path):
    """
    :param path: A sequence of node/edges
    :return: True if the path contains circles
    """

    nodes = set()
    for i, n in enumerate(path):
        if i % 2 == 0:
            if n in nodes:
                return True
            else:
                nodes.add(n)
    return False