docstr: Handle pretty printing operations onto a stream using a set of
  configured parameters.
  
  indent
      Number of spaces to indent for each level of nesting.
  
  width
      Attempted maximum number of columns in the output.
  
  depth
      The maximum depth to print out nested structures.
  
  stream
      The desired output stream.  If omitted (or false), the standard
      output stream available at construction will be used.
  
  compact
      If true, several items will be combined in one line.
  
  sort_dicts
      If true, dict keys are sorted.
  
  underscore_numbers
      If true, digit groups are separated with underscores.
docstr_tok: ["Handle","pretty","printing","operations","onto","a","stream","using","a","set","of","configured","parameters",".","indent","Number","of","spaces","to","indent","for","each","level","of","nesting",".","width","Attempted","maximum","number","of","columns","in","the","output",".","depth","The","maximum","depth","to","print","out","nested","structures",".","stream","The","desired","output","stream",".","If","omitted","(","or","false",")",",","the","standard","output","stream","available","at","construction","will","be","used",".","compact","If","true",",","several","items","will","be","combined","in","one","line",".","sort_dicts","If","true",",","dict","keys","are","sorted",".","underscore_numbers","If","true",",","digit","groups","are","separated","with","underscores","."]
code: def __init__(
      self,
      indent=1,
      width=80,
      depth=None,
      stream=None,
      *,
      compact=False,
      sort_dicts=True,
      underscore_numbers=False,
  ):
      """Handle pretty printing operations onto a stream using a set of
      configured parameters.
  
      indent
          Number of spaces to indent for each level of nesting.
  
      width
          Attempted maximum number of columns in the output.
  
      depth
          The maximum depth to print out nested structures.
  
      stream
          The desired output stream.  If omitted (or false), the standard
          output stream available at construction will be used.
  
      compact
          If true, several items will be combined in one line.
  
      sort_dicts
          If true, dict keys are sorted.
  
      underscore_numbers
          If true, digit groups are separated with underscores.
  
      """
      indent = int(indent)
      width = int(width)
      if indent < 0:
          raise ValueError("indent must be >= 0")
      if depth is not None and depth <= 0:
          raise ValueError("depth must be > 0")
      if not width:
          raise ValueError("width must be != 0")
      self._depth = depth
      self._indent_per_level = indent
      self._width = width
      if stream is not None:
          self._stream = stream
      else:
          self._stream = _sys.stdout
      self._compact = bool(compact)
      self._sort_dicts = sort_dicts
      self._underscore_numbers = underscore_numbers
  
imports: import collections
  import dataclasses
  import re
  import sys
  import types
  from io import StringIO
label_desc: Use image node_id 1 to create a new PrettyPrinter object  with example: obj = PrettyPrinter(indent, width, depth, stream)