code: def set_source_dnde(self, name, dnde, update_source=True):
          
          name = self.roi.get_source_by_name(name).name
  
          if self.roi[name]['SpectrumType'] != 'FileFunction':
              msg = 'Wrong spectral type: %s' % self.roi[name]['SpectrumType']
              self.logger.error(msg)
              raise Exception(msg)
  
          xy = self.get_source_dnde(name)
  
          if len(dnde) != len(xy[0]):
              msg = 'Wrong length for dnde array: %i' % len(dnde)
              self.logger.error(msg)
              raise Exception(msg)
  
          for c in self.components:
              src = c.like.logLike.getSource(str(name))
              spectrum = src.spectrum()
              file_function = pyLike.FileFunction_cast(spectrum)
              file_function.setSpectrum(10**xy[0], dnde)
  
          if update_source:
              self.update_source(name)
docs: Set the differential flux distribution of a source with the
          FileFunction spectral type.
  
          Parameters
          ----------
          name : str
             Source name.
  
          dnde : `~numpy.ndarray`
             Array of differential flux values (cm^{-2} s^{-1} MeV^{-1}).