Returns a property set which include all
    properties in 'properties' that have any of 'attributes'.

def take(attributes, properties):
    """Returns a property set which include all
    properties in 'properties' that have any of 'attributes'."""
    assert is_iterable_typed(attributes, basestring)
    assert is_iterable_typed(properties, basestring)
    result = []
    for e in properties:
        if b2.util.set.intersection(attributes, feature.attributes(get_grist(e))):
            result.append(e)
    return result