def __init__(self, config, type):
    self._section = 'color.%s' % type
    self._config = config
    self._out = sys.stdout

    on = self._config.GetString(self._section)
    if on is None:
      on = self._config.GetString('color.ui')

    if on == 'auto':
      if pager.active or os.isatty(1):
        self._on = True
      else:
        self._on = False
    elif on in ('true', 'always'):
      self._on = True
    else:
      self._on = False
dataset/ETHPy150Open android/tools_repo/color.py/Coloring.__init__/original