code: def render_git_describe_long(pieces):
      """TAG-DISTANCE-gHEX[-dirty].
  
      Like 'git describe --tags --dirty --always -long'.
      The distance/hash is unconditional.
  
      Exceptions:
      1: no tags. HEX[-dirty]  (note: no 'g' prefix)
      """
      if pieces["closest-tag"]:
          rendered = pieces["closest-tag"]
          rendered += "-%d-g%s" % (pieces["distance"], pieces["short"])
      else:
          # exception #1
          rendered = pieces["short"]
      if pieces["dirty"]:
          rendered += "-dirty"
      return rendered
  
imports: import configparser
  import errno
  import json
  import os
  import re
  import subprocess
  import sys
  from pathlib import Path
  from typing import Callable, Dict
  import functools
label_desc: Use image node_id 21 for calling a global function with example usage: render_git_describe_long(pieces) and returns: rendered