(value)
return ttext, value
ttext = <matches _ttext_matcher>

    We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
    defects list if we find non-ttext characters.  We also register defects for
    *any* non-printables even though the RFC doesn't exclude all of them,
    because we follow the spirit of RFC 5322.
ttext = <matches _ttext_matcher>
ttext = <matches _ttext_matcher >
def get_ttext(value):
    """ttext = <matches _ttext_matcher>

    We allow any non-TOKEN_ENDS in ttext, but add defects to the token's
    defects list if we find non-ttext characters.  We also register defects for
    *any* non-printables even though the RFC doesn't exclude all of them,
    because we follow the spirit of RFC 5322.

    """
    m = _non_token_end_matcher(value)
    if not m:
        raise errors.HeaderParseError(
            "expected ttext but found '{}'".format(value))
    ttext = m.group()
    value = value[len(ttext):]
    ttext = ValueTerminal(ttext, 'ttext')
    _validate_xtext(ttext)
    return ttext, value
def get_ttext ( value ) : m = _non_token_end_matcher ( value ) if not m : raise errors . HeaderParseError ( "expected ttext but found '{}'" . format ( value ) ) ttext = m . group ( ) value = value [ len ( ttext ) : ] ttext = ValueTerminal ( ttext , 'ttext' ) _validate_xtext ( ttext ) return ttext , value