'Get the exact spec OR get a single spec that matches.'

def _get_matching_spec_key(self, spec, **kwargs):

    key = spec.dag_hash()
    if (key not in self._data):
        match = self.query_one(spec, **kwargs)
        if match:
            return match.dag_hash()
        raise KeyError(('No    such    spec    in    database!    %s' % spec))
    return key
