code: def _is_binary_reader(
      stream: t.IO[t.Any], default: bool = False
  ) -> bool:
      try:
          return isinstance(stream.read(0), bytes)
      except Exception:
          return default
  
imports: import codecs
  import io
  import os
  import re
  import sys
  import typing
  from weakref import WeakKeyDictionary
label_desc: Use image node_id 4 for calling a global function with example usage: _is_binary_reader(stream, default) and returns: isinstance, default