code: def impute_conditional_data(self, array):
      return_array = np.zeros(array.shape)
      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: nni/nni/algorithms/hpo/bohb_advisor/config_generator.py
imports: import logging
  import ConfigSpace
  import ConfigSpace.hyperparameters
  import ConfigSpace.util
  import numpy
  import scipy.stats
  import statsmodels.api
label_desc: Use image node_id 5 for calling the CG_BOHB obj's underlying member method code with example usage: obj.impute_conditional_data(array) and returns: return_array