def METHOD_NAME():
    """
    Note:
        This function always calculates the error_function,
        if available, so that the value is cached in the MetricsCache
    Request attributes:
        binVector: the sensitive features binning vector
        metricKey: the metricKey that corresponds to the function that
            will be calculated
        modelIndex: the model index used to index the predicted y's
            by that model
    """
    try:
        data = request.get_json(force=True)
        if type(data["binVector"][0]) is np.int32:
            data['binVector'] = [
                str(bin_) for bin_ in data['binVector']]
        metric_name = data['metricKey']
        error_function_name = f"{metric_name} bounds"
        metric_function = \
            self.fairness_metrics_module._metric_methods.get(
                data["metricKey"]).get("function")
        metric_method = {
            metric_name: metric_function
        }
        error_function = \
            self.fairness_metrics_module._metric_methods.get(
                data["metricKey"]).get("error_function")
        if error_function is not None:
            metric_method.update({error_function_name: error_function})
        metric_frame = self.fairness_metrics_module.MetricFrame(
            METHOD_NAME=metric_method,
            y_true=self.model_data['true_y'],
            y_pred=self.model_data['predicted_ys'][data["modelIndex"]],
            sensitive_features=data["binVector"])
        result = {"data": {
            "global": metric_frame.overall[metric_name],
            "bins": list([
                entry for entry in
                list(metric_frame.by_group.to_dict().values())
                if not isinstance(entry[0], tuple)
            ][0].values()),
        }}
        if error_function_name in metric_method:
            result["data"].update({
                "bounds": {
                    "lower":
                    metric_frame.overall[error_function_name][0],
                    "upper":
                    metric_frame.overall[error_function_name][1],
                },
                # [(x1, y1), (x2, y2), (x3, y3)...]
                "binBounds": [{
                    "lower": bounds[0],
                    "upper": bounds[1]
                }
                    for bounds in list(
                        metric_frame.by_group[error_function_name]\
                        .to_dict().values())]
            })
        return jsonify(result)
    except Exception as ex:
        import sys
        import traceback
        exc_type, exc_value, exc_traceback = sys.exc_info()
        return jsonify({
            "error": str(ex),
            "stacktrace": str(repr(traceback.format_exception(
                exc_type, exc_value, exc_traceback))),
            "locals": str(locals()),
        })