code: def test_binary_input(n_times, test_data_binary):
      acc = Accuracy()
  
      y_pred, y, batch_size = test_data_binary
      acc.reset()
      if batch_size > 1:
          n_iters = y.shape[0] // batch_size + 1
          for i in range(n_iters):
              idx = i * batch_size
              acc.update(
                  (
                      y_pred[idx : idx + batch_size],
                      y[idx : idx + batch_size],
                  )
              )
      else:
          acc.update((y_pred, y))
  
      np_y = y.numpy().ravel()
      np_y_pred = y_pred.numpy().ravel()
  
      assert acc._type == "binary"
      assert isinstance(acc.compute(), float)
      assert accuracy_score(np_y, np_y_pred) == pytest.approx(
          acc.compute()
      )
  
imports: import os
  import pytest
  import torch
  from packaging.version import Version
  from sklearn.metrics import accuracy_score
  import ignite.distributed
  from ignite.engine import Engine
  from ignite.exceptions import NotComputableError
  from ignite.metrics import Accuracy
label_desc: Use image node_id 6 for calling a global function with example usage: test_binary_input(n_times, test_data_binary) without return types