code: def test_opacity(self):
      heatmap = heatmap_layer(self.locations, opacity=0.4)
      state = heatmap.get_state()
      assert state["opacity"] == 0.4
  
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 11 for calling the HeatmapLayer obj's underlying member method code with example usage: obj.test_opacity() without return types