code: def benchmark_attack_success_rate(
      model,
      loader,
      attack_class,
      attack_kwargs,
      device="cuda",
      num_batch=None,
  ):
      (
          num,
          accuracy,
          attack_success_rate,
          _,
      ) = _calculate_benchmark_results(
          model,
          loader,
          attack_class,
          attack_kwargs,
          None,
          device,
          num_batch,
      )
      rval = _generate_basic_benchmark_str(
          model,
          loader,
          attack_class,
          attack_kwargs,
          num,
          accuracy,
          attack_success_rate,
      )
      return rval
  
file_path: advertorch/advertorch_examples/benchmark_utils.py
imports: import os
  import sys
  import torch
  import torchvision
  import advertorch
  from advertorch.attacks.utils import multiple_mini_batch_attack
label_desc: Use image node_id 4 for calling a global function with example usage: benchmark_attack_success_rate(model, loader, attack_class, attack_kwargs, device, num_batch) and returns: rval