Adds the specified key/value pairs to the element's attributes, and
    returns the updated set of attributes.

    If the element already contains any of the attributes specified in
    attrib_kwargs, they are updated accordingly.

def set_element_attributes(elem_to_parse, **attrib_kwargs):
    """
    Adds the specified key/value pairs to the element's attributes, and
    returns the updated set of attributes.

    If the element already contains any of the attributes specified in
    attrib_kwargs, they are updated accordingly.
    """

    element = get_element(elem_to_parse)

    if element is None:
        return element

    if len(attrib_kwargs):
        element.attrib.update(attrib_kwargs)

    return element.attrib