code: def _make_text_stream(
      stream,
      encoding,
      errors,
      force_readable=False,
      force_writable=False,
  ):
      if encoding is None:
          encoding = get_best_encoding(stream)
      if errors is None:
          errors = "replace"
      return _NonClosingTextIOWrapper(
          stream,
          encoding,
          errors,
          line_buffering=True,
          force_readable=force_readable,
          force_writable=force_writable,
      )
  
imports: import codecs
  import io
  import os
  import re
  import sys
  from weakref import WeakKeyDictionary
label_desc: Use image node_id 2 for calling a global function with example usage: _make_text_stream(stream, encoding, errors, force_readable, force_writable) and returns: _NonClosingTextIOWrapper