<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_source(self, name, src_dict, free=None, init_source=True, save_source_maps=True, use_pylike=True, use_single_psf=False, **kwargs):
 """Add a source to the ROI model. This function may be called either before or after `~fermipy.gtanalysis.GTAnalysis.setup`. Parameters name : str Source name. src_dict : dict or `~fermipy.roi_model.Source` object Dictionary or source object defining the source properties (coordinates, spectral parameters, etc.). free : bool Initialize the source with a free normalization parameter. use_pylike : bool Create source maps with pyLikelihood. use_single_psf : bool Use the PSF model calculated for the ROI center. If false then a new model will be generated using the position of the source. """


        if self.roi.has_source(name):
            msg = 'Source %s already exists.' % name
            self.logger.error(msg)
            raise Exception(msg)

        loglevel = kwargs.pop('loglevel', self.loglevel)

        self.logger.log(loglevel, 'Adding source ' + name)

        src = self.roi.create_source(name, src_dict, rescale=True)
        self.make_template(src)

        for c in self.components:
            c.add_source(name, src_dict, free=free,
                         save_source_maps=save_source_maps,
                         use_pylike=use_pylike,
                         use_single_psf=use_single_psf)

        if self._like is None:
            return

        if self.config['gtlike']['edisp'] and src.name not in \
                self.config['gtlike']['edisp_disable']:
            self.set_edisp_flag(src.name, True)

        self.like.syncSrcParams(str(name))
        self.like.model = self.like.components[0].model
        # if free is not None:
        #    self.free_norm(name, free, loglevel=logging.DEBUG)

        if init_source:
            self._init_source(name)
            self._update_roi()

        if self._fitcache is not None:
            self._fitcache.update_source(name)