

def find_batch_sources(owner, repository, github_auth, run_times={
    
}):
    ' Starting with a Github repo API URL, generate a stream of master sources.\n    '
    source_urls = list(_find_batch_source_urls(owner, repository, github_auth))
    source_urls.sort(key=(lambda su: su['path']))
    source_urls.sort(key=(lambda su: (run_times.get(su['path']) or '9999')), reverse=True)
    for source_url in source_urls:
        _L.debug('Getting source {url}'.format(**source_url))
        try:
            more_source = get(source_url['url'], auth=github_auth).json()
        except ConnectionError:
            _L.info('Retrying to download {url}'.format(**more_source))
            try:
                sleep((GITHUB_RETRY_DELAY.seconds + (GITHUB_RETRY_DELAY.days * 86400)))
                more_source = get(source_url['url'], auth=github_auth).json()
            except ConnectionError:
                _L.error('Failed to download {url}'.format(**source_url))
                raise
        source = dict(content=more_source['content'])
        source.update(source_url)
        (yield source)

dataset/ETHPy150Open openaddresses/machine/openaddr/ci/__init__.py find_batch_sources/VarMisuse@141/243 `source`->`more_source`