def is_element(o, element_name):
    """Return whether a given object is a certain element generator."""
    return hasattr(o, '__iter__') and hasattr(o, 'element_name'
        ) and o.element_name == element_name
