<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, assembly):
 """Extends the `Assembly` with the contents of another `Assembly`. Raises ------ TypeError Raised if other is any type other than `Assembly`. """

        if isinstance(assembly, Assembly):
            self._molecules.extend(assembly)
        else:
            raise TypeError(
                'Only Assembly objects may be merged with an Assembly.')
        return