'Lookup \'key\'. There should be exactly one item in the associated relation.'

def lookup_unique(self, rel, node, depgraph):

    deps = [depgraph.nodes[dep] for dep in chain(*node[u'deps'].values()) if (depgraph.nodes[dep][u'rel'].lower() == rel.lower())]
    if (len(deps) == 0):
        raise KeyError((u"'%s'    doesn't    contain    a    feature    '%s'" % (node[u'word'], rel)))
    elif (len(deps) > 1):
        raise KeyError((u"'%s'    should    only    have    one    feature    '%s'" % (node[u'word'], rel)))
    else:
        return deps[0]
