docstr: Calculates all metrics related to number of queries in an attack.
  
  Args:
      results (``AttackResult`` objects):
          Attack results for each instance in dataset
docstr_tok: ["Calculates","all","metrics","related","to","number","of","queries","in","an","attack",".","Args",":","results","(","``","AttackResult","``","objects",")",":","Attack","results","for","each","instance","in","dataset"]
code: def calculate(self, results):
      """Calculates all metrics related to number of queries in an attack.
  
      Args:
          results (``AttackResult`` objects):
              Attack results for each instance in dataset
      """
  
      self.results = results
      self.num_queries = np.array(
          [
              r.num_queries
              for r in self.results
              if not isinstance(r, SkippedAttackResult)
          ]
      )
      self.all_metrics["avg_num_queries"] = self.avg_num_queries()
  
      return self.all_metrics
  
file_path: TextAttack/textattack/metrics/attack_metrics/attack_queries.py
imports: import numpy
  from textattack.attack_results import SkippedAttackResult
  from textattack.metrics import Metric
label_desc: Use image node_id 2 for calling the AttackQueries obj's underlying member method code with example usage: obj.calculate(results) and returns: self