'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``'

def _get_extra_dict(self, response, mapping):

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