code: def _chunk_mean_centering(data, chunks):
      n_chunks = chunks.max() + 1
      chunk_mask = chunks != -1
      # We need to ensure the data is float so that we can substract the
      # mean on it
      chunk_data = data[chunk_mask].astype(float, copy=False)
      chunk_labels = chunks[chunk_mask]
      for c in range(n_chunks):
          mask = chunk_labels == c
          chunk_data[mask] -= chunk_data[mask].mean(axis=0)
  
      return chunk_mask, chunk_data
  
file_path: metric-learn/metric_learn/rca.py
imports: import numpy
  import warnings
  from sklearn.base import TransformerMixin
  from ._util import _check_n_components
  from .base_metric import MahalanobisMixin
  from .constraints import Constraints
label_desc: Use image node_id 1 for calling a global function with example usage: _chunk_mean_centering(data, chunks) and returns: chunk_mask,  chunk_data