class_docstr: Internal utility class for managing a random state per batch number in a multi-threaded
  environment.
class_docstr_tok: ["Internal","utility","class","for","managing","a","random","state","per","batch","number","in","a","multi-threaded","environment","."]
code: def __getitem__(self, batch_num):
      self._lock.acquire()
      try:
          return self._walkers[batch_num]
      except IndexError:
          # always create a new seeded sampler in ascending order of batch number
          # this ensures seeds are deterministic even when batches are run in parallel
          self._walkers.extend(
              self._create_with_seed(self._rs.randrange(2**32))
              for _ in range(len(self._walkers), batch_num + 1)
          )
          return self._walkers[batch_num]
      finally:
          self._lock.release()
  
file_path: stellargraph/stellargraph/random.py
imports: import random
  import numpy.random
  import threading
  from collections import namedtuple
label_desc: Use image node_id 2 for calling the SeededPerBatch obj's underlying member method code with example usage: obj.__getitem__(batch_num) and returns: self, self