class_docstr: Place a legend on the figure/axes.
class_docstr_tok: ["Place","a","legend","on","the","figure\/axes","."]
docstr: Return a legend handler from *legend_handler_map* that
  corresponds to *orig_handler*.
  
  *legend_handler_map* should be a dictionary object (that is
  returned by the get_legend_handler_map method).
  
  It first checks if the *orig_handle* itself is a key in the
  *legend_handler_map* and return the associated value.
  Otherwise, it checks for each of the classes in its
  method-resolution-order. If no matching key is found, it
  returns ``None``.
docstr_tok: ["Return","a","legend","handler","from","*","legend_handler_map","*","that","corresponds","to","*","orig_handler","*",".","*","legend_handler_map","*","should","be","a","dictionary","object","(","that","is","returned","by","the","get_legend_handler_map","method",")",".","It","first","checks","if","the","*","orig_handle","*","itself","is","a","key","in","the","*","legend_handler_map","*","and","return","the","associated","value",".","Otherwise",",","it","checks","for","each","of","the","classes","in","its","method-resolution-order",".","If","no","matching","key","is","found",",","it","returns","``","None","``","."]
code: def get_legend_handler(legend_handler_map, orig_handle):
      """
      Return a legend handler from *legend_handler_map* that
      corresponds to *orig_handler*.
  
      *legend_handler_map* should be a dictionary object (that is
      returned by the get_legend_handler_map method).
  
      It first checks if the *orig_handle* itself is a key in the
      *legend_handler_map* and return the associated value.
      Otherwise, it checks for each of the classes in its
      method-resolution-order. If no matching key is found, it
      returns ``None``.
      """
      try:
          return legend_handler_map[orig_handle]
      except (TypeError, KeyError):  # TypeError if unhashable.
          pass
      for handle_type in type(orig_handle).mro():
          try:
              return legend_handler_map[handle_type]
          except KeyError:
              pass
      return None
  
imports: import itertools
  import logging
  import numbers
  import time
  import numpy
  import matplotlib
  from matplotlib import _api, _docstring, cbook, colors, offsetbox
  from matplotlib.artist import Artist, allow_rasterization
  from matplotlib.cbook import silent_list
  from matplotlib.font_manager import FontProperties
  from matplotlib.lines import Line2D
  from matplotlib.patches import Patch, Rectangle, Shadow, FancyBboxPatch, StepPatch
  from matplotlib.collections import Collection, CircleCollection, LineCollection, PathCollection, PolyCollection, RegularPolyCollection
  from matplotlib.text import Text
  from matplotlib.transforms import Bbox, BboxBase, TransformedBbox
  from matplotlib.transforms import BboxTransformTo, BboxTransformFrom
  from matplotlib.offsetbox import AnchoredOffsetbox, DraggableOffsetBox, HPacker, VPacker, DrawingArea, TextArea
  from matplotlib.container import ErrorbarContainer, BarContainer, StemContainer
  from .None import legend_handler
label_desc: Use image node_id 14 for calling the Legend obj's underlying member method code with example usage: obj.get_legend_handler(legend_handler_map, orig_handle) and returns: None, legend_handler_map, legend_handler_map