code: def _get_git_revision():
      try:
          revision = subprocess.check_output(
              REVISION_CMD.split()
          ).strip()
      except (subprocess.CalledProcessError, OSError):
          print("Failed to execute git to get revision")
          return None
      return revision.decode("utf-8")
  
file_path: tslearn/docs/conf.py
imports: import sys
  import os
  import warnings
  import sphinx_bootstrap_theme
  import subprocess
  from sphinx_gallery.scrapers import matplotlib_scraper
  import tslearn
label_desc: Use image node_id 2 for calling a global function with example usage: _get_git_revision() and returns: revision, None