def METHOD_NAME(mf, nmom=(None,0), frozen=None, mo_energy=None, mo_coeff=None, mo_occ=None):
    if nmom != (None,0): # redundant
        if nmom[1] == 0 and nmom[0] != 0:
            nmom = (None,0)
    if nmom != (None,0) and getattr(mf, 'with_df', None) is not None:
        raise RuntimeError('AGF2 with custom moment orders does not '
                           'density fitting.')
    elif nmom != (None,0):
        lib.logger.warn(mf, 'AGF2 called with custom moment orders - '
                            'falling back on _slow implementations.')
        return uagf2_slow.METHOD_NAME(mf, nmom, frozen, mo_energy, mo_coeff, mo_occ)
    elif getattr(mf, 'with_df', None) is not None:
        return dfuagf2.DFUAGF2(mf, frozen, mo_energy, mo_coeff, mo_occ)
    else:
        return uagf2.METHOD_NAME(mf, frozen, mo_energy, mo_coeff, mo_occ)