class_docstr: Base class for all imputers.
  
  It adds automatically support for `add_indicator`.
class_docstr_tok: ["Base","class","for","all","imputers",".","It","adds","automatically","support","for","`","add_indicator","`","."]
docstr: Concatenate indicator mask with the imputed data.
docstr_tok: ["Concatenate","indicator","mask","with","the","imputed","data","."]
code: def _concatenate_indicator(self, X_imputed, X_indicator):
      """Concatenate indicator mask with the imputed data."""
      if not self.add_indicator:
          return X_imputed
  
      if sp.issparse(X_imputed):
          # sp.hstack may result in different formats between sparse arrays and
          # matrices; specify the format to keep consistent behavior
          hstack = partial(sp.hstack, format=X_imputed.format)
      else:
          hstack = np.hstack
  
      if X_indicator is None:
          raise ValueError(
              "Data from the missing indicator are not provided. Call "
              "_fit_indicator and _transform_indicator in the imputer "
              "implementation."
          )
  
      return hstack((X_imputed, X_indicator))
  
imports: import numbers
  import warnings
  from collections import Counter
  from functools import partial
  from typing import Callable
  import numpy
  import numpy.ma
  from scipy import sparse
  from ..base import BaseEstimator, TransformerMixin, _fit_context
  from ..utils import _is_pandas_na, is_scalar_nan
  from ..utils._mask import _get_mask
  from ..utils._param_validation import MissingValues, StrOptions
  from ..utils.fixes import _mode
  from ..utils.sparsefuncs import _get_median
  from ..utils.validation import FLOAT_DTYPES, _check_feature_names_in, check_is_fitted
label_desc: Use image node_id 4 for calling the _BaseImputer obj's underlying member method code with example usage: obj._concatenate_indicator(X_imputed, X_indicator) and returns: hstack, X_imputed