code: def _prf_divide(
      numerator, denominator, metric, modifier, average, warn_for
  ):
      """Performs division and handles divide-by-zero.
  
      On zero-division, sets the corresponding result elements to zero
      and raises a warning.
  
      The metric, modifier and average arguments are used only for determining
      an appropriate warning.
      """
      result = numerator / denominator
      mask = denominator == 0.0
      if not np.any(mask):
          return result
  
      # remove infs
      result[mask] = 0.0
  
      # build appropriate warning
      # E.g. "Precision and F-score are ill-defined and being set to 0.0 in
      # labels with no predicted samples"
      axis0 = "sample"
      axis1 = "label"
      if average == "samples":
          axis0, axis1 = axis1, axis0
  
      if metric in warn_for and "f-score" in warn_for:
          msg_start = "{0} and F-score are".format(metric.title())
      elif metric in warn_for:
          msg_start = "{0} is".format(metric.title())
      elif "f-score" in warn_for:
          msg_start = "F-score is"
      else:
          return result
  
      msg = (
          "{0} ill-defined and being set to 0.0 {{0}} "
          "no {1} {2}s.".format(msg_start, modifier, axis0)
      )
      if len(mask) == 1:
          msg = msg.format("due to")
      else:
          msg = msg.format("in {0}s with".format(axis1))
      warnings.warn(msg, UndefinedMetricWarning, stacklevel=2)
      return result
  
imports: from __future__ import division
  import warnings
  import numpy
  from scipy.sparse import coo_matrix
  from scipy.sparse import csr_matrix
  from ..preprocessing import LabelBinarizer, label_binarize
  from ..preprocessing import LabelEncoder
  from ..utils import assert_all_finite
  from ..utils import check_array
  from ..utils import check_consistent_length
  from ..utils import column_or_1d
  from ..utils.multiclass import unique_labels
  from ..utils.multiclass import type_of_target
  from ..utils.validation import _num_samples
  from ..utils.sparsefuncs import count_nonzero
  from ..utils.fixes import bincount
  from ..exceptions import UndefinedMetricWarning
label_desc: Use image node_id 11 for calling a global function with example usage: _prf_divide(numerator, denominator, metric, modifier, average, warn_for) and returns: result, result, result