def pre_run_cell(self, cellno, code):
        """Executes before the user-entered code in `ipython` is run. This
        intercepts loops and other problematic code that would produce lots of
        database entries and streamlines it to produce only a single entry.

        Args:
            cellno (int): the cell number that is about to be executed.
            code (str): python source code that is about to be executed.
        """
        #First, we look for loops and list/dict comprehensions in the code. Find
        #the id of the latest cell that was executed.
        self.cellid = cellno
        
        #If there is a loop somewhere in the code, it could generate millions of
        #database entries and make the notebook unusable.
        import ast
        if findloop(ast.parse(code)):
            #Disable the acorn logging systems so that we don't pollute the
            #database.
            from acorn.logging.decoration import set_streamlining
            set_streamlining(True)

            #Create the pre-execute entry for the database.
            from time import time
            self.pre = {
                "m": "loop",
                "a": None,
                "s": time(),
                "r": None,
                "c": code,
            }