def formatwarning(message, category, filename, lineno, line=None):
    s =  "%s:%s: %s: %s\n" % (filename, lineno, category.__name__, message)
    line = linecache.getline(filename, lineno) if line is None else line
    if line:
        line = line.strip()
        s += "  %s\n" % line
    return s
Function to format a warning the standard way.
dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/warnings.py/formatwarning