code: def remove_unused_higher_bins(term_features, bins):
      # many features are not used in pairs, so we can simplify the model
      # by removing the extra higher interaction level bins
  
      highest_levels = [0] * len(bins)
      for feature_idxs in term_features:
          for feature_idx in feature_idxs:
              highest_levels[feature_idx] = max(
                  highest_levels[feature_idx], len(feature_idxs)
              )
  
      for bin_levels, max_level in zip(bins, highest_levels):
          del bin_levels[max_level:]
  
imports: from math import ceil, isnan, isinf, exp, log
  from ...utils._native import Native
  from ._tensor import restore_missing_value_zeros
  import numpy
  import warnings
  from itertools import islice
  import logging
label_desc: Use image node_id 9 for calling a global function with example usage: remove_unused_higher_bins(term_features, bins) without return types