class_docstr: Test Re-ranker Functionality.
class_docstr_tok: ["Test","Re-ranker","Functionality","."]
docstr: Test re-ranker.
code: def test_light_whoami_reranker(self):
      """
      Test re-ranker.
      """
      from projects.light_whoami.agents.rpa_rerank import RPAReranker
  
      opt = self._setup_parser()
      reranker = RPAReranker(opt)
  
      # testing abstract function impl.
      assert (
          reranker.get_class_to_rerank_for({}, LIGHT_EXAMPLE["text"])
          == "sea witch"
      )
      assert all(
          reranker.is_context(c)
          for c in LIGHT_EXAMPLE["text"].split("\n")[:-1]
      )
      assert reranker.get_predictor_label_candidates(
          {}, LIGHT_EXAMPLE["text"]
      ) == [
          "sea witch",
          "mermaid",
      ]
  
      output = reranker.classify(
          LIGHT_EXAMPLE["text"], LIGHT_EXAMPLE["labels"][0]
      )
      assert output["text_candidates"] == ["sea witch", "mermaid"]
      assert output["text"] == "sea witch"
  
imports: import unittest
  from parlai.core.message import Message
  from parlai.core.params import ParlaiParser, Opt
  from parlai.core.torch_ranker_agent import TorchRankerAgent
  import parlai.utils.testing
  from projects.light_whoami.agents import RPA_RERANKER, RPA_RERANKER_AUTO_EXPANDED, VANILLA_128, VANILLA_1024, UL_128, UL_1024, MULTIOBJECTIVE, PROFILE_EXPANDED_128, PROFILE_EXPANDED_1024, AUTO_EXPANDED_1024, EXPANDED_AND_MULTIOBJECTIVE_1024, TEST_RPA_RERANKER
label_desc: Use image node_id 2 for calling the TestReranker obj's underlying member method code with example usage: obj.test_light_whoami_reranker() without return types