code: def buildVFStatTable(
      ttFont: TTFont, doc: DesignSpaceDocument, vfName: str
  ) -> None:
      """Build the STAT table for the variable font identified by its name in
      the given document.
  
      Knowing which variable we're building STAT data for is needed to subset
      the STAT locations to only include what the variable font actually ships.
  
      .. versionadded:: 5.0
  
      .. seealso::
          - :func:`getStatAxes()`
          - :func:`getStatLocations()`
          - :func:`fontTools.otlLib.builder.buildStatTable()`
      """
      for vf in doc.getVariableFonts():
          if vf.name == vfName:
              break
      else:
          raise DesignSpaceDocumentError(
              f"Cannot find the variable font by name {vfName}"
          )
  
      region = getVFUserRegion(doc, vf)
  
      return fontTools.otlLib.builder.buildStatTable(
          ttFont,
          getStatAxes(doc, region),
          getStatLocations(doc, region),
          doc.elidedFallbackName
          if doc.elidedFallbackName is not None
          else 2,
      )
  
file_path: catboost/contrib/python/fonttools/fontTools/varLib/stat.py
imports: from __future__ import annotations
  from typing import Dict, List, Union
  import fontTools.otlLib.builder
  from fontTools.designspaceLib import AxisLabelDescriptor, DesignSpaceDocument, DesignSpaceDocumentError, LocationLabelDescriptor
  from fontTools.designspaceLib.types import Region, getVFUserRegion, locationInRegion
  from fontTools.ttLib import TTFont
label_desc: Use image node_id 1 for calling a global function with example usage: buildVFStatTable(ttFont, doc, vfName) and returns: fontTools