def get_criteria(label):
    """Returns the RFC 3501 criteria string for the given label"""

    l = 'LARGER %d' % label.min if label.min is not None else ''
    s = 'SMALLER %d' % label.max if label.max is not None else ''

    return '{larger} {smaller}'.format(larger=l, smaller=s).strip()