:return: all the attributes for the parsed element if it has any, or an empty dict

def get_element_attributes(parent_to_parse, element_path=None):
    """
    :return: all the attributes for the parsed element if it has any, or an empty dict
    """

    element = get_element(parent_to_parse, element_path)

    return {} if element is None else element.attrib