MCPcopy Create free account
hub / github.com/cortex-js/compute-engine / main

Function main

docs/mathnet/scripts/fetch-sample.py:39–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

37 return None
38
39
40def main() -> None:
41 ap = argparse.ArgumentParser()
42 ap.add_argument('--pages', type=int, default=8)
43 ap.add_argument(
44 '--offset-shift',
45 type=int,
46 default=0,
47 help='add this many rows to each evenly spaced offset',
48 )
49 ap.add_argument('--out', default='mathnet-sample.jsonl')
50 args = ap.parse_args()
51
52 stride = TOTAL // args.pages
53 max_offset = TOTAL - PAGE
54 offsets = [
55 min(args.offset_shift + i * stride, max_offset)
56 for i in range(args.pages)
57 ]
58 count = 0
59 with open(args.out, 'w') as f:
60 for offset in offsets:
61 data = fetch(offset)
62 if data is None:
63 continue

Callers 1

fetch-sample.pyFile · 0.70

Calls 4

rangeFunction · 0.85
fetchFunction · 0.85
getMethod · 0.65
printFunction · 0.50

Tested by

no test coverage detected