def truncate_synonym_list(synonym_list):
    truncated_flag = 0
    truncate_on_definition = int(vim.eval("g:thesaurus_query#truncation_on_definition_num"))  # number of definitions retained in output
    truncate_syno_list = int(vim.eval("g:thesaurus_query#truncation_on_syno_list_size"))   # number of synonyms retained for each definition in output
    output_buffer = []
    if truncate_on_definition > 0:
        if len(synonym_list) <= truncate_on_definition:
            truncated_flag = 1

    output_buffer_temp = (synonym_list if truncate_on_definition==-1 else synonym_list[:truncate_on_definition])

    for definition in output_buffer_temp:
        if truncate_syno_list==-1:
            output_buffer.append(definition)
        else:
            if truncate_syno_list<len(definition[1]):
                truncated_flag = 1
            output_buffer.append([definition[0],definition[1][:truncate_syno_list]])

    del output_buffer_temp
    return [truncated_flag, output_buffer]
dataset/ETHPy150Open Ron89/thesaurus_query.vim/autoload/thesaurus_query/thesaurus_query.py/truncate_synonym_list/swapped operands of `<=`