def interpret_device_score()

in ioXt/uraniborg/scripts/python/device_scoring.py [0:0]


def interpret_device_score(score):
  """Converts a device risk score into rating.

  Note that this is just an example of how scores can be divided into different
  rating categories, and does not represent the actual final rating that may be
  adopted by a more official standard.

  Args:
    score: A float representing the total device risk score.

  Returns:
    A string representing the interpretation or risk rating of the score.
  """
  if score >= 0 and score <= 2.5:
    return "VERY LOW"
  elif score > 2.5 and score <= 4.5:
    return "LOW"
  elif score > 4.5 and score <= 5.5:
    return "MEDIUM"
  elif score > 5.5 and score <= 6.5:
    return "HIGH"
  elif score > 6.5 and score <= 7.5:
    return "VERY HIGH"
  elif score > 7.5 and score <= 10.0:
    return "ELEVATED"
  return "ERROR"