import re


def IsUserSudoerInLines(user, sudoer_lines):
  """Return whether the user has an entry in the sudoer lines."""

  def IsUserSudoerEntry(line):
    return re.match(r'^%s\s+' % user, line)

  return filter(IsUserSudoerEntry, sudoer_lines)