def likelihood_profile(m, var_names, bins=20, minos=True):
    """
    Calculate the likelihood profile for a variable.

    :param m: Minuit object
    :param var_names: Either a string or a list of strings
    :param bins: Integer
    :param minos: Boolean. If it's ``False``, the function will call ``Minuit.profile()`` to derive the 1-d scan of **var_names**; if it's ``True``, the function will call ``Minuit.mnprofile()`` to derive the likelihood profile, which is much more time-consuming.
    :return: Dictionary indexed by **var_names**. It contains the return of either ``Minuit.mnprofile()`` or ``Minuit.profile()``.
    """
    if isinstance(var_names, str):
        var_names = [var_names]
    lklpf = {}
    for var in var_names:
        if minos:
            x, y, t = m.mnprofile(var, bins=bins)
            lklpf[var] = [x, y, t]
        else:
            x, y = m.profile(var, bins=bins)
            lklpf[var] = [x, y]
    return lklpf