def debugprint(r, prefix='', depth=-1, done=None, print_type=False,
               file=sys.stdout, print_destroy_map=False,
               print_view_map=False, order=None, ids='CHAR',
               stop_on_name=False, prefix_child=None,
               scan_ops=None, profile=None,
               scan_inner_to_outer_inputs=None, smap=None):
    if depth == 0:
        return

    if order is None:
        order = []

    if done is None:
        done = dict()

    if scan_ops is None:
        scan_ops = []

    if print_type:
        type_str = ' <%s>' % r.type
    else:
        type_str = ''

    if prefix_child is None:
        prefix_child = prefix

    def get_id_str(obj):
        if obj in done:
            id_str = done[obj]
        elif ids == "id":
            id_str = "[id %s]" % str(id(r))
        elif ids == "int":
            id_str = "[id %s]" % str(len(done))
        elif ids == "CHAR":
            id_str = "[id %s]" % char_from_number(len(done))
        elif ids == "":
            id_str = ""
        done[obj] = id_str

        return id_str

    if hasattr(r.owner, 'op'):
        # this variable is the output of computation,
        # so just print out the apply
        a = r.owner

        r_name = getattr(r, 'name', '')
        # normally if the name isn't set, it'll be None, so
        # r_name is None here
        if r_name is None:
            r_name = ''

        if print_destroy_map:
            destroy_map_str = str(getattr(r.owner.op, 'destroy_map', ''))
        else:
            destroy_map_str = ''

        if print_view_map:
            view_map_str = str(getattr(r.owner.op, 'view_map', ''))
        else:
            view_map_str = ''
        if destroy_map_str and destroy_map_str != '{}':
            destroy_map_str = 'd=' + destroy_map_str
        if view_map_str and view_map_str != '{}':
            view_map_str = 'v=' + view_map_str

        o = ''
        if order:
            o = str(order.index(r.owner))

        already_printed = a in done  # get_id_str put it in the dict
        id_str = get_id_str(a)

        if len(a.outputs) == 1:
            idx = ""
        else:
            idx = ".%i" % a.outputs.index(r)
        data = ""
        if smap:
            data = " " + str(smap.get(a.outputs[0], ''))
        if profile is None or a not in profile.apply_time:
            print('%s%s%s %s%s \'%s\' %s %s %s%s' % (prefix, a.op,
                                                     idx,
                                                     id_str, type_str,
                                                     r_name,
                                                     destroy_map_str,
                                                     view_map_str,
                                                     o, data), file=file)
        else:
            op_time = profile.apply_time[a]
            op_time_percent = (op_time / profile.fct_call_time) * 100
            tot_time_dict = profile.compute_total_times()
            tot_time = tot_time_dict[a]
            tot_time_percent = (tot_time_dict[a] / profile.fct_call_time) * 100

            if len(a.outputs) == 1:
                idx = ""
            else:
                idx = ".%i" % a.outputs.index(r)
            print("%s%s%s %s%s '%s' %s %s %s%s --> "
                  "%8.2es %4.1f%% %8.2es %4.1f%%"
                  % (prefix, a.op,
                     idx,
                     id_str, type_str,
                     r_name,
                     destroy_map_str,
                     view_map_str,
                     o, data,
                     op_time,
                     op_time_percent,
                     tot_time,
                     tot_time_percent), file=file)

        if not already_printed:
            if (not stop_on_name or
                    not (hasattr(r, 'name') and r.name is not None)):
                new_prefix = prefix_child + ' |'
                new_prefix_child = prefix_child + ' |'

                for idx, i in enumerate(a.inputs):
                    if idx == len(a.inputs) - 1:
                        new_prefix_child = prefix_child + '  '

                    if hasattr(i, 'owner') and hasattr(i.owner, 'op'):
                        if isinstance(i.owner.op,
                                      theano.scan_module.scan_op.Scan):
                            scan_ops.append(i)

                    debugprint(
                        i, new_prefix, depth=depth - 1, done=done,
                        print_type=print_type, file=file, order=order,
                        ids=ids, stop_on_name=stop_on_name,
                        prefix_child=new_prefix_child, scan_ops=scan_ops,
                        profile=profile,
                        scan_inner_to_outer_inputs=scan_inner_to_outer_inputs,
                        smap=smap)
    else:
        if scan_inner_to_outer_inputs is not None and\
           r in scan_inner_to_outer_inputs:

            id_str = get_id_str(r)
            outer_r = scan_inner_to_outer_inputs[r]

            if hasattr(outer_r.owner, 'op'):
                outer_id_str = get_id_str(outer_r.owner)
            else:
                outer_id_str = get_id_str(outer_r)
            print('%s%s %s%s -> %s' % (prefix, r, id_str, type_str,
                                       outer_id_str), file=file)
        else:
            # this is an input variable
            data = ""
            if smap:
                data = " " + str(smap.get(r, ''))
            id_str = get_id_str(r)
            print('%s%s %s%s%s' % (prefix, r, id_str,
                                   type_str, data),
                  file=file)

    return file
Solves the equation specified by the input string. This is a convenience
dataset/ETHPy150Open rizar/attention-lvcsr/libs/Theano/theano/compile/debugmode.py/debugprint--crossover with--dataset/ETHPy150Open crm416/semantic/semantic/solver.py/parseEquation