'Return a node matching a given hash.'

def from_hash(self, version_slug, page, node_hash, project_slug=None):

    snapshots = NodeSnapshot.objects.filter(hash=node_hash, node__version__slug=version_slug, node__page=page)
    if project_slug:
        snapshots = snapshots.filter(node__project__slug=project_slug)
    if (not snapshots.exists()):
        raise DocumentNode.DoesNotExist(('No    node    exists    on    %s    with    a    current    hash    of    %s' % (page, node_hash)))
    if (snapshots.count() == 1):
        node = snapshots[0].node
    else:
        number_of_nodes = len(set(snapshots.values_list('node')))
        if (number_of_nodes == 1):
            node = snapshots[0].node
        else:
            raise NotImplementedError('\n                                                                There    is    more    than    one    node    with    this    content    on    this    page.\n                                                                In    the    future,    ReadTheDocs    will    implement    an    indexing    feature\n                                                                to    allow    unique    identification    of    nodes    on    the    same    page    with    the    same    content.\n                                                                ')
    return node
