def get_param_val_from_cfgx(testres, cfgx, key):
    if (key == 'len(daids)'):
        return len(testres.cfgx2_daids[cfgx])
    elif any([(key in cfgdict) for cfgdict in testres.varied_cfg_list]):
        return testres.varied_cfg_list[cfgx][key]
    elif any([(key in cfgdict) for cfgdict in testres.varied_acfg_list]):
        return testres.varied_acfg_list[cfgx][key]
    elif any([(key in cfgdict) for cfgdict in testres.cfgx2_pcfg]):
        return testres.cfgx2_pcfg[cfgx][key]
    elif any([(key in cfgdict) for cfgdict in testres.cfgx2_acfg]):
        return testres.cfgx2_acfg[cfgx][key]
    else:
        assert False, ('param=%r doesnt exist' % (key,))
def get_param_val_from_cfgx(testres, cfgx, key):
    if (key == 'len(daids)'):
        return len(testres.cfgx2_daids[cfgx])
    elif any([(key in cfgdict) for cfgdict in testres.varied_cfg_list]):
        return testres.varied_cfg_list[cfgx][key]
    elif any([(key in cfgdict) for cfgdict in testres.varied_acfg_list]):
        return testres.varied_acfg_list[cfgx][key]
    elif any([(key in cfgdict) for cfgdict in testres.cfgx2_pcfg]):
        return testres.cfgx2_pcfg[cfgx][key]
    elif any([(key in cfgdict) for cfgdict in testres.cfgx2_acfg]):
        return testres.cfgx2_acfg[cfgx][key]
    else:
        assert False, ('param=%r doesnt exist' % (key,))