def METHOD_NAME(k,preprocessor_list,model_list):
    if 'None' not in model_list:
        model_list = ['None'] + model_list
    ui_preprocessor_keys = ['none', preprocessor_aliases['invert']]
    ui_preprocessor_keys += sorted([preprocessor_aliases.get(k, k)
                                    for k in preprocessor_list
                                    if preprocessor_aliases.get(k, k) not in ui_preprocessor_keys])
    preprocessor_list = ui_preprocessor_keys
    # print("preprocessor_list sorted: ",preprocessor_list)
    model_list = list(model_list)
    # print("list(model_list): ",model_list)
    # print("k:",k,k.lower())
    default_option = preprocessor_filters[k]
    pattern = k.lower()
    # model_list = list(cn_models.keys())
    if pattern == "all":
        return [
            preprocessor_list,
            model_list,
            'none', #default option
            "None"  #default model 
            ] 
    filtered_preprocessor_list = [
        x
        for x in preprocessor_list
        if pattern in x.lower() or x.lower() == "none"
    ]
    if pattern in ["canny", "lineart", "scribble", "mlsd"]:
        filtered_preprocessor_list += [
            x for x in preprocessor_list if "invert" in x.lower()
        ]
    ##Debug start
    # for model in model_list:
    #     print("model: ",model)
    #     if pattern in model.lower():
    #         print('add to filtered')
    #         print("pattern:",pattern, "in model.lower():",model.lower())
    #     else:
    #         print("pattern:",pattern, "not in model.lower():",model.lower())
    ##Debug end
    filtered_model_list = [
        x for x in model_list if pattern in x.lower() or x.lower() == "none"
    ]
    if default_option not in filtered_preprocessor_list:
        default_option = filtered_preprocessor_list[0]
    if len(filtered_model_list) == 1:
        default_model = "None"
        filtered_model_list = model_list
    else:
        default_model = filtered_model_list[1]
        for x in filtered_model_list:
            if "11" in x.split("[")[0]:
                default_model = x
                break
    return [filtered_preprocessor_list,filtered_model_list, default_option,default_model]