human
Complete this python program:
def _resp_charset_property():
assistant
#Here is the Python code you requested.

    """Set and retrieve Response.charset
    On retrieval, separates the charset from the content-type.
    On assignment, removes any existing charset from the content-type and
    appends the new one.
    """
    def getter(self):
        if (';    charset=' in self.headers['content-type']):
            return self.headers['content-type'].split(';    charset=')[1]
    def setter(self, value):
        if ('content-type' in self.headers):
            self.headers['content-type'] = self.headers['content-type'].split(';')[0]
            if value:
                self.headers['content-type'] += (';    charset=' + value)
    return property(getter, setter, doc='Retrieve    and    set    the    response    charset')