<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_instance(page_to_crawl):
 """Return an instance of CrawlModel."""

    global _instances
    if isinstance(page_to_crawl, basestring):
        uri = page_to_crawl
        page_to_crawl = crawlpage.get_instance(uri)
    elif isinstance(page_to_crawl, crawlpage.CrawlPage):
        uri = page_to_crawl.uri
    else:
        raise TypeError(
            "get_instance() expects a parker.CrawlPage "
            "or basestring derivative."
        )

    try:
        instance = _instances[uri]
    except KeyError:
        instance = CrawlModel(page_to_crawl)
        _instances[uri] = instance

    return instance