code: def get_index(target, labels):
      """Get qubit labels from the rest of the line,and return indices
  
      >>> from sympy.physics.quantum.qasm import get_index
      >>> get_index('q0', ['q0', 'q1'])
      1
      >>> get_index('q1', ['q0', 'q1'])
      0
      """
      nq = len(labels)
      return flip_index(labels.index(target), nq)
  
imports: from math import prod
  from sympy.physics.quantum.gate import H, CNOT, X, Z, CGate, CGateS, SWAP, S, T, CPHASE
  from sympy.physics.quantum.circuitplot import Mz
label_desc: Use image node_id 5 for calling a global function with example usage: get_index(target, labels) and returns: flip_index