def METHOD_NAME(self, value):
    """Convert/check value type."""
    if type(value) is str:
        return value
    raise AssertionError("Header names/values must be"
        " of type str (got {0})".format(repr(value)))