def error(errors):
    """Create error element."""
    e_tree, e_oaipmh = envelope()
    for code, message in errors:
        e_error = SubElement(e_oaipmh, etree.QName(NS_OAIPMH, 'error'))
        e_error.set('code', code)
        e_error.text = message
    return e_tree
def error ( errors ) : e_tree , e_oaipmh = envelope ( ) for code , message in errors : e_error = SubElement ( e_oaipmh , etree . QName ( NS_OAIPMH , 'error' ) ) e_error . set ( 'code' , code ) e_error . text = message return e_tree
Create error element.