def compose(authinfo): return HeaderElement.formatparam(b'realm', authinfo['realm'].encode('ISO8859-1', 'replace'), True)
def parse(authinfo): params = HeaderElement.parseparams(b'X;%s' % authinfo)[1] params.setdefault('realm', '') return params
def compose(cls, authinfo): params = cls._compose(authinfo) return b', '.join([HeaderElement.formatparam(k, v) for k, v in params])
def compose(authinfo): return HeaderElement.formatparam( b'realm', authinfo['realm'].encode('ISO8859-1', 'replace'), True)