code: def parity_even_p(state, marked_qubits):
      
      assert isinstance(state, int), \
          f"{state} is not an integer. Must call parity_even_p with an integer state."
      mask = 0
      for q in marked_qubits:
          mask |= 1 << q
      return bin(mask & state).count("1") % 2 == 0
docs: Calculates the parity of elements at indexes in marked_qubits
  
      Parity is relative to the binary representation of the integer state.
  
      :param state: The wavefunction index that corresponds to this state.
      :param marked_qubits: The indexes to be considered in the parity sum.
      :returns: A boolean corresponding to the parity.