<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def bonds(self):
 """Return all bonds in the Compound and sub-Compounds. Yields ------- tuple of mb.Compound The next bond in the Compound See Also -------- bond_graph.edges_iter : Iterates over all edges in a BondGraph """

        if self.root.bond_graph:
            if self.root == self:
                return self.root.bond_graph.edges_iter()
            else:
                return self.root.bond_graph.subgraph(
                    self.particles()).edges_iter()
        else:
            return iter(())