def _remove_predicates(xast, node, context):
<EOL>xast_c = deepcopy(xast)<EOL>for pred in list(xast_c.predicates):<EOL><INDENT>if not _predicate_is_constructible(pred):<EOL><INDENT>continue<EOL><DEDENT>if isinstance(pred, ast.BinaryExpression):<EOL><INDENT>if pred.op == '<STR_LIT:=>' andnode.xpath(serialize(pred), **context) is True:<EOL><INDENT>if isinstance(pred.left, ast.Step):<EOL><INDENT>if pred.left.axis in ('<STR_LIT:@>', '<STR_LIT>'):<EOL><INDENT>if _remove_attribute_node(node, context, pred.left):<EOL><INDENT>xast_c.predicates.remove(pred)<EOL><DEDENT><DEDENT>elif pred.left.axis in (None, '<STR_LIT>'):<EOL><INDENT>if _remove_child_node(node, context, pred.left, if_empty=True):<EOL><INDENT>xast_c.predicates.remove(pred)<EOL><DEDENT><DEDENT><DEDENT>elif isinstance(pred.left, ast.BinaryExpression):<EOL><INDENT>_remove_xml(pred.left, node, context, if_empty=True)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return xast_c<EOL>
Remove any constructible predicates specified in the xpath
    relative to the specified node.

    :param xast: parsed xpath (xpath abstract syntax tree) from
        :mod:`eulxml.xpath`
    :param node: lxml element which predicates will be removed from
    :param context: any context required for the xpath (e.g.,
        namespace definitions)

    :returns: updated a copy of the xast without the predicates that
        were successfully removed