def iter_decorations(of_cls, *decoration_sources):
    """ Iterates over all decorations of type *of_cls*. """
    for item in decoration_sources:
        if hasattr(item, 'iter_decorations'):
            it = item.iter_decorations()
        elif hasattr(item, '__decorations__'):
            it = iter(item.__decorations__)
        elif hasattr(item, 'decorations') and hasattr(item.decorations,
            '__iter__'):
            it = iter(item.decorations)
        elif not isinstance(item, type) and hasattr(item, '__iter__'):
            it = iter(item)
        else:
            continue
        for sub_item in it:
            if of_cls is None or isinstance(sub_item, of_cls):
                yield sub_item
