

def _replacement(self, node):
    if isinstance(node.left, ast.Constant):
        if ((node.type == 'and') and (node.left.value == True)):
            return node.right
        if ((node.type == 'or') and (node.left.value == False)):
            return node.right
    elif isinstance(node.right, ast.Constant):
        if ((node.type == 'and') and (node.right.value == True)):
            return node.left
        if ((node.type == 'or') and (node.right.value == False)):
            return node.left
    return None

dataset/ETHPy150Open armon/pypred/pypred/optimizer.py ShortCircuitLogicalPattern._replacement/original