code: def log_loss(
      y_true,
      y_pred,
      eps=1e-15,
      normalize=True,
      sample_weight=None,
      labels=None,
  ):
      if not (
          dask.is_dask_collection(y_true)
          and dask.is_dask_collection(y_pred)
      ):
          return sklearn.metrics.log_loss(
              y_true,
              y_pred,
              eps=eps,
              normalize=normalize,
              sample_weight=sample_weight,
              labels=labels,
          )
  
      if y_pred.ndim > 1 and y_true.ndim == 1:
          y_true = y_true.reshape(-1, 1)
          drop_axis: Optional[int] = 1
          if sample_weight is not None:
              sample_weight = sample_weight.reshape(-1, 1)
      else:
          drop_axis = None
  
      result = da.map_blocks(
          _log_loss_inner,
          y_true,
          y_pred,
          sample_weight,
          chunks=(1,),
          drop_axis=drop_axis,
          dtype="f8",
          eps=eps,
          normalize=normalize,
          labels=labels,
      )
      if normalize and sample_weight is not None:
          sample_weight = sample_weight.ravel()
          block_weights = sample_weight.map_blocks(
              np.sum, chunks=(1,), keepdims=True
          )
          return da.average(result, 0, weights=block_weights)
      elif normalize:
          return result.mean()
      else:
          return result.sum()
  
file_path: dask-ml/dask_ml/metrics/classification.py
imports: from typing import Optional
  import dask
  import dask.array
  import numpy
  import sklearn.metrics
  import sklearn.utils.multiclass
  from .._typing import ArrayLike
label_desc: Use image node_id 3 for calling a global function with example usage: log_loss(y_true, y_pred, eps, normalize, sample_weight, labels) and returns: sklearn, da, result, result