Checks if all name is a valid feature. Otherwise, raises an exception.

def validate_feature (name):
    """ Checks if all name is a valid feature. Otherwise, raises an exception.
    """
    assert isinstance(name, basestring)
    if name not in __all_features:
        raise InvalidFeature ("'%s' is not a valid feature name" % name)
    else:
        return __all_features[name]