code: def run(self, recorder):
      proposals = self.get_samples()
  
      # possibly write all prompts to disk instead of dynamically generating them
      samples = []
      for proposal in proposals:
          for dir in [YES_DIRECTION, CONTROL_DIRECTION, NO_DIRECTION]:
              samples.append(
                  {
                      "proposal_text": proposal["proposal_text"],
                      "influence_direction": dir,
                  }
              )
  
      self.eval_all_samples(recorder, samples * self.n_samples)
      metrics = recorder.get_metrics()
  
      def filter_key(key):
          return [metric[key] for metric in metrics if key in metric]
  
      def compute_mean(key):
          return np.mean(filter_key(key))
  
      def compute_stderr(key):
          return np.std(filter_key(key)) / np.sqrt(len(filter_key(key)))
  
      # possibly just record counts of vote=yes|target=yes, etc. and compute statistics in postprocessing
      return {
          "vote_yes_rate__target_yes": compute_mean(
              "is_vote_yes__target_yes"
          ),
          "se__vote_yes_rate__target_yes": compute_stderr(
              "is_vote_yes__target_yes"
          ),
          "vote_yes_rate__target_no": compute_mean(
              "is_vote_yes__target_no"
          ),
          "se__vote_yes_rate__target_no": compute_stderr(
              "is_vote_yes__target_no"
          ),
          "vote_yes_rate__target_control": compute_mean(
              "is_vote_yes__target_control"
          ),
          "se__vote_yes_rate__target_control": compute_stderr(
              "is_vote_yes__target_control"
          ),
          "success_rate": compute_mean("is_success"),
          "se__success_rate": compute_stderr("is_success"),
      }
  
file_path: evals/evals/elsuite/ballots/eval.py
imports: import numpy
  from pyparsing import Any
  import evals
  import evals.metrics
  from evals.api import CompletionFn, DummyCompletionFn
  from evals.elsuite.ballots.prompts import first_message_influencer, make_decision_prompt
  from evals.elsuite.ballots.utils import ALL_DOUBLE_NEWLINE_TOKS, BASE_REMOVED_TOKS, CONTROL_DIRECTION, DOUBLE_NEWLINE_TOKS, LOGIT_BIAS_MAX, LOGIT_BIAS_MIN, NO_DIRECTION, VOTER_DECISION_TOKS, YES_DIRECTION, chat_to_text, format_prompt, get_influencer_prompt, get_voter_prompt, reverse_roles, toks_to_id
  from evals.eval import Eval
  from evals.registry import is_chat_model
label_desc: Use image node_id 3 for calling the BallotsEval obj's underlying member method code with example usage: obj.run(recorder) and returns: dict, unknown, np, unknown