def get_return_nodes(backbone: str) -> list[str]:
    """Get the return nodes for feature extraction from a backbone network.

    Args:
        backbone (str): Name of the backbone CNN. Must be one of
            ``{"resnet18", "wide_resnet50_2", "vgg19_bn", "efficientnet_b5"}``.

    Raises:
        NotImplementedError: If ``backbone`` is "efficientnet_b5".
        ValueError: If ``backbone`` is not one of the supported backbones.

    Returns:
        list[str]: List of layer names to extract features from.

    Example:
        >>> nodes = get_return_nodes("resnet18")
        >>> print(nodes)
        ['layer1', 'layer2', 'layer3']
    """
    if backbone == "efficientnet_b5":
        msg = "EfficientNet feature extractor has not implemented yet."
        raise NotImplementedError(msg)

    return_nodes: list[str]
    if backbone in {"resnet18", "wide_resnet50_2"}:
        return_nodes = ["layer1", "layer2", "layer3"]
    elif backbone == "vgg19_bn":
        return_nodes = ["features.25", "features.38", "features.52"]
    else:
        msg = f"Backbone {backbone} is not supported. Supported backbones are {SUPPORTED_BACKBONES}."
        raise ValueError(msg)
    return return_nodes
Get the return nodes for feature extraction from a backbone network.

    Args:
        backbone (str): Name of the backbone CNN. Must be one of
            ``{"resnet18", "wide_resnet50_2", "vgg19_bn", "efficientnet_b5"}``.

    Raises:
        NotImplementedError: If ``backbone`` is "efficientnet_b5".
        ValueError: If ``backbone`` is not one of the supported backbones.

    Returns:
        list[str]: List of layer names to extract features from.

    Example:
        >>> nodes = get_return_nodes("resnet18")
        >>> print(nodes)
        ['layer1', 'layer2', 'layer3']
    
src/anomalib/models/image/cfa/torch_model.py