code: def getpwd():
      """Try to return a CWD without dereferencing possible symlinks
  
      If no PWD found in the env, output of getcwd() is returned
      """
      cwd = os.getcwd()
      try:
          env_pwd = os.environ["PWD"]
          from datalad.utils import Path
  
          if Path(env_pwd).resolve() != Path(cwd).resolve():
              # uses os.chdir directly, pwd is not updated
              # could be an option to fail (tp not allow direct chdir)
              return cwd
          return env_pwd
      except KeyError:
          return cwd
  
file_path: datalad/tools/checkpwd.py
imports: import os
  from os import path
  import logging
  from nose.plugins.base import Plugin
  from nose.util import src, tolist
label_desc: Use image node_id 1 for calling a global function with example usage: getpwd() and returns: env_pwd, cwd, cwd