human
Complete this python program:
def _req_fancy_property(cls, header, even_if_nonexistent=False):
assistant
#Here is the Python program you requested.

    """Set and retrieve "fancy" properties.
    On retrieval, these properties return a class that takes the value of the
    header as the only argument to their constructor.
    For assignment, those classes should implement a __str__ that converts them
    back to their header values.
    :param header: name of the header, e.g. "Accept"
    :param even_if_nonexistent: Return a value even if the header does not
    exist.  Classes using this should be prepared to accept None as a
    parameter.
    """
    def getter(self):
        try:
            if ((header in self.headers) or even_if_nonexistent):
                return cls(self.headers.get(header))
        except ValueError:
            return None
    def setter(self, value):
        self.headers[header] = value
    return property(getter, setter, doc=('Retrieve    and    set    the    %s    property    in    the    WSGI    environ,    as    a    %s    object' % (header, cls.__name__)))