def METHOD_NAME(preset):
    """ preset: None = select, 'invalid' = current """
    if isinstance(preset, (type(None), manager.Preset)):
        return preset
    presets = tuple(filter(lambda p: p.key == preset.lower(), manager.getPresets()))
    if presets:
        got_preset = presets[0]
        log.debug("Preset: %s", got_preset)
    else:
        got_preset = manager.currentFilePreset()
        if preset:
            log.warning("Preset `%s` is not specified", preset)
    return got_preset