human
Complete this python program:
def equal_computations(xs, ys, in_xs=None, in_ys=None):
assistant
#Here is the Python program you requested.

    """Checks if Theano graphs represent the same computations.
    The two lists `xs`, `ys` should have the same number of entries. The
    function checks if for any corresponding pair `(x,y)` from `zip(xs,ys)`
    `x` and `y` represent the same computations on the same variables
    (unless equivalences are provided using `in_xs`, `in_ys`).
    If `in_xs` and `in_ys` are provided, then when comparing a node `x` with
    a node `y` they are automatically considered as equal if there is some
    index `i` such that `x == in_xs[i]` and `y == in_ys[i]`(and they both
    have the same type). Note that `x` and `y` can be in the list `xs` and
    `ys`, but also represent subgraphs of a computational graph in `xs`
    or `ys`.
    """
    assert (len(xs) == len(ys))
    if (in_xs is None):
        in_xs = []
    if (in_ys is None):
        in_ys = []
    for (x, y) in izip(xs, ys):
        if (x.owner and (not y.owner)):
            return False
        if (y.owner and (not x.owner)):
            return False
        if x.owner:
            if (x.owner.outputs.index(x) != y.owner.outputs.index(y)):
                return False
        if ((x not in in_xs) and (x.type != y.type)):
            return False
    if (len(in_xs) != len(in_ys)):
        return False
    for (_x, _y) in izip(in_xs, in_ys):
        if (_x.type != _y.type):
            return False
    common = set(zip(in_xs, in_ys))
    different = set()
    for (dx, dy) in izip(xs, ys):
        if (not dx.owner):
            if (isinstance(dx, tensor.Constant) and isinstance(dy, tensor.Constant)):
                if (not dx.equals(dy)):
                    return False
                else:
                    pass
            elif (((dx, dy) not in common) and (dx != dy)):
                return False
    def compare_nodes(nd_x, nd_y, common, different):
        '\n                                Compare    two    nodes    to    determine    if    they    perform    equal    computation.\n                                This    is    done    by    comparing    the    ops,    the    number    of    inputs,    outputs    and\n                                by    ensuring    that    the    inputs    themselves    are    the    result    of    equal\n                                computation.\n\n                                NOTE    :    This    function    relies    on    the    variable    common    to    cache\n                                results    to    be    more    efficient.\n\n                                '
        if (nd_x.op != nd_y.op):
            return False
        elif (len(nd_x.inputs) != len(nd_y.inputs)):
            return False
        elif (len(nd_x.outputs) != len(nd_y.outputs)):
            return False
        else:
            all_in_common =...