def get_globals(self) -> dict[str, Any]:
        """Execute the code, and return a dict of globals it defines."""
        # A check that the caller really finished all the blocks they started.
        assert self.indent_level == 0
        # Get the Python source as a single string.
        python_source = str(self)
        # Execute the source, defining globals, and return them.
        global_namespace: dict[str, Any] = {}
        exec(python_source, global_namespace)
        return global_namespace
Execute the code, and return a dict of globals it defines.
coverage/templite.py