# Path: safe/definitions/layer_purposes.py

# 
# Path: safe/definitions/versions.py



import logging
from qgis.core import (
    QgsFeature,
    QgsWkbTypes,
)
from safe.definitions.constants import inasafe_keyword_version_key
from safe.definitions.fields import (
    aggregation_id_field,
    aggregation_name_field,
    analysis_name_field,
    profiling_function_field,
    profiling_time_field,
    profiling_memory_field
)
from safe.definitions.layer_purposes import (
    layer_purpose_profiling,
    layer_purpose_aggregation,
    layer_purpose_analysis_impacted,
)
from safe.definitions.versions import inasafe_keyword_version
from safe.gis.vector.tools import (
    create_memory_layer, create_field_from_definition, copy_layer)
from safe.utilities.gis import qgis_version
from safe.utilities.i18n import tr
from safe.utilities.profiling import profile
from safe.utilities.settings import setting
        inasafe_keyword_version)
    analysis_layer.keywords['inasafe_fields'] = {
        analysis_name_field['key']: analysis_name_field['field_name']
    }

    return analysis_layer


def create_profile_layer(profiling):
    """Create a tabular layer with the profiling.

    :param profiling: A dict containing benchmarking data.
    :type profiling: safe.messaging.message.Message

    :return: A tabular layer.
    :rtype: QgsVectorLayer
    """
    fields = [
        create_field_from_definition(profiling_function_field),
        create_field_from_definition(profiling_time_field)
    ]
    if setting(key='memory_profile', expected_type=bool):
        fields.append(create_field_from_definition(profiling_memory_field))
    tabular = create_memory_layer(
        'profiling',
        QgsWkbTypes.NullGeometry,
        fields=fields)

    # Generate profiling keywords
    tabular.keywords['layer_purpose'] = layer_purpose_profiling['key']

# Path: safe/definitions/layer_purposes.py

# 
# Path: safe/definitions/versions.py



# Path: safe/impact_function/create_extra_layers.py
import logging
from qgis.core import (
    QgsFeature,
    QgsWkbTypes,
)
from safe.definitions.constants import inasafe_keyword_version_key
from safe.definitions.fields import (
    aggregation_id_field,
    aggregation_name_field,
    analysis_name_field,
    profiling_function_field,
    profiling_time_field,
    profiling_memory_field
)
from safe.definitions.layer_purposes import (
    layer_purpose_profiling,
    layer_purpose_aggregation,
    layer_purpose_analysis_impacted,
)
from safe.definitions.versions import inasafe_keyword_version
from safe.gis.vector.tools import (
    create_memory_layer, create_field_from_definition, copy_layer)
from safe.utilities.gis import qgis_version
from safe.utilities.i18n import tr
from safe.utilities.profiling import profile
from safe.utilities.settings import setting

        inasafe_keyword_version)
    analysis_layer.keywords['inasafe_fields'] = {
        analysis_name_field['key']: analysis_name_field['field_name']
    }

    return analysis_layer


def create_profile_layer(profiling):
    """Create a tabular layer with the profiling.

    :param profiling: A dict containing benchmarking data.
    :type profiling: safe.messaging.message.Message

    :return: A tabular layer.
    :rtype: QgsVectorLayer
    """
    fields = [
        create_field_from_definition(profiling_function_field),
        create_field_from_definition(profiling_time_field)
    ]
    if setting(key='memory_profile', expected_type=bool):
        fields.append(create_field_from_definition(profiling_memory_field))
    tabular = create_memory_layer(
        'profiling',
        QgsWkbTypes.NullGeometry,
        fields=fields)

    # Generate profiling keywords
    tabular.keywords['layer_purpose'] = layer_purpose_profiling['key']

    tabular.keywords['title'] = layer_purpose_profiling['name']