code: def get_all_features(feature_weights, with_weights=False):
      """Collect a dict of all features and their weights."""
      features = {}
      for fw in feature_weights:
          if isinstance(fw.feature, list):
              features.update(
                  (f["name"], fw.weight) for f in fw.feature
              )
          else:
              features[fw.feature] = fw.weight
      return features if with_weights else set(features)
  
file_path: eli5/tests/utils.py
imports: from __future__ import print_function
  import os
  import inspect
  import json
  from pprint import pprint
  from hypothesis.strategies import integers
  from hypothesis.extra.numpy import arrays
  import numpy
  from eli5.base import Explanation
  from eli5.formatters import format_as_text, format_as_html, format_as_dict
  from eli5.formatters.html import html_escape
  from eli5.formatters.text import format_signed
  from eli5.sklearn.utils import sklearn_version
label_desc: Use image node_id 5 for calling a global function with example usage: get_all_features(feature_weights, with_weights) and returns: unknown