def METHOD_NAME(
    list_of_elements: List[Any],
    write_method: Callable[[Any, TextIO], None],
    text_output: TextIO,
    with_separator: bool = False,
):
    for element in list_of_elements:
        write_method(element, text_output)
        if with_separator:
            write_separator(text_output)