class_docstr: Repository storing possible Api parameters and their default values. Also returns parameters required
  for data classes (``PipelineComposerRequirements``, ``GPAlgorithmParameters``, ``GraphGenerationParams``)
  used while model composition.
   
docstr: Sets default values for parameters which were not set by the user
  and raises KeyError for invalid parameter keys
docstr_tok: ["Sets","default","values","for","parameters","which","were","not","set","by","the","user","and","raises","KeyError","for","invalid","parameter","keys"]
code: def check_and_set_default_params(self, params: dict) -> dict:
      """Sets default values for parameters which were not set by the user
      and raises KeyError for invalid parameter keys"""
      allowed_keys = self.default_params.keys()
      invalid_keys = params.keys() - allowed_keys
      if invalid_keys:
          raise KeyError(f"Invalid key parameters {invalid_keys}")
      else:
          missing_params = self.default_params.keys() - params.keys()
          for k in missing_params:
              if (v := self.default_params[k]) is not None:
                  params[k] = v
      return params
  
file_path: FEDOT/fedot/api/api_utils/api_params_repository.py
imports: import datetime
  from typing import Sequence
  from golem.core.optimisers.genetic.operators.inheritance import GeneticSchemeTypesEnum
  from golem.core.optimisers.genetic.operators.mutation import MutationTypesEnum
  from fedot.core.composer.gp_composer.specific_operators import parameter_change_mutation, add_resample_mutation
  from fedot.core.constants import AUTO_PRESET_NAME
  from fedot.core.repository.tasks import TaskTypesEnum
  from fedot.core.utils import default_fedot_data_dir
label_desc: Use image node_id 3 for calling the ApiParamsRepository obj's underlying member method code with example usage: obj.check_and_set_default_params(params) and returns: params