code: def write_plain(self, text, split=True):
      if self.root_context:
          self.open_ended = True
      if not text:
          return
      if not self.whitespace:
          data = " "
          self.column += len(data)
          if self.encoding:
              data = data.encode(self.encoding)
          self.stream.write(data)
      self.whitespace = False
      self.indention = False
      spaces = False
      breaks = False
      start = end = 0
      while end <= len(text):
          ch = None
          if end < len(text):
              ch = text[end]
          if spaces:
              if ch != " ":
                  if (
                      start + 1 == end
                      and self.column > self.best_width
                      and split
                  ):
                      self.write_indent()
                      self.whitespace = False
                      self.indention = False
                  else:
                      data = text[start:end]
                      self.column += len(data)
                      if self.encoding:
                          data = data.encode(self.encoding)
                      self.stream.write(data)
                  start = end
          elif breaks:
              if ch not in "\n\x85\u2028\u2029":
                  if text[start] == "\n":
                      self.write_line_break()
                  for br in text[start:end]:
                      if br == "\n":
                          self.write_line_break()
                      else:
                          self.write_line_break(br)
                  self.write_indent()
                  self.whitespace = False
                  self.indention = False
                  start = end
          else:
              if ch is None or ch in " \n\x85\u2028\u2029":
                  data = text[start:end]
                  self.column += len(data)
                  if self.encoding:
                      data = data.encode(self.encoding)
                  self.stream.write(data)
                  start = end
          if ch is not None:
              spaces = ch == " "
              breaks = ch in "\n\x85\u2028\u2029"
          end += 1
  
imports: from .error import YAMLError
  from .events import *
label_desc: Use image node_id 59 for calling the Emitter obj's underlying member method code with example usage: obj.write_plain(text, split) without return types