code: def test_file(self, input_data, expected_print):
      with tempfile.TemporaryDirectory() as tempdir:
          filename = os.path.join(tempdir, "test_stats.log")
          handler = logging.FileHandler(filename, mode="w")
          handler.setLevel(logging.INFO)
          name = "DataStats"
          logger = logging.getLogger(name)
          logger.addHandler(handler)
          input_param = {
              "keys": "img",
              "prefix": "test data",
              "data_shape": True,
              "value_range": True,
              "data_value": True,
              "additional_info": np.mean,
              "name": name,
          }
          transform = DataStatsd(**input_param)
          _ = transform(input_data)
          for h in logger.handlers[:]:
              h.close()
              logger.removeHandler(h)
          del handler
          with open(filename) as f:
              content = f.read()
          if sys.platform != "win32":
              self.assertEqual(content, expected_print)
  
file_path: MONAI/tests/test_data_statsd.py
imports: from __future__ import annotations
  import logging
  import os
  import sys
  import tempfile
  import unittest
  import numpy
  import torch
  from parameterized import parameterized
  from monai.transforms import DataStatsd
label_desc: Use image node_id 2 for calling the TestDataStatsd obj's underlying member method code with example usage: obj.test_file(input_data, expected_print) without return types