def METHOD_NAME(
    self,
    *x: str,
    delimiter: Optional[str] = None
) -> None:
    if not x:
        return
    if self.new_lines:
        if self.result and self.pretty:
            self.current_line += self.new_lines
            self.result.append('\n' * self.new_lines)
        if self.pretty:
            self.result.append(self.indent_with * self.indentation)
            self.result.append(' ' * self.char_indentation)
        else:
            self.result.append(' ')
        self.new_lines = 0
    if delimiter:
        self.result.append(x[0])
        chain = itertools.chain.from_iterable
        chunks: Iterable[str] = chain((delimiter, v) for v in x[1:])
    else:
        chunks = x
    for chunk in chunks:
        if not isinstance(chunk, str):
            raise ValueError(
                'invalid text chunk in codegen: {!r}'.format(chunk))
        self.result.append(chunk)