code: def convert_to_safe_path(input_path, follow_symlinks=True):
      # resolves symbolic links
      if follow_symlinks:
          return os.path.realpath(input_path)
      # covert to abs path
      return os.path.abspath(input_path)
  
imports: from bigdl.util.common import Sample, JTensor, JavaCreator, _get_gateway, _py2java, _java2py
  import numpy
  import os
  import tempfile
  import uuid
  import functools
  from urllib.parse import urlparse
label_desc: Use image node_id 1 for calling a global function with example usage: convert_to_safe_path(input_path, follow_symlinks) and returns: os, os