class_docstr: Displays a legend used for describing the contents of a plot.
  
  LegendItems are most commonly created by calling :meth:`PlotItem.addLegend
  <pyqtgraph.PlotItem.addLegend>`.
  
  Note that this item should *not* be added directly to a PlotItem (via
  :meth:`PlotItem.addItem <pyqtgraph.PlotItem.addItem>`). Instead, make it a
  direct descendant of the PlotItem::
  
      legend.setParentItem(plotItem)
class_docstr_tok: ["Displays","a","legend","used","for","describing","the","contents","of","a","plot",".","LegendItems","are","most","commonly","created","by","calling",":","meth",":","`","PlotItem.addLegend","<","pyqtgraph.PlotItem.addLegend",">","`",".","Note","that","this","item","should","*","not","*","be","added","directly","to","a","PlotItem","(","via",":","meth",":","`","PlotItem.addItem","<","pyqtgraph.PlotItem.addItem",">","`",")",".","Instead",",","make","it","a","direct","descendant","of","the","PlotItem",":",":","legend.setParentItem","(","plotItem",")"]
docstr: Return the labelItem inside the legend for a given plotItem
  
  The label-text can be changed via labelItem.setText
docstr_tok: ["Return","the","labelItem","inside","the","legend","for","a","given","plotItem","The","label-text","can","be","changed","via","labelItem.setText"]
code: def getLabel(self, plotItem):
      """Return the labelItem inside the legend for a given plotItem
  
      The label-text can be changed via labelItem.setText
      """
      out = [(it, lab) for it, lab in self.items if it.item == plotItem]
      try:
          return out[0][1]
      except IndexError:
          return None
  
imports: import math
  from ..None import functions
  from ..icons import invisibleEye
  from ..Point import Point
  from ..Qt import QtCore, QtGui, QtWidgets
  from .BarGraphItem import BarGraphItem
  from .GraphicsWidget import GraphicsWidget
  from .GraphicsWidgetAnchor import GraphicsWidgetAnchor
  from .LabelItem import LabelItem
  from .PlotDataItem import PlotDataItem
  from .ScatterPlotItem import ScatterPlotItem, drawSymbol
label_desc: Use image node_id 17 for calling the LegendItem obj's underlying member method code with example usage: obj.getLabel(plotItem) and returns: out, None