MCPcopy Create free account
hub / github.com/KentBeck/BPlusTree3 / get_page

Function get_page

python/examples/range_queries.py:150–159  ·  view source on GitHub ↗

Get a page of products starting from start_id.

(start_id, page_size)

Source from the content-addressed store, hash-verified

148 print("Simulating paginated API responses:")
149
150 def get_page(start_id, page_size):
151 """Get a page of products starting from start_id."""
152 results = []
153 count = 0
154 for product_id, product in tree.range(start_id, None):
155 results.append((product_id, product))
156 count += 1
157 if count >= page_size:
158 break
159 return results
160
161 # Simulate pagination
162 page_size = 10

Callers 1

demo_pagination_patternFunction · 0.85

Calls 1

rangeMethod · 0.45

Tested by

no test coverage detected