def format(text, *args, **kw):
    if args:
        text %= args
    if kw:
        text = text.format(**kw)
    return text
Format a string using the string formatting operator and/or :func:`str.format()`.
dataset/ETHPy150Open xolox/python-humanfriendly/humanfriendly/text.py/format