def get_common_complete_suffix(document, completions):
    # Take only completions that don't change the text before the cursor.
    def doesnt_change_before_cursor(completion):
        end = completion.text[:-completion.start_position]
        return document.text_before_cursor.endswith(end)

    completions = [c for c in completions if doesnt_change_before_cursor(c)]

    # Return the common prefix.
    def get_suffix(completion):
        return completion.text[-completion.start_position:]

    return _commonprefix([get_suffix(c) for c in completions])
Transform constrained parameters used in likelihood evaluation
dataset/ETHPy150Open jonathanslenders/python-prompt-toolkit/prompt_toolkit/completion.py/get_common_complete_suffix--crossover with--dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/statespace/mlemodel.py/MLEModel.untransform_params