def METHOD_NAME(self, buffer, program):
    qobjStr = self.qobj_compiler.translate(program)
    import json
    from qiskit import Aer
    from qiskit.qobj.qobj import QasmQobjSchema
    from qiskit.qobj import (QasmQobj, QobjHeader,
                             QasmQobjInstruction,
                             QasmQobjExperiment, QasmQobjExperimentConfig,
                             QobjExperimentHeader, QasmQobjConfig)
    qobj_json = json.loads(qobjStr)
    qobj_json['qObject']['config']['shots']=self.shots
    qobj = QasmQobjSchema().load(qobj_json['qObject'])
    exps = qobj.experiments
    measures = {}
    qobj.experiments[0].config.n_qubits = buffer.size()
    for i in exps[0].instructions:
        if i.name == "measure":
            measures[i.memory[0]] =i.qubits[0]
    backend = Aer.get_backend('qasm_simulator')
    if self.noise_model is not None:
        job_sim = backend.run(qobj, noise_model=self.noise_model)
    else:
        job_sim = backend.run(qobj)
    sim_result = job_sim.result()
    for b,c in sim_result.get_counts().items():
        bitstring = b
        if len(b) < buffer.size():
            tmp = ['0' for i in range(buffer.size())]
            for bit_loc, qubit in measures.items():
                lb = list(b)
                tmp[len(tmp)-1-qubit] = lb[len(b)-bit_loc-1]
            bitstring = ''.join(tmp)
        buffer.appendMeasurement(bitstring,c)