code: def _get_top_features(feature_names, coef, top, x):
      """
      Return a ``(pos, neg)`` tuple. ``pos`` and ``neg`` are lists of
      ``(name, value)`` tuples for features with positive and negative
      coefficients.
  
      Parameters:
  
      * ``feature_names`` - a vector of feature names;
      * ``coef`` - coefficient vector; coef.shape must be equal to
        feature_names.shape;
      * ``top`` can be either a number or a ``(num_pos, num_neg)`` tuple.
        If ``top`` is a number, ``top`` features with largest absolute
        coefficients are returned. If it is a ``(num_pos, num_neg)`` tuple,
        the function returns no more than ``num_pos`` positive features and
        no more than ``num_neg`` negative features. ``None`` value means
        'no limit'.
      * ``x`` is a vector of feature values, passed to FeatureWeight.value.
      """
      if isinstance(top, (list, tuple)):
          num_pos, num_neg = list(top)  # "list" is just for mypy
          pos = _get_top_positive_features(
              feature_names, coef, num_pos, x
          )
          neg = _get_top_negative_features(
              feature_names, coef, num_neg, x
          )
      else:
          pos, neg = _get_top_abs_features(feature_names, coef, top, x)
      return pos, neg
  
file_path: eli5/eli5/_feature_weights.py
imports: from __future__ import absolute_import
  import numpy
  from eli5.base import FeatureWeights, FeatureWeight
  from .utils import argsort_k_largest_positive, argsort_k_smallest, mask
label_desc: Use image node_id 1 for calling a global function with example usage: _get_top_features(feature_names, coef, top, x) and returns: pos,  neg