<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _display_layers(circ: Circuit, qubits: Qubits) -> Circuit: """Separate a circuit into groups of gates that do not visually overlap"""

    N = len(qubits)
    qubit_idx = dict(zip(qubits, range(N)))
    gate_layers = DAGCircuit(circ).layers()

    layers = []
    lcirc = Circuit()
    layers.append(lcirc)
    unused = [True] * N

    for gl in gate_layers:
        assert isinstance(gl, Circuit)
        for gate in gl:
            indices = [qubit_idx[q] for q in gate.qubits]

            if not all(unused[min(indices):max(indices)+1]):
                # New layer
                lcirc = Circuit()
                layers.append(lcirc)
                unused = [True] * N

            unused[min(indices):max(indices)+1] = \
                [False] * (max(indices) - min(indices) + 1)
            lcirc += gate

    return Circuit(layers)