code: def try_close(f):
      # Avoid issue #875 (race condition when using the file in another
      # thread).
      for i in range(10):
          try:
              f.close()
          except IOError:
              # Yield to another thread
              time.sleep(1e-3)
          else:
              break
      # Try a last time and let raise
      f.close()
  
file_path: catboost/contrib/python/tornado/tornado-4/tornado/platform/common.py
imports: from __future__ import absolute_import, division, print_function
  import errno
  import socket
  import time
  from tornado.platform import interface
  from tornado.util import errno_from_exception
label_desc: Use image node_id 1 for calling a global function with example usage: try_close(f) without return types