code: def _stream_is_misconfigured(stream: t.TextIO) -> bool:
      """A stream is misconfigured if its encoding is ASCII."""
      # If the stream does not have an encoding set, we assume it's set
      # to ASCII.  This appears to happen in certain unittest
      # environments.  It's not quite clear what the correct behavior is
      # but this at least will force Click to recover somehow.
      return is_ascii_encoding(
          getattr(stream, "encoding", None) or "ascii"
      )
  
imports: import codecs
  import io
  import os
  import re
  import sys
  import typing
  from weakref import WeakKeyDictionary
label_desc: Use image node_id 8 for calling a global function with example usage: _stream_is_misconfigured(stream) and returns: is_ascii_encoding