MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / fetch_pull_requests

Method fetch_pull_requests

tools/commitlist.py:404–427  ·  view source on GitHub ↗
(
        self, numbers: list[int], batch_size: int, workers: int
    )

Source from the content-addressed store, hash-verified

402 return results
403
404 def fetch_pull_requests(
405 self, numbers: list[int], batch_size: int, workers: int
406 ) -> dict[int, PullRequestRecord]:
407 unique_numbers = sorted(set(numbers))
408 if not unique_numbers:
409 return {}
410 batches = [
411 unique_numbers[index : index + batch_size]
412 for index in range(0, len(unique_numbers), batch_size)
413 ]
414 results: dict[int, PullRequestRecord] = {}
415 if workers <= 1 or len(batches) == 1:
416 for batch in batches:
417 results.update(self._fetch_batch(batch))
418 return results
419
420 with ThreadPoolExecutor(max_workers=workers) as executor:
421 future_to_batch = {
422 executor.submit(self._fetch_batch, batch): batch
423 for batch in batches
424 }
425 for future in as_completed(future_to_batch):
426 results.update(future.result())
427 return results
428
429
430def build_commit_rows(

Callers 1

mainFunction · 0.80

Calls 5

_fetch_batchMethod · 0.95
setClass · 0.85
rangeFunction · 0.85
updateMethod · 0.45
resultMethod · 0.45

Tested by

no test coverage detected