human
Complete this python program:
def adapt_criterion_to_null(crit, nulls):
assistant
#Here is the Python code you requested.

    """given criterion containing bind params, convert selected elements
    to IS NULL.
    """
    def visit_binary(binary):
        if (isinstance(binary.left, BindParameter) and (binary.left._identifying_key in nulls)):
            binary.left = binary.right
            binary.right = Null()
            binary.operator = operators.is_
            binary.negate = operators.isnot
        elif (isinstance(binary.right, BindParameter) and (binary.right._identifying_key in nulls)):
            binary.right = Null()
            binary.operator = operators.is_
            binary.negate = operators.isnot
    return visitors.cloned_traverse(crit, {}, {'binary': visit_binary})