text:
namespace Microsoft.Azure.Management.DataFactory.Models
{
    using Newtonsoft.Json;
    using System.Linq;

    /// <summary>
    /// Power query sink.
    /// </summary>
    public partial class PowerQuerySink : DataFlowSink
    {
        /// <summary>
        /// Initializes a new instance of the PowerQuerySink class.
        /// </summary>
        public PowerQuerySink()
        {
            CustomInit();
        }

        /// <summary>
        /// Initializes a new instance of the PowerQuerySink class.
        /// </summary>
        /// <param name="name">Transformation name.</param>
        /// <param name="description">Transformation description.</param>
        /// <param name="dataset">Dataset reference.</param>
        /// <param name="linkedService">Linked service reference.</param>
        /// <param name="flowlet">Flowlet Reference</param>
        /// <param name="schemaLinkedService">Schema linked service
        /// reference.</param>
        /// <param name="rejectedDataLinkedService">Rejected data linked
        /// service reference.</param>
        /// <param name="script">sink script.</param>
        public PowerQuerySink(string name, string description = default(string), DatasetReference dataset = default(DatasetReference), LinkedServiceReference linkedService = default(LinkedServiceReference), DataFlowReference flowlet = default(DataFlowReference), LinkedServiceReference schemaLinkedService = default(LinkedServiceReference), LinkedServiceReference rejectedDataLinkedService = default(LinkedServiceReference), string script = default(string))
            : base(name, description, dataset, linkedService, flowlet, schemaLinkedService, rejectedDataLinkedService)
        {
            Script = script;
            CustomInit();
        }

        /// <summary>
        /// An initialization method that performs custom operations like setting defaults
        /// </summary>
        partial void CustomInit();

        /// <summary>
        /// Gets or sets sink script.
        /// </summary>
        [JsonProperty(PropertyName = "script")]
        public string Script { get; set; }

        /// <summary>
        /// Validate the object.
        /// </summary>
        /// <exception cref="Rest.ValidationException">
        /// Thrown if validation fails
        /// </exception>
        public override void Validate()
        {
            base.Validate();
        }
    }
}


text:
import React from 'react'
import { Route, IndexRoute } from 'react-router'

// NOTE: here we're making use of the `resolve.root` configuration
// option in webpack, which allows us to specify import paths as if
// they were from the root of the ~/src directory. This makes it
// very easy to navigate to files regardless of how deeply nested
// your current file is.
import CoreLayout from 'layouts/CoreLayout'
import AboutView from 'views/AboutView'
import ContactView from 'views/ContactView'
import CriteriaView from 'views/CriteriaView'
import StatsView from 'views/StatsView'

export default (
  <Route path='/' component={CoreLayout}>
    <IndexRoute component={CriteriaView} />
    <Route path='/about' component={AboutView} />
    <Route path='/contact' component={ContactView} />
    <Route path='/stats' component={StatsView} />
  </Route>
)

redpajama_set_name: RedPajamaGithub


text:
// ============================================================================
//
// Copyright (C) 2006-2015 Talend Inc. - www.talend.com
//
// This source code is available under agreement available at
// %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt
//
// You should have received a copy of the agreement
// along with this program; if not, write to Talend SA
// 9 rue Pages 92150 Suresnes, France
//
// ============================================================================
package org.talend.daikon.exception.error;

import java.io.Serializable;
import java.util.Collection;

/**
 * An error code uniquely describes an error condition (for reference, documentation, UI, etc).
 */
public interface ErrorCode extends Serializable {

    /**
     * @return the product used for the error message... Hum... TDP ? ;-)
     */
    String getProduct();

    /**
     * @return the group this message belongs to (API, DATASET, PREPARATION...)
     */
    String getGroup();

    /**
     * @return the http status to return.
     */
    int getHttpStatus();

    /**
     * @return the expected context entries if any.
     */
    Collection<String> getExpectedContextEntries();

    /**
     * @return the full code for this message.
     */
    String getCode();

}


text:
package com.cool.alipay.apis;

import com.alipay.api.response.AlipayDataDataserviceBillDownloadurlQueryResponse;
import com.cool.alipay.req.BillContent;
import com.cool.alipay.req.DefaultAlipayClientReq;

public interface AlipayBillService {
	public AlipayDataDataserviceBillDownloadurlQueryResponse billRequest(DefaultAlipayClientReq req,BillContent billContent);
}


text:
package ru.r2cloud.jradio.selfiesat;

public enum ObcState {

	IDLE(0), SAFE(1), UNKNOWN(255);

	private final int code;

	private ObcState(int code) {
		this.code = code;
	}

	public static ObcState valueOfCode(int code) {
		for (ObcState cur : values()) {
			if (cur.code == code) {
				return cur;
			}
		}
		return UNKNOWN;
	}
}


text:
cask 'parallels-virtualization-sdk' do
  version '12.2.0-41591'
  sha256 '7294fb05e5750025acecde57fb516170c266bb437a42cfea626f79b2bbb8bfd1'

  url "https://download.parallels.com/desktop/v#{version.major}/#{version}/ParallelsVirtualizationSDK-#{version}-mac.dmg"
  name 'Parallels Virtualization SDK'
  homepage 'https://www.parallels.com/products/desktop/download/'

  pkg 'Parallels Virtualization SDK.pkg'

  uninstall pkgutil: 'com.parallels.pkg.sdk'
end


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <array name="pref_textSize_entries">
        <item>@string/pref_textSize_item_small</item>
        <item>@string/pref_textSize_item_medium</item>
        <item>@string/pref_textSize_item_large</item>
    </array>
    <array name="pref_textSize_values">
        <item>@string/pref_textSize_item_small</item>
        <item>@string/pref_textSize_item_medium</item>
        <item>@string/pref_textSize_item_large</item>
    </array>
    <array name="pref_typeface_entries">
        <item>@string/pref_typeface_roboto</item>
        <item>@string/pref_typeface_notoSerif</item>
    </array>
    <array name="pref_typeface_values">
        <item>@string/pref_typeface_roboto</item>
        <item>@string/pref_typeface_notoSerif</item>
    </array>
</resources>


text:
Christos Varoufakis

Web Designer, Eroticist and Spy

<md-icon md-font-icon="icon-location-on color-inherit"></md-icon>Athens, Greece

<md-tabs md-dynamic-height md-border-bottom class="tabs-tall">
    <md-tab>
        <md-tab-label layout="column">
            Tweets
            11.4K
        </md-tab-label>
        <md-tab-body>

                <widget layout-margin flex="50" flex-sm="100" avatar="assets/images/avatars/avatar-5.png" palette-background="blue:800" title="Christos Varoufakis" subtitle="@christos - 11h" title-position="top">

                        Don't miss it! A Material Design Avatar set with 1440 avatars! http://sellfy.com/p/EUcC/ #avatars #materialdesign

                </widget>

                    <widget layout-margin flex palette-background="blue:500" avatar="assets/images/avatars/avatar-2.png" title="Kate Smith" subtitle="@christos - 12h" title-position="top">

                            Got some awesome news! C-3PO 1.1.2 our new #AngularJS admin template is out now!  FAB Speed Dial & FAB Toolbar added. Enjoy!

                    </widget>
                    <widget layout-margin flex palette-background="light-blue:500" avatar="assets/images/avatars/avatar-6.png" title="Jane Smith" subtitle="@christos - 14h" title-position="top">

                            Don't miss our latest Angular Material Design Admin Template: http://goo.gl/0Yxm1U  #angularJS #material #webdesign

                    </widget>
                    <widget layout-margin flex palette-background="cyan:500" avatar="assets/images/avatars/avatar-5.png" title="Christos Varoufakis" subtitle="@christos - 16h" title-position="top">

                            New Freebie! Material Design Image fonts! In high res png's http://goo.gl/j1fWZz  #MaterialDesign #webdesign

                    </widget>

                <widget layout-margin flex palette-background="indigo:500" avatar="assets/images/avatars/avatar-1.png" title="Manos Proistakis" subtitle="@christos - 16h" title-position="top">

                        Don't miss our latest Angular Material Design Admin Template: http://goo.gl/0Yxm1U  #angularJS #material #webdesign

                </widget>
                <widget layout-margin flex palette-background="deep-purple:500" avatar="assets/images/avatars/avatar-4.png" title="Despoina" subtitle="@christos - 16h" title-position="top">

                        New Freebie! Material Design Image fonts! In high res png's http://goo.gl/j1fWZz  #MaterialDesign #webdesign

                </widget>
                <widget layout-margin flex palette-background="purple:500" avatar="assets/images/avatars/avatar-1.png" title="Manos Proistakis" subtitle="@christos - 16h" title-position="top">

                        C-3PO 1.1.2 our new #AngularJS admin template is out now!  FAB Speed Dial & FAB Toolbar added. Enjoy!

                </widget>

        </md-tab-body>
    </md-tab>
    <md-tab>
        <md-tab-label layout="column">
            Following
            3,220
        </md-tab-label>
        <md-tab-body>

                <widget class="widget-follower" flex content-layout="column" content-layout-align="center top">

John

@morris

Senior Software Test Engineer at Progressive, Indie Game Developer, Cleveland Game Devs member, a cyberpunk before it was cool & a geek Dad.

                </widget>
                <widget class="widget-follower" flex content-layout="column" content-layout-align="center top">

Sam Cook

@scook

Intermediary acquisition customer-facing return on investment customer-facing conscientious outsourcing incrementally increasing sales experienced and confident.

                </widget>
                <widget class="widget-follower" flex content-layout="column" content-layout-align="center top">

Manos proistakis

@proistak

Recruiting key personnel effective management and mentoring of the team acquiring new clients maximised returns in short time frame.

                </widget>

                <widget class="widget-follower" flex content-layout="column" content-layout-align="center top">

Jane Onions

@morris

Entrepreneurial, brand strategy key relationship management cross-functional; handling customer complaints. Preparing financial data going to the cinema dynamic self starter easy to work with.

                </widget>
                <widget class="widget-follower" flex content-layout="column" content-layout-align="center top">

Christine Jackson

@scook

Presenting to senior management streamlined operations outside the box. Incrementally increasing sales customer-centric, commercially minded increased revenue customer-facing.

                </widget>
                <widget class="widget-follower" flex content-layout="column" content-layout-align="center top">

John Langan

@proistak

Recruiting key personnel effective management and mentoring of the team acquiring new clients maximised returns in short time frame.

                </widget>

        </md-tab-body>
    </md-tab>
    <md-tab>
        <md-tab-label layout="column">
            Favorites
            578
        </md-tab-label>
        <md-tab-body>

                <widget flex="70" flex-sm="100" title="Favorites" content-layout="column" content-layout-align="center top"  layout-margin>
                    <md-divider></md-divider>
                    <md-list>
                        <md-list-item class="md-3-line" ng-repeat="fave in favorites">

                                        {{fave.name}}
                                        @{{fave.user}}

{{fave.tweet}}

                            <md-divider></md-divider>
                        </md-list-item>
                    </md-list>
                </widget>

                    <widget flex title="Who to follow" content-layout="column" content-layout-align="center top" palette-background="cyan:500" layout-margin>
                        <md-divider></md-divider>
                        <md-list>
                            <md-list-item class="md-2-line" ng-repeat="follow in whotofollow">

{{follow.name}}

@{{follow.user}}

                                    <md-icon md-font-icon="icon-person-add" ng-click="doSecondaryAction($event)" class="md-secondary md-hue-3"></md-icon>

                                <md-divider ng-hide="$last"></md-divider>
                            </md-list-item>
                        </md-list>
                    </widget>
                    <widget flex title="Trends" content-layout="column" content-layout-align="center top" palette-background="cyan:500" layout-margin>
                        <md-divider></md-divider>
                        <md-list>
                            <md-list-item ng-repeat="trend in trends">

{{trend}}

                                <md-divider ng-hide="$last"></md-divider>
                            </md-list-item>

                    </widget>

        </md-tab-body>
    </md-tab>
</md-tabs>


text:
/*jshint globalstrict:false, strict:false, maxlen: 7000 */
/*global assertEqual, assertTrue, assertFalse, AQL_EXPLAIN */

////////////////////////////////////////////////////////////////////////////////
/// @brief tests for index selection
///
/// DISCLAIMER
///
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
///
/// Licensed under the Apache License, Version 2.0 (the "License");
/// you may not use this file except in compliance with the License.
/// You may obtain a copy of the License at
///
///     http://www.apache.org/licenses/LICENSE-2.0
///
/// Unless required by applicable law or agreed to in writing, software
/// distributed under the License is distributed on an "AS IS" BASIS,
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
/// See the License for the specific language governing permissions and
/// limitations under the License.
///
/// Copyright holder is triAGENS GmbH, Cologne, Germany
///
/// @author Jan Steemann
/// @author Copyright 2012, triAGENS GmbH, Cologne, Germany
////////////////////////////////////////////////////////////////////////////////

const jsunity = require("jsunity");
const db = require("internal").db;
const deriveTestSuite = require('@arangodb/test-helper').deriveTestSuite;
const cn = 'UnitTestsCollection';

let setupCollection = function(cn, n) {
  db._drop(cn);
  let c = db._create(cn);
  let docs = [];
  for (let i = 0; i < n; ++i) {
    docs.push({ _key: "test" + i, uid: i, pid: (i % 100), dt: Date.now() - ((i * 10) % 10000), other: i });
    if (docs.length === 5000) {
      c.insert(docs);
      docs = [];
    }
  }
  if (docs.length) {
    c.insert(docs);
  }
};

function BaseTestConfig () {
  let resetIndexes = function(cn) {
    db[cn].indexes().filter((idx) => idx.type !== 'primary').forEach((idx) => {
      db[cn].dropIndex(idx);
    });
  };

  return {
    tearDownAll : function() {
      db._drop(cn);
    },

    setUp: function() {
      resetIndexes(cn);
    },

    tearDown: function() {
      resetIndexes(cn);
    },

    testManyIndexesWithPrefixes: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other2"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other3", "other4", "other5"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other3", "other4"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other6", "other4", "other5"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other6", "other4"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["other5", "uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other6", "pid", "other5"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other6", "pid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["pid", "dt", "uid", "other4"] });

      [
        [ `FOR doc IN ${cn} FILTER doc.pid == 1234 FILTER doc.dt == 1234 FILTER doc.uid == 1234 RETURN doc`, ["pid", "dt", "uid", "other4"] ],
        [ `FOR doc IN ${cn} FILTER doc.pid == 1234 FILTER doc.dt == 1234 FILTER doc.uid == 1234 SORT doc.other5 RETURN doc`, ["pid", "dt", "uid", "other4"] ],
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q[0]).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(q[1], index.fields, q);
      });
    },

    testIndexPrefixes: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["pid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["pid", "dt"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "pid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "pid", "dt"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "pid", "dt"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["dt", "other"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "other", "pid"] });

      [
        [ `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN doc`, ["uid", "pid", "dt"] ],
        [ `FOR doc IN ${cn} FILTER doc.pid == 1234 RETURN doc`, ["pid", "dt"] ],
        [ `FOR doc IN ${cn} FILTER doc.pid == 1234 && doc.uid == 1234 RETURN doc`, ["uid", "pid", "dt"] ],
        [ `FOR doc IN ${cn} FILTER doc.pid == 1234 && doc.dt == 1234 RETURN doc`, ["pid", "dt"] ],
        [ `FOR doc IN ${cn} FILTER doc.pid == 1234 && doc.dt == 1234 && doc.uid == 1234 RETURN doc`, ["uid", "pid", "dt"] ],
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q[0]).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(q[1], index.fields, q);
      });
    },

    testSingleIndexSingleFilter: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testSingleIndexSingleFilterAndProjection: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 RETURN doc.uid`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["uid"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testMultipleIndexesSingleFilter: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        // the optimizer does not know about projections when selecting the index,
        // so it always picks the "longer" of the 2 indexes here in case everything
        // else is equal
        assertEqual(["uid", "dt"], index.fields);
      });
    },

    testMultipleIndexesSingleFilterAndProjection: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 RETURN doc.uid`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["uid"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        // the optimizer does not know about projections when selecting the index,
        // so it always picks the "longer" of the 2 indexes here in case everything
        // else is equal
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 RETURN doc.dt`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        // the optimizer does not know about projections when selecting the index,
        // so it always picks the "longer" of the 2 indexes here in case everything
        // else is equal
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 RETURN [doc.dt, doc.uid]`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 RETURN [doc.dt, doc.uid]`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 RETURN [doc.dt, doc.uid]`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt", "uid"], indexNode.projections.sort());
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        // the optimizer does not know about projections when selecting the index,
        // so it always picks the "longer" of the 2 indexes here in case everything
        // else is equal
        assertEqual(["uid", "dt"], index.fields);
      });
    },

    testSingleIndexMultipleFilters: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testSingleIndexMultipleFiltersAndProjection: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN doc.uid`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertTrue(["uid"], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN doc.dt`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt"], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testMultipleIndexesMultipleFilters: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });
    },

    testMultipleIndexesMultipleFiltersAndProjection: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN doc.uid`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN doc.uid`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["uid"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN doc.dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN doc.dt`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 RETURN [doc.dt, doc.uid]`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt", "uid"], indexNode.projections.sort());
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 RETURN [doc.dt, doc.uid]`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 RETURN [doc.dt, doc.uid]`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt <= 9999 RETURN [doc.dt, doc.uid]`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt", "uid"], indexNode.projections.sort());
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });
    },

    testSingleIndexSingleFilterAndSort1: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 SORT doc.dt RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(1, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testSingleIndexSingleFilterAndSort2: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid > 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 SORT doc.uid RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testMultipleIndexesSingleFilterAndSort: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 SORT doc.dt RETURN doc`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid > 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 SORT doc.dt RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(1, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });
    },

    testMultipleIndexesMultipleFiltersAndSort: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.dt == 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.dt >= 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.dt <= 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.dt >= 1234 && doc.dt < 9999 SORT doc.uid RETURN doc`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt == 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt <= 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 && doc.dt >= 1234 && doc.dt < 9999 SORT doc.dt RETURN doc`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.uid > 1234 && doc.dt == 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 && doc.dt >= 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 && doc.dt <= 1234 SORT doc.dt RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.uid >= 1234 && doc.dt >= 1234 && doc.dt < 9999 SORT doc.dt RETURN doc`
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(1, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
      });
    },

    testMultipleIndexesFiltersAndSort: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.dt == 1234 SORT doc.uid RETURN doc`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(1, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["dt"], index.fields);
      });

      [
        `FOR doc IN ${cn} FILTER doc.dt >= 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.dt <= 1234 SORT doc.uid RETURN doc`,
        `FOR doc IN ${cn} FILTER doc.dt >= 1234 && doc.dt < 9999 SORT doc.uid RETURN doc`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual([], indexNode.projections);
        assertFalse(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid"], index.fields);
      });
    },

    testSortedCollect: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["dt"] });

      [
        `FOR doc IN ${cn} COLLECT dt = doc.dt RETURN dt`,
        `FOR doc IN ${cn} FILTER doc.dt == 1234 COLLECT dt = doc.dt RETURN dt`,
        `FOR doc IN ${cn} SORT doc.dt COLLECT dt = doc.dt RETURN dt`,
        `FOR doc IN ${cn} FILTER doc.dt == 1234 SORT doc.dt COLLECT dt = doc.dt RETURN dt`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["dt"], index.fields);
        let collectNode = nodes.filter((n) => n.type === 'CollectNode')[0];
        assertEqual("sorted", collectNode.collectOptions.method);
      });
    },

    testSortedCollectMultipleIndexes: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["dt"] });
      db[cn].ensureIndex({ type: "persistent", fields: ["uid", "dt"] });

      [
        `FOR doc IN ${cn} FILTER doc.uid == 1234 COLLECT dt = doc.dt RETURN dt`,
        `FOR doc IN ${cn} FILTER doc.uid == 1234 SORT doc.dt COLLECT dt = doc.dt RETURN dt`,
      ].forEach((q) => {
        let nodes = AQL_EXPLAIN(q).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        assertEqual(0, nodes.filter((n) => n.type === 'SortNode').length);
        let indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(["dt"], indexNode.projections);
        assertTrue(indexNode.indexCoversProjections);
        assertEqual(1, indexNode.indexes.length);
        let index = indexNode.indexes[0];
        assertEqual("persistent", index.type);
        assertEqual(["uid", "dt"], index.fields);
        let collectNode = nodes.filter((n) => n.type === 'CollectNode')[0];
        assertEqual("sorted", collectNode.collectOptions.method);
      });
    },

    testSingleFilterUpperAndLowerBound: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      [
        `
          FOR doc IN ${cn}
            LET lowerBound = 1
            LET upperBound = 100
            FILTER doc.uid >= lowerBound AND doc.uid <= upperBound
            RETURN doc
        `,
        `
          FOR doc IN ${cn}
            LET lowerBound = 1
            LET upperBound = 100
            FILTER lowerBound <= doc.uid AND upperBound >= doc.uid
            RETURN doc
        `,
        `
          FOR src IN [{uid: 123}, {uid: 124}]
            LET upperBound = src.uid + 100
            FOR dst IN ${cn}
              FILTER dst.uid >= src.uid AND dst.uid <= upperBound
              RETURN { src, dst }
        `
      ].forEach((q) => {
        const nodes = AQL_EXPLAIN(q, {},
          { optimizer: { rules: ["-interchange-adjacent-enumerations", "-move-filters-into-enumerate"] }}).plan.nodes;
        assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
        const indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
        assertEqual(1, indexNode.condition.subNodes.length);
        assertEqual("n-ary and", indexNode.condition.subNodes[0].type);
        // index covers both conditions
        assertEqual(2, indexNode.condition.subNodes[0].subNodes.length);
        // since the index covers all conditions, the filter should be completely removed
        assertEqual(0, nodes.filter((n) => n.type === 'FilterNode').length);
      });
    },

    testSingleFilterUpperAndLowerBoundWithRedunantCondition: function() {
      db[cn].ensureIndex({ type: "persistent", fields: ["uid"] });
      // generate the cross product of the given arrays
      const product = (...a) => a.reduce((a, b) => a.flatMap(d => b.map(e => [d, e].flat())));
      // generate a list of all permutations of the given array
      const perm = a => a.length
        ? a.reduce((r, v, i) => [...r, ...perm([...a.slice(0, i), ...a.slice(i + 1)]).map(x => [v, ...x])], [])
        : [[]];

      // lowerBound = 10
      // upperBound = 100
      const lowerBound = ["doc.uid >= lowerBound", "lowerBound <= doc.uid"];
      const upperBound = ["doc.uid <= upperBound", "upperBound >= doc.uid"];
      const bounds = product(lowerBound, upperBound);
      [
        // TODO - the commented cases currently do not work correctly.
        // The optimizer picks the wrong (weaker) bound and keeps an additional filter for
        // the stronger bound. The problem is Condition::optimize which does not properly
        // handle these scenarios, but this needs to be fixed in a separate PR.
        [["doc.uid > 5", "5 < doc.uid"], ">=", 10, "<=", 100],
        [["doc.uid >= 5", "5 <= doc.uid"], ">=", 10, "<=", 100],
        [["doc.uid > 42", "42 < doc.uid"], ">", 42, "<=", 100],
        //[["doc.uid >= 42", "42 <= doc.uid"], ">=", 42, "<=", 100],
        [["doc.uid < 42", "42 > doc.uid"], ">=", 10, "<", 42],
        //[["doc.uid <= 42", "42 >= doc.uid"], ">=", 10, "<=", 42],
        //[["doc.uid < 1234", "1234 > doc.uid"], ">=", 10, "<=", 100],
        //[["doc.uid <= 1234", "1234 >= doc.uid"], ">=", 10, "<=", 100],
        [["doc.uid != 5"], ">=", 10, "<=", 100],
        [["doc.uid != 1234"], ">=", 10, "<=", 100],
        [product(["doc.uid > 20", "20 < doc.uid"],  ["doc.uid < 90", "90 > doc.uid"]), ">", 20, "<", 90],
        //[product(["doc.uid >= 20", "20 <= doc.uid"],  ["doc.uid <= 90", "90 >= doc.uid"]), ">=", 20, "<=", 90],
      ].forEach(([filters, lbOp, lb, ubOp, ub]) => {
        product(bounds, filters)
          .map(list => perm(list.flat()))
          .flat(1)
          .forEach(filter => {
            const q = `
                FOR doc IN ${cn}
                  LET lowerBound = 10
                  LET upperBound = 100
                  FILTER ${filter.join(" AND ")}
                  RETURN doc
              `;
            const nodes = AQL_EXPLAIN(q, {}, { optimizer: { rules: ["-move-filters-into-enumerate"] }}).plan.nodes;
            assertEqual(1, nodes.filter((n) => n.type === 'IndexNode').length);
            const indexNode = nodes.filter((n) => n.type === 'IndexNode')[0];
            assertEqual(1, indexNode.condition.subNodes.length);
            assertEqual("n-ary and", indexNode.condition.subNodes[0].type);
            // index covers both conditions, so both conditions should be present in the index node
            assertEqual(2, indexNode.condition.subNodes[0].subNodes.length);
            const conds = indexNode.condition.subNodes[0].subNodes;
            assertEqual("compare " + lbOp, conds[0].type);
            assertEqual(lb, conds[0].subNodes[1].value);
            assertEqual("compare " + ubOp, conds[1].type);
            assertEqual(ub, conds[1].subNodes[1].value);
            // since the index covers all conditions, the filter should be completely removed
            assertEqual(0, nodes.filter((n) => n.type === 'FilterNode').length);
          });
      });
    },
  };
}

function aqlIndexChoiceMiniCollectionSuite () {
  'use strict';

  let suite = {
    setUpAll: function() {
      setupCollection(cn, 100);
    },
  };

  deriveTestSuite(BaseTestConfig(), suite, '_MiniCollectionSuite');
  return suite;
}

function aqlIndexChoiceSmallCollectionSuite () {
  'use strict';

  let suite = {
    setUpAll: function() {
      setupCollection(cn, 5000);
    },
  };

  deriveTestSuite(BaseTestConfig(), suite, '_SmallCollectionSuite');
  return suite;
}

function aqlIndexChoiceMediumCollectionSuite () {
  'use strict';

  let suite = {
    setUpAll: function() {
      setupCollection(cn, 50000);
    },
  };

  deriveTestSuite(BaseTestConfig(), suite, '_MediumCollectionSuite');
  return suite;
}

function aqlIndexChoiceLargeCollectionSuite () {
  'use strict';

  let suite = {
    setUpAll: function() {
      setupCollection(cn, 150000);
    },
  };

  deriveTestSuite(BaseTestConfig(), suite, '_LargeCollectionSuite');
  return suite;
}

jsunity.run(aqlIndexChoiceMiniCollectionSuite);
jsunity.run(aqlIndexChoiceSmallCollectionSuite);
jsunity.run(aqlIndexChoiceMediumCollectionSuite);
jsunity.run(aqlIndexChoiceLargeCollectionSuite);

return jsunity.done();


text:
'use strict';

// mocha defines to avoid JSHint breakage
/* global describe, it, before, beforeEach, after, afterEach */

var assert = require('../../utils/assert.js');
var server = require('../../utils/server.js');
var preq   = require('preq');
var P = require('bluebird');
var handlerTemplate = require('../../../lib/handlerTemplate');

describe('handler template', function () {
    this.timeout(20000);

    before(function () { return server.start(); });

    // A test page that includes the current date, so that it changes if
    // re-rendered more than a second apart.
    var testPage = server.config.baseURL + '/service/test/User:GWicke%2fDate';

    function hasTextContentType(res) {
        assert.contentType(res, 'text/html');
    }

    var slice;

    it('retrieve content from backend service', function () {
        var tid1;
        var tid2;
        return preq.get({
            uri: testPage
        })
        .then(function (res) {
            assert.deepEqual(res.status, 200);
            tid1 = res.headers.etag;
            hasTextContentType(res);

            // Delay for 1s to make sure that the content differs on
            // re-render, then force a re-render and check that it happened.
            slice = server.config.logStream.slice();
            return P.delay(1100)
            .then(function() {
                return preq.get({
                    uri: testPage,
                    headers: { 'cache-control': 'no-cache' }
                });
            });
        })
        .then(function (res) {
            tid2 = res.headers.etag;
            assert.notDeepEqual(tid2, tid1);
            assert.notDeepEqual(tid2, undefined);
            hasTextContentType(res);
            slice.halt();
            assert.remoteRequests(slice, true);
            // delay for 1s to let the content change on re-render
            slice = server.config.logStream.slice();

            // Check retrieval of a stored render
            return P.delay(1100)
            .then(function() {
                return preq.get({
                    uri: testPage,
                });
            });
        })
        .then(function (res) {
            var tid3 = res.headers.etag;
            assert.deepEqual(tid3, tid2);
            assert.notDeepEqual(tid3, undefined);
            // Check that there were no remote requests
            slice.halt();
            assert.remoteRequests(slice, false);
            hasTextContentType(res);
        });
    });

    function testValidation(action, expectedError) {
        var caught;
        try {
            action();
        } catch (e) {
            caught = true;
            assert.deepEqual(expectedError.test(e.message), true);
        }
        if (!caught) {
            throw new Error('Error should be thrown');
        }
    }

    it('validates config: checks parallel returning requests', function() {
        testValidation(function() {
            handlerTemplate.createHandler([{
                get_one: {
                    request: {
                        uri: 'http://en.wikipedia.org/wiki/One'
                    },
                    return: '{$.get_one}'
                },
                get_two: {
                    request: {
                        uri: 'http://en.wikipedia.org/wiki/Two'
                    },
                    return: '{$.get_two}'
                }
            }]);
        }, /^Invalid spec\. Returning requests cannot be parallel\..*/);
    });

    it('validates config: requires either return or request', function() {
        testValidation(function() {
            handlerTemplate.createHandler([{
                get_one: {}
            }]);
        }, /^Invalid spec\. Either request or return must be specified\..*/);
    });

    it('validates config: compiles a valid condition function', function() {
        handlerTemplate.createHandler([{
            get_one: {
                request: {
                    uri: '/my/path'
                },
                return_if: {
                    status: '5xx'
                },
                return: '{$.request}'
            }
        }]);
    });

    it('validates config: requires request for return_if', function() {
        testValidation(function() {
            handlerTemplate.createHandler([{
                get_one: {
                    return_if: {
                        status: '5xx'
                    },
                    return: '$.request'
                }
            }]);
        }, /^Invalid spec\. return_if should have a matching request\..*/);
    });

    it('validates config: requires request for catch', function() {
        testValidation(function() {
            handlerTemplate.createHandler([{
                get_one: {
                    catch: {
                        status: '5xx'
                    },
                    return: '$.request'
                }
            }]);
        }, /^Invalid spec\. catch should have a matching request\..*/);
    });
});


text:
It's hard to tell someone to throw away work they've done already, it's easy to
tell them beforehand there's already a solution to their problem and they don't
need to write a PR.

# Other rules

There's a couple. They're not even really rules, more just telling you what you
can expect.

* Issues are ALWAYS welcome, whether or not you think it's a dumb question or
  it's been asked before. I make a very real attempt to respond to all issues in
  24 hours. You can email me directly if I don't make this deadline.

* Pull requests for small bug fixes have the same rules as issues, just submit
  it and I'll get to it ASAP.

* The API never breaks. All PRs which aren't backwards compatible will not be
  accepted. Similarly, if I do commit something which isn't backwards compatible
  with an older behavior please submit an issue ASAP so I can fix it.


text:
'use strict';

angular.module('aquilaApp')
    .controller('ClaimCaseController', function ($scope, ClaimCase, Employer, ParseLinks) {
        $scope.claimCases = [];
        $scope.employers = Employer.query();
        $scope.page = 1;
        $scope.loadAll = function() {
            ClaimCase.query({page: $scope.page, per_page: 20}, function(result, headers) {
                $scope.links = ParseLinks.parse(headers('link'));
                $scope.claimCases = result;
            });
        };
        $scope.loadPage = function(page) {
            $scope.page = page;
            $scope.loadAll();
        };
        $scope.loadAll();

        $scope.create = function () {
            ClaimCase.update($scope.claimCase,
                function () {
                    $scope.loadAll();
                    $('#saveClaimCaseModal').modal('hide');
                    $scope.clear();
                });
        };

        $scope.update = function (id) {
            ClaimCase.get({id: id}, function(result) {
                $scope.claimCase = result;
                $('#saveClaimCaseModal').modal('show');
            });
        };

        $scope.delete = function (id) {
            ClaimCase.get({id: id}, function(result) {
                $scope.claimCase = result;
                $('#deleteClaimCaseConfirmation').modal('show');
            });
        };

        $scope.confirmDelete = function (id) {
            ClaimCase.delete({id: id},
                function () {
                    $scope.loadAll();
                    $('#deleteClaimCaseConfirmation').modal('hide');
                    $scope.clear();
                });
        };

        $scope.clear = function () {
            $scope.claimCase = {legacyCaseNumber: null, id: null};
            $scope.editForm.$setPristine();
            $scope.editForm.$setUntouched();
        };
    });


text:
package javax.xml.ws.spi;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

import javax.xml.ws.WebServiceContext;

/**
 * @since 2.2
 */
public abstract class Invoker {
    /**
     *
     */
    public abstract void inject(WebServiceContext webServiceContext)
        throws IllegalAccessException,
        IllegalArgumentException,
        InvocationTargetException;

    /**
     *
     */
    public abstract Object invoke(Method m, Object ... args)
        throws IllegalAccessException,
            IllegalArgumentException,
            InvocationTargetException;

}


text:
<?php
        /*
         * Start a channel on a queuemanager
         */

        if ( count($argv) < 3 ) {
                echo 'Please pass a queuemanager name and channelname as argument', PHP_EOL;
                exit;
        }
        $qmgr = $argv[1];
        $channel = $argv[2];

        $url = "http://localhost:8081/api/channel/start/$qmgr/$channel";

        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL, $url);
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);

        if ( ($response = curl_exec($curl) ) === false ) {
                $err = curl_error($curl);
                echo "An HTTP error occurred while starting channel $channel: $err\n";
        }
        else {
                $json = json_decode($response);
                if ( isset($json->error) ) {
                        echo "An MQ error occurred while starting channel $channel.\n";
                        echo "Reason Code: {$json->error->reason->code} - {$json->error->reason->desc}\n";
                }
                else {
                        echo "Channel $channel started.\n";
                }
        }


text:
package org.owasp.dependencycheck.utils;

import java.io.FileInputStream;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import java.security.KeyManagementException;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.TrustManagerFactory;
import org.apache.commons.lang3.StringUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * TODO - is this class needed anymore as we do not support Java 6 and 7.
 *
 * This class is used to enable additional ciphers used by the SSL Socket. This
 * is specifically because the NVD stopped supporting TLS 1.0 and Java 6 and 7
 * clients by default were unable to connect to download the NVD data feeds.
 *

 * The following code was copied from
 * http://stackoverflow.com/questions/1037590/which-cipher-suites-to-enable-for-ssl-socket/23365536#23365536
 *
 * @author jww
 * @version $Id: $Id
 */
public class SSLSocketFactoryEx extends SSLSocketFactory {

    /**
     * The Logger for use throughout the class.
     */
    private static final Logger LOGGER = LoggerFactory.getLogger(SSLSocketFactoryEx.class);

    /**
     * The SSL context.
     */
    private SSLContext sslCtxt;
    /**
     * The protocols.
     */
    private String[] protocols;
    /**
     * The configured settings.
     */
    private final Settings settings;

    /**
     * Simple boolean flag to prevent logging the protocols repeatedly.
     */
    private static boolean protocolsLogged = false;

    /**
     * Constructs a new SSLSocketFactory.
     *
     * @param settings reference to the configured settings
     * @throws java.security.NoSuchAlgorithmException thrown when an algorithm
     * is not supported
     * @throws java.security.KeyManagementException thrown if initialization
     * fails
     */
    public SSLSocketFactoryEx(Settings settings) throws NoSuchAlgorithmException, KeyManagementException {
        this.settings = settings;
        final KeyManager[] km = getKeyManagers();
        final TrustManager[] tm = getTrustManagers();

        initSSLSocketFactoryEx(km, tm, null);
    }

    /**
     * Constructs a new SSLSocketFactory.
     *
     * @param km the key manager
     * @param tm the trust manager
     * @param random secure random
     * @param settings reference to the configured settings
     * @throws java.security.NoSuchAlgorithmException thrown when an algorithm
     * is not supported
     * @throws java.security.KeyManagementException thrown if initialization
     * fails
     */
    public SSLSocketFactoryEx(KeyManager[] km, TrustManager[] tm, SecureRandom random, Settings settings)
            throws NoSuchAlgorithmException, KeyManagementException {
        this.settings = settings;
        initSSLSocketFactoryEx(km, tm, random);
    }

    /**
     * Constructs a new SSLSocketFactory.
     *
     * @param ctx the SSL context
     * @param settings reference to the configured settings
     * @throws java.security.NoSuchAlgorithmException thrown when an algorithm
     * is not supported
     * @throws java.security.KeyManagementException thrown if initialization
     * fails
     */
    public SSLSocketFactoryEx(SSLContext ctx, Settings settings) throws NoSuchAlgorithmException, KeyManagementException {
        this.settings = settings;
        initSSLSocketFactoryEx(ctx);
    }

    /**
     * {@inheritDoc}
     *

     * Returns the default cipher suites.
     */
    @Override
    public String[] getDefaultCipherSuites() {
        return sslCtxt.getSocketFactory().getDefaultCipherSuites();
    }

    /**
     * {@inheritDoc}
     *

     * Returns the supported cipher suites.
     */
    @Override
    public String[] getSupportedCipherSuites() {
        return sslCtxt.getSocketFactory().getSupportedCipherSuites();
    }

    /**
     * Returns the default protocols.
     *
     * @return the default protocols
     */
    public String[] getDefaultProtocols() {
        return Arrays.copyOf(protocols, protocols.length);
    }

    /**
     * Returns the supported protocols.
     *
     * @return the supported protocols
     */
    public String[] getSupportedProtocols() {
        return Arrays.copyOf(protocols, protocols.length);
    }

    /**
     * {@inheritDoc}
     *

     * Creates an SSL Socket.
     */
    @Override
    public Socket createSocket(Socket s, String host, int port, boolean autoClose) throws IOException {
        final SSLSocketFactory factory = sslCtxt.getSocketFactory();
        final SSLSocket ss = (SSLSocket) factory.createSocket(s, host, port, autoClose);

        ss.setEnabledProtocols(protocols);

        return ss;
    }

    /**
     * {@inheritDoc}
     *

     * Creates a new SSL Socket.
     */
    @Override
    public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException {
        final SSLSocketFactory factory = sslCtxt.getSocketFactory();
        final SSLSocket ss = (SSLSocket) factory.createSocket(address, port, localAddress, localPort);

        ss.setEnabledProtocols(protocols);

        return ss;
    }

    /**
     * {@inheritDoc}
     *

     * Creates a new SSL Socket.
     */
    @Override
    public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException {
        final SSLSocketFactory factory = sslCtxt.getSocketFactory();
        final SSLSocket ss = (SSLSocket) factory.createSocket(host, port, localHost, localPort);

        ss.setEnabledProtocols(protocols);

        return ss;
    }

    /**
     * {@inheritDoc}
     *

     * Creates a new SSL Socket.
     */
    @Override
    public Socket createSocket(InetAddress host, int port) throws IOException {
        final SSLSocketFactory factory = sslCtxt.getSocketFactory();
        final SSLSocket ss = (SSLSocket) factory.createSocket(host, port);

        ss.setEnabledProtocols(protocols);

        return ss;
    }

    /**
     * {@inheritDoc}
     *

     * Creates a new SSL Socket.
     */
    @Override
    public Socket createSocket(String host, int port) throws IOException {
        final SSLSocketFactory factory = sslCtxt.getSocketFactory();
        final SSLSocket ss = (SSLSocket) factory.createSocket(host, port);

        ss.setEnabledProtocols(protocols);

        return ss;
    }

    /**
     * Initializes the SSL Socket Factory Extension.
     *
     * @param km the key managers
     * @param tm the trust managers
     * @param random the secure random number generator
     * @throws NoSuchAlgorithmException thrown when an algorithm is not
     * supported
     * @throws KeyManagementException thrown if initialization fails
     */
    private void initSSLSocketFactoryEx(KeyManager[] km, TrustManager[] tm, SecureRandom random)
            throws NoSuchAlgorithmException, KeyManagementException {
        sslCtxt = SSLContext.getInstance("TLS");
        sslCtxt.init(km, tm, random);

        protocols = getProtocolList();
    }

    /**
     * Initializes the SSL Socket Factory Extension.
     *
     * @param ctx the SSL context
     * @throws NoSuchAlgorithmException thrown when an algorithm is not
     * supported
     * @throws KeyManagementException thrown if initialization fails
     */
    private void initSSLSocketFactoryEx(SSLContext ctx)
            throws NoSuchAlgorithmException, KeyManagementException {
        sslCtxt = ctx;
        protocols = getProtocolList();
    }

    /**
     * Returns the protocol list.
     *
     * @return the protocol list
     */
    @SuppressWarnings("StringSplitter")
    protected String[] getProtocolList() {
        SSLSocket socket = null;
        final String[] availableProtocols;
        final String[] preferredProtocols = settings.getString(
                Settings.KEYS.DOWNLOADER_TLS_PROTOCOL_LIST,
                "TLSv1.1,TLSv1.2,TLSv1.3")
                .split(",");
        try {
            final SSLSocketFactory factory = sslCtxt.getSocketFactory();
            socket = (SSLSocket) factory.createSocket();

            availableProtocols = socket.getSupportedProtocols();
            Arrays.sort(availableProtocols);
            if (LOGGER.isDebugEnabled() && !protocolsLogged) {
                protocolsLogged = true;
                LOGGER.debug("Available Protocols:");
                for (String p : availableProtocols) {
                    LOGGER.debug(p);
                }
            }
        } catch (Exception ex) {
            LOGGER.debug("Error getting protocol list, using TLSv1.1-1.3", ex);
            return new String[]{"TLSv1.1", "TLSv1.2", "TLSv1.3"};
        } finally {
            if (socket != null) {
                try {
                    socket.close();
                } catch (IOException ex) {
                    LOGGER.trace("Error closing socket", ex);
                }
            }
        }

        final List<String> aa = new ArrayList<>();
        for (String preferredProtocol : preferredProtocols) {
            final int idx = Arrays.binarySearch(availableProtocols, preferredProtocol);
            if (idx >= 0) {
                aa.add(preferredProtocol);
            }
        }

        return aa.toArray(new String[0]);
    }

    private KeyManager[] getKeyManagers() {
        KeyManager[] km = null;
        final String ksPath = System.getProperty("javax.net.ssl.keyStore");
        final String ksType = System.getProperty("javax.net.ssl.keyStoreType");
        final String ksPass = System.getProperty("javax.net.ssl.keyStorePassword");

        if (!StringUtils.isAnyEmpty(ksPath, ksType, ksPass)) {
            try (FileInputStream fis = new FileInputStream(ksPath)) {
                final KeyStore ks = KeyStore.getInstance(ksType);
                ks.load(fis, ksPass.toCharArray());
                final KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
                kmf.init(ks, ksPass.toCharArray());
                km = kmf.getKeyManagers();
            } catch (KeyStoreException | IOException | CertificateException | UnrecoverableKeyException | NoSuchAlgorithmException ex) {
                throw new RuntimeException(ex);
            }
        }
        return km;
    }

    private TrustManager[] getTrustManagers() {
        TrustManager[] tm = null;
        final String ksType = System.getProperty("javax.net.ssl.keyStoreType");
        final String tsPath = System.getProperty("javax.net.ssl.trustStore");
        final String tsPass = System.getProperty("javax.net.ssl.trustStorePassword");

        if (!StringUtils.isAnyEmpty(tsPath, ksType, tsPass)) {
            try (FileInputStream fis = new FileInputStream(tsPath)) {
                final KeyStore ts = KeyStore.getInstance(ksType);
                ts.load(fis, tsPass.toCharArray());
                final TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509");
                tmf.init(ts);
                tm = tmf.getTrustManagers();
            } catch (KeyStoreException | IOException | CertificateException | NoSuchAlgorithmException ex) {
                throw new RuntimeException(ex);
            }
        }
        return tm;
    }
}


text:
interface IDictionary<T> {
	[index: string]: T;
}


text:
package net.sourceforge.schemaspy.util;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;

/**
 * BufferedWriter that adds a writeln() method
 * to output a lineDelimited line of text without
 * cluttering up code.
 */
public class LineWriter extends BufferedWriter {
    private final Writer out;

    public LineWriter(String filename, String charset) throws UnsupportedEncodingException, FileNotFoundException {
        this(new FileOutputStream(filename), charset);
    }

    public LineWriter(String filename, int sz, String charset) throws UnsupportedEncodingException, FileNotFoundException {
        this(new FileOutputStream(filename), sz, charset);
    }

    public LineWriter(File file, String charset) throws UnsupportedEncodingException, FileNotFoundException {
        this(new FileOutputStream(file), charset);
    }

    public LineWriter(File file, int sz, String charset) throws UnsupportedEncodingException, IOException {
        this(new FileOutputStream(file), sz, charset);
    }

    public LineWriter(OutputStream out, String charset) throws UnsupportedEncodingException {
        this(new OutputStreamWriter(out, charset), 8192);
    }

    public LineWriter(OutputStream out, int sz, String charset) throws UnsupportedEncodingException {
        this(new OutputStreamWriter(out, charset), sz);
    }

    private LineWriter(Writer out, int sz) {
        // by this point a charset has already been specified
        super(out, sz);
        this.out = out;
    }

    public void writeln(String str) throws IOException {
        write(str);
        newLine();
    }

    public void writeln() throws IOException {
        newLine();
    }

    /**
     * Intended to simplify use when wrapping StringWriters.
     */
    @Override
    public String toString() {
        try {
            flush();
        } catch (IOException exc) {
            throw new RuntimeException(exc);
        }

        return out.toString();
    }
}