(doc, domain_hint=None, cache=None)
return doc_info
cache is just a dictionary that you can keep passing in to speed up info
    retrieval.
cache is just a dictionary that you can keep passing in to speed up info
    retrieval.
cache is just a dictionary that you can keep passing in to speed up info retrieval .
def get_doc_info(doc, domain_hint=None, cache=None):
    """
    cache is just a dictionary that you can keep passing in to speed up info
    retrieval.
    """
    domains = ()
    if isinstance(doc, dict):
        domains = doc.get('domains', ())
        domain_hint = domain_hint or (domains[0] if domains else None)
        doc_info = get_doc_info_couch(doc, domain_hint, cache=cache)
    else:
        doc_info = get_doc_info_sql(doc, cache=cache)

    if domain_hint and not (
        doc_info.domain == domain_hint or domain_hint in domains
    ):
        raise DomainMismatchException("Doc '%s' does not match the domain_hint '%s'" % (doc_info.id, domain_hint))

    return doc_info
def get_doc_info ( doc , domain_hint = None , cache = None ) : domains = ( ) if isinstance ( doc , dict ) : domains = doc . get ( 'domains' , ( ) ) domain_hint = domain_hint or ( domains [ 0 ] if domains else None ) doc_info = get_doc_info_couch ( doc , domain_hint , cache = cache ) else : doc_info = get_doc_info_sql ( doc , cache = cache ) if domain_hint and not ( doc_info . domain == domain_hint or domain_hint in domains ) : raise DomainMismatchException ( "Doc '%s' does not match the domain_hint '%s'" % ( doc_info . id , domain_hint ) ) return doc_info