code: def plotly_prediction_piechart(
      predictions_df, showlegend=True, size=250
  ):
      """Return piechart with predict_proba distributions for ClassifierExplainer
  
      Args:
          predictions_df (pd.DataFrame): generated with
              ClassifierExplainer.prediction_summary_df(index)
          showlegend (bool, optional): Show the legend. Defaults to True.
          size (int): width and height of the plot
  
      Returns:
          plotly.Fig
      """
  
      data = [
          go.Pie(
              labels=predictions_df.label.values,
              values=predictions_df.probability.values,
              hole=0.3,
              sort=False,
          )
      ]
      layout = dict(
          autosize=False,
          width=size,
          height=size,
          margin=dict(l=20, r=20, b=20, t=30, pad=4),
          showlegend=showlegend,
      )
      fig = go.Figure(data, layout)
      return fig
  
imports: import warnings
  import numpy
  import pandas
  from pandas.api.types import is_numeric_dtype
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from sklearn.metrics import classification_report, confusion_matrix, precision_recall_curve, roc_curve, roc_auc_score, average_precision_score
  from .explainer_methods import matching_cols, safe_isinstance
label_desc: Use image node_id 1 for calling a global function with example usage: plotly_prediction_piechart(predictions_df, showlegend, size) and returns: fig