def __merge_values(self, from_dict, to_dict):
for key, value in from_dict.iteritems():<EOL><INDENT>if key in to_dict:<EOL><INDENT>assert type(to_dict[key]) is type(from_dict[key]), '<STR_LIT>'.format(key, type(from_dict[key]), type(to_dict[key]))<EOL>if type(to_dict[key]) is dict:<EOL><INDENT>to_dict[key] = self.__merge_values(from_dict[key], to_dict[key])<EOL><DEDENT>else:<EOL><INDENT>to_dict[key] = from_dict[key]<EOL><DEDENT><DEDENT><DEDENT>return to_dict<EOL>
Merge dictionary objects recursively, by only updating keys existing in to_dict