def METHOD_NAME(mf, cell):
    mf1 = mf.__class__(cell)
    if isinstance(mf, scf.hf.KohnShamDFT):
        mf1.xc = mf.xc
    mf1.kpts = mf.kpts
    mf1.exxdiv = getattr(mf, 'exxdiv', None)
    mf1.conv_tol = mf.conv_tol
    mf1.conv_tol_grad = mf.conv_tol_grad
    return mf1