code: def parse_afm(fh):
      """
      Parse the Adobe Font Metics file in file handle *fh*. Return value
      is a (*dhead*, *dcmetrics*, *dkernpairs*, *dcomposite*) tuple where
      *dhead* is a :func:`_parse_header` dict, *dcmetrics* is a
      :func:`_parse_composites` dict, *dkernpairs* is a
      :func:`_parse_kern_pairs` dict (possibly {}), and *dcomposite* is a
      :func:`_parse_composites` dict (possibly {})
      """
      _sanity_check(fh)
      dhead = _parse_header(fh)
      dcmetrics_ascii, dcmetrics_name = _parse_char_metrics(fh)
      doptional = _parse_optional(fh)
      return (
          dhead,
          dcmetrics_ascii,
          dcmetrics_name,
          doptional[0],
          doptional[1],
      )
  
imports: import sys, os, re
  from _mathtext_data import uni2type1
label_desc: Use image node_id 10 for calling a global function with example usage: parse_afm(fh) and returns: dhead,  dcmetrics_ascii,  dcmetrics_name,  doptional,  doptional