def _SetColour(self, value_list):
    """Sets row's colour attributes to a list of values in terminal.SGR."""
    if value_list is None:
      self._color = None
      return
    colors = []
    for color in value_list:
      if color in terminal.SGR:
        colors.append(color)
      elif color in terminal.FG_COLOR_WORDS:
        colors += terminal.FG_COLOR_WORDS[color]
      elif color in terminal.BG_COLOR_WORDS:
        colors += terminal.BG_COLOR_WORDS[color]
      else:
        raise ValueError('Invalid colour specification.')
    self._color = list(set(colors))
dataset/ETHPy150Open google/textfsm/texttable.py/Row._SetColour/original