Checks if given string is contained in each string in the array.
    Output is a vec of booleans.

    Args:
        array (WeldObject / Numpy.ndarray): Input array
        start (int): starting index
        size (int): length to truncate at
        ty (WeldType): Type of each element in the input array

    Returns:
        A WeldObject representing this computation

def contains(array, ty, string):
    """
    Checks if given string is contained in each string in the array.
    Output is a vec of booleans.

    Args:
        array (WeldObject / Numpy.ndarray): Input array
        start (int): starting index
        size (int): length to truncate at
        ty (WeldType): Type of each element in the input array

    Returns:
        A WeldObject representing this computation
    """
    weld_obj = WeldObject(encoder_, decoder_)

    string_obj = weld_obj.update(string)
    if isinstance(string, WeldObject):
        string_obj =  string.obj_id
        weld_obj.dependencies[string_obj] = string

    array_var = weld_obj.update(array)
    if isinstance(array, WeldObject):
        array_var = array.obj_id
        weld_obj.dependencies[array_var] = array

    (start, end) = 0, len(string)
    # Some odd bug where iterating on str and slicing str results
    # in a segfault
    weld_template = """
       map(
         %(array)s,
         |str: vec[%(ty)s]|
           let tstr = str;
           result(
             for(
               str,
               merger[i8,+](i8(0)),
               |b,i,e|
                 if(slice(tstr, i, i64(%(end)s)) == %(cmpstr)s,
                    merge(b, i8(1)),
                    b
                 )
              )
            ) > i8(0)
       )
    """
    weld_obj.weld_code = weld_template % {"array": array_var, "ty": ty,
                                          "start": start, "end": end,
                                          "cmpstr": string_obj}

    return weld_obj