code: def general_wilson(p, n, digits=4, z=1.959964):
      """Return lower and upper bound of a Wilson confidence interval.
  
      Parameters
      ----------
      p : float
          Proportion of successes.
      n : int
          Total number of trials.
      digits : int
          Digits of precision to which the returned bound will be rounded
      z : float
          Z-score, which indicates the number of standard deviations of confidence.
          The default value of 1.959964 is for a 95% confidence interval
  
      Returns
      -------
          np.ndarray
          Array of length 2 of form: [lower_bound, upper_bound]
      """
      denominator = 1 + z**2 / n
      centre_adjusted_probability = p + z * z / (2 * n)
      adjusted_standard_deviation = np.sqrt(
          (p * (1 - p) + z * z / (4 * n))
      ) / np.sqrt(n)
      lower_bound = (
          centre_adjusted_probability - z * adjusted_standard_deviation
      ) / denominator
      upper_bound = (
          centre_adjusted_probability + z * adjusted_standard_deviation
      ) / denominator
      return np.array(
          [round(lower_bound, digits), round(upper_bound, digits)]
      )
  
file_path: fairlearn/examples/plot_plotting_metrics_with_error.py
imports: import numpy
  from sklearn.compose import ColumnTransformer
  from sklearn.compose import make_column_selector
  from fairlearn.datasets import fetch_adult
  from sklearn.impute import SimpleImputer
  from sklearn.metrics import accuracy_score, confusion_matrix, recall_score
  from sklearn.model_selection import train_test_split
  from sklearn.pipeline import Pipeline
  from sklearn.preprocessing import OneHotEncoder, StandardScaler
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils import check_consistent_length
  from fairlearn.experimental.enable_metric_frame_plotting import plot_metric_frame
  from fairlearn.metrics import MetricFrame
label_desc: Use image node_id 1 for calling a global function with example usage: general_wilson(p, n, digits, z) and returns: np