<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def weld_str_split(array, pat, side):
 """Split on pat and return side. Parameters array : numpy.ndarray or WeldObject Input data. pat : str To find. side : {0, 1} Which side to return, with 0 being left and 1 being right Returns ------- WeldObject Representation of this computation. """

    obj_id, weld_obj = create_weld_object(array)
    pat_id = get_weld_obj_id(weld_obj, pat)

    left_side_template = """let pat_start_index = words_iter_res.$0 - 1L;
result(
    for(slice(e, 0L, pat_start_index),
        appender[i8],
        |c: appender[i8], j: i64, f: i8|
            merge(c, f)   
    )                 
)"""
    right_side_template = """let start_index = words_iter_res.$0 - 1L + lenPat;
result(
    for(slice(e, start_index, lenString),
        appender[i8],
        |c: appender[i8], j: i64, f: i8|
            merge(c, f)   
    )                 
)"""

    weld_template = """let lenPat = len({pat});
map({array},
    |e: vec[i8]|
        let lenString = len(e);
        if(lenPat > lenString,
            e,
            # start by assuming sub is not found, until proven it is
            let words_iter_res = iterate({{0L, false}}, 
                |p| 
                    let e_i = p.$0;
                    let pat_i = 0L;
                    # start by assuming the substring and sub are the same, until proven otherwise
                    let word_check_res = iterate({{e_i, pat_i, true}}, 
                        |q| 
                            let found = lookup(e, q.$0) == lookup({pat}, q.$1);
                            {{
                                {{q.$0 + 1L, q.$1 + 1L, found}}, 
                                q.$1 + 1L < lenPat &&
                                found == true
                            }}
                    ).$2;
                    {{
                        {{p.$0 + 1L, word_check_res}}, 
                        p.$0 + lenPat < lenString &&
                        word_check_res == false
                    }}
            );
            if(words_iter_res.$1 == true,
                {side},
                e
            )
        )
)"""

    weld_obj.weld_code = weld_template.format(array=obj_id,
                                              pat=pat_id,
                                              side=left_side_template if side == 0 else right_side_template)

    return weld_obj