def METHOD_NAME(lines, file, start_marker=None, end_marker=None):
    include = not start_marker
    for line in lines:
        if line == start_marker:
            include = True
        if include:
            file.METHOD_NAME(line.rstrip() + '\n')
        if line == end_marker:
            include = False