Generate a random section of the code, 64 - 128 lines long
(n_lines: int)
| 341 | |
| 342 | |
| 343 | def _generate_random_section(n_lines: int) -> Tuple[int, int]: |
| 344 | """Generate a random section of the code, 64 - 128 lines long""" |
| 345 | random_length = random.randint(64, 128) |
| 346 | if random_length > n_lines: |
| 347 | random_length = n_lines |
| 348 | random_start = random.randint(0, n_lines - random_length) |
| 349 | random_end = random_start + random_length |
| 350 | return random_start, random_end |
| 351 | |
| 352 | |
| 353 | def _gather_info(config, commits) -> list[dict[str, Any]]: |