code: def _data_batches_equal(
      db1: data_io.Batch, db2: data_io.Batch
  ) -> bool:
      equal = True
      equal = equal and torch.allclose(db1.source, db2.source)
      equal = equal and torch.allclose(
          db1.source_length, db2.source_length
      )
      equal = equal and torch.allclose(db1.target, db2.target)
      equal = equal and torch.allclose(
          db1.target_length, db2.target_length
      )
      equal = equal and db1.labels.keys() == db2.labels.keys()
      equal = equal and db1.samples == db2.samples
      equal = equal and db1.tokens == db2.tokens
      return equal
  
imports: import os
  import random
  from tempfile import TemporaryDirectory
  from typing import Optional, List, Tuple
  import numpy
  import pytest
  import torch
  from sockeye import constants
  from sockeye import data_io
  from sockeye import utils
  from sockeye import vocab
  from sockeye.test_utils import tmp_digits_dataset
  from sockeye.utils import SockeyeError, get_tokens, seed_rngs
label_desc: Use image node_id 24 for calling a global function with example usage: _data_batches_equal(db1, db2) and returns: equal