class_docstr: Not for users
code: def __init__(
      self, data, batchsize=50, random_seed=42, dtype="floatX"
  ):
      self.dtype = (
          pytensor.config.floatX if dtype == "floatX" else dtype
      )
      self.rng = np.random.RandomState(random_seed)
      self.data = data
      self.n = batchsize
  
imports: import io
  import itertools
  import re
  import cloudpickle
  import numpy
  import pytensor
  import pytensor.tensor
  import pytest
  from pytensor import shared
  from pytensor.tensor.variable import TensorVariable
  import pymc
  from pymc.data import is_minibatch
  from pymc.pytensorf import GeneratorOp, floatX
label_desc: Use image node_id 1 to create a new _DataSampler object  with example: obj = _DataSampler(data, batchsize, random_seed, dtype)