def set_pen_attr(element, attributes):
    """
    Set pen attributes.
    :param element:
    :param attributes:
    :return:
    """
    pen_attr = element.get('attr')
    if pen_attr is None:
        return {}
    else:
        return {'lineStyle': pen_attr.get('lineStyle'), 'lineWidth': float(
            pen_attr.get('lineWidth', '0')), 'lineColor': pen_attr.get(
            'lineColor')}
