def _explain(self, tree):
self._explaining = True<EOL>self._call_list = []<EOL>old_call = self.connection.call<EOL>def fake_call(command, **kwargs):<EOL><INDENT>"""<STR_LIT>"""<EOL>if command == "<STR_LIT>":<EOL><INDENT>return old_call(command, **kwargs)<EOL><DEDENT>self._call_list.append((command, kwargs))<EOL>raise ExplainSignal<EOL><DEDENT>self.connection.call = fake_call<EOL>try:<EOL><INDENT>ret = self._run(tree[<NUM_LIT:1>])<EOL>try:<EOL><INDENT>list(ret)<EOL><DEDENT>except TypeError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT>finally:<EOL><INDENT>self.connection.call = old_call<EOL>self._explaining = False<EOL><DEDENT>
Set up the engine to do a dry run of a query