code: def is_constant(self, qc: QuantumComputer, bitstring_map: Dict[str, str]) -> bool:
          
          self._init_attr(bitstring_map)
  
          prog = Program()
          dj_ro = prog.declare('ro', 'BIT', len(self.computational_qubits))
          prog += self.deutsch_jozsa_circuit
          prog += [MEASURE(qubit, ro) for qubit, ro in zip(self.computational_qubits, dj_ro)]
          executable = qc.compile(prog)
          returned_bitstring = qc.run(executable)
          # We are only running a single shot, so we are only interested in the first element.
          bitstring = np.array(returned_bitstring, dtype=int)
          constant = all([bit == 0 for bit in bitstring])
          return constant
docs: Computes whether bitstring_map represents a constant function, given that it is constant
           or balanced. Constant means all inputs map to the same value, balanced means half of the
           inputs maps to one value, and half to the other.
  
          :param QVMConnection cxn: The connection object to the Rigetti cloud to run pyQuil programs.
          :param bitstring_map: A dictionary whose keys are bitstrings, and whose values are bits
           represented as strings.
          :type bistring_map: Dict[String, String]
          :return: True if the bitstring_map represented a constant function, false otherwise.
          :rtype: bool