code: def test_weighted(self):
      heatmap = heatmap_layer(self.locations, weights=self.weights)
      state = heatmap.get_state()
      assert state["_view_name"] == "WeightedHeatmapLayerView"
      assert state["_model_name"] == "WeightedHeatmapLayerModel"
      assert state["weights"] == self.weights
      assert state["locations"] == self.locations
  
imports: import unittest
  import pytest
  import traitlets
  from ..heatmap import _HeatmapOptionsMixin, heatmap_layer, Heatmap, WeightedHeatmap
  from ..geotraitlets import InvalidPointException, InvalidWeightException
label_desc: Use image node_id 2 for calling the HeatmapLayer obj's underlying member method code with example usage: obj.test_weighted() without return types