def get_crafter(classifier: "CLASSIFIER_TYPE", attack: str, params: dict[str, Any] | None = 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

    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.
    
art/metrics/metrics.py