def __init__(self, code, severity, filename, message, line_range=None, lines=None):
    if severity not in self.SEVERITY:
      raise ValueError('Severity should be one of {}'.format(' '.join(self.SEVERITY.values())))
    if not re.match(r'[A-Z]\d{3}', code):
      raise ValueError('Code must contain a prefix letter followed by a 3 digit number')
    self.filename = filename
    self.code = code
    self.severity = severity
    self._message = message
    self._line_range = line_range
    self._lines = lines
dataset/ETHPy150Open pantsbuild/pants/contrib/python/src/python/pants/contrib/python/checks/tasks/checkstyle/common.py/Nit.__init__/original