def _dict_to_object(desired_type: Type[T], contents_dict: Dict[str, Any], logger: Logger,<EOL>options: Dict[str, Dict[str, Any]], conversion_finder: ConversionFinder = None,<EOL>is_dict_of_dicts: bool = False) -> T:
<EOL>constructor_args_types_and_opt = get_constructor_attributes_types(desired_type)<EOL>try:<EOL><INDENT>dict_for_init = dict()<EOL>for attr_name, provided_attr_value in contents_dict.items():<EOL><INDENT>if attr_name in constructor_args_types_and_opt.keys():<EOL><INDENT>attr_type_required = constructor_args_types_and_opt[attr_name][<NUM_LIT:0>]<EOL>attr_type_required = resolve_forward_ref(attr_type_required)<EOL>if not is_dict_of_dicts:<EOL><INDENT>if is_valid_pep484_type_hint(attr_type_required):<EOL><INDENT>full_attr_name = get_pretty_type_str(desired_type) + '<STR_LIT:.>' + attr_name<EOL>dict_for_init[attr_name] = ConversionFinder.try_convert_value(conversion_finder, full_attr_name,<EOL>provided_attr_value,<EOL>attr_type_required, logger,<EOL>options)<EOL><DEDENT>else:<EOL><INDENT>warn("<STR_LIT>"<EOL>"<STR_LIT>".format(t=get_pretty_type_str(desired_type),<EOL>att=attr_name))<EOL>dict_for_init[attr_name] = provided_attr_value<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if isinstance(provided_attr_value, dict):<EOL><INDENT>if (attr_type_required is None) or (attr_type_required is Parameter.empty):<EOL><INDENT>raise TypeInformationRequiredError.create_for_object_attributes(desired_type, attr_name,<EOL>attr_type_required)<EOL><DEDENT>elif not is_valid_pep484_type_hint(attr_type_required):<EOL><INDENT>raise InvalidPEP484TypeHint.create_for_object_attributes(desired_type, attr_name,<EOL>attr_type_required)<EOL><DEDENT>else:<EOL><INDENT>dict_for_init[attr_name] = dict_to_object(attr_type_required, provided_attr_value,<EOL>logger, options,<EOL>conversion_finder=conversion_finder)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>' + str(desired_type) + '<STR_LIT>'<EOL>'<STR_LIT>' + attr_name + '<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>if is_dict_of_dicts and attr_name is '<STR_LIT>':<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise InvalidAttributeNameForConstructorError.create(desired_type,<EOL>list(set(constructor_args_types_and_opt.keys()) - {'<STR_LIT>'}),<EOL>attr_name)<EOL><DEDENT><DEDENT><DEDENT>try:<EOL><INDENT>return desired_type(**dict_for_init)<EOL><DEDENT>except Exception as e:<EOL><INDENT>raise ObjectInstantiationException.create(desired_type, dict_for_init, e)<EOL><DEDENT><DEDENT>except TypeError as e:<EOL><INDENT>raise CaughtTypeErrorDuringInstantiation.create(desired_type, contents_dict, e)<EOL><DEDENT>
Utility method to create an object from a dictionary of constructor arguments. Constructor arguments that dont have
the correct type are intelligently converted if possible

:param desired_type:
:param contents_dict:
:param logger:
:param options:
:param conversion_finder:
:param is_dict_of_dicts:
:return: