@staticmethod
def _get_extra_dict(response, mapping):
    """
        Extract attributes from the element based on rules provided in the
        mapping dictionary.

        :param   response: The JSON response to parse the values from.
        :type    response: ``dict``

        :param   mapping: Dictionary with the extra layout
        :type    mapping: ``dict``

        :rtype:  ``dict``
        """
    extra = {}
    for attribute, values in mapping.items():
        transform_func = values['transform_func']
        value = response.get(values['key_name'])
        extra[attribute] = transform_func(value) if value else None
    return extra
