code: def version(package, encoding="utf-8"):
      """Obtain the packge version from a python file e.g. pkg/__init__.py
      See <https://packaging.python.org/en/latest/single_source_version.html>.
      """
      path = os.path.join(
          os.path.dirname(__file__), package, "__init__.py"
      )
      with io.open(path, encoding=encoding) as fp:
          version_info = fp.read()
      version_match = re.search(
          r"""^__version__ = ['"]([^'"]*)['"]""", version_info, re.M
      )
      if not version_match:
          raise RuntimeError("Unable to find version string.")
      return version_match.group(1)
  
file_path: pyflux/setup.py
imports: import io
  import os
  import re
  import sys
  import subprocess
label_desc: Use image node_id 1 for calling a global function with example usage: version(package, encoding) and returns: version_match