<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_spectrum(self, binned=True):
 """Reduce the observation to a simple spectrum object. An observation is a complex object with some restrictions on its capabilities. At times, it would be useful to work with the simulated observation as a simple object that is easier to manipulate and takes up less memory. Parameters binned : bool If `True` (default), export binned dataset. Otherwise, native. Returns ------- result : `~pysynphot.spectrum.ArraySourceSpectrum` Observation dataset as a simple spectrum object. """

        if binned:
            wave, flux = self.binwave, self.binflux
        else:
            wave, flux = self.wave, self.flux

        result = ArraySourceSpectrum(wave, flux,
                                     self.waveunits,
                                     self.fluxunits,
                                     name = self.name,
                                     keepneg = True)

        return result