Did I find the right examples for you? yes no

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Expects unicode 
Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | 
                [#x10000-#x10FFFF]

        def valid_string(val):
    """ Expects unicode 
    Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | 
                    [#x10000-#x10FFFF]
    """
    for char in val:
        try:
            char = ord(char)
        except TypeError:
            raise NotValid("string")
        if char == 0x09 or char == 0x0A or char == 0x0D:
            continue
        elif 0x20 <= char <= 0xD7FF:
            continue
        elif 0xE000 <= char <= 0xFFFD:
            continue
        elif 0x10000 <= char <= 0x10FFFF:
            continue
        else:
            raise NotValid("string")
    return True
        


src/p/y/pysaml2-2.0.0/tests/test_13_validate.py   pysaml2(Download)
from saml2.validate import valid_unsigned_short
from saml2.validate import valid_non_negative_integer
from saml2.validate import valid_string
from saml2.validate import valid_instance
from saml2.validate import valid_any_uri
def test_valid_string():
    assert valid_string(u'example')
 
    raises( NotValid, 'valid_string("02656c6c6f".decode("hex"))')
 

src/p/y/pysaml2-HEAD/tests/test_13_validate.py   pysaml2(Download)
from saml2.validate import valid_unsigned_short
from saml2.validate import valid_non_negative_integer
from saml2.validate import valid_string
from saml2.validate import valid_instance
from saml2.validate import valid_any_uri
def test_valid_string():
    assert valid_string(u'example')
 
    raises(NotValid, 'valid_string("02656c6c6f".decode("hex"))')