code: def test_register_context() -> None:
      # use as context manager unregisters tables created within each scope
      # on exit from that scope; arbitrary levels of nesting are supported.
      with pl.SQLContext() as ctx:
          _lf1 = pl.LazyFrame({"a": [1, 2, 3], "b": ["m", "n", "o"]})
          _lf2 = pl.LazyFrame({"a": [2, 3, 4], "c": ["p", "q", "r"]})
          ctx.register_globals()
          assert ctx.tables() == ["_lf1", "_lf2"]
  
          with ctx:
              _lf3 = pl.LazyFrame(
                  {"a": [3, 4, 5], "b": ["s", "t", "u"]}
              )
              _lf4 = pl.LazyFrame(
                  {"a": [4, 5, 6], "c": ["v", "w", "x"]}
              )
              ctx.register_globals(n=2)
              assert ctx.tables() == ["_lf1", "_lf2", "_lf3", "_lf4"]
  
          assert ctx.tables() == ["_lf1", "_lf2"]
  
      assert ctx.tables() == []
  
imports: from __future__ import annotations
  import datetime
  import math
  from pathlib import Path
  import pytest
  import polars
  import polars.selectors
  from polars.exceptions import ComputeError, InvalidOperationError
  from polars.testing import assert_frame_equal, assert_series_equal
label_desc: Use image node_id 33 for calling a global function with example usage: test_register_context() without return types