code: def _format_single_feature(feature, weight, hl_spaces):
      # type: (str, float, bool) -> str
      feature = html_escape(feature)
      if not hl_spaces:
          return feature
  
      def replacer(n_spaces, side):
          # type: (int, str) -> str
          m = "0.1em"
          margins = {"left": (m, 0), "right": (0, m), "center": (m, m)}[
              side
          ]
          style = "; ".join(
              [
                  "background-color: hsl({}, 80%, 70%)".format(
                      _hue(weight)
                  ),
                  "margin: 0 {} 0 {}".format(*margins),
              ]
          )
          return '<span style="{style}" title="{title}">{spaces}</span>'.format(
              style=style,
              title="A space symbol"
              if n_spaces == 1
              else "{} space symbols".format(n_spaces),
              spaces="&emsp;" * n_spaces,
          )
  
      return replace_spaces(feature, replacer)
  
imports: from __future__ import absolute_import
  from itertools import groupby
  from typing import List, Optional, Tuple
  import numpy
  from jinja2 import Environment, PackageLoader
  from eli5 import _graphviz
  from eli5.base import Explanation, TargetExplanation, FeatureWeights, FeatureWeight
  from eli5.utils import max_or_0
  from .utils import format_signed, format_value, format_weight, has_any_values_for_weights, replace_spaces, should_highlight_spaces
  from .None import fields
  from .features import FormattedFeatureName
  from .trees import tree2text
  from .text_helpers import prepare_weighted_spans, PreparedWeightedSpans
label_desc: Use image node_id 14 for calling a global function with example usage: _format_single_feature(feature, weight, hl_spaces) and returns: replace_spaces, feature, str