# Path: safe/definitions/hazard_classifications.py



from math import floor
from qgis.core import QgsPointXY
from safe.definitions.exposure import exposure_population
from safe.definitions.hazard_classifications import (
    hazard_classes_all, not_exposed_class)
from safe.definitions.utilities import get_displacement_rate, is_affected
from safe.utilities.i18n import tr

    :param hazard: The hazard to use.
    :type hazard: str

    :param classification: The hazard classification to use.
    :type classification: str

    :param hazard_class: The hazard class of the feature.
    :type hazard_class: str

    :return: If this hazard class is affected or not. It can be `not exposed`.
        The not exposed value returned is the key defined in
        `hazard_classification.py` at the top of the file.
    :rtype: bool,'not exposed'
    """
    if exposure == exposure_population['key']:
        affected = is_affected(
            hazard, classification, hazard_class)
    else:
        classes = None
        for hazard in hazard_classes_all:
            if hazard['key'] == classification:
                classes = hazard['classes']
                break

        for the_class in classes:
            if the_class['key'] == hazard_class:
                affected = the_class['affected']
                break
        else:

# Path: safe/definitions/hazard_classifications.py



# Path: safe/processors/post_processor_functions.py
from math import floor
from qgis.core import QgsPointXY
from safe.definitions.exposure import exposure_population
from safe.definitions.hazard_classifications import (
    hazard_classes_all, not_exposed_class)
from safe.definitions.utilities import get_displacement_rate, is_affected
from safe.utilities.i18n import tr


    :param hazard: The hazard to use.
    :type hazard: str

    :param classification: The hazard classification to use.
    :type classification: str

    :param hazard_class: The hazard class of the feature.
    :type hazard_class: str

    :return: If this hazard class is affected or not. It can be `not exposed`.
        The not exposed value returned is the key defined in
        `hazard_classification.py` at the top of the file.
    :rtype: bool,'not exposed'
    """
    if exposure == exposure_population['key']:
        affected = is_affected(
            hazard, classification, hazard_class)
    else:
        classes = None
        for hazard in hazard_classes_all:
            if hazard['key'] == classification:
                classes = hazard['classes']
                break

        for the_class in classes:
            if the_class['key'] == hazard_class:
                affected = the_class['affected']
                break
        else:

            affected = not_exposed_class['key']