def extract_code(end_mark, current_str, str_array, line_num):
if end_mark not in current_str:<EOL><INDENT>reached_end = False<EOL>line_num += <NUM_LIT:1><EOL>while reached_end is False:<EOL><INDENT>next_line = str_array[line_num]<EOL>if end_mark in next_line:<EOL><INDENT>reached_end = True<EOL><DEDENT>else:<EOL><INDENT>line_num += <NUM_LIT:1><EOL><DEDENT>current_str += next_line<EOL><DEDENT><DEDENT>clean_str = current_str.split(end_mark)[<NUM_LIT:0>]<EOL>return {'<STR_LIT>': clean_str, '<STR_LIT>': line_num}<EOL>
Extract a multi-line string from a string array, up to a specified end marker.

        Args:
            end_mark (str): The end mark string to match for.
            current_str (str): The first line of the string array.
            str_array (list): An array of strings (lines).
            line_num (int): The current offset into the array.

        Returns:
            Extended string up to line with end marker.