code: def test_perplexity():
      from textattack.attack_results import SuccessfulAttackResult
      from textattack.goal_function_results.classification_goal_function_result import (
          ClassificationGoalFunctionResult,
      )
      from textattack.metrics.quality_metrics import Perplexity
      from textattack.shared.attacked_text import AttackedText
  
      sample_text = "hide new secretions from the parental units "
      sample_atck_text = "Ehide enw secretions from the parental units "
  
      results = [
          SuccessfulAttackResult(
              ClassificationGoalFunctionResult(
                  AttackedText(sample_text),
                  None,
                  None,
                  None,
                  None,
                  None,
                  None,
              ),
              ClassificationGoalFunctionResult(
                  AttackedText(sample_atck_text),
                  None,
                  None,
                  None,
                  None,
                  None,
                  None,
              ),
          )
      ]
      ppl = Perplexity(model_name="distilbert-base-uncased").calculate(
          results
      )
  
      assert int(ppl["avg_original_perplexity"]) == int(81.95)
  
label_desc: Use image node_id 1 for calling a global function with example usage: test_perplexity() without return types