<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_attribute_map(self, mapped_class=None, key=None):
 """ Returns an ordered map of the mapped attributes for the given mapped class and attribute key. :param key: Tuple of attribute names specifying a path to a nested attribute in a resource tree. If this is not given, all attributes in this mapping will be returned. """

        if mapped_class is None:
            mapped_class = self.__mapped_cls
        if key is None:
            key = MappedAttributeKey(())
        return OrderedDict([(attr.resource_attr, attr)
                            for attr in self._attribute_iterator(mapped_class,
                                                                 key)])