<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, other: Operation) -> None: """Append gates from circuit to the end of this circuit"""

        if isinstance(other, Circuit):
            self.elements.extend(other.elements)
        else:
            self.elements.extend([other])