def _nested(submatch, match):
    """Check whether submatch is nested in match"""
    ids_submatch = set((key, tok.id) for key, tok in list(submatch.items()))
    id_match = set((key, tok.id) for key, tok in list(match.items()))
    return set.issubset(ids_submatch, id_match)