code: def _format_feature(feature, weight, hl_spaces):
      # type: (...) -> str
      
      if isinstance(feature, FormattedFeatureName):
          return feature.format()
      elif (isinstance(feature, list) and
              all('name' in x and 'sign' in x for x in feature)):
          return _format_unhashed_feature(feature, weight, hl_spaces=hl_spaces)
      else:
          return _format_single_feature(feature, weight, hl_spaces=hl_spaces)
docs: Format any feature.