def wrap_formatter(formatter):
    if isinstance(formatter, ticker.Formatter):
        return formatter
    elif callable(formatter):
        return ticker.FuncFormatter(formatter)
    elif isinstance(formatter, basestring):
        if re.findall(r"\{(\w+)\}", formatter):
            return ticker.StrMethodFormatter(formatter)
        else:
            return ticker.FormatStrFormatter(formatter)
Wraps formatting function or string in
dataset/ETHPy150Open ioam/holoviews/holoviews/plotting/mpl/util.py/wrap_formatter