code: def loss_sensitivity(
      classifier: "CLASSIFIER_LOSS_GRADIENTS_TYPE",
      x: np.ndarray,
      y: np.ndarray,
  ) -> np.ndarray:
      """
      Local loss sensitivity estimated through the gradients of the prediction at points in `x`.
  
      | Paper link: https://arxiv.org/abs/1706.05394
  
      :param classifier: A trained model.
      :param x: Data sample of shape that can be fed into `classifier`.
      :param y: Labels for sample `x`, one-hot encoded.
      :return: The average loss sensitivity of the model.
      """
      grads = classifier.loss_gradient(x, y)
      norm = la.norm(grads.reshape(grads.shape[0], -1), ord=2, axis=1)
  
      return np.mean(norm)
  
imports: from __future__ import absolute_import, division, print_function, unicode_literals
  from functools import reduce
  import logging
  from typing import Any, Dict, List, Optional, Union, TYPE_CHECKING
  import numpy
  import numpy.linalg
  from scipy.optimize import fmin
  from scipy.stats import weibull_min
  from tqdm.auto import tqdm
  from art.config import ART_NUMPY_DTYPE
  from art.attacks.attack import EvasionAttack
  from art.attacks.evasion.auto_attack import AutoAttack
  from art.attacks.evasion.fast_gradient import FastGradientMethod
  from art.attacks.evasion.hop_skip_jump import HopSkipJump
  from art.utils import random_sphere
label_desc: Use image node_id 4 for calling a global function with example usage: loss_sensitivity(classifier, x, y) and returns: np