(value)
return Criterion(name='metadata', predicate=predicate)
Return a Criterion which matches against metadata.

    :param value: a dictionary, mapping a regular expression of a metadata key
        to a regular expression describing a metadata value.
    :type value: dict mapping unicode to unicode
Return a Criterion which matches against metadata.
Return a Criterion which matches against metadata .
def metadata_criterion(value):
    """
    Return a Criterion which matches against metadata.

    :param value: a dictionary, mapping a regular expression of a metadata key
        to a regular expression describing a metadata value.
    :type value: dict mapping unicode to unicode
    """
    def predicate(attribute):
        for k, v in value.items():
            if not re.compile(v).match(attribute.get(k, "")):
                return False
        return True
    return Criterion(name='metadata', predicate=predicate)
def metadata_criterion ( value ) : def predicate ( attribute ) : for k , v in value . items ( ) : if not re . compile ( v ) . match ( attribute . get ( k , "" ) ) : return False return True return Criterion ( name = 'metadata' , predicate = predicate )