code: def write(self, obj):
      if isinstance(obj, unicode):
          obj = obj.encode(self.encoding)
      elif isinstance(obj, str):
          pass
      else:
          obj = str(obj)
      self._stream.write(obj)
  
imports: import os
  import sys
  import py
  import tempfile
label_desc: Use image node_id 2 for calling the EncodedFile obj's underlying member method code with example usage: obj.write(obj) without return types