def hasRunLevel(serviceName, runLevel):
  """Parse chkconfig output and return True if serviceName is set to run at
  that runLevel"""
  try:
    raw = execute((serviceName) % "chkconfig --list %s").split()
  except:
    # chkconfig will exit non-zero if there are no entries for serviceName
    return False
  for stanza in raw[1:]:
    level = int(stanza[:1])
    status = stanza[2:]
    if runLevel == level and status == "on":
      return True
  return False
dataset/ETHPy150Open NumentaCorp/agamotto/agamotto/service.py/hasRunLevel/swapped operands of `%`