<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def cross_correlate(self, templates, **kwargs):
 """ Cross correlate the spectrum against a set of templates. """


        # templates can be:
        # - a single Spectrum1D object
        # - (template_dispersion, template_fluxes)

        # templates can be a single spectrum or a tuple of (dispersion, fluxes)

        if isinstance(templates, (Spectrum1D, )):
            template_dispersion = templates.disp
            template_fluxes = templates.flux

        else:
            template_dispersion = templates[0]
            template_fluxes = templates[1]

        return _cross_correlate(self, template_dispersion, template_fluxes,
            **kwargs)