def METHOD_NAME(selector: selectors.MediaSelector):
    query = selector.query
    if len(query) == 1:
        mode = query[0].lower()
    elif (
        len(query) == 3
        and query[0].lower() == "prefers-color-scheme"
        and query[1] == "="
    ):
        mode = query[2].lower()
    else:
        mode = None
    if mode in ("dark", "dark-mode"):
        return lambda el: el.dark_mode is True
    elif mode in ("light", "light-mode"):
        return lambda el: el.dark_mode is False
    return lambda el: False