def map_attributes(properties, filter_function):
    """Map properties to attributes"""
    if not isinstance(properties, list):
        properties = list(properties)

    return dict(
        map(
            lambda x: (x.get("@name"), x.get("@value")),
            filter(filter_function, properties),
        )
    )