<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def migrate_autoload_details(autoload_details, shell_name, shell_type):
 """ Migrate autoload details. Add namespace for attributes :param autoload_details: :param shell_name: :param shell_type: :return: """


    mapping = {}
    for resource in autoload_details.resources:
        resource.model = "{shell_name}.{model}".format(shell_name=shell_name, model=resource.model)
        mapping[resource.relative_address] = resource.model

    for attribute in autoload_details.attributes:

        if not attribute.relative_address:  # Root element
            attribute.attribute_name = "{shell_type}.{attr_name}".format(shell_type=shell_type,
                                                                         attr_name=attribute.attribute_name)
        else:
            attribute.attribute_name = "{model}.{attr_name}".format(model=mapping[attribute.relative_address],
                                                                    attr_name=attribute.attribute_name)

    return autoload_details