def create_map(self, type_from, type_to, mapping=None):
key_from = type_from.__name__<EOL>key_to = type_to.__name__<EOL>if mapping is None:<EOL><INDENT>mapping = {}<EOL><DEDENT>if key_from in self.mappings:<EOL><INDENT>inner_map = self.mappings[key_from]<EOL>if key_to in inner_map:<EOL><INDENT>raise ObjectMapperException("<STR_LIT>".format(key_from, key_to))<EOL><DEDENT>else:<EOL><INDENT>inner_map[key_to] = mapping<EOL><DEDENT><DEDENT>else:<EOL><INDENT>self.mappings[key_from] = {}<EOL>self.mappings[key_from][key_to] = mapping<EOL><DEDENT>
Method for adding mapping definitions

        :param type_from: source type
        :param type_to: target type
        :param mapping: dictionary of mapping definitions in a form {'target_property_name',
                        lambda function from rhe source}

        :return: None