code: def lock_source(self, name, lock=True):
          
          name = self.get_source_name(name)
          if lock:
              par_names = self.get_source_params(name)
              self.free_source(name, False, pars=par_names)
              self._lck_params[name] = par_names
          else:
              self._lck_params[name] = []
docs: Set all parameters of a source to a locked/unlocked state.
          Locked parameters will be ignored when running methods that
          free/fix sources or parameters.
  
          Parameters
          ----------
          name : str
              Source name.
  
          lock : bool        
              Set source parameters to locked (True) or unlocked (False)
              state.