# Path: safe/definitions/earthquake.py
# def earthquake_fatality_rate(hazard_level):
#     """Earthquake fatality ratio for a given hazard level.
# 
#     It reads the QGIS QSettings to know what is the default earthquake
#     function.
# 
#     :param hazard_level: The hazard level.
#     :type hazard_level: int
# 
#     :return: The fatality rate.
#     :rtype: float
#     """
#     earthquake_function = setting(
#         'earthquake_function', EARTHQUAKE_FUNCTIONS[0]['key'], str)
#     ratio = 0
#     for model in EARTHQUAKE_FUNCTIONS:
#         if model['key'] == earthquake_function:
#             eq_function = model['fatality_rates']
#             ratio = eq_function().get(hazard_level)
#     return ratio
# 
# def current_earthquake_model_name():
#     """Human friendly name for the currently active earthquake fatality model.
# 
#     :returns: Name of the current EQ fatality model as defined in users
#         settings.
#     """
#     default_earthquake_function = setting(
#         'earthquake_function', EARTHQUAKE_FUNCTIONS[0]['key'], str)
#     current_function = None
#     for model in EARTHQUAKE_FUNCTIONS:
#         if model['key'] == default_earthquake_function:
#             current_function = model['name']
#     return current_function


from safe.definitions import concepts
from safe.definitions.constants import big_number
from safe.definitions.earthquake import (
    earthquake_fatality_rate, current_earthquake_model_name)
from safe.definitions.exposure import (
    exposure_land_cover,
    exposure_place,
    exposure_population,
    exposure_road,
    exposure_structure)
from safe.definitions.styles import (
    grey,
    green,
    light_green,
    yellow,
    orange,
    red,
    dark_red,
    very_dark_red,
    MMI_10,
    MMI_9,
    MMI_8,
    MMI_7,
    MMI_6,
    MMI_5,
    MMI_4,
    MMI_3,
    MMI_2,
    MMI_1)
from safe.definitions.units import (
    unit_centimetres,
    unit_miles_per_hour,
    unit_kilometres_per_hour,
    unit_knots,
    unit_metres_per_second
)
from safe.utilities.i18n import tr
            'color': MMI_6,
            'name': tr('VI'),
            'affected': True,
            'description':
                tr('Felt by all, many frightened. Some heavy furniture moved; '
                   'a few instances of fallen plaster. Damage slight.'),
            'string_defaults': ['strong'],
            'fatality_rate': earthquake_fatality_rate(6),
            'displacement_rate': 1.0,
            'numeric_default_min': 5.5,
            'numeric_default_max': 6.5,
            'citations': [
                {
                    'text': None,
                    'link': 'https://earthquake.usgs.gov/learn/topics/'
                            'mercalli.php'
                }
            ]
        },
        {
            'key': 'V',
            'value': 5,
            'color': MMI_5,
            'name': tr('V'),
            'affected': True,
            'description':
                tr('Felt by nearly everyone; many awakened. Some dishes, '
                   'windows broken. Unstable objects overturned. Pendulum '
                   'clocks may stop.'),
            'string_defaults': ['moderate'],

# Path: safe/definitions/earthquake.py
# def earthquake_fatality_rate(hazard_level):
#     """Earthquake fatality ratio for a given hazard level.
# 
#     It reads the QGIS QSettings to know what is the default earthquake
#     function.
# 
#     :param hazard_level: The hazard level.
#     :type hazard_level: int
# 
#     :return: The fatality rate.
#     :rtype: float
#     """
#     earthquake_function = setting(
#         'earthquake_function', EARTHQUAKE_FUNCTIONS[0]['key'], str)
#     ratio = 0
#     for model in EARTHQUAKE_FUNCTIONS:
#         if model['key'] == earthquake_function:
#             eq_function = model['fatality_rates']
#             ratio = eq_function().get(hazard_level)
#     return ratio
# 
# def current_earthquake_model_name():
#     """Human friendly name for the currently active earthquake fatality model.
# 
#     :returns: Name of the current EQ fatality model as defined in users
#         settings.
#     """
#     default_earthquake_function = setting(
#         'earthquake_function', EARTHQUAKE_FUNCTIONS[0]['key'], str)
#     current_function = None
#     for model in EARTHQUAKE_FUNCTIONS:
#         if model['key'] == default_earthquake_function:
#             current_function = model['name']
#     return current_function


# Path: safe/definitions/hazard_classifications.py
from safe.definitions import concepts
from safe.definitions.constants import big_number
from safe.definitions.earthquake import (
    earthquake_fatality_rate, current_earthquake_model_name)
from safe.definitions.exposure import (
    exposure_land_cover,
    exposure_place,
    exposure_population,
    exposure_road,
    exposure_structure)
from safe.definitions.styles import (
    grey,
    green,
    light_green,
    yellow,
    orange,
    red,
    dark_red,
    very_dark_red,
    MMI_10,
    MMI_9,
    MMI_8,
    MMI_7,
    MMI_6,
    MMI_5,
    MMI_4,
    MMI_3,
    MMI_2,
    MMI_1)
from safe.definitions.units import (
    unit_centimetres,
    unit_miles_per_hour,
    unit_kilometres_per_hour,
    unit_knots,
    unit_metres_per_second
)
from safe.utilities.i18n import tr

            'color': MMI_6,
            'name': tr('VI'),
            'affected': True,
            'description':
                tr('Felt by all, many frightened. Some heavy furniture moved; '
                   'a few instances of fallen plaster. Damage slight.'),
            'string_defaults': ['strong'],
            'fatality_rate': earthquake_fatality_rate(6),
            'displacement_rate': 1.0,
            'numeric_default_min': 5.5,
            'numeric_default_max': 6.5,
            'citations': [
                {
                    'text': None,
                    'link': 'https://earthquake.usgs.gov/learn/topics/'
                            'mercalli.php'
                }
            ]
        },
        {
            'key': 'V',
            'value': 5,
            'color': MMI_5,
            'name': tr('V'),
            'affected': True,
            'description':
                tr('Felt by nearly everyone; many awakened. Some dishes, '
                   'windows broken. Unstable objects overturned. Pendulum '
                   'clocks may stop.'),
            'string_defaults': ['moderate'],

            'fatality_rate': earthquake_fatality_rate(5),