code: def get_crafter(
      classifier: "CLASSIFIER_TYPE",
      attack: str,
      params: Optional[Dict[str, Any]] = None,
  ) -> "EvasionAttack":
      """
      Create an attack instance to craft adversarial samples.
  
      :param classifier: A trained model.
      :param attack: adversarial attack name.
      :param params: Parameters specific to the adversarial attack.
      :return: An attack instance.
      """
      try:
          crafter = SUPPORTED_METHODS[attack]["class"](classifier)
      except Exception:  # pragma: no cover
          logger.warning(
              "Available attacks include %s.",
              ", ".join(SUPPORTED_METHODS.keys()),
          )
          raise NotImplementedError(
              f"{attack} crafting method not supported."
          ) from Exception
  
      if "params" in SUPPORTED_METHODS[attack]:
          crafter.set_params(**SUPPORTED_METHODS[attack]["params"])
      if params:
          crafter.set_params(**params)
  
      return crafter
  
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 1 for calling a global function with example usage: get_crafter(classifier, attack, params) and returns: crafter