code: def test_odd_even_target_factors(data: Dict):
      num_target_factors = len(data["train_target_factors"])
      for json in data["test_outputs"]:
          factor_keys = [
              k
              for k in json.keys()
              if k.startswith("factor") and not k.endswith("score")
          ]
          assert len(factor_keys) == num_target_factors
          primary_tokens = json["translation"].split()
          secondary_factor_tokens = [
              json[factor_key].split() for factor_key in factor_keys
          ]
          for factor_tokens in secondary_factor_tokens:
              assert len(factor_tokens) == len(primary_tokens)
              print(primary_tokens, factor_tokens)
              for primary_token, factor_token in zip(
                  primary_tokens, factor_tokens
              ):
                  try:
                      if int(primary_token) % 2 == 0:
                          assert factor_token == "e"
                      else:
                          assert factor_token == "o"
                  except ValueError:
                      logger.warning(
                          "primary token cannot be converted to int, skipping"
                      )
                      continue
  
file_path: sockeye/test/common.py
imports: import logging
  import os
  import sys
  from contextlib import ExitStack
  from typing import Any, Dict, List
  from unittest.mock import patch
  import numpy
  import sockeye.score
  import sockeye.translate
  from sockeye import constants
  from sockeye.test_utils import run_train_translate, run_translate_restrict, TRANSLATE_PARAMS_COMMON, TRANSLATE_WITH_FACTORS_COMMON, collect_translate_output_and_scores, SCORE_PARAMS_COMMON, SCORE_WITH_SOURCE_FACTORS_COMMON, SCORE_WITH_TARGET_FACTORS_COMMON, TRANSLATE_WITH_JSON_FORMAT
label_desc: Use image node_id 5 for calling a global function with example usage: test_odd_even_target_factors(data) without return types