code: def _pprint_str(
      self, object, stream, indent, allowance, context, level
  ):
      write = stream.write
      if not len(object):
          write(repr(object))
          return
      chunks = []
      lines = object.splitlines(True)
      if level == 1:
          indent += 1
          allowance += 1
      max_width1 = max_width = self._width - indent
      for i, line in enumerate(lines):
          rep = repr(line)
          if i == len(lines) - 1:
              max_width1 -= allowance
          if len(rep) <= max_width1:
              chunks.append(rep)
          else:
              # A list of alternating (non-space, space) strings
              parts = re.findall(r"\S*\s*", line)
              assert parts
              assert not parts[-1]
              parts.pop()  # drop empty last part
              max_width2 = max_width
              current = ""
              for j, part in enumerate(parts):
                  candidate = current + part
                  if j == len(parts) - 1 and i == len(lines) - 1:
                      max_width2 -= allowance
                  if len(repr(candidate)) > max_width2:
                      if current:
                          chunks.append(repr(current))
                      current = part
                  else:
                      current = candidate
              if current:
                  chunks.append(repr(current))
      if len(chunks) == 1:
          write(rep)
          return
      if level == 1:
          write("(")
      for i, rep in enumerate(chunks):
          if i > 0:
              write("\n" + " " * indent)
          write(rep)
      if level == 1:
          write(")")
  
imports: import collections
  import dataclasses
  import re
  import sys
  import types
  from io import StringIO
label_desc: Use image node_id 13 for calling the PrettyPrinter obj's underlying member method code with example usage: obj._pprint_str(object, stream, indent, allowance, context, level) without return types