def _deprecate_grandchild_assert_attributes_in_sys_modules():
    """Ensure submodule attributes are identical to sys.modules values."""
    import cirq.testing._compat_test_data.module_a.fake_ab  # type: ignore

    assert (
        cirq.testing._compat_test_data.module_a.fake_ab
        is sys.modules['cirq.testing._compat_test_data.module_a.fake_ab']
    )
    assert (
        cirq.testing._compat_test_data.module_a
        is sys.modules['cirq.testing._compat_test_data.module_a']
    )
    assert cirq.testing._compat_test_data is sys.modules['cirq.testing._compat_test_data']
Ensure submodule attributes are identical to sys.modules values.
cirq-core/cirq/_compat_test.py