code: def write(self, data):
      warn(
          "IOStream is deprecated since IPython 5.0, use sys.{stdin,stdout,stderr} instead",
          DeprecationWarning,
          stacklevel=2,
      )
      try:
          self._swrite(data)
      except:
          try:
              # print handles some unicode issues which may trip a plain
              # write() call.  Emulate write() by using an empty end
              # argument.
              print(data, end="", file=self.stream)
          except:
              # if we get here, something is seriously broken.
              print(
                  "ERROR - failed to write data to stream:",
                  self.stream,
                  file=sys.stderr,
              )
  
imports: from __future__ import print_function
  from __future__ import absolute_import
  import atexit
  import os
  import sys
  import tempfile
  import warnings
  from warnings import warn
  from IPython.utils.decorators import undoc
  from .capture import CapturedIO, capture_output
  from .py3compat import string_types, input, PY3
label_desc: Use image node_id 3 for calling the IOStream obj's underlying member method code with example usage: obj.write(data) without return types