def resolve_parameter_refs(self, input_dict, parameters):
if not self.can_handle(input_dict):<EOL><INDENT>return input_dict<EOL><DEDENT>value = input_dict[self.intrinsic_name]<EOL>if not isinstance(value, list) or len(value) != <NUM_LIT:3>:<EOL><INDENT>raise InvalidDocumentException(<EOL>[InvalidTemplateException('<STR_LIT>'<EOL>.format(value))])<EOL><DEDENT>map_name = self.resolve_parameter_refs(value[<NUM_LIT:0>], parameters)<EOL>top_level_key = self.resolve_parameter_refs(value[<NUM_LIT:1>], parameters)<EOL>second_level_key = self.resolve_parameter_refs(value[<NUM_LIT:2>], parameters)<EOL>if not isinstance(map_name, string_types) ornot isinstance(top_level_key, string_types) ornot isinstance(second_level_key, string_types):<EOL><INDENT>return input_dict<EOL><DEDENT>if map_name not in parameters ortop_level_key not in parameters[map_name] orsecond_level_key not in parameters[map_name][top_level_key]:<EOL><INDENT>return input_dict<EOL><DEDENT>return parameters[map_name][top_level_key][second_level_key]<EOL>
Recursively resolves "Fn::FindInMap"references that are present in the mappings and returns the value.
If it is not in mappings, this method simply returns the input unchanged.

:param input_dict: Dictionary representing the FindInMap function. Must contain only one key and it
                   should be "Fn::FindInMap".

:param parameters: Dictionary of mappings from the SAM template