hackernews/client.py
async def async_fetch_urls(urls, session, recursive=0):
    """Download (asynchronously) JSON from the urls.

    Params:
        urls : list[string] : list of urls to be fetched
        recursive : int : if positive, dig down to 'recursive' level of 'kids'

    Returns:
        list[dict] : list of dicts with HN posts in question
    """
    LOGGER.debug('fetching %s urls with recursive=%s', len(urls), recursive)
    tasks = [asyncio.ensure_future(async_fetch_url(url, session))
             for url in urls]
    items = await asyncio.gather(*tasks)
    if recursive > 0:
        new_items = []
        for i, item in enumerate(items):
            if item:
                kids = item.get('kids') or item.get('submitted') or []
                urls = [ITEM_URL.format(kid) for kid in kids]
                if urls:
                    LOGGER.debug('[%d/%d/%d] adding %s urls to the queue',
                                 i+1,
                                 len(items),
                                 len(items)+len(new_items),
                                 len(urls))
                    new_items += await async_fetch_urls(
                        urls, session, recursive=recursive-1)
        items += new_items
    return items
Download (asynchronously) JSON from the urls.

    Params:
        urls : list[string] : list of urls to be fetched
        recursive : int : if positive, dig down to 'recursive' level of 'kids'

    Returns:
        list[dict] : list of dicts with HN posts in question
    
Download (asynchronously) JSON from the urls.
Download ( asynchronously ) JSON from the urls .
async def async_fetch_urls(urls, session, recursive=0):
    LOGGER.debug('fetching %s urls with recursive=%s', len(urls), recursive)
    tasks = [asyncio.ensure_future(async_fetch_url(url, session))
             for url in urls]
    items = await asyncio.gather(*tasks)
    if recursive > 0:
        new_items = []
        for i, item in enumerate(items):
            if item:
                kids = item.get('kids') or item.get('submitted') or []
                urls = [ITEM_URL.format(kid) for kid in kids]
                if urls:
                    LOGGER.debug('[%d/%d/%d] adding %s urls to the queue',
                                 i+1,
                                 len(items),
                                 len(items)+len(new_items),
                                 len(urls))
                    new_items += await async_fetch_urls(
                        urls, session, recursive=recursive-1)
        items += new_items
    return items
async def async_fetch_urls ( urls , session , recursive = 0 ) : LOGGER . debug ( 'fetching %s urls with recursive=%s' , len ( urls ) , recursive ) tasks = [ asyncio . ensure_future ( async_fetch_url ( url , session ) ) for url in urls ] items = await asyncio . gather ( * tasks ) if recursive > 0 : new_items = [ ] for i , item in enumerate ( items ) : if item : kids = item . get ( 'kids' ) or item . get ( 'submitted' ) or [ ] urls = [ ITEM_URL . format ( kid ) for kid in kids ] if urls : LOGGER . debug ( '[%d/%d/%d] adding %s urls to the queue' , i + 1 , len ( items ) , len ( items ) + len ( new_items ) , len ( urls ) ) new_items += await async_fetch_urls ( urls , session , recursive = recursive - 1 ) items += new_items return items
Download (asynchronously) JSON from the urls.
Download ( asynchronously ) JSON from the urls .
"""Download (asynchronously) JSON from the urls.

    Params:
        urls : list[string] : list of urls to be fetched
        recursive : int : if positive, dig down to 'recursive' level of 'kids'

    Returns:
        list[dict] : list of dicts with HN posts in question
    """
list[dict] : list of dicts with HN posts in question
list [ dict ] : list of dicts with HN posts in question
urls
session
recursive
urls 
list[string] : list of urls to be fetched
list [ string ] : list of urls to be fetched
recursive 
int : if positive, dig down to 'recursive' level of 'kids'
int : if positive dig down to ' recursive ' level of ' kids '