@utilities.arguments_not_none<EOL><INDENT>def set_duration(self, duration):<DEDENT>
<EOL>if self.get_duration_metadata().is_read_only():<EOL><INDENT>raise errors.NoAccess()<EOL><DEDENT>if not self._is_valid_duration(<EOL>duration,<EOL>self.get_duration_metadata()):<EOL><INDENT>raise errors.InvalidArgument()<EOL><DEDENT>map = dict()<EOL>map['<STR_LIT>'] = duration.days<EOL>map['<STR_LIT>'] = duration.seconds<EOL>map['<STR_LIT>'] = duration.microseconds<EOL>self._my_map['<STR_LIT>'] = map<EOL>
Sets the assessment duration.

        arg:    duration (osid.calendaring.Duration): assessment
                duration
        raise:  InvalidArgument - ``duration`` is invalid
        raise:  NoAccess - ``Metadata.isReadOnly()`` is ``true``
        *compliance: mandatory -- This method must be implemented.*