code: def _format_mean_match_candidates(self, data, available_candidates):
      var_indx_list = list(available_candidates)
      assert not self._mmc_formatted, "mmc are already formatted"
  
      if isinstance(self.mean_match_candidates, int):
          mmc_formatted = {
              v: self.mean_match_candidates for v in var_indx_list
          }
  
      elif isinstance(self.mean_match_candidates, dict):
          mmc_formatted = {}
          for v, mmc in self.mean_match_candidates.items():
              if isinstance(v, str):
                  assert isinstance(
                      data, pd_DataFrame
                  ), "columns cannot be names unless data is pandas DF"
                  v_ind = data.columns.tolist().index(v)
                  assert (
                      v_ind in var_indx_list
                  ), f"{v} is not having a model built, should not get mmc."
                  assert (
                      mmc <= available_candidates[v_ind]
                  ), f"{v} doesn't have enough candidates for mmc {mmc}"
  
              else:
                  v_ind = v
  
              if isinstance(mmc, float):
                  assert 0.0 < mmc < 1.0, f"{v} mmc malformed"
                  print("A")
                  mmc_formatted[v_ind] = int(
                      mmc * available_candidates[v_ind]
                  )
              else:
                  mmc_formatted[v_ind] = mmc
                  print("B")
  
          for v in var_indx_list:
              if v not in list(mmc_formatted):
                  mmc_formatted[v] = _DEFAULT_MMC
  
      else:
          raise ValueError(
              "malformed mean_match_candidates was passed to MeanMatchScheme"
          )
  
      self.mean_match_candidates = mmc_formatted
      self._mmc_formatted = True
  
file_path: miceforest/miceforest/MeanMatchScheme.py
imports: from .compat import pd_DataFrame
  import inspect
  from copy import deepcopy
  from typing import Callable, Union, Dict, Set
  from numpy import dtype
label_desc: Use image node_id 4 for calling the MeanMatchScheme obj's underlying member method code with example usage: obj._format_mean_match_candidates(data, available_candidates) without return types