class_docstr: Pre-batched training instances for the sLCWA training loop.
  
  .. note ::
      this class is intended to be used with automatic batching disabled, i.e., both parameters `batch_size` and
      `batch_sampler` of torch.utils.data.DataLoader` are set to `None`.
class_docstr_tok: ["Pre-batched","training","instances","for","the","sLCWA","training","loop",".","..","note",":",":","this","class","is","intended","to","be","used","with","automatic","batching","disabled",",","i.e.",",","both","parameters","`","batch_size","`","and","`","batch_sampler","`","of","torch.utils.data.DataLoader","`","are","set","to","`","None","`","."]
docstr: Return the number of batches.
docstr_tok: ["Return","the","number","of","batches","."]
code: def __len__(self) -> int:
      """Return the number of batches."""
      num_batches, remainder = divmod(
          len(self.mapped_triples), self.batch_size
      )
      if remainder and not self.drop_last:
          num_batches += 1
      return num_batches
  
imports: import math
  from abc import ABC, abstractmethod
  from typing import Callable, Generic, Iterable, Iterator, List, NamedTuple, Optional, Tuple, TypeVar
  import numpy
  import scipy.sparse
  import torch
  from class_resolver import HintOrType, OptionalKwargs
  from torch.utils import data
  from .utils import compute_compressed_adjacency_list
  from ..sampling import NegativeSampler, negative_sampler_resolver
  from ..typing import MappedTriples
label_desc: Use image node_id 6 for calling the BaseBatchedSLCWAInstances obj's underlying member method code with example usage: obj.__len__() and returns: num_batches