code: def general_wilson(p, n, digits=digits_of_precision, z=z_score):
      """Return lower and upper bound using Wilson Interval.
  
      Parameters
      ----------
      p : float
          Proportion of successes.
      n : int
          Total number of trials.
      digits : int
          Digits of precisions to which the returned bound will be rounded
      z : float
          Z-score, which indicates the number of standard deviations of confidence
  
      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)]
      )
  
imports: import matplotlib
  import matplotlib.pyplot
  import numpy
  import pytest
  from sklearn.metrics import accuracy_score, confusion_matrix, recall_score
  from sklearn.utils import check_consistent_length
  from fairlearn.experimental.enable_metric_frame_plotting import plot_metric_frame
  from fairlearn.metrics import MetricFrame
  from fairlearn.metrics._plotter import _CONF_INTERVALS_FLIPPED_BOUNDS_ERROR, _CONF_INTERVALS_MUST_BE_ARRAY, _METRIC_FRAME_INVALID_ERROR
  from .data_for_test import g_1, y_p, y_t
label_desc: Use image node_id 1 for calling a global function with example usage: general_wilson(p, n, digits, z) and returns: np