def METHOD_NAME(model):
    pytest.importorskip('transformers')
    from transformers import BertForMaskedLM, BertForSequenceClassification
    from transformers.models.bert.modeling_bert import BertOutput
    assert isinstance(model, BertForMaskedLM) or isinstance(model, BertForSequenceClassification)
    # ensure that within the entire model, no BertOutput exists, and at least one BERTGatedFFOutput does.
    assert model.modules is not None, 'model has .modules method'
    for module_class in model.modules():
        assert not isinstance(
            module_class, BertOutput
        ), 'A transformers.models.bert.modeling_bert.BertOutput should not be found in the model after surgery is applied.'
    assert any(
        isinstance(module_class, BERTGatedFFOutput) for module_class in model.modules()
    ), 'composer.algorithms.gated_linear_units.gated_linear_unit_layers.BERTGatedFFOutput is not found in the post-surgery model.'