def parse_common_attributes(self, element, attributes):
    'parse and return dict of common attributes'
    result_attributes = {}
    for attribute in attributes:
        attrib_info = ALL_ATTRIBUTES_MAP[attribute]
        if (attrib_info.get('default', MISSING) is not MISSING):
            default_value = attrib_info['default']
        else:
            default_value = MISSING
        attribute_name = attrib_info.get('attribute_name', attribute)
        value = element.attrib.get(attribute_name, default_value)
        if ((value is MISSING) or (value == '')):
            if (attrib_info.get('use') == 'optional'):
                continue
            else:
                raise ValueError(f'element {element.tag} missing required attribute {attribute_name}')
        if attrib_info.get('type'):
            try:
                value = attrib_info['type'](value)
            except ValueError as exc:
                raise ValueError(f'element {element.tag} invalid value {repr(value)} for attribute {attribute_name}') from exc
        if attrib_info.get('minimumValue'):
            if (value < attrib_info['minimumValue']):
                raise ValueError(f"element {element.tag} invalid value {repr(value)} for attribute {attribute_name},less than allowed minimum {repr(attrib_info['minimumValue'])}")
        if attrib_info.get('pattern'):
            if (not attrib_info['pattern'].match(value)):
                raise ValueError(f"element {element.tag} invalid value {repr(value)} for attribute {attribute_name},does not match expected pattern {repr(attrib_info['pattern'])}")
        if attrib_info.get('map'):
            try:
                value = attrib_info['map'][value]
            except (KeyError, IndexError) as exc:
                raise ValueError(f"element {element.tag} invalid value {repr(value)} for attribute {attribute_name}, must be one of {repr(attrib_info['map'].keys())}") from exc
        if attrib_info.get('rename'):
            attribute = attrib_info['rename']
        result_attributes[attribute] = value
    return result_attributes
parse and return dict of common attributes
def parse_common_attributes(self, element, attributes):
    
    result_attributes = {}
    for attribute in attributes:
        attrib_info = ALL_ATTRIBUTES_MAP[attribute]
        if (attrib_info.get('default', MISSING) is not MISSING):
            default_value = attrib_info['default']
        else:
            default_value = MISSING
        attribute_name = attrib_info.get('attribute_name', attribute)
        value = element.attrib.get(attribute_name, default_value)
        if ((value is MISSING) or (value == )):
            if (attrib_info.get('use') == 'optional'):
                continue
            else:
                raise ValueError(f'element {element.tag} missing required attribute {attribute_name}')
        if attrib_info.get('type'):
            try:
                value = attrib_info['type'](value)
            except ValueError as exc:
                raise ValueError(f'element {element.tag} invalid value {repr(value)} for attribute {attribute_name}') from exc
        if attrib_info.get('minimumValue'):
            if (value < attrib_info['minimumValue']):
                raise ValueError(f"element {element.tag} invalid value {repr(value)} for attribute {attribute_name},less than allowed minimum {repr(attrib_info['minimumValue'])}")
        if attrib_info.get('pattern'):
            if (not attrib_info['pattern'].match(value)):
                raise ValueError(f"element {element.tag} invalid value {repr(value)} for attribute {attribute_name},does not match expected pattern {repr(attrib_info['pattern'])}")
        if attrib_info.get('map'):
            try:
                value = attrib_info['map'][value]
            except (KeyError, IndexError) as exc:
                raise ValueError(f"element {element.tag} invalid value {repr(value)} for attribute {attribute_name}, must be one of {repr(attrib_info['map'].keys())}") from exc
        if attrib_info.get('rename'):
            attribute = attrib_info['rename']
        result_attributes[attribute] = value
    return result_attributes