def get_next_id(self):
        try:
            query = {'_id': 'last_id'}
            update = {'$inc': {'id': 1}}
            fn = self.db.internal.find_and_modify
            row = fn(query, update, upsert=True, new=True)
        except Exception as e:
            raise DatabaseException(e)
        return row['id']
def test_impl(n):
            df1 = pd.DataFrame({'key1': np.arange(n), 'A': np.arange(n) + 1.0})
            df2 = pd.DataFrame({'key2': n - np.arange(n), 'A': n + np.arange(n) + 1.0})
            df3 = pd.concat([df1, df2])
            return df3.A.sum() + df3.key2.sum()