def augment_heatmaps(self, heatmaps, parents=None, hooks=None):
if self.deterministic:<EOL><INDENT>state_orig = self.random_state.get_state()<EOL><DEDENT>if parents is None:<EOL><INDENT>parents = []<EOL><DEDENT>input_was_single_instance = False<EOL>if isinstance(heatmaps, ia.HeatmapsOnImage):<EOL><INDENT>input_was_single_instance = True<EOL>heatmaps = [heatmaps]<EOL><DEDENT>ia.do_assert(ia.is_iterable(heatmaps),<EOL>"<STR_LIT>" % (type(heatmaps),))<EOL>ia.do_assert(all([isinstance(heatmaps_i, ia.HeatmapsOnImage) for heatmaps_i in heatmaps]),<EOL>"<STR_LIT>" % (<EOL>[type(el) for el in heatmaps],))<EOL>if len(parents) == <NUM_LIT:0> or hooks is not None:<EOL><INDENT>heatmaps_copy = [heatmaps_i.deepcopy() for heatmaps_i in heatmaps]<EOL><DEDENT>else:<EOL><INDENT>heatmaps_copy = heatmaps<EOL><DEDENT>if hooks is not None:<EOL><INDENT>heatmaps_copy = hooks.preprocess(heatmaps_copy, augmenter=self, parents=parents)<EOL><DEDENT>if (hooks is None and self.activated)or (hooks is not None<EOL>and hooks.is_activated(heatmaps_copy, augmenter=self, parents=parents, default=self.activated)):<EOL><INDENT>if len(heatmaps_copy) > <NUM_LIT:0>:<EOL><INDENT>heatmaps_result = self._augment_heatmaps(<EOL>heatmaps_copy,<EOL>random_state=ia.copy_random_state(self.random_state),<EOL>parents=parents,<EOL>hooks=hooks<EOL>)<EOL>ia.forward_random_state(self.random_state)<EOL><DEDENT>else:<EOL><INDENT>heatmaps_result = heatmaps_copy<EOL><DEDENT><DEDENT>else:<EOL><INDENT>heatmaps_result = heatmaps_copy<EOL><DEDENT>if hooks is not None:<EOL><INDENT>heatmaps_result = hooks.postprocess(heatmaps_result, augmenter=self, parents=parents)<EOL><DEDENT>if self.deterministic:<EOL><INDENT>self.random_state.set_state(state_orig)<EOL><DEDENT>if input_was_single_instance:<EOL><INDENT>return heatmaps_result[<NUM_LIT:0>]<EOL><DEDENT>return heatmaps_result<EOL>
Augment a heatmap.

Parameters
----------
heatmaps : imgaug.HeatmapsOnImage or list of imgaug.HeatmapsOnImage
    Heatmap(s) to augment. Either a single heatmap or a list of
    heatmaps.

parents : None or list of imgaug.augmenters.meta.Augmenter, optional
    Parent augmenters that have previously been called before the
    call to this function. Usually you can leave this parameter as None.
    It is set automatically for child augmenters.

hooks : None or imaug.HooksHeatmaps, optional
    HooksHeatmaps object to dynamically interfere with the augmentation process.

Returns
-------
heatmap_result : imgaug.HeatmapsOnImage or list of imgaug.HeatmapsOnImage
    Corresponding augmented heatmap(s).