code: def resolve_file_name(file_name, paths):
      """
      check if `file_name` exists, if not,
      go though the list of [path + file_name for path in paths].
      raises IOError if all options don't exist
  
      :param file_name:
      :param paths:
      :return:
      """
      try:
          assert file_name
          if os.path.isfile(file_name):
              return os.path.abspath(file_name)
          for path in paths:
              path_file_name = os.path.join(path, file_name)
              if os.path.isfile(path_file_name):
                  tf.logging.info(
                      "Resolving {} as {}".format(
                          file_name, path_file_name
                      )
                  )
                  return os.path.abspath(path_file_name)
          raise IOError("Could not resolve file name")
      except (TypeError, AssertionError, IOError):
          raise IOError("Could not resolve {}".format(file_name))
  
imports: from __future__ import absolute_import, print_function, unicode_literals
  import errno
  import importlib
  import logging
  import os
  import re
  import sys
  import warnings
  import nibabel
  import numpy
  import pandas
  import scipy.ndimage
  import tensorflow
  from tensorflow.core.framework import summary_pb2
  from niftynet.io.image_loader import load_image_obj
  from niftynet.utilities.niftynet_global_config import NiftyNetGlobalConfig
  from niftynet.utilities.util_import import require_module
label_desc: Use image node_id 20 for calling a global function with example usage: resolve_file_name(file_name, paths) and returns: os, os