Constructs a instance with the specified settings.

@constructor
@param {Object} settings Name/value object with settings.
493455
function (settings) {
        settings = {
          border: 1,
          padding: 20,
          layout: 'flex',
          pack: "center",
          align: "center",
          containerCls: 'panel',
          autoScroll: true,
          buttons: { type: "button", text: "Ok", action: "ok" },
          items: {
            type: "label",
            multiline: true,
            maxWidth: 500,
            maxHeight: 200
          }
        };

        this._super(settings);
      }
808251
@Override
    public void initialize(Settings settings) {
        this.settings = settings;
        final String key = getAnalyzerEnabledSettingKey();
        try {
            this.setEnabled(settings.getBoolean(key, true));
        } catch (InvalidSettingException ex) {
            final String msg = String.format("Invalid setting for property '%s'", key);
            LOGGER.warn(msg);
            LOGGER.debug(msg, ex);
        }
    }
1073928
def new_instance(settings):
    
    settings = set_default({}, settings)
    if not settings["class"]:
        Log.error("Expecting 'class' attribute with fully qualified class name")

    # IMPORT MODULE FOR HANDLER
    path = settings["class"].split(".")
    class_name = path[-1]
    path = ".".join(path[:-1])
    constructor = None
    try:
        temp = __import__(path, globals(), locals(), [class_name], 0)
        constructor = object.__getattribute__(temp, class_name)
    except Exception as e:
        Log.error("Can not find class {{class}}", {"class": path}, cause=e)

    settings['class'] = None
    try:
        return constructor(kwargs=settings)  # MAYBE IT TAKES A KWARGS OBJECT
    except Exception as e:
        pass

    try:
        return constructor(**settings)
    except Exception as e:
        Log.error("Can not create instance of {{name}}", name=".".join(path), cause=e)
1016405
def settings(&block)
      @settings ||= setup

      settings = instance_variable_defined?(:@namespace) ? @settings.get_value(@namespace) : @settings

      if block_given?
        block.arity == 0 ? settings.instance_eval(&block) : block.call(settings)
      end

      settings
    end
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;
        }
249747
function(text, settings) {
            var that = this;
            settings = settings || {};

            var getTypeId = settings.getTypeId || function(object) { return that.getTypeId(object); };
            var getConstructor = settings.getConstructor || function(id) { return that.typeMap[id]; };
            var reviver = settings.reviver || function(key, value) { return that.reviver(key, value, getTypeId, getConstructor); };

            return JSON.parse(text, reviver);
        }
736300
function(initialValue, settings){
		var self = this;
		// This is the async getter function.  Depending on how many arguments the function takes,
		// we setup bindings differently.
		var getter = settings.fn;
		var bindings;

		this.value = initialValue;

		// This compute will call update with the new value itself.
		this._setUpdates = true;

		// An "async" compute has a `lastSetValue` that represents
		// the last value `compute.set` was called with.
		// The following creates `lastSetValue` as a can.Compute so when
		//  `lastSetValue` is changed, the `getter` can see that change
		// and automatically update itself.
		this.lastSetValue = new Compute(initialValue);

		// Wires up setting this compute to set `lastSetValue`.
		// If the new value matches the last setValue, do nothing.
		this._set = function(newVal){
			if(newVal === self.lastSetValue.get()) {
				return this.value;
			}

			return self.lastSetValue.set(newVal);
		};

		// Wire up the get to pass the lastNewValue
		this._get = function() {
			return getter.call(settings.context, self.lastSetValue.get() );
		};

		if(getter.length === 0) {
			// If it takes no arguments, it should behave just like a Getter compute.
			bindings = setupComputeHandlers(this, getter, settings.context);
		} else if(getter.length === 1) {
			// If it has a single argument, pass it the last setValue.
			bindings = setupComputeHandlers(this, function() {
				return getter.call(settings.context, self.lastSetValue.get() );
			}, settings);

		} else {
			// If the function takes 2 arguments, the second argument is a function
			// that should update the value of the compute (`setValue`). To make this we need
			// the "normal" updater function because we are about to overwrite it.
			var oldUpdater = this.updater,
				resolve = ObservationRecorder.ignore(function(newVal) {
					oldUpdater.call(self, newVal, self.value);
				});

			// Because `setupComputeHandlers` calls `updater` internally with its
			// observation._value as `oldValue` and that might not be up to date,
			// we overwrite updater to always use self.value.
			this.updater = function(newVal) {
				oldUpdater.call(self, newVal, self.value);
			};


			bindings = setupComputeHandlers(this, function() {
				// Call getter, and get new value
				var res = getter.call(settings.context, self.lastSetValue.get(), resolve);
				// If undefined is returned, don't update the value.
				return res !== undefined ? res : this.value;
			}, this);
		}

		assign(this, bindings);
	}
861681
function(newValue,property,config) {
                var thesetter = config.setter;
                if ( typeof(config.setter) === 'string' ) {
                    record[config.setter](newValue, property, config,record);
                } else {
                    //assume function
                    thesetter.call(record,newValue, property, config,record);
                }

            }
614897
public void setSettings(LinkedHashMap<String, Object> settings) {
        Settings.Builder builder = Settings.settingsBuilder();
        for (Map.Entry<String, Object> entry : settings.entrySet()) {
            builder.put(entry.getKey(), entry.getValue());
        }
        this.settings = builder.build();
    }
942223
function(setting) {
		var o = setting.treeObj;
		var c = consts.event;
		o.bind(c.RENAME, function (event, treeId, treeNode, isCancel) {
			tools.apply(setting.callback.onRename, [event, treeId, treeNode, isCancel]);
		});

		o.bind(c.DRAG, function (event, srcEvent, treeId, treeNodes) {
			tools.apply(setting.callback.onDrag, [srcEvent, treeId, treeNodes]);
		});

		o.bind(c.DRAGMOVE,function(event, srcEvent, treeId, treeNodes){
			tools.apply(setting.callback.onDragMove,[srcEvent, treeId, treeNodes]);
		});

		o.bind(c.DROP, function (event, srcEvent, treeId, treeNodes, targetNode, moveType, isCopy) {
			tools.apply(setting.callback.onDrop, [srcEvent, treeId, treeNodes, targetNode, moveType, isCopy]);
		});
	}
1007903
private function setSettings($settings)
    {
        if ($settings) {
            foreach ($this->settings as $key => &$value) {
                if (!empty($settings->{$key}) && $settings->{$key}) {
                    if (is_object($settings->{$key})) {
                        $value = array_merge(
                            $value,
                            json_decode(json_encode($settings->{$key}, JSON_FORCE_OBJECT), true)
                        );
                    } else {
                        $value = $settings->{$key};
                    }
                }
            }
        }
    }
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);
        }
	}
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);
}
758210
function(key, settings) {
            //merge global setting with local setting
            settings = jsonQ.merge({}, jsonQ.settings.sort, settings);
            var jobj = this.find(key),
                current = jobj.clone(),
                sortStack = [],
                i, ln,
                sortedPath = [],
                type = objType(jobj.pathValue(current[0].path)),
                //function to get value which is an array from pathKey traversing from right.
                getClosestArray = function(key) {
                    while (key.length !== 0) {
                        var lastKey = key.pop();
                        if (!isNaN(lastKey)) {
                            var val = jobj.pathValue(key);
                            if (objType(val) == 'array') {
                                return val;
                            }
                        }
                    }
                    return null;
                };

            //initialize sort stack
            for (i = 0, ln = current.length; i < ln; i++) {
                sortStack.push({
                    pathHolder: current[i].path.concat([]),
                    current: current[i].path.concat([])
                });
            }

            //to run the loop until all are sorted
            var alpha = 0,

                // function to remove element if sorting is done for that path
                spliceElm = function(i) {
                    sortStack.splice(i, 1);
                    return --i;
                };
            while (sortStack.length !== 0) {
                alpha++;
                for (i = 0; i < sortStack.length; i++) {
                    var cur = sortStack[i].current,
                        pH = sortStack[i].pathHolder,
                        //to get the closest array in the current path. This will also change value of current path variable.
                        ary = getClosestArray(cur),
                        pathStr = cur.join();



                    //to remove from sort stack if no array is left on key or if that is already sorted
                    if (cur.length === 0 || sortedPath.indexOf(pathStr) != -1) {
                        i = spliceElm(i);
                    }

                    //to sort if array found
                    else {
                        //logic path is path which we add in on condition to find the element value according to which we are sorting
                        var logicPath = pH.slice(cur.length + 1, pH.length),

                            logic = function(a) {
                                var val = jsonQ.pathValue(a, logicPath);

                                //to convert val to be compared
                                val = sortFunc.baseConv(type, val, settings);
                                return settings.logic(val);
                            };

                        //to sort the root json
                        sortFunc.sortAry(ary, logic, settings);

                        //if multilevel sort is true
                        if (settings.allLevel) {
                            //to maintain the path which is already sorted and change pathHolder to point first element of sorted array
                            pH[cur.length] = 0;
                            sortedPath.push(pathStr);
                        } else {
                            //remove sorted path
                            i = spliceElm(i);
                        }
                    }



                }
            }


            return jsonQ(jobj.jsonQ_root).find(key);
        }
723211
function create(context) {
    const settings = Object.assign({}, defaults, context.options[0]);

    function check(setting, node, list, format) {
        const val = settings[setting];
        const lines = list.map(line);

        if ((isLongerThan(val, lines) || isAlways(val)) && hasDuplicates(lines)) {
            const message = messages.always[setting];
            const fix = (f) => f.replaceTextRange(node.range, format(node));
            context.report({ node, message, fix });
        }

        if (isNever(val) && hasMultiple(lines)) {
            const message = messages.never[setting];
            context.report({ node, message });
        }
    }

    return {
        CallExpression(node) {
            if (!isAmdCall(node) || node.arguments.length < 2) return;

            const args = withoutModuleId(node.arguments);
            const deps = args[0];
            const func = args[1];

            if (!isArrayExpr(deps) || !isFunctionExpr(func)) return;

            const indent = indentation(func);

            check("paths", deps, deps.elements, formatPaths(indent));
            check("names", func, func.params, formatNames(indent, context));
        }
    };
}
474875
def create_instance(self, name, moduleName, settings):
        
        if name in self.insts:
            raise ValueError("There's already an instance named %s" %
                             name)
        if moduleName not in self.modules:
            raise ValueError("There's no module %s" % moduleName)
        md = self.modules[moduleName]
        deps = dict()
        for k, v in six.iteritems(md.deps):
            if k not in settings:
                settings[k] = self._get_or_create_a(v.type)
            if settings[k] is None:
                if not v.allow_null:
                    raise ValueError("`null' not allowed for %s" % k)
            elif settings[k] not in self.insts:
                raise ValueError("No such instance %s" % settings[k])
            else:
                settings[k] = self.insts[settings[k]].object
                deps[k] = settings[k]
        for k, v in six.iteritems(md.vsettings):
            if k not in settings:
                settings[k] = v.default
                if v.default is None:
                    self.l.warn('%s:%s not set' % (name, k))
        self.l.info('create_instance %-15s %s' % (name, md.implementedBy))
        cl = get_by_path(md.implementedBy)
        il = logging.getLogger(name)
        obj = cl(settings, il)
        self.register_instance(name, moduleName, obj, settings, deps)
        return obj
98282
function makeSettings() {
		var i,
			data = $.data(element, colorbox);
		
		if (data == null) {
			settings = $.extend({}, defaults);
			if (console && console.log) {
				console.log('Error: cboxElement missing settings object');
			}
		} else {
			settings = $.extend({}, data);
		}
		
		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 || $(element).data('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);
		}
	}