def overwrite_tags_with_parameters(tagged_lines,parameter_strings):
    """
    Takes tagged lines and the respective options and creates a
    valid Python source file.
    ---Inputs---
    tagged_lines : {list}
        list of all lines making up the tagged source code of the
        user's solver (all lines included, some tagged)
    parameter_strings : {list}
        list containing strings of source code to insert at each
        corresponding tag point
    ---Outputs---
    running_lines : {list}
        list of lines corresponding to a version of user's
            solver with arguments specified by parameter_strings 
    """

    running_lines = [0]*len(tagged_lines)
    num_tags_found = 0
    tag_string_cur = f'mgtune_tag_{num_tags_found}'
    for i_line,tagged_line in enumerate(tagged_lines):
        cur_line = tagged_lines[i_line]
        found_all_tags_in_line = False
        while (not found_all_tags_in_line): 
            cur_line_split = cur_line.split(tag_string_cur)
            if (len(cur_line_split) == 2):
                #current tag was in line, update cur_line by inserting parameter at split point
                cur_line = cur_line_split[0] + parameter_strings[num_tags_found] + cur_line_split[1]
                num_tags_found += 1
                tag_string_cur = f'mgtune_tag_{num_tags_found}'
            elif (len(cur_line_split) == 1):
                #can't split on current tag (since it's not in line)
                found_all_tags_in_line = True 
                running_lines[i_line] = cur_line
    return running_lines