def search(self, searchtext, startrow=None, startcol=None, search_forward=True):
        searchtext = searchtext.lower()
        if search_forward:
            if startrow is not None and startcol is not None:
                row = startrow
            else:
                startcol = self.GetGridCursorCol() + 1
                row = self.GetGridCursorRow()
                if startcol >= self.GetNumberCols():
                    startcol = 0
                    row += 1
            while True:
                for col in range(startcol, self.table.GetNumberCols()):
                    try:
                        foo = self.table.GetValue(row, col)
                        text = self._getvalue(row, col)
                        if searchtext in text.string().lower():
                            self.SetGridCursor(row, col)
                            self.MakeCellVisible(row, col)
                            return
                    except IndexError:
                        return
                startcol = 0
                row += 1
        else:
            if startrow is not None and startcol is not None:
                row = startrow
            else:
                startcol = self.GetGridCursorCol() - 1
                row = self.GetGridCursorRow()
                if startcol < 0:
                    startcol = self.GetNumberCols() - 1
                    row -= 1
            while True:
                for col in range(startcol, -1, -1):
                    try:
                        foo = self.table.GetValue(row, col)
                        text = self._getvalue(row, col)
                        if searchtext in text.string().lower():
                            self.SetGridCursor(row, col)
                            self.MakeCellVisible(row, col)
                            return
                    except IndexError:
                        return
                startcol = self.table.GetNumberCols()-1
                row -= 1
Convert a number of seconds into human readable compact string.
dataset/ETHPy150Open ipython/ipython-py3k/IPython/deathrow/igrid.py/IGridGrid.search--crossover with--dataset/ETHPy150Open rietveld-codereview/rietveld/codereview/library.py/format_duration