<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def all_tags_of_type(self, type_or_types, recurse_into_sprites = True):
 """ Generator for all tags of the given type_or_types. Generates in breadth-first order, optionally including all sub-containers. """

        for t in self.tags:
            if isinstance(t, type_or_types):
                yield t
        if recurse_into_sprites:
            for t in self.tags:
                # recurse into nested sprites
                if isinstance(t, SWFTimelineContainer):
                    for containedtag in t.all_tags_of_type(type_or_types):
                        yield containedtag