Update the attributes sources, min_mag, max_mag
        according to the given source.

        :param src:
            an instance of :class:
            `openquake.hazardlib.source.base.BaseSeismicSource`
329008
def update(self, src):
        
        assert src.tectonic_region_type == self.trt, (
            src.tectonic_region_type, self.trt)
        if not src.min_mag:  # if not set already
            src.min_mag = self.min_mag.get(self.trt) or self.min_mag['default']
        # checking mutex ruptures
        if (not isinstance(src, NonParametricSeismicSource) and
                self.rup_interdep == 'mutex'):
            msg = "Mutually exclusive ruptures can only be "
            msg += "modelled using non-parametric sources"
            raise ValueError(msg)

        nr = get_set_num_ruptures(src)
        if nr == 0:  # the minimum_magnitude filters all ruptures
            return
        self.tot_ruptures += nr
        self.sources.append(src)
        _, max_mag = src.get_min_max_mag()
        prev_max_mag = self.max_mag
        if prev_max_mag is None or max_mag > prev_max_mag:
            self.max_mag = max_mag
539497
def source_attr(attr_name):
    

    def source_attr(_value, context, **_params):
        value = getattr(context["model"].source, attr_name)
        return _attr(value)

    return source_attr
589925
def update(source_uri, all)
      source_uri = URI.parse source_uri unless URI::Generic === source_uri
      source_uri.path += '/' unless source_uri.path =~ /\/$/

      use_incremental = false

      begin
        gem_names = fetch_quick_index source_uri, all
        remove_extra gem_names
        missing_gems = find_missing gem_names

        return false if missing_gems.size.zero?

        say "Missing metadata for #{missing_gems.size} gems" if
        missing_gems.size > 0 and Gem.configuration.really_verbose

        use_incremental = missing_gems.size <= Gem.configuration.bulk_threshold
      rescue Gem::OperationNotSupportedError => ex
        alert_error "Falling back to bulk fetch: #{ex.message}" if
        Gem.configuration.really_verbose
        use_incremental = false
      end

      if use_incremental then
        update_with_missing(source_uri, missing_gems)
      else
        new_index = fetch_bulk_index(source_uri)
        @gems.replace(new_index.gems)
      end

      true
    end
346999
function update (src) {
      if (element.styleSheet) {
        element.styleSheet.cssText = src
      } else {
        element.textContent = src
      }
    }
135976
def add_source(self, task_source):
		
		next_start = task_source.next_start()
		self.__sources[task_source] = next_start
		self.__update(task_source)
223532
def set_type(self, value):
        """"""
        if value not in self.types_available:
            log = "Sources field 'type' should be in one of %s" % (
                self.types_available
            )
            raise MalFormattedSource(log)
        self._type = value
472843
def create_oqhazardlib_source(self, tom, mesh_spacing, use_defaults=False):
        
        if not self.mfd:
            raise ValueError("Cannot write to hazardlib without MFD")
        return SimpleFaultSource(
            self.id,
            self.name,
            self.trt,
            self.mfd,
            mesh_spacing,
            conv.mag_scale_rel_to_hazardlib(self.mag_scale_rel, use_defaults),
            conv.render_aspect_ratio(self.rupt_aspect_ratio, use_defaults),
            tom,
            self.upper_depth,
            self.lower_depth,
            self.fault_trace,
            self.dip,
            self.rake)
62825
def _update(self, **kwargs):
        """"""
        if 'content' in kwargs:
            content = kwargs.pop('content')
            path = self._construct_path_to_source_content()
            self._http.put(path, json.dumps({'content': content}))
        super(Resource, self)._update(**kwargs)
968374
def add_JSsource(self, new_src):
        """"""
        if isinstance(new_src, list):
            for h in new_src:
                self.JSsource.append(h)
        elif isinstance(new_src, basestring):
            self.JSsource.append(new_src)
        else:
            raise OptionTypeError("Option: %s Not Allowed For Series Type: %s" % type(new_src))
702737
def AddSourceRestriction(self,cidr):
		

		self.source_restrictions.append(SourceRestriction(self,cidr))

		return(self.Update())
23389
def update_eff_ruptures(self, count_ruptures):
        
        for smodel in self.source_models:
            for sg in smodel.src_groups:
                sg.eff_ruptures = (count_ruptures(sg.id)
                                   if callable(count_ruptures)
                                   else count_ruptures.get(sg.id, 0))
252482
def update_module_file(redbaron_tree, module_path, show_diff=False, dry_run=False):
    
    with tempfile.NamedTemporaryFile() as tmp_file:
        tmp_file.write(redbaron_tree_to_module_str(redbaron_tree))
        tmp_file.seek(0)
        if are_files_equal(module_path, tmp_file.name):
            logging.debug('Source unchanged')
            return False

        logging.debug('Source modified')

        tmp_file.seek(0)
        diff_update_file(module_path, tmp_file.read(), show_diff, dry_run)
1003570
def update
      unless File.exist?(@source_file)
        raise FileNotFoundError.new("Source file deleted")
      end

      markdown_render = @preview_pipeline.call(IO.read(@source_file), @pipeline_context, {})[:output].to_s
      preview_html = wrap_preview(markdown_render)

      File.open(@preview_file, 'w') do |f|
        f.write(preview_html)
      end

      @update_callbacks.each { |callback| callback.call }
    end
864909
def reload_source(self, name):
        

        src = self.roi.get_source_by_name(name)

        if hasattr(self.like.logLike, 'loadSourceMap'):
            self.like.logLike.loadSourceMap(str(name), True, False)
            srcmap_utils.delete_source_map(self.files['srcmap'], name)
            self.like.logLike.saveSourceMaps(str(self.files['srcmap']))
            self._scale_srcmap(self._src_expscale, check_header=False,
                               names=[name])
            self.like.logLike.buildFixedModelWts()
        else:
            self.write_xml('tmp')
            src = self.delete_source(name)
            self.add_source(name, src, free=True)
            self.load_xml('tmp')
5394
def source_getattr():
    

    def source_getattr(_value, context, **_params):
        value = getattr(context["model"].source, context["key"])
        return _attr(value)

    return source_getattr
873836
def AddEventSource(self, event_source):
    
    self._RaiseIfNotWritable()

    self._AddAttributeContainer(
        self._CONTAINER_TYPE_EVENT_SOURCE, event_source)
182829
def update_resources_from_datafile(self, srcpath, type_, names=None, 
                                       languages=None):
        
        UpdateResourcesFromDataFile(self.filename, srcpath, type_, names, 
                                    languages)