Constructs a instance with the specified settings.

@constructor
@param {Object} settings Name/value object with settings.
@setting {String} delimiter Delimiter to display between row in path.
348384
function (settings) {
        var self = this;

        if (!settings.delimiter) {
          settings.delimiter = '\u00BB';
        }

        self._super(settings);
        self.classes.add('path');
        self.canFocus = true;

        self.on('click', function (e) {
          var index, target = e.target;

          if ((index = target.getAttribute('data-index'))) {
            self.fire('select', { value: self.row()[index], index: index });
          }
        });

        self.row(self.settings.row);
      }
1251298
function initConfig(conf) {
  const result = Object.assign({}, conf);
  if (conf.filename) {
    result.filepath = path.dirname(conf.filename);
  }
  return result;
}
130982
function(defaults, settings) {
            var out = {};
            for (var key in defaults) {
                if (key in settings) {
                    out[key] = settings[key];
                } else {
                    out[key] = defaults[key];
                }
            }
            return out;
        }
365129
function (row, prop, value) {
      if (typeof prop === 'string' && prop.indexOf('.') > -1) {
        var sliced = prop.split(".");
        var out = priv.settings.data[row];
        for (var i = 0, ilen = sliced.length - 1; i < ilen; i++) {
          out = out[sliced[i]];
        }
        out[sliced[i]] = value;
      }
      else {
        priv.settings.data[row][prop] = value;
      }
    }
322729
def build_settings_docs(docs_path, prefix=None):
    
    # String to use instead of setting value for dynamic defaults
    dynamic = "[dynamic]"
    lines = [".. THIS DOCUMENT IS AUTO GENERATED VIA conf.py"]
    for name in sorted(registry.keys()):
        if prefix and not name.startswith(prefix):
            continue
        setting = registry[name]
        settings_name = "``%s``" % name
        settings_label = ".. _%s:" % name
        setting_default = setting["default"]
        if isinstance(setting_default, str):
            if gethostname() in setting_default or (
                setting_default.startswith("/") and
                    os.path.exists(setting_default)):
                setting_default = dynamic
        if setting_default != dynamic:
            setting_default = repr(deep_force_unicode(setting_default))
        lines.extend(["", settings_label])
        lines.extend(["", settings_name, "-" * len(settings_name)])
        lines.extend(["",
            urlize(setting["description"] or "").replace(
                "<a href=\"", "`").replace(
                "\" rel=\"nofollow\">", " <").replace(
                "</a>", ">`_")])
        if setting["choices"]:
            choices = ", ".join(["%s: ``%s``" % (str(v), force_text(k))
                                 for k, v in setting["choices"]])
            lines.extend(["", "Choices: %s" % choices, ""])
        lines.extend(["", "Default: ``%s``" % setting_default])
    with open(os.path.join(docs_path, "settings.rst"), "w") as f:
        f.write("\n".join(lines).replace("u'", "'").replace("yo'",
            "you'").replace("&#39;", "'"))
1307603
function(key, data) {
        var currentData;
        currentData = settings[key] || {};
        settings[key] = _.extend(currentData, data);
      }
500411
function setter(obj, path, setValue, fullExp) {
   var element = path.split('.'),
      key;
   for (var i = 0; element.length > 1; i++) {
      key = ensureSafeMemberName(element.shift(), fullExp);
      var propertyObj = obj[key];
      if (!propertyObj) {
         propertyObj = {};
         obj[key] = propertyObj;
      }
      obj = propertyObj;
   }
   key = ensureSafeMemberName(element.shift(), fullExp);
   obj[key] = setValue;
   return setValue;
}
152007
function Settings(types, settingValues) {
  this._types = types;

  // Where we store the settings that we've created
  this._settings = {};

  // Where the values for the settings are stored while in use.
  this._settingValues = settingValues || {};

  // Where the values for the settings are persisted for next use.
  this._settingStorage = new LocalSettingStorage();
  this._settingStorage.load(this._settingValues);

  // Event for use to detect when the list of settings changes
  this.onChange = util.createEvent('Settings.onChange');
}
880233
function(name, value) {
			var prefs = name;
			if (typeof name === 'string') {
				prefs = {};
				prefs[name] = value;
			}
			
			Object.keys(prefs).forEach(function(k) {
				var v = prefs[k];
				if (!(k in defaults)) {
					throw new Error('Property "' + k + '" is not defined. You should define it first with `define` method of current module');
				}
				
				// do not set value if it equals to default value
				if (v !== defaults[k].value) {
					// make sure we have value of correct type
					switch (typeof defaults[k].value) {
						case 'boolean':
							v = toBoolean(v);
							break;
						case 'number':
							v = parseInt(v + '', 10) || 0;
							break;
						default: // convert to string
							if (v !== null) {
								v += '';
							}
					}

					preferences[k] = v;
				} else if (k in preferences) {
					delete preferences[k];
				}
			});
		}
524878
function (settings) {
  validatePresenceOfOptions(settings, ['urlTemplate', 'userName']);

  if (settings.templateName) {
    this.endpoints = {
      get: [WindshaftConfig.MAPS_API_BASE_URL, 'named', settings.templateName, 'jsonp'].join('/'),
      post: [WindshaftConfig.MAPS_API_BASE_URL, 'named', settings.templateName].join('/')
    };
  } else {
    this.endpoints = {
      get: WindshaftConfig.MAPS_API_BASE_URL,
      post: WindshaftConfig.MAPS_API_BASE_URL
    };
  }

  this.url = settings.urlTemplate.replace('{user}', settings.userName);
  this._requestTracker = new RequestTracker(MAP_INSTANTIATION_LIMIT);
}
502802
function (settings) {
            var setting, i, j, last, interval,
                sp = this.stepParams,
                isStart = (sp.timing === "start"),
                p = [];

            var defaultSettings = {
                bgColor:        "transparent",
                borderColor:    "#bbb",
                stepColor:      "#2893ef",
                dashColor:      "#b8b8b8",
                borderWidth:    0.00667,
                stepLineWidth:  0.02,
                dashLineWidth:  0.008,
                pointLineWidth: 0.008,
                pointRadius:    0.015
            };

            this.settings = settings || {};

            for (setting in defaultSettings) {
                if (defaultSettings.hasOwnProperty(setting)) {
                    if (!this.settings.hasOwnProperty(setting)) {
                        this.settings[setting] = defaultSettings[setting];
                    }
                }
            }

            this.ctx = this.canvas.getContext("2d");

            // Build points array. There's a starting point at 0,0
            // plus a point for each step
            p[0] = { x: 0, y: 0 };
            for (i = 1; i <= sp.count; i++) {
                interval = i / sp.count;
                p[i] = { x: interval, y: interval };
            }

            // Start with a clean slate
            this.ctx.clearRect(-0.5, -0.5, 2, 2);
            this.drawBackground();

            // Draw each interval
            last = p.length - 1;
            for (i = 0, j = 1; i < last; i++, j++) {
                if (isStart) {
                    this.drawStartInterval(p[i].x, p[i].y, p[j].x, p[j].y);
                } else {
                    this.drawEndInterval(p[i].x, p[i].y, p[j].x, p[j].y);
                }
            }

            // Each interval draws start and mid point for that interval,
            // so we need to draw last point. It's always filled.
            this.drawPoint(p[last].x, p[last].y, true);
        }
227394
function loadData (settings = {}, json = data) {
  const dataSet = new DataSet(json, settings)
  dataSet.processData()
  return dataSet
}
1045572
function builtTemplateFromString(str, filename, options) {

  try {
    var config = {};

    // config at the beginning of the file
    str.replace(settings.config, function(m, conf) {
      config = yaml.safeLoad(conf);
    });

    // strip comments
    if (settings.stripComment) {
      str = str.replace(settings.comment, function(m, code, assign, value) {
        return '';
      });
    }

    // strip whitespace
    if (settings.stripWhitespace) {
      settings.dot.strip = settings.stripWhitespace;
    }

    // layout sections
    var sections = {};

    if (!config.layout) {
      sections.body = str;
    }
    else {
      str.replace(settings.dot.define, function(m, code, assign, value) {
        sections[code] = value;
      });
    }

    var templateSettings = _.pick(options, ['settings']);
    options.getTemplate && (templateSettings.getTemplate = options.getTemplate);
    return new Template({
      express: templateSettings,
      config: config,
      sections: sections,
      dirname: path.dirname(filename),
      filename: filename
    });
  }
  catch (err) {
    throw new Error(
      'Failed to build template' +
      ' (' + filename + ')' +
      ' - ' + err.toString()
    );
  }
}
1042670
function(settings) {
    this.events = [];
    this.setSettings(settings);
    this.bytesLoaded = 0;
    this.bytesTotal = 0;
    this.paused = !this.settings.autoStart;

    var _self = this;
    var _fileList = [];
    var _completed = new List('item.uuid');
    var _errors = new List('item.uuid');
    var _queue = new List('item.uuid');

    var onStart = function(event) {
        var e = new FileManagerEvent('file_start', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);
    };

    var onPause = function(event) {
        var e = new FileManagerEvent('file_pause', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);
    };

    var onProgress = function(event) {
        _self.bytesLoaded += event.bytesLoaded;

        // @deprecated
        var e = new FileManagerEvent('file_progress', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);

        e = new FileManagerEvent('progress', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray()
        });

        _self.dispatchEvent(e);
    };

    var onError = function(event) {
        _queue.remove(event.target);
        _errors.add(event.target);

        // @deprecated
        var e = new FileManagerEvent('file_error', {
            bytesLoaded: 0,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            fileError: event
        });

        _self.dispatchEvent(e);

        e = new FileManagerEvent('error', {
            bytesLoaded: 0,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            fileError: event
        });

        _self.dispatchEvent(e);
        
        queue.apply(_self);
    };

    var onComplete = function(event) {
        _completed.add(event.target);
        _queue.remove(event.target);

        // @deprecated
        var e = new FileManagerEvent('file_complete', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            data: event.data
        });

        _self.dispatchEvent(e);

        e = new FileManagerEvent('complete', {
            bytesLoaded: event.bytesLoaded,
            bytesTotal: event.bytesTotal,
            totalBytesLoaded: _self.bytesLoaded,
            totalBytesTotal: _self.bytesTotal,
            currentTarget: event.target,
            file: event.file,
            queue: _queue.toArray(),
            errors: _errors.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            data: event.data
        });

        _self.dispatchEvent(e);
        
        queue.apply(_self);
    };

    _queue.add = function(item) {
        if (!!item.uuid) {
            item.on('start', onStart);
            item.on('pause', onPause);
            item.on('progress', onProgress);
            item.on('error', onError);
            item.on('complete', onComplete);

            this.list[item.uuid] = item;
            ++this.length;
        }
    };
    _queue.remove = function(item) {
        if (!!item.uuid) {
            item.off('start', onStart);
            item.off('pause', onPause);
            item.off('progress', onProgress);
            item.off('error', onError);
            item.off('complete', onComplete);

            delete this.list[item.uuid];
            --this.length;
        }
    };

    this.addFile = function(file) {
        if (!file instanceof File || !this.validate(file)) {
            // If it's an actual file, just throw it in the error queue
            if (file instanceof File) {
                _errors.add(file);
                var e = new FileManagerEvent('invalid', {
                    bytesLoaded: 0,
                    bytesTotal: file.size,
                    totalBytesLoaded: _self.bytesLoaded,
                    totalBytesTotal: _self.bytesTotal,
                    currentTarget: this,
                    queue: _queue.toArray(),
                    file: file,
                    fileList: _fileList,
                    completed: _completed.toArray(),
                    errors: _errors.toArray()
                });

                this.dispatchEvent(e);
            }
            return;
        }

        if (!_fileList) {
            _fileList = [];
        }

        _fileList.push(file);
        
        this.bytesTotal += file.size;

        // Update the queue
        queue.apply(this);

        return this;
    };

    this.setFiles = function(files) {
        if (!files instanceof FileList || !files instanceof Array || files.length === 0) {
            return;
        }

        this.pause();
        _fileList = [];
        var i;

        if (files instanceof FileList) {
            for (i = 0; i < files.length; i++) {
                this.addFile(files.item(i));
            }
        }
        else {
            for (i = 0; i < files.length; i++) {
                this.addFile(files[i]);
            }
        }

        if (this.settings.autoStart === true) {
            this.start();
        }

        return this;
    };

    var queue = function () {
        var _self = this;
        while(_queue.length < _self.settings.maxQueue && _fileList.length > 0) {
            var file = _fileList.shift();
            if (!!file) {
                // Create the FileUpload to queue
                var fu = new FileUpload(file, {
                    url: _self.settings.url,
                    method: _self.settings.method,
                    autoStart: false,
                    maxChunkSize: _self.settings.maxChunkSize,
                    formFileField: _self.settings.formFileField,
                    chunkParameter: _self.settings.chunkParameter,
                    chunksParameter: _self.settings.chunksParameter
                });

                // Update the total queue size
                _self.bytesTotal += file.size;

                // Add the uploader to the queue
                _queue.add(fu);

                // Dispatch an queue event
                _self.dispatchEvent(new FileManagerEvent('queue', {
                    bytesLoaded: 0,
                    bytesTotal: file.size,
                    totalBytesLoaded: _self.bytesLoaded,
                    totalBytesTotal: _self.bytesTotal,
                    currentTarget: fu,
                    queue: _queue.toArray(),
                    file: file,
                    fileList: _fileList,
                    completed: _completed.toArray(),
                    errors: _errors.toArray()
                }));

                // If the manager isn't paused, start the upload
                if (!_self.paused) {
                    fu.start();
                }
            }
        }
    };

    this.start = function() {
        this.paused = false;

        queue.apply(this);
        
        for (var n in _queue.list) {
            _queue.get(n).start();
        }

        this.dispatchEvent(FileManagerEvent('start', {
            bytesLoaded: this.bytesLoaded,
            bytesTotal: this.bytesTotal,
            queue: _queue.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            errors: _errors.toArray()
        }));
    };

    this.pause = function() {
        this.paused = true;
        for (var i = 0; i < _queue.length; i++) {
            _queue[i].pause();
        }

        this.dispatchEvent(new FileManagerEvent('pause', {
            bytesLoaded: this.bytesLoaded,
            bytesTotal: this.bytesTotal,
            queue: _queue.toArray(),
            fileList: _fileList,
            completed: _completed.toArray(),
            errors: _errors.toArray()
        }));
    };
    
    this.clearQueue = function() {
      _queue.clear();
      return this;
    };
    
    this.clearErrors = function() {
      _errors.clear();
      return this;
    };
    
    this.clearCompleted = function() {
      _completed.clear();
      return this;
    }
}
632759
function makeSettings() {
        var i;
        settings = $.extend({}, $.data(element, colorbox));
        
		for (i in settings) {
			if ($.isFunction(settings[i]) && i.slice(0, 2) !== 'on') { // checks to make sure the function isn't one of the callbacks, they will be handled at the appropriate time.
			    settings[i] = settings[i].call(element);
			}
		}
        
		settings.rel = settings.rel || element.rel || 'nofollow';
		settings.href = settings.href || $(element).attr('href');
		settings.title = settings.title || element.title;
        
        if (typeof settings.href === "string") {
            settings.href = $.trim(settings.href);
        }
	}
1162178
function set(name, val) {
  // If the name is an object
  var key;
  if (typeof name === 'object') {
    // Iterate over its properties
    for (key in name) {
      if (name.hasOwnProperty(key)) {
        // Set each one
        set(key, name[key]);
      }
    }
  } else {
  // Otherwise, save to settings
    settings[name] = val;
  }
}
942495
public String generateJs(final Settings settings, final String methodName)
	{
		// 1. Create an empty map...
		final Map<String, Object> variables = initializeVariables(settings.asSet());
		// 4. Generate the js template with the map and the method name...
		final String stringTemplateContent = generateJavascriptTemplateContent(variables,
			methodName);
		// 5. Create the StringTextTemplate with the generated template...
		final StringTextTemplate stringTextTemplate = new StringTextTemplate(stringTemplateContent);
		// 6. Interpolate the template with the values of the map...
		stringTextTemplate.interpolate(variables);
		try
		{
			// 7. return it as String...
			return stringTextTemplate.asString();
		}
		finally
		{
			try
			{
				stringTextTemplate.close();
			}
			catch (final IOException e)
			{
				LOGGER.error(e.getMessage(), e);
			}
		}
	}