code: def test_session_new_session(self, sentinel):
      s = sentinel(False)
  
      def handle_to_dict(msg):
          s.set(True)
          message = json.loads(msg)
          assert message["data"] == data
  
      message = {
          "id": 1,
          "table_name": "table1",
          "view_name": "view1",
          "cmd": "view",
      }
  
      manager = PerspectiveManager()
      session = manager.new_session()
      client_id = session.client_id
      table = Table(data)
  
      manager.host_table("table1", table)
  
      # create a view through the session to make sure it has a client id
      session.process(message, self.post)
  
      # make sure the client ID is attached to the new view
      assert len(manager._views.keys()) == 1
      assert manager._get_view("view1")._client_id == client_id
  
      to_dict_message = {
          "id": 2,
          "name": "view1",
          "cmd": "view_method",
          "method": "to_dict",
      }
  
      session.process(to_dict_message, handle_to_dict)
      assert s.get() is True
  
file_path: perspective/python/perspective/perspective/tests/manager/test_session.py
imports: import json
  import random
  from perspective import Table, PerspectiveManager
label_desc: Use image node_id 3 for calling the TestPerspectiveSession obj's underlying member method code with example usage: obj.test_session_new_session(sentinel) without return types