code: def test_overlay_legend_with_labels(self):
      overlay = (
          Curve(range(10), label="A") * Curve(range(10), label="B")
      ).opts(legend_labels={"A": "A Curve", "B": "B Curve"})
      plot = mpl_renderer.get_plot(overlay)
      legend = plot.handles["legend"]
      legend_labels = [l.get_text() for l in legend.texts]
      self.assertEqual(legend_labels, ["A Curve", "B Curve"])
  
imports: import numpy
  from holoviews.core import DynamicMap, HoloMap, NdOverlay, Overlay
  from holoviews.element import Curve, Scatter
  from ...utils import LoggingComparisonTestCase
  from .test_plot import TestMPLPlot, mpl_renderer
label_desc: Use image node_id 2 for calling the TestLegends obj's underlying member method code with example usage: obj.test_overlay_legend_with_labels() without return types