code: def update_legend(plot, legend_kwarg, glyph_renderer):
      legend = _get_or_create_legend(plot)
      kwarg, value = next(iter(legend_kwarg.items()))
  
      _LEGEND_KWARG_HANDLERS[kwarg](value, legend, glyph_renderer)
  
file_path: bokeh/src/bokeh/plotting/_legends.py
imports: from __future__ import annotations
  import logging
  import numpy
  from ..core.properties import field, value
  from ..models import Legend, LegendItem
  from ..util.strings import nice_join
label_desc: Use image node_id 2 for calling a global function with example usage: update_legend(plot, legend_kwarg, glyph_renderer) without return types