def hugeOffsetTestHelper(self, fetch):
<EOL>save_max_query_offset = datastore_stub_util._MAX_QUERY_OFFSET<EOL>try:<EOL><INDENT>datastore_stub_util._MAX_QUERY_OFFSET = <NUM_LIT:10><EOL>ndb = model<EOL>class M(ndb.Model):<EOL><INDENT>a = ndb.IntegerProperty()<EOL><DEDENT>ms = [M(a=i, id='<STR_LIT>' % i) for i in range(<NUM_LIT>)]<EOL>ks = ndb.put_multi(ms)<EOL>q = M.query().order(M.a)<EOL>xs = fetch(q, <NUM_LIT:9>)<EOL>self.assertEqual(xs, ms[<NUM_LIT:9>:<NUM_LIT:10>])<EOL>xs = fetch(q, <NUM_LIT:10>)<EOL>self.assertEqual(xs, ms[<NUM_LIT:10>:<NUM_LIT:11>])<EOL>xs = fetch(q, <NUM_LIT:11>)<EOL>self.assertEqual(xs, ms[<NUM_LIT:11>:<NUM_LIT:12>])<EOL>xs = fetch(q, <NUM_LIT>)<EOL>self.assertEqual(xs, ms[<NUM_LIT>:<NUM_LIT>])<EOL>xs = fetch(q, <NUM_LIT>)<EOL>self.assertEqual(xs, ms[<NUM_LIT>:<NUM_LIT:32>])<EOL><DEDENT>finally:<EOL><INDENT>datastore_stub_util._MAX_QUERY_OFFSET = save_max_query_offset<EOL><DEDENT>
Helper function to test large offsets.

        Args:
          fetch: A function that takes in (query, offset) and returns a list with
          one result.