code: def _cached_log_stream(filename):
      # Use 1K buffer if writing to cloud storage.
      io = pathmgr.open(
          filename, "a", buffering=1024 if "://" in filename else -1
      )
      atexit.register(io.close)
      return io
  
file_path: SlowFast/slowfast/utils/logging.py
imports: import atexit
  import builtins
  import decimal
  import functools
  import logging
  import os
  import sys
  import simplejson
  import slowfast.utils.distributed
  from slowfast.utils.env import pathmgr
label_desc: Use image node_id 2 for calling a global function with example usage: _cached_log_stream(filename) and returns: io