def _maybe_wrap_formatter(formatter):
    if is_string_like(formatter):
        return (lambda x: formatter.format(x))
    elif callable(formatter):
        return formatter
    else:
        msg = 'Expected a template string or callable, got {formatter} instead'.format(formatter=formatter)
        raise TypeError(msg)
def _maybe_wrap_formatter(formatter):
    if is_string_like(formatter):
        return (lambda x: formatter.format(x))
    elif callable(formatter):
        return formatter
    else:
        msg = 'Expected a template string or callable, got {formatter} instead'.format(formatter=formatter)
        raise TypeError(msg)