code: def get_stream_encoding(stream):
      if stream.encoding:
          try:
              codecs.lookup(stream.encoding)
              return stream.encoding
          except LookupError:
              pass
      return DEFAULT_ENCODING
  
imports: import locale
  import logging
  import six
  import sys
  import codecs
  import library.python.func
label_desc: Use image node_id 12 for calling a global function with example usage: get_stream_encoding(stream) and returns: DEFAULT_ENCODING, stream