code: def _get_stat_float(
      label_result_dict: Dict[str, float], stat: str
  ) -> float:
      """
      Extract precision, recall, and f-score values from the given dictionary.
  
      Parameters
      ----------
      label_result_dict : Dict[str, float]
          Dictionary containing the stats to retrieve for a particular label.
      stat : str
          The statistic we're looking for in the dictionary.
  
      Returns
      -------
      float
          The value of the stat if it's in the dictionary, and NaN otherwise.
      """
      if (
          stat in label_result_dict
          and label_result_dict[stat] is not None
      ):
          return label_result_dict[stat]
      else:
          return float("nan")
  
imports: import json
  import math
  import re
  from collections import defaultdict
  from typing import Any, Dict, List, Union
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.pipeline import Pipeline
  from tabulate import tabulate
  from skll.types import EvaluateTaskResults, LabelType
  from skll.utils.logging import get_skll_logger
label_desc: Use image node_id 3 for calling a global function with example usage: _get_stat_float(label_result_dict, stat) and returns: label_result_dict, float