def res_doc_type(corp, context_type, label_name, doc):
    if isstr(doc):
        query = {label_name: doc}
        d = corp.meta_int(context_type, query)
    elif isinstance(doc, dict):
        d = corp.meta_int(context_type, doc)
        
        #TODO: Define an exception for failed queries in
        #vsm.corpus. Use it here.
        doc = corp.view_metadata(context_type)[label_name][d]
    else:
        d, doc = doc, str(doc)

    return d, doc
Returns the customer for the given request (which means for the current
dataset/ETHPy150Open inpho/vsm/vsm/viewer/types.py/res_doc_type--crossover with--dataset/ETHPy150Open diefenbach/django-lfs/lfs/customer/utils.py/get_customer