

def page(title=None, pageid=None, auto_suggest=True, redirect=True, preload=False):
    '\n  Get a WikipediaPage object for the page with title `title` or the pageid\n  `pageid` (mutually exclusive).\n\n  Keyword arguments:\n\n  * title - the title of the page to load\n  * pageid - the numeric pageid of the page to load\n  * auto_suggest - let Wikipedia find a valid page title for the query\n  * redirect - allow redirection without raising RedirectError\n  * preload - load content, summary, images, references, and links during initialization\n  '
    if (title is not None):
        if auto_suggest:
            (results, suggestion) = search(title, results=1, suggestion=True)
            try:
                title = (suggestion or results[0])
            except IndexError:
                raise PageError(title)
        return WikipediaPage(title, redirect=redirect, preload=preload)
    elif (pageid is not None):
        return WikipediaPage(pageid=pageid, preload=preload)
    else:
        raise ValueError('Either a title or a pageid must be specified')

dataset/ETHPy150Open goldsmith/Wikipedia/wikipedia/wikipedia.py page/original