code: def _follow_symlinks(filepath):
      """In case filepath is a symlink, follow it until a
      real file is reached.
      """
      filepath = os.path.abspath(filepath)
      while os.path.islink(filepath):
          filepath = os.path.normpath(
              os.path.join(
                  os.path.dirname(filepath), os.readlink(filepath)
              )
          )
      return filepath
  
imports: import collections
  import os
  import re
  import sys
  import functools
  import itertools
label_desc: Use image node_id 17 for calling a global function with example usage: _follow_symlinks(filepath) and returns: filepath