def METHOD_NAME(self, nb):
    if not self.from_log: return
    self.filter_out_non_imports(nb)
    self._log_temp_file = tempfile.mkstemp()
    log_fn = self._log_temp_file[1]
    for e in self.otter_log.entries:
        e.flush_to_file(log_fn)
    nb.cells.append(nbf.v4.new_code_cell(dedent(f"""\
        import json
        from otter import Notebook
        from otter.check.logs import Log
        from otter.utils import get_variable_type
        variables = json.loads(\"\"\"{json.dumps(self.variables)}\"\"\")
        log = Log.from_file("{log_fn}")
        logged_questions = []
        grader = Notebook()
        for entry in log.question_iterator():
            shelf = entry.unshelve(globals())
            if variables is not None:
                for k, v in shelf.items():
                    full_type = get_variable_type(v)
                    if not (k in variables and variables[k] == full_type):
                        del shelf[k]
                        print(f"Found variable of different type than expected: {{k}}")
            globals().update(shelf)
            grader.check(entry.question)
            logged_questions.append(entry.question)
        print(f"Questions executed from log: {{', '.join(logged_questions)}}")
    """)))