def get_random_batches(self, num_batches, batch_size):
        """Creates a random-batch generator.
            Batches returned are pandas dataframes of length=batch_size.
            Note: If the sampled partition has less rows than the
            specified batch_size, then a smaller batch of the same
            size as that partition's number of rows is returned.

        Args:
            num_batches (int): Number of batches to generate.
            batch_size (int]): Batch size.
        """
        for i in range(num_batches):
            rnd_part_idx = random.randint(0, self.df.npartitions - 1)
            sample_part = self.df.partitions[rnd_part_idx].compute()
            if sample_part.shape[0] > batch_size:
                yield sample_part.sample(batch_size, random_state=self.random_seed)
            else:
                yield sample_part
Creates a random-batch generator.
            Batches returned are pandas dataframes of length=batch_size.
            Note: If the sampled partition has less rows than the
            specified batch_size, then a smaller batch of the same
            size as that partition's number of rows is returned.

        Args:
            num_batches (int): Number of batches to generate.
            batch_size (int]): Batch size.
        
utils_nlp/dataset/data_loaders.py