code: def nonlinearity_1d_handler(input_ind, explainer, op, *grads):
      # make sure only the given input varies
      op_inputs = op.inputs
      if op_inputs is None:
          op_inputs = op.outputs[0].op.inputs
  
      for i in range(len(op_inputs)):
          if i != input_ind:
              assert not explainer._variable_inputs(op)[i], (
                  str(i) + "th input to " + op.name + " cannot vary!"
              )
  
      xin0, rin0 = tf.split(op_inputs[input_ind], 2)
      xout, rout = tf.split(op.outputs[input_ind], 2)
      delta_in0 = xin0 - rin0
      if delta_in0.shape is None:
          dup0 = [2, 1]
      else:
          dup0 = [2] + [1 for i in delta_in0.shape[1:]]
      out = [None for _ in op_inputs]
      if op.type.startswith("shap_"):
          op.type = op.type[5:]
      orig_grad = explainer.orig_grads[op.type](op, grads[0])
      out[input_ind] = tf.where(
          tf.tile(tf.abs(delta_in0), dup0) < 1e-6,
          orig_grad[input_ind] if len(op_inputs) > 1 else orig_grad,
          grads[0] * tf.tile((xout - rout) / delta_in0, dup0),
      )
      return out
  
imports: import warnings
  import numpy
  from packaging import version
  from ...utils._exceptions import DimensionError
  from .._explainer import Explainer
  from ..tf_utils import _get_graph, _get_model_inputs, _get_model_output, _get_session
  from .deep_utils import _check_additivity
label_desc: Use image node_id 11 for calling a global function with example usage: nonlinearity_1d_handler(input_ind, explainer, op) and returns: out