<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend(self, ampal_container):
 """Extends an `AmpalContainer` with another `AmpalContainer`."""

        if isinstance(ampal_container, AmpalContainer):
            self._ampal_objects.extend(ampal_container)
        else:
            raise TypeError(
                'Only AmpalContainer objects may be merged with '
                'an AmpalContainer.')
        return