def disconnect(self, mol):
log.debug('<STR_LIT>')<EOL>for smarts in [self._metal_nof, self._metal_non]:<EOL><INDENT>pairs = mol.GetSubstructMatches(smarts)<EOL>rwmol = Chem.RWMol(mol)<EOL>orders = []<EOL>for i, j in pairs:<EOL><INDENT>orders.append(int(mol.GetBondBetweenAtoms(i, j).GetBondTypeAsDouble()))<EOL>rwmol.RemoveBond(i, j)<EOL><DEDENT>mol = rwmol.GetMol()<EOL>for n, (i, j) in enumerate(pairs):<EOL><INDENT>chg = orders[n]<EOL>atom1 = mol.GetAtomWithIdx(i)<EOL>atom1.SetFormalCharge(atom1.GetFormalCharge() + chg)<EOL>atom2 = mol.GetAtomWithIdx(j)<EOL>atom2.SetFormalCharge(atom2.GetFormalCharge() - chg)<EOL>log.info('<STR_LIT>', atom1.GetSymbol(), atom2.GetSymbol())<EOL><DEDENT><DEDENT>Chem.SanitizeMol(mol)<EOL>return mol<EOL>
Break covalent bonds between metals and organic atoms under certain conditions.

        The algorithm works as follows:

        - Disconnect N, O, F from any metal.
        - Disconnect other non-metals from transition metals + Al (but not Hg, Ga, Ge, In, Sn, As, Tl, Pb, Bi, Po).
        - For every bond broken, adjust the charges of the begin and end atoms accordingly.

        :param mol: The input molecule.
        :type mol: rdkit.Chem.rdchem.Mol
        :return: The molecule with metals disconnected.
        :rtype: rdkit.Chem.rdchem.Mol