code: def _installed_version(package):
      try:
          exec(f"import {package}")
      except ModuleNotFoundError:
          v = "NA"
      try:
          v = eval(f"{package}.__version__")
      except AttributeError:
          v = "NA"
      return v
  
file_path: pysal/pysal/base.py
label_desc: Use image node_id 1 for calling a global function with example usage: _installed_version(package) and returns: v