code: def _test_binary_dict_metric(self, metric, value_dict):
      sample = Sample()
      predicted = dict()
  
      sample.targets = torch.tensor(
          [[0, 1], [1, 0], [1, 0], [0, 1]], dtype=torch.float
      )
      predicted["scores"] = torch.tensor(
          [
              [-0.9332, 0.8149],
              [-0.8391, 0.6797],
              [-0.7235, 0.7220],
              [-0.9043, 0.3078],
          ],
          dtype=torch.float,
      )
  
      metric_result = metric.calculate(sample, predicted)
      for key, val in value_dict.items():
          self.assertAlmostEqual(metric_result[key].item(), val, 4)
  
      sample.targets = torch.tensor([1, 0, 0, 1], dtype=torch.long)
      metric_result = metric.calculate(sample, predicted)
      for key, val in value_dict.items():
          self.assertAlmostEqual(metric_result[key].item(), val, 4)
  
imports: import os
  import unittest
  import mmf.modules.metrics
  import torch
  from mmf.common.registry import registry
  from mmf.common.sample import Sample
  from mmf.datasets.processors import CaptionProcessor
  from mmf.utils.configuration import load_yaml
label_desc: Use image node_id 7 for calling the TestModuleMetrics obj's underlying member method code with example usage: obj._test_binary_dict_metric(metric, value_dict) without return types