code: def _write_failure_reason_file(failure_msg):
      """Create a file 'failure' with failure reason written if remote function execution failed.
  
      See: https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-training-algo.html
      Args:
          failure_msg: The content of file to be written.
      """
      if not os.path.exists(FAILURE_REASON_PATH):
          with open(FAILURE_REASON_PATH, "w") as f:
              f.write(failure_msg)
  
file_path: sagemaker-python-sdk/src/sagemaker/remote_function/errors.py
imports: from __future__ import absolute_import
  import os
  from tblib import pickling_support
  from sagemaker.s3 import s3_path_join
  import sagemaker.remote_function.core.serialization
label_desc: Use image node_id 2 for calling a global function with example usage: _write_failure_reason_file(failure_msg) without return types