class_docstr: Colorize the %(levelname)..s part of the log format passed to __init__.
class_docstr_tok: ["Colorize","the","%","(","levelname",")","..","s","part","of","the","log","format","passed","to","__init__","."]
code: def format(self, record):
      fmt = self._level_to_fmt_mapping.get(
          record.levelno, self._original_fmt
      )
      if six.PY2:
          self._fmt = fmt
      else:
          self._style._fmt = fmt
      return super(ColoredLevelFormatter, self).format(record)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import logging
  import re
  from contextlib import contextmanager
  import py
  import six
  import pytest
  from _pytest.compat import dummy_context_manager
  from _pytest.config import create_terminal_writer
  from _pytest.pathlib import Path
label_desc: Use image node_id 2 for calling the ColoredLevelFormatter obj's underlying member method code with example usage: obj.format(record) and returns: super