code: function assignLocals(context, config, file) {
    var searchpath = path.dirname(file.path);
    var pfile = path.parse(file.path);
    var locals = String.prototype.replace.apply(config.locals, [
      '<filename>', pfile.base]);
    locals = String.prototype.replace.apply(locals, [
      '<filename_noext>', pfile.name]);
    var pattern = locals;
    config.vlog('Searching for locals with pattern:', pattern, 'in:', searchpath);
    var options = {
      cwd: searchpath,
      nodir: true
    };
    var found = glob.sync(pattern, options);
    var i, fullpath, result;
    config.vlog('Found:', found.length, 'locals files.');
    for (i = 0; i < found.length; i++) {
      fullpath = path.resolve(searchpath, found[i]);
      config.vlog('Using locals file:', found[i], 'fullpath:', fullpath);
      result = {};
      if (requireFile(config, fullpath, result))
        assign(context, result.obj);
    }
  }
docs: #endregion