code: def _assign_where(X1, X2, cond):
      """Assign X2 to X1 where cond is True.
  
      Parameters
      ----------
      X1 : ndarray or dataframe of shape (n_samples, n_features)
          Data.
  
      X2 : ndarray of shape (n_samples, n_features)
          Data to be assigned.
  
      cond : ndarray of shape (n_samples, n_features)
          Boolean mask to assign data.
      """
      if hasattr(X1, "mask"):  # pandas dataframes
          X1.mask(cond=cond, other=X2, inplace=True)
      else:  # ndarrays
          X1[cond] = X2[cond]
  
imports: import warnings
  from collections import namedtuple
  from numbers import Integral, Real
  from time import time
  import numpy
  from scipy import stats
  from ..base import _fit_context, clone
  from ..exceptions import ConvergenceWarning
  from ..preprocessing import normalize
  from ..utils import _safe_assign, _safe_indexing, check_array, check_random_state, is_scalar_nan
  from ..utils._mask import _get_mask
  from ..utils._param_validation import HasMethods, Interval, StrOptions
  from ..utils.metadata_routing import _RoutingNotSupportedMixin
  from ..utils.validation import FLOAT_DTYPES, _check_feature_names_in, check_is_fitted
  from ._base import SimpleImputer, _BaseImputer, _check_inputs_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: _assign_where(X1, X2, cond) without return types