code: def _build_legend(ax, kind, legend_label):
      """Take an axis and builds a custom legend.
  
      Adds a legend item based off of `legend_label` for confidence intervals
  
      Parameters
      ----------
      ax : :class:`matplotlib.axes.Axes`
          The Axes for which the legend will be modified.
  
      kind : str
          The type of plot to display, e.g., "point", "bar", "line", etc.
          The supported values are "point" and those listed in :meth:`pandas.DataFrame.plot`
  
      legend_label : str
          The label corresponding to the confidence interval bars
      """
      color = ax.lines[0].get_color() if kind == "point" else "black"
  
      # extend legend with user-provided legend_label
      handles, labels = ax.get_legend_handles_labels()
      custom_line = [Line2D([0], [0], color=color, label=legend_label)]
      handles.extend(custom_line)
      ax.legend(handles=handles)
  
file_path: fairlearn/fairlearn/metrics/_plotter.py
imports: from typing import List, Union
  import numpy
  import pandas
  from matplotlib.lines import Line2D
  from sklearn.utils import check_consistent_length
  from ._metric_frame import MetricFrame
label_desc: Use image node_id 2 for calling a global function with example usage: _build_legend(ax, kind, legend_label) without return types