code: def traverse(self, attr_name = None, attr_value = None):
          
          for sprite in self.sprites:
              if (attr_name is None) or \
                 (attr_value is None and hasattr(sprite, attr_name)) or \
                 (attr_value is not None and getattr(sprite, attr_name, None) == attr_value):
                  yield sprite
  
              for child in sprite.traverse(attr_name, attr_value):
                  yield child
docs: traverse the whole sprite tree and return child sprites which have the
          attribute and it's set to the specified value.
          If falue is None, will return all sprites that have the attribute