docs: def extract_code(end_mark, current_str, str_array, line_num):
      '''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.
      '''
      if end_mark not in current_str:
          reached_end = False
          line_num += 1
          while reached_end is False:
              next_line = str_array[line_num]
              if end_mark in next_line:
                  reached_end = True
              else:
                  line_num += 1
              current_str += next_line
      clean_str = current_str.split(end_mark)[0]
      return {'current_str': clean_str, 'line_num': line_num}