<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def MEASURE(qubit, classical_reg):
 """ Produce a MEASURE instruction. :param qubit: The qubit to measure. :param classical_reg: The classical register to measure into, or None. :return: A Measurement instance. """

    qubit = unpack_qubit(qubit)
    if classical_reg is None:
        address = None
    elif isinstance(classical_reg, int):
        warn("Indexing measurement addresses by integers is deprecated. "
             + "Replacing this with the MemoryReference ro[i] instead.")
        address = MemoryReference("ro", classical_reg)
    else:
        address = unpack_classical_reg(classical_reg)
    return Measurement(qubit, address)