code: def run_black_safe(filename, wr_back, mode, report):
      try:
          return run_black(filename, wr_back, mode, report, fast=False)
      except Exception:
          # fast mode failed - drop report stats and retry
          report.change_count = 0
          report.same_count = 0
          report.failure_count = 0
  
          return run_black(filename, wr_back, mode, report, fast=True)
  
file_path: catboost/tools/black_linter/bin/__main__.py
imports: import contextlib
  import io
  import logging
  import os
  import sys
  import time
  from pathlib import Path
  import yalibrary.term.console
  from library.python.testing.custom_linter_util import linter_params, reporter
  import black
  import black.files
  import black.report
  import black.mode
label_desc: Use image node_id 3 for calling a global function with example usage: run_black_safe(filename, wr_back, mode, report) and returns: run_black, run_black