def METHOD_NAME(changes: List[Change], allowed_changes: Mapping[Offset, AllowPolicy]
                     ) -> Tuple[List[Change], List[Change]]:
    """
    Classify list of changes into good(allowed) and bad(not allowed) based on allowed changes.
    :param list[(tuple,object,object)] changes: result of get_doc_changes
    :param allowed_changes: mapping from key to change policy (subset, superset, any)
    :return: good_changes, bad_chages
    """
    allowed_changes_index = dict(allowed_changes)
    good_changes: List[Change] = []
    bad_changes: List[Change] = []
    for offset, old_val, new_val in changes:
        allowance = allowed_changes_index.get(offset)
        allowance_offset = offset
        # If no allowance on this leaf, find if any parents have allowances.
        while allowance is None:
            if not allowance_offset:
                break
            allowance_offset = allowance_offset[:-1]
            allowance = allowed_changes_index.get(allowance_offset)
        if allowance is None:
            bad_changes.append((offset, old_val, new_val))
        elif hasattr(allowance, '__call__'):
            if allowance(allowance_offset, offset, old_val, new_val):
                good_changes.append((offset, old_val, new_val))
            else:
                bad_changes.append((offset, old_val, new_val))
        else:
            raise RuntimeError('Unknown change type: expecting validation function at %r' % offset)
    return good_changes, bad_changes