code: def test_freeze(self, mock_recompute: MagicMock) -> None:
      d = Document()
      dm = bdm.DocumentModelManager(d)
  
      assert dm._freeze_count == 0
  
      with dm.freeze():
          assert dm._freeze_count == 1
          assert not mock_recompute.called
  
          with dm.freeze():
              assert dm._freeze_count == 2
              assert not mock_recompute.called
  
          assert dm._freeze_count == 1
          assert not mock_recompute.called
  
      assert dm._freeze_count == 0
      assert mock_recompute.called
  
imports: from __future__ import annotations
  import pytest
  import gc
  from unittest.mock import MagicMock, patch
  from bokeh.core.has_props import Local
  from bokeh.core.properties import Instance, Nullable
  from bokeh.core.types import ID
  from bokeh.document import Document
  from bokeh.model import Model
  from bokeh.models import Div, Row
  import bokeh.document.models
label_desc: Use image node_id 7 for calling the TestDocumentModelManager obj's underlying member method code with example usage: obj.test_freeze(mock_recompute) without return types