code: def compute_stats(data, colname, whis, precision):
      # Computes mean, median, Q1 and Q3 with approx_percentile and precision
      pdf = data._psdf._internal.resolved_copy.spark_frame.agg(
          *[
              F.expr(
                  "approx_percentile(`{}`, {}, {})".format(
                      colname, q, int(1.0 / precision)
                  )
              ).alias("{}_{}%".format(colname, int(q * 100)))
              for q in [0.25, 0.50, 0.75]
          ],
          F.mean("`%s`" % colname).alias("{}_mean".format(colname)),
      ).toPandas()
  
      # Computes IQR and Tukey's fences
      iqr = "{}_iqr".format(colname)
      p75 = "{}_75%".format(colname)
      p25 = "{}_25%".format(colname)
      pdf.loc[:, iqr] = pdf.loc[:, p75] - pdf.loc[:, p25]
      pdf.loc[:, "{}_lfence".format(colname)] = (
          pdf.loc[:, p25] - whis * pdf.loc[:, iqr]
      )
      pdf.loc[:, "{}_ufence".format(colname)] = (
          pdf.loc[:, p75] + whis * pdf.loc[:, iqr]
      )
  
      qnames = ["25%", "50%", "75%", "mean", "lfence", "ufence"]
      col_summ = pdf[["{}_{}".format(colname, q) for q in qnames]]
      col_summ.columns = qnames
      lfence, ufence = col_summ["lfence"], col_summ["ufence"]
  
      stats = {
          "mean": col_summ["mean"].values[0],
          "med": col_summ["50%"].values[0],
          "q1": col_summ["25%"].values[0],
          "q3": col_summ["75%"].values[0],
      }
  
      return stats, (lfence.values[0], ufence.values[0])
  
imports: import importlib
  import pandas
  import numpy
  from pandas.core.base import PandasObject
  from pandas.core.dtypes.inference import is_integer
  from pyspark.ml.feature import Bucketizer
  from pyspark.mllib.stat import KernelDensity
  from pyspark.sql import functions
  from pyspark.pandas.missing import unsupported_function
  from pyspark.pandas.config import get_option
  from pyspark.pandas.utils import name_like_string
label_desc: Use image node_id 2 for calling the BoxPlotBase obj's underlying member method code with example usage: obj.compute_stats(data, colname, whis, precision) and returns: stats,  lfence,  ufence