code: def should_strip_ansi(
      stream: t.Optional[t.IO[t.Any]] = None,
      color: t.Optional[bool] = None,
  ) -> bool:
      if color is None:
          if stream is None:
              stream = sys.stdin
          return not isatty(stream) and not _is_jupyter_kernel_output(
              stream
          )
      return not color
  
imports: import codecs
  import io
  import os
  import re
  import sys
  import typing
  from weakref import WeakKeyDictionary
label_desc: Use image node_id 24 for calling a global function with example usage: should_strip_ansi(stream, color) and returns: unknown, unknown