TODO load adjustment by name
554910
function findExistingAdjustment(next) {
      // prepare criteria by _id or fields
      let criteria = _.merge({}, _adjustment);
      criteria = (
        criteria._id ?
        _.pick(criteria, '_id') :
        _.pick(criteria, 'type', 'reason', 'item', 'stock', 'store')
      );
      Adjustment.findOne(criteria, next);
    }
566495
function getCanonicalNamePlain(loader, normalized, isPlugin) {
  // now just reverse apply paths rules to get canonical name
  var pathMatch;

  // first check exact path matches
  for (var p in loader.paths) {
    if (loader.paths[p].indexOf('*') != -1)
      continue;

    var curPath = normalizePath(loader, loader.paths[p], isPlugin);

    // always stop on first exact match
    if (normalized === curPath)
      return p;

    // support trailing / in paths rules
    else if (curPath[curPath.length - 1] == '/' &&
        normalized.substr(0, curPath.length - 1) == curPath.substr(0, curPath.length - 1) &&
        (normalized.length < curPath.length || normalized[curPath.length - 1] == curPath[curPath.length - 1])) {
      // first case is that canonicalize('src') = 'app' for 'app/': 'src/'
      return normalized.length < curPath.length ? p.substr(0, p.length - 1) : p + normalized.substr(curPath.length);
    }
  }

  // then wildcard matches
  var pathMatchLength = 0;
  var curMatchLength;
  if (!pathMatch)
    for (var p in loader.paths) {
      if (loader.paths[p].indexOf('*') == -1)
        continue;

      // normalize the output path
      var curPath = normalizePath(loader, loader.paths[p], true);

      // do reverse match
      var wIndex = curPath.indexOf('*');
      if (normalized.substr(0, wIndex) === curPath.substr(0, wIndex)
        && normalized.substr(normalized.length - curPath.length + wIndex + 1) === curPath.substr(wIndex + 1)) {
        curMatchLength = curPath.split('/').length;
        if (curMatchLength >= pathMatchLength) {
          pathMatch = p.replace('*', normalized.substr(wIndex, normalized.length - curPath.length + 1));
          pathMatchLength = curMatchLength;
        }
      }
    }

  // when no path was matched, act like the standard rule is *: baseURL/*
  if (!pathMatch) {
    if (normalized.substr(0, loader.baseURL.length) == loader.baseURL)
      pathMatch = normalized.substr(loader.baseURL.length);
    else if (normalized.match(absURLRegEx))
      throw new Error('Unable to calculate canonical name to bundle ' + normalized + '. Ensure that this module sits within the baseURL or a wildcard path config.');
    else
      pathMatch = normalized;
  }

  return pathMatch;
}
493846
function(name) {
  try {
    debug(`Loading ${name} configuration`);

    return waigo.load(`config/${name}`);
  } catch (e) {
    debug(`Error loading config: ${name}`);
    debug(e);

    return null;
  }
}
201939
def adjust_cells(self):
        """"""
        self.resizeColumnsToContents()
        fm = self.horizontalHeader().fontMetrics()
        names = [fm.width(s.cmd) for s in self.source_model.servers]
        if names:
            self.setColumnWidth(CMD, max(names))
        self.horizontalHeader().setStretchLastSection(True)
784052
def _load(self):
        """"""
        for attr_name, config_prop in self._iter_config_props():
            found = False
            for loader in self._loaders:
                if loader.exists(config_prop.property_key):
                    raw_value = loader.get(config_prop.property_key)
                    converted_value = config_prop.load(raw_value)

                    self._set_instance_prop(attr_name, config_prop, converted_value)
                    found = True
                    break

            if not found:
                if not config_prop.required or config_prop.default is not None:
                    self._set_instance_prop(attr_name, config_prop, config_prop.default)
                else:
                    raise ValueError('Missing required ConfigProperty {}'.format(attr_name))
622512
def load_file(self, filename):
        """"""

        self.tree_editor.load_file(filename)
        self.project_name.configure(text=filename)
        self.currentfile = filename
        self.is_changed = False
1106627
function load(err, data){
            if (err) throw err
            _.log('view added: '+name+': '+source)
            views[name] = compile(''+data)
        }
22843
function(id, loaded, total) {
            updateTotalProgress(id, loaded, total);
            perFileProgress[id] = {loaded: loaded, total: total};
        }
624149
function(filename, fileInfo) {
		var projectName = path.relative(
			app.config.paths.projects,
			path.dirname(filename)
		);

		if (app.projects.get(projectName)) {
			logger.log('Unload project: "' + projectName + '"');
			app.projects.unload({name: projectName});
		}

		// on add or change (info is falsy on unlink)
		if (fileInfo) {
			logger.log('Load project "' + projectName + '" on change');
			app.projects.load({name: projectName}, function(err) {
				if (err) {
					return logger.error(
						'Error during load project "' + projectName + '": ',
						err.stack || err
					);
				}
				logger.log(
					'Project "' + projectName + '" loaded:',
					JSON.stringify(app.projects.get(projectName), null, 4)
				);
			});
		}
	}
194831
function preloader(items, preloadFunction, callback) {

    var itemc = 0;
    var loadc = 0;

    // called by preloadFunction to notify result
    function _check(err, id) {
        updateProgress(1);
        if (err) {
            alert('Failed to load ' + id + ': ' + err);
        }
        loadc++;
        if (itemc == loadc) callback();
    }

    if (items.constructor == Array) {
        itemc = items.length;
        loadc = 0;
        progressTotalCount += items.length;
        // queue each item for fetching
        items.forEach(function (item) {
            preloadFunction(item, _check);
        });
    } else {
        // object
        for (var key in items) {
            itemc++;
            progressTotalCount++;
            preloadFunction(items[key], _check);
        }
    }
}
1213442
function (name) {
        if (JOII.Config.constructors.indexOf(name) !== -1) {
            return;
        }

        JOII.Config.constructors.push(name);
    }
614926
function (name, req, onLoad, config) {
//>>excludeStart("exclude", pragmas.optimizeSave);
			var that = this,
				url = req.toUrl(name);

			// load content (css code)
			text.get(url, function (data) {

				if (config.isBuild) {
					// in build-time: remember path to from generic.css to baseDir
					if (!_genericCssToRootPath) {
						_genericCssToRootPath = config.genericCssToRootPath;
					}

					_buildMap[name] = { path: url, data: data, write: config.writeGenericCss };

				} else {
					// in runtime (non-optimized): include css as style tag into document's head
					var imports = [],
						css = _replaceCssRelativeUrls(data, url, imports);

					if (imports.length) {
						// the css file has @import directives, we have to load each imported css-file explicitly,
						// as browsers support @import directives only at the beginning of style tag.
						var ctx = {
							name: name,
							css: css,
							waiting: imports.length,
							loaded: {}
						};
						imports.forEach(function (url) {
							console.log("DEBUG: Loading css-file from @import: " + url);
							text.get(url, function (data) {
								var importUrl;
								ctx.loaded[url] = data;
								ctx.waiting -= 1;
								if (ctx.waiting === 0) {
									// last script has been loaded
									for(importUrl in ctx.loaded) {
										ctx.css = ctx.css.replace("/*>>import: " + url + "*/", ctx.loaded[url]);
									}
									that.helper.appendCssToPage(ctx.css, ctx.name);
									onLoad();
								}
							});
							return;
						});
					} else {
						that.helper.appendCssToPage(css, name);
					}
				}
				onLoad();
				return;
			});
//>>excludeEnd("exclude");
			onLoad();
		}
19763
def _setload(l: Loader, value, type_) -> Set:
    
    t = type_.__args__[0]
    return {l.load(i, t) for i in value}
890309
def adjust!(other)
      @x0 = other.x0 if other.x0 < @x0
      @y0 = other.y0 if other.y0 < @y0
      @x1 = other.x1 if other.x1 > @x1
      @y1 = other.y1 if other.y1 > @y1
    end
52582
def adjustBytesUploaded(infoHash, adjustment)
      torrentData = @torrentData[infoHash]
      if ! torrentData
        @logger.warn "Asked to adjust uploaded bytes for a non-existent torrent #{QuartzTorrent.bytesToHex(infoHash)}"
        return
      end
      
      runInReactorThread do
        torrentData.bytesUploaded += adjustment
        torrentData.bytesUploadedDataOnly += adjustment
      end
    end
144987
def bind_name(self, name):
        """"""
        if self.name:
            raise errors.Error('Already bound "{0}" with name "{1}" could not '
                               'be rebound'.format(self, self.name))
        self.name = name
        self.storage_name = ''.join(('_', self.name))
        return self
374185
def adjustBytesDownloaded(infoHash, adjustment)
      return if ! adjustment
      raise "Bytes downloaded adjustment must be an Integer, not a #{adjustment.class}" if !adjustment.is_a?(Integer)
      @handler.adjustBytesDownloaded(infoHash, adjustment)
    end