<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _msg_name(self, container, max_width):
 """Build the container name."""

        name = container['name']
        if len(name) > max_width:
            name = '_' + name[-max_width + 1:]
        else:
            name = name[:max_width]
        return ' {:{width}}'.format(name, width=max_width)