def augment_batch(self, batch, hooks=None):
batch_orig = batch<EOL>if isinstance(batch, UnnormalizedBatch):<EOL><INDENT>batch = batch.to_normalized_batch()<EOL><DEDENT>augmentables = [(attr_name[:-len("<STR_LIT>")], attr)<EOL>for attr_name, attr<EOL>in batch.__dict__.items()<EOL>if attr_name.endswith("<STR_LIT>") and attr is not None]<EOL>augseq = self<EOL>if len(augmentables) > <NUM_LIT:1> and not self.deterministic:<EOL><INDENT>augseq = self.to_deterministic()<EOL><DEDENT>for attr_name, attr in augmentables:<EOL><INDENT>aug = getattr(augseq, "<STR_LIT>" % (attr_name,))(<EOL>attr, hooks=hooks)<EOL>setattr(batch, "<STR_LIT>" % (attr_name,), aug)<EOL><DEDENT>if isinstance(batch_orig, UnnormalizedBatch):<EOL><INDENT>batch = batch_orig.fill_from_augmented_normalized_batch(batch)<EOL><DEDENT>return batch<EOL>
Augment a single batch.

Parameters
----------
batch : imgaug.augmentables.batches.Batch \
        or imgaug.augmentables.batches.UnnormalizedBatch
    A single batch to augment.

hooks : None or imgaug.HooksImages, optional
    HooksImages object to dynamically interfere with the augmentation
    process.

Returns
-------
imgaug.augmentables.batches.Batch \
        or imgaug.augmentables.batches.UnnormalizedBatch
    Augmented batch.