code: def impute_conditional_data(self, array):
      return_array = np.empty_like(array)
  
      for i in range(array.shape[0]):
          datum = np.copy(array[i])
          nan_indices = np.argwhere(np.isnan(datum)).flatten()
  
          while np.any(nan_indices):
              nan_idx = nan_indices[0]
              valid_indices = np.argwhere(
                  np.isfinite(array[:, nan_idx])
              ).flatten()
  
              if len(valid_indices) > 0:
                  # pick one of them at random and overwrite all NaN values
                  row_idx = np.random.choice(valid_indices)
                  datum[nan_indices] = array[row_idx, nan_indices]
  
              else:
                  # no good point in the data has this value activated, so fill it with a valid but random value
                  t = self.vartypes[nan_idx]
                  if t == 0:
                      datum[nan_idx] = np.random.rand()
                  else:
                      datum[nan_idx] = np.random.randint(t)
  
              nan_indices = np.argwhere(np.isnan(datum)).flatten()
          return_array[i, :] = datum
      return return_array
  
file_path: auptimizer/src/aup/Proposer/hpbandster/optimizers/config_generators/h2bo.py
imports: import logging
  from copy import deepcopy
  import traceback
  import ConfigSpace
  import ConfigSpace.hyperparameters
  import ConfigSpace.util
  import numpy
  import scipy.stats
  from hpbandster.core.base_config_generator import base_config_generator
  from hpbandster.optimizers.kde.mvkde import MultivariateKDE
label_desc: Use image node_id 4 for calling the H2BO obj's underlying member method code with example usage: obj.impute_conditional_data(array) and returns: return_array