code: def _add_interaction(int_type, **kwargs):
      """Add the interaction for the specified type.
  
      If a figure is passed using the key-word argument `figure` it is used. Else
      the context figure is used.
      If a list of marks are passed using the key-word argument `marks` it
      is used. Else the latest mark that is passed is used as the only mark
      associated with the selector.
  
      Parameters
      ----------
      int_type: type
          The type of interaction to be added.
      """
  
      fig = kwargs.pop("figure", current_figure())
      marks = kwargs.pop("marks", [_context["last_mark"]])
  
      for name, traitlet in int_type.class_traits().items():
          dimension = traitlet.get_metadata("dimension")
          if dimension is not None:
              # only scales have this attribute in interactions
              kwargs[name] = _get_context_scale(dimension)
      kwargs["marks"] = marks
      interaction = int_type(**kwargs)
      if fig.interaction is not None:
          fig.interaction.close()
      fig.interaction = interaction
      return interaction
  
imports: import sys
  from collections import OrderedDict
  from IPython.display import display
  from ipywidgets import Image
  from numpy import arange, issubdtype, array, column_stack, shape
  from .figure import Figure
  from bqscales import Scale, LinearScale, Mercator
  from .axes import Axis
  from .marks import Lines, Scatter, Hist, Bars, OHLC, Pie, Map, Image, Label, HeatMap, GridHeatMap, topo_load, Boxplot, Bins
  from .interacts import BrushIntervalSelector, FastIntervalSelector, BrushSelector, IndexSelector, MultiSelector, LassoSelector
  from traitlets.utils.sentinel import Sentinel
  import functools
label_desc: Use image node_id 37 for calling a global function with example usage: _add_interaction(int_type) and returns: interaction