original_docstring: 
      Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for
      each selector. Total number of curves will be num_selectors * num_y_attr_names.
      :param stats: A dictionary where each entry corresponds to the SimulationStatsDistribution of each selector.
      :param y_attr_names: The names of the attributes to plot on the y axis.
      :param y_attr_labels: The labels for the legend of the attributes to plot on the y axis.
      :param title: The title of the figure.
      :param x_label: The title of the x-axis.
      :param y_label: The title of the y-axis.
      :param legend_loc: The location of the legend.
      :param plot_n_not_ambiguous_noise_cases: If True, indicate the number of noise easy cases left at the end of the
      simulation
      for each selector. If all cases are selected indicate the corresponding iteration.
      :return: The figure and axis with all the curves plotted.
      
docstring: Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for
  each selector. Total number of curves will be num_selectors * num_y_attr_names.
docstring_tokens: Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for each selector . Total number of curves will be num_selectors * num_y_attr_names .
code: def plot_stats_for_all_selectors(stats: Dict[str, SimulationStatsDistribution],
                                   y_attr_names: List[str],
                                   y_attr_labels: List[str],
                                   title: str = '',
                                   x_label: str = '',
                                   y_label: str = '',
                                   legend_loc: Union[int, str] = 2,
                                   fontsize: int = 12,
                                   figsize: Tuple[int, int] = (14, 10),
                                   plot_n_not_ambiguous_noise_cases: bool = False,
                                   **plot_kwargs: Any) -> Tuple[plt.Figure, plt.Axes]:
      """
      Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for
      each selector. Total number of curves will be num_selectors * num_y_attr_names.
      :param stats: A dictionary where each entry corresponds to the SimulationStatsDistribution of each selector.
      :param y_attr_names: The names of the attributes to plot on the y axis.
      :param y_attr_labels: The labels for the legend of the attributes to plot on the y axis.
      :param title: The title of the figure.
      :param x_label: The title of the x-axis.
      :param y_label: The title of the y-axis.
      :param legend_loc: The location of the legend.
      :param plot_n_not_ambiguous_noise_cases: If True, indicate the number of noise easy cases left at the end of the
      simulation
      for each selector. If all cases are selected indicate the corresponding iteration.
      :return: The figure and axis with all the curves plotted.
      """
      colors = ['blue', 'red', 'orange', 'brown', 'black', 'purple', 'green', 'gray', 'olive', 'cyan', 'yellow', 'pink']
      linestyles = ['-', '--']
      fig, ax = plt.subplots(figsize=figsize)
  
      # Sort alphabetically
      ordered_keys = sorted(stats.keys())
      # Put always oracle and random first (this crashes if oracle / random not there)
      ordered_keys.remove("Oracle")
      ordered_keys.remove("Random")
      ordered_keys.insert(0, "Oracle")
      ordered_keys.insert(1, "Random")
  
      for _stat_key, color in zip(ordered_keys, cycle(colors)):
          _stat = stats[_stat_key]
          if '(Posterior)' in _stat.name:
              _stat.name = _stat.name.split('(Posterior)')[0]
          for y_attr_name, y_attr_label, linestyle in zip(y_attr_names, y_attr_labels, cycle(linestyles)):
              color = assign_preset_color(name=_stat.name, color=color)
              _plot_mean_and_confidence_intervals(ax=ax, y=_stat.__getattribute__(y_attr_name), color=color,
                                                  label=y_attr_label + _stat.name, linestyle=linestyle, **plot_kwargs)
          if plot_n_not_ambiguous_noise_cases:
              average_value_attribute = np.mean(_stat.__getattribute__(y_attr_name), axis=0)
              std_value_attribute = np.std(_stat.__getattribute__(y_attr_name), axis=0)
              logging.debug(f"Method {_stat.name} - {y_attr_name} std: {std_value_attribute[-1]}")
              n_average_mislabelled_not_ambiguous = np.mean(_stat.num_remaining_mislabelled_not_ambiguous, axis=0)
              ax.text(average_value_attribute.size + 1, average_value_attribute[-1],
                      f"{average_value_attribute[-1]:.2f}", fontsize=fontsize - 4)
              no_mislabelled_not_ambiguous_remaining = np.where(n_average_mislabelled_not_ambiguous == 0)[0]
              if no_mislabelled_not_ambiguous_remaining.size > 0:
                  idx = np.min(no_mislabelled_not_ambiguous_remaining)
                  ax.scatter(idx + 1, average_value_attribute[idx], color=color, marker="s")
      ax.grid()
      ax.set_title(title, fontsize=fontsize)
      ax.set_xlabel(x_label, fontsize=fontsize)
      ax.set_ylabel(y_label, fontsize=fontsize)
      ax.legend(loc=legend_loc, fontsize=fontsize - 2)
      ax.xaxis.set_tick_params(labelsize=fontsize - 2)
      ax.yaxis.set_tick_params(labelsize=fontsize - 2)
  
      return fig, ax
code_tokens: def plot_stats_for_all_selectors ( stats : Dict [ str , SimulationStatsDistribution ] , y_attr_names : List [ str ] , y_attr_labels : List [ str ] , title : str = '' , x_label : str = '' , y_label : str = '' , legend_loc : Union [ int , str ] = 2 , fontsize : int = 12 , figsize : Tuple [ int , int ] = ( 14 , 10 ) , plot_n_not_ambiguous_noise_cases : bool = False , ** plot_kwargs : Any ) -> Tuple [ plt . Figure , plt . Axes ] : colors = [ 'blue' , 'red' , 'orange' , 'brown' , 'black' , 'purple' , 'green' , 'gray' , 'olive' , 'cyan' , 'yellow' , 'pink' ] linestyles = [ '-' , '--' ] fig , ax = plt . subplots ( figsize = figsize ) ordered_keys = sorted ( stats . keys ( ) ) ordered_keys . remove ( "Oracle" ) ordered_keys . remove ( "Random" ) ordered_keys . insert ( 0 , "Oracle" ) ordered_keys . insert ( 1 , "Random" ) for _stat_key , color in zip ( ordered_keys , cycle ( colors ) ) : _stat = stats [ _stat_key ] if '(Posterior)' in _stat . name : _stat . name = _stat . name . split ( '(Posterior)' ) [ 0 ] for y_attr_name , y_attr_label , linestyle in zip ( y_attr_names , y_attr_labels , cycle ( linestyles ) ) : color = assign_preset_color ( name = _stat . name , color = color ) _plot_mean_and_confidence_intervals ( ax = ax , y = _stat . __getattribute__ ( y_attr_name ) , color = color , label = y_attr_label + _stat . name , linestyle = linestyle , ** plot_kwargs ) if plot_n_not_ambiguous_noise_cases : average_value_attribute = np . mean ( _stat . __getattribute__ ( y_attr_name ) , axis = 0 ) std_value_attribute = np . std ( _stat . __getattribute__ ( y_attr_name ) , axis = 0 ) logging . debug ( f"Method {_stat.name} - {y_attr_name} std: {std_value_attribute[-1]}" ) n_average_mislabelled_not_ambiguous = np . mean ( _stat . num_remaining_mislabelled_not_ambiguous , axis = 0 ) ax . text ( average_value_attribute . size + 1 , average_value_attribute [ - 1 ] , f"{average_value_attribute[-1]:.2f}" , fontsize = fontsize - 4 ) no_mislabelled_not_ambiguous_remaining = np . where ( n_average_mislabelled_not_ambiguous == 0 ) [ 0 ] if no_mislabelled_not_ambiguous_remaining . size > 0 : idx = np . min ( no_mislabelled_not_ambiguous_remaining ) ax . scatter ( idx + 1 , average_value_attribute [ idx ] , color = color , marker = "s" ) ax . grid ( ) ax . set_title ( title , fontsize = fontsize ) ax . set_xlabel ( x_label , fontsize = fontsize ) ax . set_ylabel ( y_label , fontsize = fontsize ) ax . legend ( loc = legend_loc , fontsize = fontsize - 2 ) ax . xaxis . set_tick_params ( labelsize = fontsize - 2 ) ax . yaxis . set_tick_params ( labelsize = fontsize - 2 ) return fig , ax
short_docstring: Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for
  each selector.
short_docstring_tokens: Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for each selector .
comment: """
      Given the dictionary with SimulationStatsDistribution plot a curve for each attribute in the y_attr_names list for
      each selector. Total number of curves will be num_selectors * num_y_attr_names.
      :param stats: A dictionary where each entry corresponds to the SimulationStatsDistribution of each selector.
      :param y_attr_names: The names of the attributes to plot on the y axis.
      :param y_attr_labels: The labels for the legend of the attributes to plot on the y axis.
      :param title: The title of the figure.
      :param x_label: The title of the x-axis.
      :param y_label: The title of the y-axis.
      :param legend_loc: The location of the legend.
      :param plot_n_not_ambiguous_noise_cases: If True, indicate the number of noise easy cases left at the end of the
      simulation
      for each selector. If all cases are selected indicate the corresponding iteration.
      :return: The figure and axis with all the curves plotted.
      """$SEP$# Sort alphabetically$SEP$# Put always oracle and random first (this crashes if oracle / random not there)