def ast_to_blitz_expr(ast_seq):
    # Don't overwrite orignal sequence in call to transform slices.
    ast_seq = copy.deepcopy(ast_seq)
    slice_handler.transform_slices(ast_seq)

    # Build the actual program statement from ast_seq
    expr = ast_tools.ast_to_string(ast_seq)

    # Now find and replace specific symbols to convert this to
    # a blitz++ compatible statement.
    # I'm doing this with string replacement here.  It could
    # also be done on the actual ast tree (and probably should from
    # a purest standpoint...).

    # this one isn't necessary but it helps code readability
    # and compactness. It requires that
    #   Range _all = blitz::Range::all();
    # be included in the generated code.
    # These could all alternatively be done to the ast in
    # build_slice_atom()
    expr = expr.replace('slice(_beg,_end)', '_all')
    expr = expr.replace('slice', 'blitz::Range')
    expr = expr.replace('[','(')
    expr = expr.replace(']', ')')
    expr = expr.replace('_stp', '1')

    # Instead of blitz::fromStart and blitz::toEnd.  This requires
    # the following in the generated code.
    #   Range _beg = blitz::fromStart;
    #   Range _end = blitz::toEnd;
    #expr = expr.replace('_beg', 'blitz::fromStart' )
    #expr = expr.replace('_end', 'blitz::toEnd' )

    return expr + ';\n'
Prepares the boot of deploy ramdisk using virtual media.
dataset/ETHPy150Open scipy/scipy/scipy/weave/blitz_tools.py/ast_to_blitz_expr--crossover with--dataset/ETHPy150Open openstack/ironic/ironic/drivers/modules/ilo/boot.py/IloVirtualMediaBoot.prepare_ramdisk