docstr: Wrapper around a `.Legend` to support mouse dragging.
  
  Parameters
  ----------
  legend : `.Legend`
      The `.Legend` instance to wrap.
  use_blit : bool, optional
      Use blitting for faster image composition. For details see
      :ref:`func-animation`.
  update : {'loc', 'bbox'}, optional
      If "loc", update the *loc* parameter of the legend upon finalizing.
      If "bbox", update the *bbox_to_anchor* parameter.
docstr_tok: ["Wrapper","around","a","`",".Legend","`","to","support","mouse","dragging",".","Parameters","--","--","--","--","--","legend",":","`",".Legend","`","The","`",".Legend","`","instance","to","wrap",".","use_blit",":","bool",",","optional","Use","blitting","for","faster","image","composition",".","For","details","see",":","ref",":","`","func-animation","`",".","update",":","{","'loc","'",",","'bbox","'","}",",","optional","If","``","loc","''",",","update","the","*","loc","*","parameter","of","the","legend","upon","finalizing",".","If","``","bbox","''",",","update","the","*","bbox_to_anchor","*","parameter","."]
code: def __init__(self, legend, use_blit=False, update="loc"):
      """
      Wrapper around a `.Legend` to support mouse dragging.
  
      Parameters
      ----------
      legend : `.Legend`
          The `.Legend` instance to wrap.
      use_blit : bool, optional
          Use blitting for faster image composition. For details see
          :ref:`func-animation`.
      update : {'loc', 'bbox'}, optional
          If "loc", update the *loc* parameter of the legend upon finalizing.
          If "bbox", update the *bbox_to_anchor* parameter.
      """
      self.legend = legend
  
      _api.check_in_list(["loc", "bbox"], update=update)
      self._update = update
  
      super().__init__(legend, legend._legend_box, use_blit=use_blit)
  
imports: import itertools
  import logging
  import numbers
  import time
  import numpy
  import matplotlib
  from matplotlib import _api, _docstring, 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 1 to create a new DraggableLegend object from inherited base classes: DraggableOffsetBox with example: obj = DraggableLegend(legend, use_blit, update)