following is a bunch of stuff to make give the leveldown api...
428105
function (key, cb) {
      if(!db.data) return cb(new Error('kiddb not open'))
      if(db.data[key]) cb(null, db.data[key])
      else          cb(new Error('not found'))
    }
1290907
function () {
      var done = this.async();
      var questions = [];
      var choices = [
        {
          name: 'Standard Preset',
          value: 'standard'
        },
        {
          name: 'Minimum Preset',
          value: 'minimum'
        },
        {
          name: 'Custom Configuration (Advanced)',
          value: 'custom'
        }
      ];
      var defaultType = 'standard';

      if (!this.skipWelcomeMessage) {
        this.log(yosay('Welcome to ' + this.pkg.name + ' v' + this.pkg.version));
      }

      if (!this.configType) {
        if (this.config.existed) {
          choices.splice(2, 0, {
            name: 'User Preset',
            value: 'user'
          });
          defaultType = 'user';
        }
        questions.push({
          type: 'list',
          name: 'configType',
          message: 'Setup Type',
          choices: choices,
          default: defaultType
        });
      }

      this.prompt(questions, function (answers) {
        if (typeof answers.configType !== 'undefined') {
          this.configType = answers.configType;
        }

        // Preset for skipping prompt
        switch (this.configType) {
          case 'standard':
            this.preset = standardPreset;
            break;
          case 'minimum':
            this.preset = minimumPreset;
            break;
          case 'user':
            this.preset = this.config.getAll();
            break;
          case 'custom':
            this.preset = {};
            break;
        }

        // Initial settings
        this.settings = _.assign({}, defaultConfig, this.config.getAll());

        done();
      }.bind(this));
    }
218588
function() {
      var items = Array(this.modules.length);
      for (var i = 0, module; module = this.modules[i]; i++) items[i] = module.placeHolder;
      var menu = MENU.FindId('Accessibility');
      if (menu) {
        items.unshift(ITEM.RULE());
        menu.submenu.items.push.apply(menu.submenu.items,items);
      } else {
        var renderer = (MENU.FindId("Settings","Renderer")||{}).submenu;
        if (renderer) {
          // move AssitiveMML and InTabOrder from Renderer to Accessibility menu
          items.unshift(ITEM.RULE());
          items.unshift(renderer.items.pop());
          items.unshift(renderer.items.pop());
        }
        items.unshift("Accessibility");
        var menu = ITEM.SUBMENU.apply(ITEM.SUBMENU,items);
        var locale = MENU.IndexOfId('Locale');
        if (locale) {
          MENU.items.splice(locale,0,menu);
        } else {
          MENU.items.push(ITEM.RULE(), menu);
        }
      }
    }
537560
function mergeAtLevel(summary, level, newValue) {
    var levelParts = level.split('.');
    var partIndex = Number(levelParts[0]) -1;

    var parts = summary.getParts();
    var part = parts.get(partIndex);
    if (!part) {
        return summary;
    }

    var isEditingPart = levelParts.length < 2;
    if (isEditingPart) {
        part = part.merge(newValue);
    } else {
        part = editArticleInPart(part, level, newValue);
    }

    parts = parts.set(partIndex, part);
    return summary.set('parts', parts);
}
765237
private void popAndResetToOldLevel() {
        this.levelStack.pop();
        if (!this.levelStack.isEmpty()) {
            JsonLevel newTop = levelStack.peek();
            if (newTop != null) {
                newTop.removeLastTokenFromJsonPointer();
            }
        }
    }
1205158
function normalizeCaps(settings) {
	var features = settings.required_features, caps = {};

	function resolve(feature, value, strict) {
		// Feature notation is deprecated, use caps (this thing here is required for backward compatibility)
		var map = {
			chunks: 'slice_blob',
			jpgresize: 'send_binary_string',
			pngresize: 'send_binary_string',
			progress: 'report_upload_progress',
			multi_selection: 'select_multiple',
			dragdrop: 'drag_and_drop',
			drop_element: 'drag_and_drop',
			headers: 'send_custom_headers',
			urlstream_upload: 'send_binary_string',
			canSendBinary: 'send_binary',
			triggerDialog: 'summon_file_dialog'
		};

		if (map[feature]) {
			caps[map[feature]] = value;
		} else if (!strict) {
			caps[feature] = value;
		}
	}

	if (typeof(features) === 'string') {
		plupload.each(features.split(/\s*,\s*/), function(feature) {
			resolve(feature, true);
		});
	} else if (typeof(features) === 'object') {
		plupload.each(features, function(value, feature) {
			resolve(feature, value);
		});
	} else if (features === true) {
		// check settings for required features
		if (settings.chunk_size && settings.chunk_size > 0) {
			caps.slice_blob = true;
		}

		if (!plupload.isEmptyObj(settings.resize) || settings.multipart === false) {
			caps.send_binary_string = true;
		}

		if (settings.http_method) {
            caps.use_http_method = settings.http_method;
        }

		plupload.each(settings, function(value, feature) {
			resolve(feature, !!value, true); // strict check
		});
	}

	return caps;
}
598558
function updateTOC() {
  if (ov && svc.hasLoaded()) {
    var toc = '';
    var scale = 591657527.591555 / (Math.pow(2, map.getZoom()));//591657527.591555 is the scale at level 0
    var layers = svc.layers;
    for (var i = 0; i < layers.length; i++) {
      var layer = layers[i];
      var inScale = layer.isInScale(scale);
      toc += '<div style="color:' + (inScale ? 'black' : 'gray') + '">';
      if (layer.subLayerIds) {
        toc += layer.name + '(group)<br/>';
      } else {
        if (layer.parentLayer) {
          toc += '&nbsp;&nbsp;&nbsp;&nbsp;';
        }
        toc += '<input type="checkbox" id="layer' + layer.id + '"';
        if (layer.visible) {
          toc += ' checked="checked"';
        }
        if (!inScale || svc.singleFusedMapCache) {
          toc += ' disabled="disabled"';
        }
        toc += ' onclick="setLayerVisibility()">' + layer.name + '<br/>';
      }
      toc += '</div>';
    }
    document.getElementById('toc').innerHTML = toc;
  }
  
}
799723
function buildScales() {
            const maxValueByDate = isUsingFakeData ? emptyDataConfig.maxY : getMaxValueByDate();

            xScale = d3Scale.scaleTime()
                .domain(d3Array.extent(dataByDate, ({date}) => date))
                .rangeRound([0, chartWidth]);

            yScale = d3Scale.scaleLinear()
                .domain([0, maxValueByDate])
                .rangeRound([chartHeight, 0])
                .nice();

            categoryColorMap =  order.reduce((memo, topic, index) => (
                assign({}, memo, {[topic]: colorSchema[index]})
            ), {});
        }
120343
function() {

            var info = this.moduleInfo, name, i, j;

            // Create skin modules
            for (name in info) {

                if (lang.hasOwnProperty(info, name)) {
                    var m = info[name];
                    if (m && m.skinnable) {
                        // Y.log("skinning: " + name);
                        var o=this.skin.overrides, smod;
                        if (o && o[name]) {
                            for (i=0; i<o[name].length; i=i+1) {
                                smod = this._addSkin(o[name][i], name);
                            }
                        } else {
                            smod = this._addSkin(this.skin.defaultSkin, name);
                        }

                        m.requires.push(smod);
                    }
                }

            }

            var l = lang.merge(this.inserted); // shallow clone
            
            if (!this._sandbox) {
                l = lang.merge(l, env.modules);
            }

            // Y.log("Already loaded stuff: " + lang.dump(l, 0));

            // add the ignore list to the list of loaded packages
            if (this.ignore) {
                YUI.ObjectUtil.appendArray(l, this.ignore);
            }

            // remove modules on the force list from the loaded list
            if (this.force) {
                for (i=0; i<this.force.length; i=i+1) {
                    if (this.force[i] in l) {
                        delete l[this.force[i]];
                    }
                }
            }

            // expand the list to include superseded modules
            for (j in l) {
                // Y.log("expanding: " + j);
                if (lang.hasOwnProperty(l, j)) {
                    lang.augmentObject(l, this.getProvides(j));
                }
            }

            // Y.log("loaded expanded: " + lang.dump(l, 0));

            this.loaded = l;

        }
944556
function() {
        // set world size
        me.game.viewport.bounds.resize(2000, 2000);

        // add background to the game world
        me.game.world.addChild(new me.ImageLayer(0, 0, {image:"grid", z:1}));

        var leftContainer = document.querySelector("#leftPanel .controls");
        var rightContainer = document.querySelector("#rightPanel .controls");
        var controller = game.EmitterController = new game.ParticleEditor.EmitterController(rightContainer);
        var emitterList = game.EmitterList = new game.ParticleEditor.EmitterList(controller, leftContainer);
        game.CodeGenerator = new game.ParticleEditor.CodeGenerator(controller, leftContainer);

        // start the default emitter example
        game.changeEmitter();

        // enable the keyboard
        me.input.bindKey(me.input.KEY.X, "moveEmitter", false, false);
        me.input.bindKey(me.input.KEY.C, "moveViewport", false, false);

        // map the left button click on the enter key
        me.input.bindPointer(me.input.pointer.LEFT, me.input.KEY.X);
        me.input.bindPointer(me.input.pointer.MIDDLE, me.input.KEY.C);

        // flush cached html layout after we added the editor elements
        me.video.onresize();

        // listen to mouse movement
        var viewport = me.game.viewport;
        var mousepos = me.input.pointer.pos;
        var lastX = mousepos.x, lastY = mousepos.y;
        me.event.subscribe(me.event.POINTERMOVE, function() {
            if (me.input.isKeyPressed("moveEmitter")) {
                var pos;
                for ( var emitters = emitterList.emitters, i = emitters.length, obj; i--, (obj = emitters[i]);) {
                    if (!obj.floating) {
                        pos = viewport.localToWorld(mousepos.x, mousepos.y);
                    } else {
                        pos = mousepos;
                    }
                    obj.pos.x = pos.x - obj.width / 2;
                    obj.pos.y = pos.y - obj.height / 2;
                }

                me.event.publish("propertyChanged", [ game.EmitterController.emitter ]);
            }
            if (me.input.isKeyPressed("moveViewport")) {
                viewport.move(lastX - mousepos.x, lastY - mousepos.y);
            }
            lastX = mousepos.x;
            lastY = mousepos.y;
        });
    }
860166
function buildScales() {
            let percentageAxis = Math.min(percentageAxisToMaxRatio * d3Array.max(data, getValue))

            if (isHorizontal) {
                xScale = d3Scale.scaleLinear()
                    .domain([0, percentageAxis])
                    .rangeRound([0, chartWidth]);

                yScale = d3Scale.scaleBand()
                    .domain(data.map(getName))
                    .rangeRound([chartHeight, 0])
                    .padding(betweenBarsPadding);
            } else {
                xScale = d3Scale.scaleBand()
                    .domain(data.map(getName))
                    .rangeRound([0, chartWidth])
                    .padding(betweenBarsPadding);

                yScale = d3Scale.scaleLinear()
                    .domain([0, percentageAxis])
                    .rangeRound([chartHeight, 0]);
            }

            if (shouldReverseColorList) {
                colorList = data.map(d => d)
                                .reverse()
                                .map(({name}, i) => ({
                                        name,
                                        color: colorSchema[i % colorSchema.length]}
                                    ));
            } else {
                colorList = data.map(d => d)
                                .map(({name}, i) => ({
                                        name,
                                        color: colorSchema[i % colorSchema.length]}
                                    ));
            }

            colorMap = (item) => colorList.filter(({name}) => name === item)[0].color;
        }
518024
function nestTwoLevels(samples) {
  return samples.reduce(function(acc, sample) {
    var page     = sample.hierarchy.length > 0 ? sample.hierarchy[0] : 'API';
    var heading  = sample.hierarchy.length > 1 ? sample.hierarchy[1] : 'Samples';
    acc[page] = acc[page] || {};
    acc[page][heading] = acc[page][heading] || [];
    acc[page][heading].push(sample);
    return acc;
  }, {});
}
1327437
function() {
    this.jsonInit({
      "message0": "%1 %2",
      "args0": [
        {
          "type": "field_dropdown",
          "name": "OP",
          "options": [
            [Blockly.Msg.MATH_ROUND_OPERATOR_ROUND, 'ROUND'],
            [Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDUP, 'ROUNDUP'],
            [Blockly.Msg.MATH_ROUND_OPERATOR_ROUNDDOWN, 'ROUNDDOWN']
          ]
        },
        {
          "type": "input_value",
          "name": "NUM",
          "check": "Number"
        }
      ],
      "output": "Number",
      "colour": Blockly.Blocks.math.HUE,
      "tooltip": Blockly.Msg.MATH_ROUND_TOOLTIP,
      "helpUrl": Blockly.Msg.MATH_ROUND_HELPURL
    });
  }
347113
function buildScales() {
            let yMax = d3Array.max(data.map(getValue));

            if (isHorizontal) {
                xScale = d3Scale.scaleLinear()
                    .domain([0, yMax])
                    .rangeRound([0, chartWidth - 1]);
                // 1 pix for edge tick

                yScale = d3Scale.scaleBand()
                    .domain(data.map(getName))
                    .rangeRound([chartHeight, 0])
                    .padding(0.1);

                yScale2 = d3Scale.scaleBand()
                    .domain(data.map(getGroup))
                    .rangeRound([yScale.bandwidth(), 0])
                    .padding(0.1);
            } else {
                xScale = d3Scale.scaleBand()
                    .domain(data.map(getName))
                    .rangeRound([0, chartWidth])
                    .padding(0.1);
                xScale2 = d3Scale.scaleBand()
                    .domain(data.map(getGroup))
                    .rangeRound([0, xScale.bandwidth()])
                    .padding(0.1);

                yScale = d3Scale.scaleLinear()
                    .domain([0, yMax])
                    .rangeRound([chartHeight, 0])
                    .nice();
            }

            colorScale = d3Scale.scaleOrdinal()
                .range(colorSchema)
                .domain(data.map(getGroup));

            categoryColorMap = colorScale
                .domain(data.map(getName)).domain()
                .reduce((memo, item) => {
                    data.forEach(function (v) {
                        if (getName(v) == item) {
                            memo[v.name] = colorScale(v.group)
                            memo[v.group] = colorScale(v.group)
                            memo[v.group + item] = colorScale(v.group)
                        }
                    })
                    return memo;
                }, {});
        }
312057
function bumpLevel(level) {
  return gulp.src(config.pkg)
      .pipe(bump({type: level}))
      .on('error', (e) => log.error(e))
      .pipe(gulp.dest(config.root));
}
30454
function() {
        // clear the background
        me.game.world.addChild(new me.ColorLayer("background", "rgba(248, 194, 40, 1.0)"), 0);

        // add the UI elements
        var panel = new game.UI.Container(150, 100, 450, 325, "OPTIONS");

        // add a few checkbox
        panel.addChild(new game.UI.CheckBoxUI(
            125, 75,
            game.texture,
            "green_boxCheckmark",
            "grey_boxCheckmark",
            "Music ON", // default
            "Music OFF"
        ));
        panel.addChild(new game.UI.CheckBoxUI(
            125, 125,
            game.texture,
            "green_boxCheckmark",
            "grey_boxCheckmark",
            "Sound FX ON", // default
            "Sound FX OFF"
        ));

        // a few buttons
        panel.addChild(new game.UI.ButtonUI(
            125, 175,
            "blue",
            "Video Options"
        ));
        panel.addChild(new game.UI.ButtonUI(
            30, 250,
            "green",
            "Accept"
        ));
        panel.addChild(new game.UI.ButtonUI(
            230, 250,
            "yellow",
            "Cancel"
        ));

        // add the panel to word (root) container
        me.game.world.addChild(panel, 1);

        // display the current pointer coordinates on top of the pointer arrow
        this.font = new me.Text(0, 0 ,{
            font: "Arial",
            size: 10,
            fillStyle: "white",
            textAlign: "center",
            textBaseline: "top",
            text: "(xxx, xxx)"
        });
        me.game.world.addChild(this.font, Infinity);

        // display the current pointer coordinates on top of the pointer arrow
        var self = this;
        me.event.subscribe(me.event.POINTERMOVE, function(event) {
            var x = Math.round(event.gameScreenX);
            var y = Math.round(event.gameScreenY);
            self.font.pos.set(x, y - self.font.height, self.font.pos.z);
            self.font.setText( "( " + x + "," + y + " )");
        });

    }
1108882
function (levels, fn) {
    return function (label, val) {
        for (var i = 0; i < levels.length; i++) {
            if (levels[i] === exports.level) {
                return fn(label, val);
            }
        }
    };
}