code: def redirect_istream(stream: IO):
      """Redirect the standard input stream to the specified stream"""
      _t = sys.stdin
      sys.stdin = stream
      yield
      sys.stdin = _t
  
file_path: PaddleHub/paddlehub/utils/io.py
imports: import contextlib
  import sys
  from typing import IO
  from paddlehub.utils.utils import generate_tempfile
label_desc: Use image node_id 1 for calling a global function with example usage: redirect_istream(stream) without return types