def format_level_1_memory(memory):
formatted_memory = _list_to_complex_array(memory)<EOL>if not <NUM_LIT:1> <= len(formatted_memory.shape) <= <NUM_LIT:2>:<EOL><INDENT>raise QiskitError('<STR_LIT>')<EOL><DEDENT>return formatted_memory<EOL>
Format an experiment result memory object for measurement level 1.

    Args:
        memory (list): Memory from experiment with `meas_level==1`. `avg` or
            `single` will be inferred from shape of result memory.

    Returns:
        np.ndarray: Measurement level 1 complex numpy array

    Raises:
        QiskitError: If the returned numpy array does not have 1 (avg) or 2 (single)
            indicies.