code: def cut_file_log(log_file) -> StringIO:
      dest = StringIO()
      pos = log_file.tell()
      try:
          yield dest
      finally:
          log_file.seek(pos, os.SEEK_SET)
          dest.write(log_file.read())
  
file_path: mars/mars/oscar/backends/mars/tests/test_debug.py
imports: import asyncio
  import logging
  import os
  import sys
  from contextlib import contextmanager
  from io import StringIO
  from typing import List
  import pytest
  from .....None import oscar
  from ....debug import reload_debug_opts_from_env, get_debug_options
label_desc: Use image node_id 1 for calling a global function with example usage: cut_file_log(log_file) without return types