code: def _plot_lines(
      x,
      y,
      sizes=None,
      labels=None,
      colors=None,
      marker_size=None,
      xlabel=None,
      ylabel=None,
      ax=None,
      ax_equal=False,
      figsize=None,
      show_legend=False,
      **kwargs,
  ):
      if ax is None:
          fig = plt.figure()
          ax = fig.add_subplot(111)
      else:
          fig = ax.figure
  
      if marker_size is None:
          # Choose a reasonable marker size based on number of points
          num_points = sum(len(xi) for xi in x)
          marker_size = 2.0 * (10 ** (4 - np.log10(num_points)))
          marker_size = max(1, min(marker_size, 50))
  
      colors = _get_qualitative_colors(len(y), colors=colors)
  
      xs = []
      ys = []
      cs = []
      ss = []
      for _x, _y, _s, _l, _c in zip(x, y, sizes, labels, colors):
          ax.plot(_x, _y, linestyle="-", label=_l, color=_c, **kwargs)
  
          xs.extend(_x)
          ys.extend(_y)
          cs.extend([_c] * len(_y))
          if _s is not None:
              # Scale sizes so that 0.5 * max(sizes) corresponds to `marker_size`
              min_marker_size = min(0.1, marker_size)
              sizeref = 0.5 * max(_s) / marker_size
              ss.extend(max(s / sizeref, min_marker_size) for s in _s)
  
      if not ss:
          ss = marker_size
  
      collection = ax.scatter(xs, ys, c=cs, s=ss, **kwargs)
  
      if show_legend:
          ax.legend()
  
      if figsize is not None:
          fig.set_size_inches(*figsize)
  
      if ax_equal:
          ax.axis("equal")
  
      if xlabel is not None:
          ax.set(xlabel=xlabel)
  
      if ylabel is not None:
          ax.set(ylabel=ylabel)
  
      return collection
  
imports: import itertools
  import logging
  import numpy
  import matplotlib
  from matplotlib.widgets import Button, LassoSelector
  from matplotlib.path import Path
  import matplotlib.pyplot
  from mpl_toolkits.axes_grid1 import make_axes_locatable
  from mpl_toolkits.axes_grid1.inset_locator import InsetPosition
  from mpl_toolkits.mplot3d import Axes3D
  import sklearn.metrics.pairwise
  import sklearn.metrics
  import eta.core.utils
  import fiftyone.core.context
  import fiftyone.core.utils
  from .base import InteractivePlot
  from .utils import best_fit_line, load_button_icon, parse_lines_inputs, parse_locations, parse_scatter_inputs
label_desc: Use image node_id 9 for calling a global function with example usage: _plot_lines(x, y, sizes, labels, colors, marker_size, xlabel, ylabel, ax, ax_equal, figsize, show_legend) and returns: collection