<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def warn(self, message, container=None):
 """Present the warning `message` to the user, adding information on the location of the related element in the input file."""

        if self.source is not None:
            message = '[{}] '.format(self.source.location) + message
        if container is not None:
            try:
                message += ' (page {})'.format(container.page.formatted_number)
            except AttributeError:
                pass
        warn(message)