def recursive_search(parser: Callable,  seeds: List[str], depth: int = 2, skip: List[str] = [], unit: str = 'links', base_url: str = None, **kwargs) -> Tuple[List[str], List[str]]:
    """Find math recursively. Look in `seeds` for math and further sites to look.

    Args:
        parser (Callable): A function that returns a `Tuple[List[str], List[str]]` of math and ids (for `base_url`) respectively.
        seeds (List[str]): Fist set of ids.
        depth (int, optional): How many iterations to look for. Defaults to 2.
        skip (List[str], optional): List of alreadly visited ids. Defaults to [].
        unit (str, optional): Tqdm verbose unit description. Defaults to 'links'.
        base_url (str, optional): Base url to add ids to. Defaults to None.

    Returns:
        Tuple[List[str],List[str]]: Returns list of found math and visited ids respectively.
    """
    visited, links = set(skip), set(seeds)
    math = []
    try:
        for i in range(int(depth)):
            link_list = list(links)
            random.shuffle(link_list)
            t_bar = tqdm(link_list, initial=len(visited), unit=unit)
            for link in t_bar:
                if not link in visited:
                    t_bar.set_description('searching %s' % (link[:15]))
                    if base_url:
                        m, l = parser(base_url+link, **kwargs)
                    else:
                        m, l = parser(link, **kwargs)
                    # check if we got any math from this wiki page and
                    # if not terminate the tree
                    if len(m) > 0:
                        for li in l:
                            links.add(li)
                        # t_bar.total = len(links)
                        math.extend(m)
                    visited.add(link)
        return list(visited), list(set(math))
    except Exception as e:
        logging.debug(e)
        return list(visited), list(set(math))
    except KeyboardInterrupt:
        return list(visited), list(set(math))
Find math recursively. Look in `seeds` for math and further sites to look.

    Args:
        parser (Callable): A function that returns a `Tuple[List[str], List[str]]` of math and ids (for `base_url`) respectively.
        seeds (List[str]): Fist set of ids.
        depth (int, optional): How many iterations to look for. Defaults to 2.
        skip (List[str], optional): List of alreadly visited ids. Defaults to [].
        unit (str, optional): Tqdm verbose unit description. Defaults to 'links'.
        base_url (str, optional): Base url to add ids to. Defaults to None.

    Returns:
        Tuple[List[str],List[str]]: Returns list of found math and visited ids respectively.
    
pix2tex/dataset/scraping.py