def METHOD_NAME(key: str) -> StrictOption:
    regex = re.compile(
        "(?P<section>{sections})(:(?P<setting>{switches}))?".format(
            sections="|".join(valid_keys), switches="|".join(valid_switches)
        )
    )
    match = regex.fullmatch(key)
    if not match:
        raise exceptions.InvalidConfigurationException(
            "Invalid value for 'strict' given - expected one of {}, got '{}'".format(
                ["{}[:on/off]".format(key) for key in valid_keys], key
            )
        )
    as_dict = match.groupdict()
    if as_dict["section"] != "json" and as_dict["setting"] == "list_any_order":
        logger.warning(
            "Using 'list_any_order' key outside of 'json' section has no meaning"
        )
    return StrictOption(as_dict["section"], strict_setting_factory(as_dict["setting"]))