def _get_result(self, hit, parent_class=None):
    doc_class = Hit
    dt = hit.get('_type')
    if ('_nested' in hit):
        doc_class = self._resolve_nested(hit, parent_class)
    elif (dt in self._doc_type_map):
        doc_class = self._doc_type_map[dt]
    else:
        for doc_type in self._doc_type:
            if (hasattr(doc_type, '_matches') and doc_type._matches(hit)):
                doc_class = doc_type
                break
    for t in hit.get('inner_hits', ()):
        hit['inner_hits'][t] = Response(self, hit['inner_hits'][t], doc_class=doc_class)
    callback = getattr(doc_class, 'from_es', doc_class)
    return callback(hit)
def _get_result(self, hit, parent_class=None):
    doc_class = Hit
    dt = hit.get('_type')
    if ('_nested' in hit):
        doc_class = self._resolve_nested(hit, parent_class)
    elif (dt in self._doc_type_map):
        doc_class = self._doc_type_map[dt]
    else:
        for doc_type in self._doc_type:
            if (hasattr(doc_type, '_matches') and doc_type._matches(hit)):
                doc_class = doc_type
                break
    for t in hit.get('inner_hits', ()):
        hit['inner_hits'][t] = Response(self, hit['inner_hits'][t], doc_class=doc_class)
    callback = getattr(doc_class, 'from_es', doc_class)
    return callback(hit)