original_docstring:  Set up the engine to do a dry run of a query 
docstring: Set up the engine to do a dry run of a query
docstring_tokens: Set up the engine to do a dry run of a query
code: def _explain(self, tree):
          """ Set up the engine to do a dry run of a query """
          self._explaining = True
          self._call_list = []
          old_call = self.connection.call
  
          def fake_call(command, **kwargs):
              """ Replacement for connection.call that logs args """
              if command == "describe_table":
                  return old_call(command, **kwargs)
              self._call_list.append((command, kwargs))
              raise ExplainSignal
  
          self.connection.call = fake_call
          try:
              ret = self._run(tree[1])
              try:
                  list(ret)
              except TypeError:
                  pass
          finally:
              self.connection.call = old_call
              self._explaining = False
code_tokens: def _explain ( self , tree ) : self . _explaining = True self . _call_list = [ ] old_call = self . connection . call def fake_call ( command , ** kwargs ) : """ Replacement for connection.call that logs args """ if command == "describe_table" : return old_call ( command , ** kwargs ) self . _call_list . append ( ( command , kwargs ) ) raise ExplainSignal self . connection . call = fake_call try : ret = self . _run ( tree [ 1 ] ) try : list ( ret ) except TypeError : pass finally : self . connection . call = old_call self . _explaining = False
short_docstring: Set up the engine to do a dry run of a query
short_docstring_tokens: Set up the engine to do a dry run of a query
comment: """ Set up the engine to do a dry run of a query """$SEP$""" Replacement for connection.call that logs args """