<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _create_source(self, src):
 """Create a pyLikelihood Source object from a `~fermipy.roi_model.Model` object."""


        if src['SpatialType'] == 'SkyDirFunction':
            pylike_src = pyLike.PointSource(self.like.logLike.observation())
            pylike_src.setDir(src.skydir.ra.deg, src.skydir.dec.deg, False,
                              False)
        elif src['SpatialType'] == 'SpatialMap':
            filepath = str(utils.path_to_xmlpath(src['Spatial_Filename']))
            sm = pyLike.SpatialMap(filepath)
            pylike_src = pyLike.DiffuseSource(sm,
                                              self.like.logLike.observation(),
                                              False)
        elif src['SpatialType'] == 'RadialProfile':
            filepath = str(utils.path_to_xmlpath(src['Spatial_Filename']))
            sm = pyLike.RadialProfile(filepath)
            sm.setCenter(src['ra'], src['dec'])
            pylike_src = pyLike.DiffuseSource(sm,
                                              self.like.logLike.observation(),
                                              False)
        elif src['SpatialType'] == 'RadialGaussian':
            sm = pyLike.RadialGaussian(src.skydir.ra.deg, src.skydir.dec.deg,
                                       src.spatial_pars['Sigma']['value'])
            pylike_src = pyLike.DiffuseSource(sm,
                                              self.like.logLike.observation(),
                                              False)

        elif src['SpatialType'] == 'RadialDisk':
            sm = pyLike.RadialDisk(src.skydir.ra.deg, src.skydir.dec.deg,
                                   src.spatial_pars['Radius']['value'])
            pylike_src = pyLike.DiffuseSource(sm,
                                              self.like.logLike.observation(),
                                              False)

        elif src['SpatialType'] == 'MapCubeFunction':
            filepath = str(utils.path_to_xmlpath(src['Spatial_Filename']))
            mcf = pyLike.MapCubeFunction2(filepath)
            pylike_src = pyLike.DiffuseSource(mcf,
                                              self.like.logLike.observation(),
                                              False)
        else:
            raise Exception('Unrecognized spatial type: %s',
                            src['SpatialType'])

        if src['SpectrumType'] == 'FileFunction':
            fn = gtutils.create_spectrum_from_dict(src['SpectrumType'],
                                                   src.spectral_pars)

            file_function = pyLike.FileFunction_cast(fn)
            filename = str(os.path.expandvars(src['Spectrum_Filename']))
            file_function.readFunction(filename)
        elif src['SpectrumType'] == 'DMFitFunction':

            fn = pyLike.DMFitFunction()
            fn = gtutils.create_spectrum_from_dict(src['SpectrumType'],
                                                   src.spectral_pars, fn)
            filename = str(os.path.expandvars(src['Spectrum_Filename']))
            fn.readFunction(filename)
        else:
            fn = gtutils.create_spectrum_from_dict(src['SpectrumType'],
                                                   src.spectral_pars)

        pylike_src.setSpectrum(fn)
        pylike_src.setName(str(src.name))

        return pylike_src