text:
using System;
using System.Collections.Generic;
using System.Text;

using BitDiffer.Common.Model;
using BitDiffer.Common.Interfaces;
using BitDiffer.Common.Utility;
using BitDiffer.Common.Misc;
using BitDiffer.Common.Configuration;

namespace BitDiffer.Tests
{
	internal class StubDetail : RootDetail, IHaveVisibility
	{
		private string _content;
		private Visibility _visibility;

		public StubDetail()
		{
		}

		internal StubDetail(string name, string content, Visibility visibility)
			: base(null, name)
		{
			_visibility = visibility;
			_content = content;
		}

		internal StubDetail(string name)
			: base(null, name)
		{
		}

		protected override bool SuppressBreakingChangesInChildren
		{
			get { return _visibility != Visibility.Public; }
		}

		public Visibility Visibility
		{
			get { return _visibility; }
			set { _visibility = value; }
		}

		protected override ChangeType CompareInstance(ICanCompare previous, bool suppressBreakingChanges)
		{
			ChangeType change = base.CompareInstance(previous, suppressBreakingChanges);

			StubDetail other = (StubDetail)previous;

			change |= VisibilityUtil.GetVisibilityChange(other._visibility, _visibility, suppressBreakingChanges);

			if (_content != other._content)
			{
				change |= ChangeType.ContentChanged;
			}

			return change;
		}
	}
}


text:
#ifndef MONIKOR_CONFIG_H_
# define MONIKOR_CONFIG_H_

#include <stdio.h>
#include <yaml.h>
#include <stdint.h>
#include <sys/types.h>

#include "strl.h"

#define MONIKOR_DEFAULT_RUN_DIR "/"
#define MONIKOR_DEFAULT_PIDFILE "/tmp/monikor.pid"
#define MONIKOR_DEFAULT_CONFIG_PATH "/etc/monikor/monikor.yml"
#define MONIKOR_DEFAULT_MODULES_PATH "/usr/lib/monikor/modules"
#define MONIKOR_DEFAULT_MODULES_CONFIG_PATH "/etc/monikor/mod.d"
#define MONIKOR_DEFAULT_POLL_INTERVAL 60
#define MONIKOR_DEFAULT_UPDATE_INTERVAL 30
#define MONIKOR_DEFAULT_SERVER_TIMEOUT 5
#define MONIKOR_DEFAULT_SERVER_MAX_SEND_SIZE (5 * 1024 * 1024)
#define MONIKOR_DEFAULT_MAX_CACHE_SIZE (30 * 1024 * 1024)

#define MONIKOR_DEFAULT_LISTEN_MODE 0660

#define MONIKOR_QUANTA_TOKEN_MAX_LENGTH 42
#define MONIKOR_HOSTID_MAX_LENGTH 42

#define MONIKOR_CONFIG_EXT ".yml"

typedef enum {
  MONIKOR_CFG_DICT,
  MONIKOR_CFG_LIST,
  MONIKOR_CFG_SCALAR
} monikor_config_elem_type_t;

typedef struct monikor_config_dict_s {
  char *key;
  monikor_config_elem_type_t type;
  union {
    struct monikor_config_dict_s *dict;
    strl_t *list;
    char *value;
  } value;
  struct monikor_config_dict_s *next;
} monikor_config_dict_t;

typedef struct {
  monikor_config_dict_t *full_config;
  char *config_path;

  char *hostname;

  char *user;
  char *group;
  char *run_dir;
  char *pidfile;
  uint8_t daemonize;

  struct {
    char *path;
    char *config_path;
    strl_t *modules;
  } modules;

  char *hostid;
  char *quanta_token;

  struct {
    char *url;
    int timeout;
    size_t max_send_size;
    char *proxy_url;
  } server;

  struct {
    char *path;
    char *user;
    char *group;
    mode_t mode;
  } listen;

  struct {
    int level;
    char *file;
  } logger;

  struct {
    int max_size;
  } cache;

  int poll_interval;
  int update_interval;

} monikor_config_t;

monikor_config_t *monikor_config_new(void);
void monikor_config_free(monikor_config_t *config);
monikor_config_t *monikor_load_config(char *config_path);
monikor_config_dict_t *monikor_load_mod_config(char *mod_config_path, char *mod_name);
int monikor_setup_config(monikor_config_t *config);

monikor_config_dict_t *monikor_config_dict_new(void);
void monikor_config_dict_free(monikor_config_dict_t *dict);
char *monikor_config_dict_get_scalar(monikor_config_dict_t *dict, const char *key);
strl_t *monikor_config_dict_get_list(monikor_config_dict_t *dict, const char *key);
monikor_config_dict_t *monikor_config_dict_get_dict(monikor_config_dict_t *dict, const char *key);

int monikor_parse_config_file(FILE *fh, monikor_config_dict_t *cfg);
int config_parse_key(yaml_parser_t *parser, const char *key, monikor_config_dict_t *dict);
int config_parse_mapping(yaml_parser_t *parser, monikor_config_dict_t *dict);
int config_parse_list(yaml_parser_t *parser, strl_t *list);

#endif /* end of include guard: MONIKOR_CONFIG_H_ */

redpajama_set_name: RedPajamaGithub


text:
<?php

// :admin:login.html.twig
return array (
);


text:
<?php

namespace Blackfire\Player\Step;

/**
 * @author Fabien Potencier <fabien@blackfire.io>
 *
 * @internal
 */
class WhileStep extends BlockStep
{
    private $condition;
    private $whileStep;

    public function __construct($condition, $file = null, $line = null)
    {
        $this->condition = $condition;

        parent::__construct($file, $line);
    }

    public function setWhileStep(AbstractStep $whileStep)
    {
        $this->whileStep = $whileStep;
    }

    public function __toString()
    {
        $str = sprintf("└ %s: %s\n", static::class, $this->condition);
        $str .= $this->blockToString($this->whileStep);

        return $str;
    }

    public function getCondition()
    {
        return $this->condition;
    }

    public function getWhileStep()
    {
        return $this->whileStep;
    }
}


text:
'use strict';

const util = require('../index.js');
const standardize = require('../../lib/standardize.js');
const wrap = require('../../lib/websocket/index.js');
const createOptions = require('../../lib/options.js');
const createRequestCache = require('../../lib/request.cache.js');

describe('Websocket close()', () => {

    let options;
    let requestCache;
    let mockSocket;
    let wrappedSocket;

    beforeEach(() => {
        options = createOptions();
        requestCache = createRequestCache();
        mockSocket = util.mockNodeWebsocket();
        wrappedSocket = wrap(standardize(mockSocket), requestCache, options);
    });

    it('Rejects all outstanding requests', () => {
        const promise = new Promise(requestCache.addPromise.bind(null, 'promise test'));
        wrappedSocket.close();
        return promise.should.be.rejectedWith(Error, 'Websocket was closed locally with code: 1000 and message: Socket was closed');
    });

    it('Defaults the close code and message', () => {
        wrappedSocket.close();
        mockSocket.closed.should.equal(true);
        mockSocket.closeCode.should.equal(1000);
        mockSocket.closeMessage.should.equal('"Socket was closed"');
    });

    it('Closes the underlying socket with the specified code and message', () => {
        wrappedSocket.close('Closed', 200);
        mockSocket.closed.should.equal(true);
        mockSocket.closeCode.should.equal(200);
        mockSocket.closeMessage.should.equal('"Closed"');
    });

    it('Encodes the close message', () => {
        const msg = { goodbye: 'world' };
        wrappedSocket.close(msg);
        mockSocket.closed.should.equal(true);
        mockSocket.closeCode.should.equal(1000);
        mockSocket.closeMessage.should.equal(JSON.stringify(msg));
    });

    it('Encodes a close Error', () => {
        const msg = new Error('closed');
        wrappedSocket.close(msg);
        mockSocket.closed.should.equal(true);
        mockSocket.closeCode.should.equal(1000);
        JSON.parse(mockSocket.closeMessage).should.have.a.property('message').that.equals('closed');
    });

    it('Adds a promise to the request cache when no callback is supplied', () => {
        const promise = wrappedSocket.close('Some message');
        requestCache.requests.should.have.a.property('close');
        promise.should.have.a.property('then').that.is.a('function');
        requestCache.requests['close'].should.have.a.property('resolve').that.is.a('function');
        requestCache.requests['close'].should.have.a.property('reject').that.is.a('function');
    });

    it('Adds a callback to the request cache when a callback is supplied', () => {
        wrappedSocket.close('Some message', 1000, 0, () => {});
        const key = Object.keys(requestCache.requests)[0];

        Object.keys(requestCache.requests).length.should.equal(1);
        requestCache.requests[key].should.have.a.property('cb').that.is.a('function');
    });

    it('Adds a timeout if one is specified', () => {
        return wrappedSocket.close('Hello', 1006, 10)
            .should.be.rejectedWith(Error, 'Timed out after 10 ms');
    });

    it('Throws an error if a callback is not supplied and there is no Promise object', () => {
        delete options.Promise;
        wrappedSocket = wrap(standardize(mockSocket), requestCache, options);
        (() => {
            wrappedSocket.close('something');
        }).should.throw(Error, 'Can\'t close without a Promise implementation or callback');
    });
});


text:
export const version = "ethers/5.7.2";
//# sourceMappingURL=_version.js.map


text:
require 'faye'
require 'json'
require 'openssl'
require 'monitor'
require 'faraday'
require 'faraday_middleware'
require 'observer'
require 'em-synchrony'
require 'securerandom'
require 'thread_safe'

require 'colossus/configuration'
require 'colossus/verifier'
require 'colossus/http_writer_client'
require 'colossus/simple_writer_server'

require 'colossus/engines/memory/memory'
require 'colossus/engines/memory/client_session'
require 'colossus/engines/memory/client_session_store'

require 'colossus/engines/memory_thread_safe/memory'
require 'colossus/engines/memory_thread_safe/client_session'
require 'colossus/engines/memory_thread_safe/client_session_store'

require 'colossus/engines/memory_monitor/memory'

require 'colossus/faye/extension'

# Top Level Class.
# The public API of the Gem.
class Colossus
  include Observable

  ACTIVE       = 'active'.freeze
  AWAY         = 'away'.freeze
  DISCONNECTED = 'disconnected'.freeze

  attr_reader :engine, :verifier

  # Initialize Colossus
  #
  # @param ttl [Integer] the seconds before a user without emitting heartbeat
  #   is considered disconnected
  #
  # @param engine [Engine] the engine which implements the needed methods
  #   to work with Colossus
  #
  # @return [Colossus]
  def initialize(ttl          = Colossus.config.ttl,
                 engine       = Colossus.config.engine,
                 secret       = Colossus.config.secret_key,
                 writer_token = Colossus.config.writer_token)
    @engine = engine.new(ttl.to_i)
    @engine.add_observer(self)
    @verifier = Colossus::Verifier.new(secret, writer_token)
  end

  # Set the status of a user on a specificed client. A client could be
  # a Websocket session (if the user has 2 tabs opened) or anything else.
  #
  # @param user_id [#to_s] The unique identifier of a user
  # @param client_id [#to_s] The unique identifier of a client
  # @param status [#to_s] The status of a the user, it can be active,
  #   away or disconnected.
  #
  # @return [Boolean] Return true if the status has changed if not false.
  def set(user_id, client_id, status)
    engine.set(user_id.to_s, client_id.to_s, status.to_s)
  end

  # Get the status of a specified user, it analyzes the status
  #   of all the sessions.
  #   It returns :
  #
  #   - active if one or more clients are active.
  #   - away if one or more clients are away.
  #   - disconnected.
  #
  # @param user_id [#to_s] The unique identifier of a user
  #
  # @return Hash{String => String} User_id key, status value
  def get(user_id)
    engine.get(user_id.to_s)
  end

  # @param user_ids [Array<#to_s>] An array of user ids
  # (see #get)
  def get_multi(*user_ids)
    engine.get_multi(*user_ids.map(&:to_s))
  end

  # (see #get)
  def get_all
    engine.get_all
  end

  # Reset all the data (useful for specs)
  def reset!
    engine.reset!
  end

  # Generate a token for the given user_id
  def generate_user_token(user_id)
    verifier.generate_user_token(user_id)
  end

  # Method used when the engine notify a change
  #
  # @!visibility private
  def update(user_id, status)
    changed
    notify_observers(user_id, status)
  end
end


text:
<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class AddBirthColumnToNewcomersTable extends Migration
{

    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('newcomers', function (Blueprint $table) {
            $table->timestamp('birth')->after('password')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('newcomers', function (Blueprint $table) {
            $table->dropColumn('birth');
        });
    }
}


text:
@extends('chronos::guard')

@section('content')
    {!! Form::open(['route' => 'chronos.auth.password_reset_form_post', 'method' => 'POST']) !!}
        {!! Form::hidden('token', $token) !!}

has('email')) has-error @endif" id="email">
            {!! Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => trans('chronos.scaffolding::forms.Email'), 'autocomplete' => 'off']) !!}
            @if ($errors->has('email'))

                    {!! trans('chronos.scaffolding::alerts.Incorrect email') !!}
                    {{ $errors->first('email') }}

            @endif

has('password')) has-error @endif" id="password">
            {!! Form::password('password', ['class' => 'form-control', 'placeholder' => trans('chronos.scaffolding::forms.New password'), 'autocomplete' => 'off']) !!}
            @if ($errors->has('password'))

                    {!! trans('chronos.scaffolding::alerts.Password error') !!}
                    {{ $errors->first('password') }}

            @endif

has('password_confirmation')) has-error @endif" id="password-confirmation">
            {!! Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => trans('chronos.scaffolding::forms.Confirm new password'), 'autocomplete' => 'off']) !!}
            @if ($errors->has('password_confirmation'))

                    {!! trans('chronos.scaffolding::alerts.Password error') !!}
                    {{ $errors->first('password_confirmation') }}

            @endif

        <button type="submit" class="btn btn-primary">{!! trans('chronos.scaffolding::forms.Change password') !!}</button>
    {!! Form::close() !!}
@endsection


text:
public class MysecondBug {

	static public void bugFixed(){
	System.out.print("the bug has been fixed ;)");

	}
}


text:
<readable><title>3329793486_afc16663cc</title><content>
A man on a snowboard is grinding a ramp .
a skier on a snowy ski jump
A snowboarder is riding down a ramp amidst snow .
A snowboarder prepares to go over a ramp .
Snowboarding practice on a snowy hillside
</content></readable>


text:
package java.lang.reflect;

/**
 * Implementors of this interface dispatch methods invoked on proxy instances.
 *
 * @see Proxy
 */
public interface InvocationHandler {

    /**
     * Handles the method which was originally invoked on the proxy instance. A
     * typical usage pattern follows below:
     *
     *

     * public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
     *     //do some processing before the method invocation
     *
     *     //invoke the method
     *     Object result = method.invoke(proxy, args);
     *
     *     //do some processing after the method invocation
     *     return result;
     * }

     *
     * @param proxy
     *            the proxy instance on which the method was invoked
     * @param method
     *            the method invoked on the proxy instance
     * @param args
     *            an array of objects containing the parameters passed to the
     *            method, or {@code null} if no arguments are expected.
     *            Primitive types are boxed.
     *
     * @return the result of executing the method. Primitive types are boxed.
     *
     * @throws Throwable
     *             the exception to throw from the invoked method on the proxy.
     *             The exception must match one of the declared exception types
     *             of the invoked method or any unchecked exception type. If not
     *             then an {@code UndeclaredThrowableException} is thrown
     */
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable;
}


text:
//////////////////////////////////////////////////////////////////////////////////
//
// Author: Sase
// Email: sase@stilsoft.net
//
// This software may be modified and distributed under the terms
// of the MIT license. See the LICENSE file for details.
//
//////////////////////////////////////////////////////////////////////////////////

using System.Globalization;
using CasparCg.AmcpClient.Common;
using CasparCg.AmcpClient.Utils;

namespace CasparCg.AmcpClient.Commands.Mixer.Common.Response
{
    public class MixerAnchorGetCommandResponse : AmcpResponse
    {
        public MixerAnchor Anchor { get; private set; }

        internal override void ProcessData(AmcpParsedData data)
        {
            base.ProcessData(data);

            var values = Converter.StringToDoubleArray(data.Data[1], " ", NumberStyles.AllowDecimalPoint, new CultureInfo("en-US"));

            Anchor = new MixerAnchor(values[0], values[1]);
        }
    }
}


text:
/*!
 * Copyright (c) 2016 by Contributors
 * \file multibox_target-inl.h
 * \brief
 * \author Joshua Zhang
*/
#ifndef MXNET_OPERATOR_CONTRIB_MULTIBOX_TARGET_INL_H_
#define MXNET_OPERATOR_CONTRIB_MULTIBOX_TARGET_INL_H_
#include <dmlc/logging.h>
#include <dmlc/parameter.h>
#include <mxnet/operator.h>
#include <mxnet/base.h>
#include <map>
#include <vector>
#include <string>
#include <utility>
#include <valarray>
#include "../operator_common.h"
#include "../mshadow_op.h"

namespace mxnet {
namespace op {

namespace mshadow_op {
struct safe_divide {
  template<typename DType>
  MSHADOW_XINLINE static DType Map(DType a, DType b) {
    if (b == DType(0.0f)) return DType(0.0f);
    return DType(a / b);
  }
};  // struct safe_divide
}  // namespace mshadow_op

namespace mboxtarget_enum {
enum MultiBoxTargetOpInputs {kAnchor, kLabel, kClsPred};
enum MultiBoxTargetOpOutputs {kLoc, kLocMask, kCls};
enum MultiBoxTargetOpResource {kTempSpace};
}  // namespace mboxtarget_enum

struct MultiBoxTargetParam : public dmlc::Parameter<MultiBoxTargetParam> {
  float overlap_threshold;
  float ignore_label;
  float negative_mining_ratio;
  float negative_mining_thresh;
  int minimum_negative_samples;
  nnvm::Tuple<float> variances;
  DMLC_DECLARE_PARAMETER(MultiBoxTargetParam) {
    DMLC_DECLARE_FIELD(overlap_threshold).set_default(0.5f)
    .describe("Anchor-GT overlap threshold to be regarded as a positive match.");
    DMLC_DECLARE_FIELD(ignore_label).set_default(-1.0f)
    .describe("Label for ignored anchors.");
    DMLC_DECLARE_FIELD(negative_mining_ratio).set_default(-1.0f)
    .describe("Max negative to positive samples ratio, use -1 to disable mining");
    DMLC_DECLARE_FIELD(negative_mining_thresh).set_default(0.5f)
    .describe("Threshold used for negative mining.");
    DMLC_DECLARE_FIELD(minimum_negative_samples).set_default(0)
    .describe("Minimum number of negative samples.");
    DMLC_DECLARE_FIELD(variances).set_default({0.1f, 0.1f, 0.2f, 0.2f})
    .describe("Variances to be encoded in box regression target.");
  }
};  // struct MultiBoxTargetParam

template<typename xpu, typename DType>
class MultiBoxTargetOp : public Operator {
 public:
  explicit MultiBoxTargetOp(MultiBoxTargetParam param) {
    this->param_ = param;
  }

  virtual void Forward(const OpContext &ctx,
                       const std::vector<TBlob> &in_data,
                       const std::vector<OpReqType> &req,
                       const std::vector<TBlob> &out_data,
                       const std::vector<TBlob> &aux_args) {
    using namespace mshadow;
    using namespace mshadow_op;
    using namespace mshadow::expr;
    CHECK_EQ(in_data.size(), 3);
    CHECK_EQ(out_data.size(), 3);
    Stream<xpu> *s = ctx.get_stream<xpu>();
    Tensor<xpu, 2, DType> anchors = in_data[mboxtarget_enum::kAnchor]
      .get_with_shape<xpu, 2, DType>(
      Shape2(in_data[mboxtarget_enum::kAnchor].size(1), 4), s);
    Tensor<xpu, 3, DType> labels = in_data[mboxtarget_enum::kLabel]
      .get<xpu, 3, DType>(s);
    Tensor<xpu, 3, DType> cls_preds = in_data[mboxtarget_enum::kClsPred]
      .get<xpu, 3, DType>(s);
    Tensor<xpu, 2, DType> loc_target = out_data[mboxtarget_enum::kLoc]
      .get<xpu, 2, DType>(s);
    Tensor<xpu, 2, DType> loc_mask = out_data[mboxtarget_enum::kLocMask]
      .get<xpu, 2, DType>(s);
    Tensor<xpu, 2, DType> cls_target = out_data[mboxtarget_enum::kCls]
      .get<xpu, 2, DType>(s);

    index_t num_batches = labels.size(0);
    index_t num_anchors = anchors.size(0);
    index_t num_labels = labels.size(1);
    // TODO(zhreshold): use maximum valid ground-truth in batch rather than # in dataset
    Shape<4> temp_shape = Shape4(11, num_batches, num_anchors, num_labels);
    Tensor<xpu, 4, DType> temp_space = ctx.requested[mboxtarget_enum::kTempSpace]
      .get_space_typed<xpu, 4, DType>(temp_shape, s);
    loc_target = 0.f;
    loc_mask = 0.0f;
    cls_target = param_.ignore_label;
    temp_space = -1.0f;
    CHECK_EQ(anchors.CheckContiguous(), true);
    CHECK_EQ(labels.CheckContiguous(), true);
    CHECK_EQ(cls_preds.CheckContiguous(), true);
    CHECK_EQ(loc_target.CheckContiguous(), true);
    CHECK_EQ(loc_mask.CheckContiguous(), true);
    CHECK_EQ(cls_target.CheckContiguous(), true);
    CHECK_EQ(temp_space.CheckContiguous(), true);

    // compute overlaps
    // TODO(zhreshold): squeeze temporary memory space
    // temp_space, 0:out, 1:l1, 2:t1, 3:r1, 4:b1, 5:l2, 6:t2, 7:r2, 8:b2
    // 9: intersection, 10:union
    temp_space[1] = broadcast_keepdim(broadcast_with_axis(slice<1>(anchors, 0, 1), -1,
      num_batches), 2, num_labels);
    temp_space[2] = broadcast_keepdim(broadcast_with_axis(slice<1>(anchors, 1, 2), -1,
      num_batches), 2, num_labels);
    temp_space[3] = broadcast_keepdim(broadcast_with_axis(slice<1>(anchors, 2, 3), -1,
      num_batches), 2, num_labels);
    temp_space[4] = broadcast_keepdim(broadcast_with_axis(slice<1>(anchors, 3, 4), -1,
      num_batches), 2, num_labels);
    Shape<3> temp_reshape = Shape3(num_batches, 1, num_labels);
    temp_space[5] = broadcast_keepdim(reshape(slice<2>(labels, 1, 2), temp_reshape), 1,
      num_anchors);
    temp_space[6] = broadcast_keepdim(reshape(slice<2>(labels, 2, 3), temp_reshape), 1,
      num_anchors);
    temp_space[7] = broadcast_keepdim(reshape(slice<2>(labels, 3, 4), temp_reshape), 1,
      num_anchors);
    temp_space[8] = broadcast_keepdim(reshape(slice<2>(labels, 4, 5), temp_reshape), 1,
      num_anchors);
    temp_space[9] = F<maximum>(ScalarExp<DType>(0.0f),
      F<minimum>(temp_space[3], temp_space[7]) - F<maximum>(temp_space[1], temp_space[5]))
        * F<maximum>(ScalarExp<DType>(0.0f),
        F<minimum>(temp_space[4], temp_space[8]) - F<maximum>(temp_space[2], temp_space[6]));
    temp_space[10] = (temp_space[3] - temp_space[1]) * (temp_space[4] - temp_space[2])
     + (temp_space[7] - temp_space[5]) * (temp_space[8] - temp_space[6])
      - temp_space[9];
    temp_space[0] = F<safe_divide>(temp_space[9], temp_space[10]);

    MultiBoxTargetForward(loc_target, loc_mask, cls_target,
                          anchors, labels, cls_preds, temp_space,
                          param_.overlap_threshold,
                          param_.ignore_label,
                          param_.negative_mining_ratio,
                          param_.negative_mining_thresh,
                          param_.minimum_negative_samples,
                          param_.variances);
  }

  virtual void Backward(const OpContext &ctx,
                        const std::vector<TBlob> &out_grad,
                        const std::vector<TBlob> &in_data,
                        const std::vector<TBlob> &out_data,
                        const std::vector<OpReqType> &req,
                        const std::vector<TBlob> &in_grad,
                        const std::vector<TBlob> &aux_args) {
  using namespace mshadow;
  using namespace mshadow::expr;
  Stream<xpu> *s = ctx.get_stream<xpu>();
  Tensor<xpu, 2, DType> grad = in_grad[mboxtarget_enum::kClsPred].FlatTo2D<xpu, DType>(s);
  grad = 0.f;
}

 private:
  MultiBoxTargetParam param_;
};  // class MultiBoxTargetOp

template<typename xpu>
Operator* CreateOp(MultiBoxTargetParam param, int dtype);

#if DMLC_USE_CXX11
class MultiBoxTargetProp : public OperatorProperty {
 public:
  std::vector<std::string> ListArguments() const override {
    return {"anchor", "label", "cls_pred"};
  }

  std::vector<std::string> ListOutputs() const override {
    return {"loc_target", "loc_mask", "cls_target"};
  }

  void Init(const std::vector<std::pair<std::string, std::string> >& kwargs) override {
    param_.Init(kwargs);
  }

  std::map<std::string, std::string> GetParams() const override {
    return param_.__DICT__();
  }

  bool InferShape(mxnet::ShapeVector *in_shape,
                  mxnet::ShapeVector *out_shape,
                  mxnet::ShapeVector *aux_shape) const override {
    using namespace mshadow;
    CHECK_EQ(in_shape->size(), 3) << "Input: [anchor, label, clsPred]";
    mxnet::TShape ashape = in_shape->at(mboxtarget_enum::kAnchor);
    CHECK_EQ(ashape.ndim(), 3) << "Anchor should be batch shared N*4 tensor";
    CHECK_EQ(ashape[0], 1) << "Anchors are shared across batches, first dimension should be 1";
    CHECK_GT(ashape[1], 0) << "Number boxes should be greater than 0";
    CHECK_EQ(ashape[2], 4) << "Box dimension should be 4: [xmin, ymin, xmax, ymax]";
    mxnet::TShape lshape = in_shape->at(mboxtarget_enum::kLabel);
    CHECK_EQ(lshape.ndim(), 3) << "Label should be [batch, num_labels, label_width] tensor";
    CHECK_GT(lshape[1], 0) << "Padded label should be greater than 0";
    CHECK_GE(lshape[2], 5) << "Label width should be greater than or equal to 5";
    mxnet::TShape pshape = in_shape->at(mboxtarget_enum::kClsPred);
    CHECK_EQ(pshape.ndim(), 3) << "Prediction: [batch, num_classes, num_anchors]";
    CHECK_EQ(pshape[2], ashape[1]) << "Number of anchors mismatch";
    mxnet::TShape loc_shape = Shape2(lshape[0], ashape.Size());  // batch - (num_box * 4)
    mxnet::TShape lm_shape = loc_shape;
    mxnet::TShape label_shape = Shape2(lshape[0], ashape[1]);  // batch - num_box
    out_shape->clear();
    out_shape->push_back(loc_shape);
    out_shape->push_back(lm_shape);
    out_shape->push_back(label_shape);
    return true;
  }

  OperatorProperty* Copy() const override {
    MultiBoxTargetProp* MultiBoxTarget_sym = new MultiBoxTargetProp();
    MultiBoxTarget_sym->param_ = this->param_;
    return MultiBoxTarget_sym;
  }

  std::string TypeString() const override {
    return "_contrib_MultiBoxTarget";
  }

  //  decalre dependency and inplace optimization options
  std::vector<int> DeclareBackwardDependency(
    const std::vector<int> &out_grad,
    const std::vector<int> &in_data,
    const std::vector<int> &out_data) const override {
    return {};
  }

  std::vector<ResourceRequest> ForwardResource(
       const mxnet::ShapeVector &in_shape) const override {
    return {ResourceRequest::kTempSpace};
  }

  Operator* CreateOperator(Context ctx) const override {
    LOG(FATAL) << "Not implemented";
    return NULL;
  }

  Operator* CreateOperatorEx(Context ctx, mxnet::ShapeVector *in_shape,
                              std::vector<int> *in_type) const override;

 private:
  MultiBoxTargetParam param_;
};  // class MultiBoxTargetProp
#endif  // DMLC_USE_CXX11

}  // namespace op
}  // namespace mxnet

#endif  // MXNET_OPERATOR_CONTRIB_MULTIBOX_TARGET_INL_H_


text:
#include "engine/routing_algorithms/many_to_many.hpp"
#include "engine/routing_algorithms/routing_base_mld.hpp"

#include <boost/assert.hpp>
#include <boost/range/iterator_range_core.hpp>

#include <limits>
#include <memory>
#include <unordered_map>
#include <vector>

namespace osrm
{
namespace engine
{
namespace routing_algorithms
{

namespace mld
{

using PackedEdge = std::tuple</*from*/ NodeID, /*to*/ NodeID, /*from_clique_arc*/ bool>;
using PackedPath = std::vector<PackedEdge>;

template <typename MultiLevelPartition>
inline LevelID getNodeQueryLevel(const MultiLevelPartition &partition,
                                 const NodeID node,
                                 const PhantomNodeCandidates &phantom_node,
                                 const LevelID maximal_level)
{
    const auto node_level = getNodeQueryLevel(partition, node, phantom_node);

    if (node_level >= maximal_level)
        return INVALID_LEVEL_ID;

    return node_level;
}

template <bool DIRECTION>
void relaxBorderEdges(const DataFacade<mld::Algorithm> &facade,
                      const NodeID node,
                      const EdgeWeight weight,
                      const EdgeDuration duration,
                      const EdgeDistance distance,
                      typename SearchEngineData<mld::Algorithm>::ManyToManyQueryHeap &query_heap,
                      LevelID level)
{
    for (const auto edge : facade.GetBorderEdgeRange(level, node))
    {
        const auto &data = facade.GetEdgeData(edge);
        if ((DIRECTION == FORWARD_DIRECTION) ? facade.IsForwardEdge(edge)
                                             : facade.IsBackwardEdge(edge))
        {
            const NodeID to = facade.GetTarget(edge);
            if (facade.ExcludeNode(to))
            {
                continue;
            }

            const auto turn_id = data.turn_id;
            const auto node_id = DIRECTION == FORWARD_DIRECTION ? node : facade.GetTarget(edge);
            const auto node_weight = facade.GetNodeWeight(node_id);
            const auto node_duration = facade.GetNodeDuration(node_id);
            const auto node_distance = facade.GetNodeDistance(node_id);
            const auto turn_weight =
                node_weight + alias_cast<EdgeWeight>(facade.GetWeightPenaltyForEdgeID(turn_id));
            const auto turn_duration =
                node_duration +
                alias_cast<EdgeDuration>(facade.GetDurationPenaltyForEdgeID(turn_id));

            BOOST_ASSERT_MSG(node_weight + turn_weight > EdgeWeight{0}, "edge weight is invalid");
            const auto to_weight = weight + turn_weight;
            const auto to_duration = duration + turn_duration;
            const auto to_distance = distance + node_distance;

            // New Node discovered -> Add to Heap + Node Info Storage
            const auto toHeapNode = query_heap.GetHeapNodeIfWasInserted(to);
            if (!toHeapNode)
            {
                query_heap.Insert(to, to_weight, {node, false, to_duration, to_distance});
            }
            // Found a shorter Path -> Update weight and set new parent
            else if (std::tie(to_weight, to_duration, to_distance, node) <
                     std::tie(toHeapNode->weight,
                              toHeapNode->data.duration,
                              toHeapNode->data.distance,
                              toHeapNode->data.parent))
            {
                toHeapNode->data = {node, false, to_duration, to_distance};
                toHeapNode->weight = to_weight;
                query_heap.DecreaseKey(*toHeapNode);
            }
        }
    }
}

template <bool DIRECTION, typename... Args>
void relaxOutgoingEdges(
    const DataFacade<mld::Algorithm> &facade,
    const typename SearchEngineData<mld::Algorithm>::ManyToManyQueryHeap::HeapNode &heapNode,
    typename SearchEngineData<mld::Algorithm>::ManyToManyQueryHeap &query_heap,
    const Args &... args)
{
    BOOST_ASSERT(!facade.ExcludeNode(heapNode.node));

    const auto &partition = facade.GetMultiLevelPartition();

    const auto level = getNodeQueryLevel(partition, heapNode.node, args...);

    // Break outgoing edges relaxation if node at the restricted level
    if (level == INVALID_LEVEL_ID)
        return;

    const auto &cells = facade.GetCellStorage();
    const auto &metric = facade.GetCellMetric();

    if (level >= 1 && !heapNode.data.from_clique_arc)
    {
        const auto &cell = cells.GetCell(metric, level, partition.GetCell(level, heapNode.node));
        if (DIRECTION == FORWARD_DIRECTION)
        { // Shortcuts in forward direction
            auto destination = cell.GetDestinationNodes().begin();
            auto shortcut_durations = cell.GetOutDuration(heapNode.node);
            auto shortcut_distances = cell.GetOutDistance(heapNode.node);
            for (auto shortcut_weight : cell.GetOutWeight(heapNode.node))
            {
                BOOST_ASSERT(destination != cell.GetDestinationNodes().end());
                BOOST_ASSERT(!shortcut_durations.empty());
                BOOST_ASSERT(!shortcut_distances.empty());
                const NodeID to = *destination;

                if (shortcut_weight != INVALID_EDGE_WEIGHT && heapNode.node != to)
                {
                    const auto to_weight = heapNode.weight + shortcut_weight;
                    const auto to_duration = heapNode.data.duration + shortcut_durations.front();
                    const auto to_distance = heapNode.data.distance + shortcut_distances.front();
                    const auto toHeapNode = query_heap.GetHeapNodeIfWasInserted(to);
                    if (!toHeapNode)
                    {
                        query_heap.Insert(
                            to, to_weight, {heapNode.node, true, to_duration, to_distance});
                    }
                    else if (std::tie(to_weight, to_duration, to_distance, heapNode.node) <
                             std::tie(toHeapNode->weight,
                                      toHeapNode->data.duration,
                                      toHeapNode->data.distance,
                                      toHeapNode->data.parent))
                    {
                        toHeapNode->data = {heapNode.node, true, to_duration, to_distance};
                        toHeapNode->weight = to_weight;
                        query_heap.DecreaseKey(*toHeapNode);
                    }
                }
                ++destination;
                shortcut_durations.advance_begin(1);
                shortcut_distances.advance_begin(1);
            }
            BOOST_ASSERT(shortcut_durations.empty());
            BOOST_ASSERT(shortcut_distances.empty());
        }
        else
        { // Shortcuts in backward direction
            auto source = cell.GetSourceNodes().begin();
            auto shortcut_durations = cell.GetInDuration(heapNode.node);
            auto shortcut_distances = cell.GetInDistance(heapNode.node);
            for (auto shortcut_weight : cell.GetInWeight(heapNode.node))
            {
                BOOST_ASSERT(source != cell.GetSourceNodes().end());
                BOOST_ASSERT(!shortcut_durations.empty());
                BOOST_ASSERT(!shortcut_distances.empty());
                const NodeID to = *source;

                if (shortcut_weight != INVALID_EDGE_WEIGHT && heapNode.node != to)
                {
                    const auto to_weight = heapNode.weight + shortcut_weight;
                    const auto to_duration = heapNode.data.duration + shortcut_durations.front();
                    const auto to_distance = heapNode.data.distance + shortcut_distances.front();
                    const auto toHeapNode = query_heap.GetHeapNodeIfWasInserted(to);
                    if (!toHeapNode)
                    {
                        query_heap.Insert(
                            to, to_weight, {heapNode.node, true, to_duration, to_distance});
                    }
                    else if (std::tie(to_weight, to_duration, to_distance, heapNode.node) <
                             std::tie(toHeapNode->weight,
                                      toHeapNode->data.duration,
                                      toHeapNode->data.distance,
                                      toHeapNode->data.parent))
                    {
                        toHeapNode->data = {heapNode.node, true, to_duration, to_distance};
                        toHeapNode->weight = to_weight;
                        query_heap.DecreaseKey(*toHeapNode);
                    }
                }
                ++source;
                shortcut_durations.advance_begin(1);
                shortcut_distances.advance_begin(1);
            }
            BOOST_ASSERT(shortcut_durations.empty());
            BOOST_ASSERT(shortcut_distances.empty());
        }
    }

    relaxBorderEdges<DIRECTION>(facade,
                                heapNode.node,
                                heapNode.weight,
                                heapNode.data.duration,
                                heapNode.data.distance,
                                query_heap,
                                level);
}

//
// Unidirectional multi-layer Dijkstra search for 1-to-N and N-to-1 matrices
//
template <bool DIRECTION>
std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>>
oneToManySearch(SearchEngineData<Algorithm> &engine_working_data,
                const DataFacade<Algorithm> &facade,
                const std::vector<PhantomNodeCandidates> &candidates_list,
                std::size_t source_index,
                const std::vector<std::size_t> &target_indices,
                const bool calculate_distance)
{
    std::vector<EdgeWeight> weights_table(target_indices.size(), INVALID_EDGE_WEIGHT);
    std::vector<EdgeDuration> durations_table(target_indices.size(), MAXIMAL_EDGE_DURATION);
    std::vector<EdgeDistance> distances_table(calculate_distance ? target_indices.size() : 0,
                                              MAXIMAL_EDGE_DISTANCE);
    std::vector<NodeID> middle_nodes_table(target_indices.size(), SPECIAL_NODEID);

    // Collect destination (source) nodes into a map
    std::unordered_multimap<NodeID, std::tuple<std::size_t, EdgeWeight, EdgeDuration, EdgeDistance>>
        target_nodes_index;
    target_nodes_index.reserve(target_indices.size());
    for (std::size_t index = 0; index < target_indices.size(); ++index)
    {
        const auto &target_candidates = candidates_list[target_indices[index]];

        for (const auto &phantom_node : target_candidates)
        {
            if (DIRECTION == FORWARD_DIRECTION)
            {
                if (phantom_node.IsValidForwardTarget())
                    target_nodes_index.insert(
                        {phantom_node.forward_segment_id.id,
                         std::make_tuple(index,
                                         phantom_node.GetForwardWeightPlusOffset(),
                                         phantom_node.GetForwardDuration(),
                                         phantom_node.GetForwardDistance())});

                if (phantom_node.IsValidReverseTarget())
                    target_nodes_index.insert(
                        {phantom_node.reverse_segment_id.id,
                         std::make_tuple(index,
                                         phantom_node.GetReverseWeightPlusOffset(),
                                         phantom_node.GetReverseDuration(),
                                         phantom_node.GetReverseDistance())});
            }
            else if (DIRECTION == REVERSE_DIRECTION)
            {
                if (phantom_node.IsValidForwardSource())
                    target_nodes_index.insert(
                        {phantom_node.forward_segment_id.id,
                         std::make_tuple(index,
                                         EdgeWeight{0} - phantom_node.GetForwardWeightPlusOffset(),
                                         EdgeDuration{0} - phantom_node.GetForwardDuration(),
                                         EdgeDistance{0} - phantom_node.GetForwardDistance())});

                if (phantom_node.IsValidReverseSource())
                    target_nodes_index.insert(
                        {phantom_node.reverse_segment_id.id,
                         std::make_tuple(index,
                                         EdgeWeight{0} - phantom_node.GetReverseWeightPlusOffset(),
                                         EdgeDuration{0} - phantom_node.GetReverseDuration(),
                                         EdgeDistance{0} - phantom_node.GetReverseDistance())});
            }
        }
    }

    // Initialize query heap
    engine_working_data.InitializeOrClearManyToManyThreadLocalStorage(
        facade.GetNumberOfNodes(), facade.GetMaxBorderNodeID() + 1);
    auto &query_heap = *(engine_working_data.many_to_many_heap);

    // Check if node is in the destinations list and update weights/durations
    auto update_values =
        [&](NodeID node, EdgeWeight weight, EdgeDuration duration, EdgeDistance distance) {
            auto candidates = target_nodes_index.equal_range(node);
            for (auto it = candidates.first; it != candidates.second;)
            {
                std::size_t index;
                EdgeWeight target_weight;
                EdgeDuration target_duration;
                EdgeDistance target_distance;
                std::tie(index, target_weight, target_duration, target_distance) = it->second;

                const auto path_weight = weight + target_weight;
                if (path_weight >= EdgeWeight{0})
                {
                    const auto path_duration = duration + target_duration;
                    const auto path_distance = distance + target_distance;

                    EdgeDistance nulldistance = {0};
                    auto &current_distance =
                        distances_table.empty() ? nulldistance : distances_table[index];

                    if (std::tie(path_weight, path_duration, path_distance) <
                        std::tie(weights_table[index], durations_table[index], current_distance))
                    {
                        weights_table[index] = path_weight;
                        durations_table[index] = path_duration;
                        current_distance = path_distance;
                        middle_nodes_table[index] = node;
                    }

                    // Remove node from destinations list
                    it = target_nodes_index.erase(it);
                }
                else
                {
                    ++it;
                }
            }
        };

    auto insert_node = [&](NodeID node,
                           EdgeWeight initial_weight,
                           EdgeDuration initial_duration,
                           EdgeDistance initial_distance) {
        if (target_nodes_index.count(node))
        {
            // Source and target on the same edge node. If target is not reachable directly via
            // the node (e.g destination is before source on oneway segment) we want to allow
            // node to be visited later in the search along a reachable path.
            // Therefore, we manually run first step of search without marking node as visited.
            update_values(node, initial_weight, initial_duration, initial_distance);
            relaxBorderEdges<DIRECTION>(
                facade, node, initial_weight, initial_duration, initial_distance, query_heap, 0);
        }
        else
        {
            query_heap.Insert(node, initial_weight, {node, initial_duration, initial_distance});
        }
    };

    { // Place source (destination) adjacent nodes into the heap
        const auto &source_candidates = candidates_list[source_index];

        for (const auto &phantom_node : source_candidates)
        {
            if (DIRECTION == FORWARD_DIRECTION)
            {
                if (phantom_node.IsValidForwardSource())
                {
                    insert_node(phantom_node.forward_segment_id.id,
                                EdgeWeight{0} - phantom_node.GetForwardWeightPlusOffset(),
                                EdgeDuration{0} - phantom_node.GetForwardDuration(),
                                EdgeDistance{0} - phantom_node.GetForwardDistance());
                }

                if (phantom_node.IsValidReverseSource())
                {
                    insert_node(phantom_node.reverse_segment_id.id,
                                EdgeWeight{0} - phantom_node.GetReverseWeightPlusOffset(),
                                EdgeDuration{0} - phantom_node.GetReverseDuration(),
                                EdgeDistance{0} - phantom_node.GetReverseDistance());
                }
            }
            else if (DIRECTION == REVERSE_DIRECTION)
            {
                if (phantom_node.IsValidForwardTarget())
                {
                    insert_node(phantom_node.forward_segment_id.id,
                                phantom_node.GetForwardWeightPlusOffset(),
                                phantom_node.GetForwardDuration(),
                                phantom_node.GetForwardDistance());
                }

                if (phantom_node.IsValidReverseTarget())
                {
                    insert_node(phantom_node.reverse_segment_id.id,
                                phantom_node.GetReverseWeightPlusOffset(),
                                phantom_node.GetReverseDuration(),
                                phantom_node.GetReverseDistance());
                }
            }
        }
    }

    while (!query_heap.Empty() && !target_nodes_index.empty())
    {
        // Extract node from the heap. Take a copy (no ref) because otherwise can be modified later
        // if toHeapNode is the same
        const auto heapNode = query_heap.DeleteMinGetHeapNode();

        // Update values
        update_values(
            heapNode.node, heapNode.weight, heapNode.data.duration, heapNode.data.distance);

        // Relax outgoing edges
        relaxOutgoingEdges<DIRECTION>(
            facade, heapNode, query_heap, candidates_list, source_index, target_indices);
    }

    return std::make_pair(std::move(durations_table), std::move(distances_table));
}

//
// Bidirectional multi-layer Dijkstra search for M-to-N matrices
//
template <bool DIRECTION>
void forwardRoutingStep(const DataFacade<Algorithm> &facade,
                        const unsigned row_idx,
                        const unsigned number_of_sources,
                        const unsigned number_of_targets,
                        typename SearchEngineData<Algorithm>::ManyToManyQueryHeap &query_heap,
                        const std::vector<NodeBucket> &search_space_with_buckets,
                        std::vector<EdgeWeight> &weights_table,
                        std::vector<EdgeDuration> &durations_table,
                        std::vector<EdgeDistance> &distances_table,
                        std::vector<NodeID> &middle_nodes_table,
                        const PhantomNodeCandidates &candidates)
{
    // Take a copy of the extracted node because otherwise could be modified later if toHeapNode is
    // the same
    const auto heapNode = query_heap.DeleteMinGetHeapNode();

    // Check if each encountered node has an entry
    const auto &bucket_list = std::equal_range(search_space_with_buckets.begin(),
                                               search_space_with_buckets.end(),
                                               heapNode.node,
                                               NodeBucket::Compare());
    for (const auto &current_bucket : boost::make_iterator_range(bucket_list))
    {
        // Get target id from bucket entry
        const auto column_idx = current_bucket.column_index;
        const auto target_weight = current_bucket.weight;
        const auto target_duration = current_bucket.duration;
        const auto target_distance = current_bucket.distance;

        // Get the value location in the results tables:
        //  * row-major direct (row_idx, column_idx) index for forward direction
        //  * row-major transposed (column_idx, row_idx) for reversed direction
        const auto location = DIRECTION == FORWARD_DIRECTION
                                  ? row_idx * number_of_targets + column_idx
                                  : row_idx + column_idx * number_of_sources;
        auto &current_weight = weights_table[location];
        auto &current_duration = durations_table[location];

        EdgeDistance nulldistance = {0};
        auto &current_distance = distances_table.empty() ? nulldistance : distances_table[location];

        // Check if new weight is better
        auto new_weight = heapNode.weight + target_weight;
        auto new_duration = heapNode.data.duration + target_duration;
        auto new_distance = heapNode.data.distance + target_distance;

        if (new_weight >= EdgeWeight{0} &&
            std::tie(new_weight, new_duration, new_distance) <
                std::tie(current_weight, current_duration, current_distance))
        {
            current_weight = new_weight;
            current_duration = new_duration;
            current_distance = new_distance;
            middle_nodes_table[location] = heapNode.node;
        }
    }

    relaxOutgoingEdges<DIRECTION>(facade, heapNode, query_heap, candidates);
}

template <bool DIRECTION>
void backwardRoutingStep(const DataFacade<Algorithm> &facade,
                         const unsigned column_idx,
                         typename SearchEngineData<Algorithm>::ManyToManyQueryHeap &query_heap,
                         std::vector<NodeBucket> &search_space_with_buckets,
                         const PhantomNodeCandidates &candidates)
{
    // Take a copy of the extracted node because otherwise could be modified later if toHeapNode is
    // the same
    const auto heapNode = query_heap.DeleteMinGetHeapNode();

    // Store settled nodes in search space bucket
    search_space_with_buckets.emplace_back(heapNode.node,
                                           heapNode.data.parent,
                                           heapNode.data.from_clique_arc,
                                           column_idx,
                                           heapNode.weight,
                                           heapNode.data.duration,
                                           heapNode.data.distance);

    const auto &partition = facade.GetMultiLevelPartition();
    const auto maximal_level = partition.GetNumberOfLevels() - 1;

    relaxOutgoingEdges<!DIRECTION>(facade, heapNode, query_heap, candidates, maximal_level);
}

template <bool DIRECTION>
void retrievePackedPathFromSearchSpace(NodeID middle_node_id,
                                       const unsigned column_idx,
                                       const std::vector<NodeBucket> &search_space_with_buckets,
                                       PackedPath &path)
{
    auto bucket_list = std::equal_range(search_space_with_buckets.begin(),
                                        search_space_with_buckets.end(),
                                        middle_node_id,
                                        NodeBucket::ColumnCompare(column_idx));

    BOOST_ASSERT_MSG(std::distance(bucket_list.first, bucket_list.second) == 1,
                     "The pointers are not pointing to the same element.");

    NodeID current_node_id = middle_node_id;

    while (bucket_list.first->parent_node != current_node_id &&
           bucket_list.first != search_space_with_buckets.end())
    {
        const auto parent_node_id = bucket_list.first->parent_node;

        const auto from = DIRECTION == FORWARD_DIRECTION ? current_node_id : parent_node_id;
        const auto to = DIRECTION == FORWARD_DIRECTION ? parent_node_id : current_node_id;
        path.emplace_back(std::make_tuple(from, to, bucket_list.first->from_clique_arc));

        current_node_id = parent_node_id;
        bucket_list = std::equal_range(search_space_with_buckets.begin(),
                                       search_space_with_buckets.end(),
                                       current_node_id,
                                       NodeBucket::ColumnCompare(column_idx));

        BOOST_ASSERT_MSG(std::distance(bucket_list.first, bucket_list.second) == 1,
                         "The pointers are not pointing to the same element.");
    }
}

template <bool DIRECTION>
std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>>
manyToManySearch(SearchEngineData<Algorithm> &engine_working_data,
                 const DataFacade<Algorithm> &facade,
                 const std::vector<PhantomNodeCandidates> &candidates_list,
                 const std::vector<std::size_t> &source_indices,
                 const std::vector<std::size_t> &target_indices,
                 const bool calculate_distance)
{
    const auto number_of_sources = source_indices.size();
    const auto number_of_targets = target_indices.size();
    const auto number_of_entries = number_of_sources * number_of_targets;

    std::vector<EdgeWeight> weights_table(number_of_entries, INVALID_EDGE_WEIGHT);
    std::vector<EdgeDuration> durations_table(number_of_entries, MAXIMAL_EDGE_DURATION);
    std::vector<EdgeDistance> distances_table(calculate_distance ? number_of_entries : 0,
                                              INVALID_EDGE_DISTANCE);
    std::vector<NodeID> middle_nodes_table(number_of_entries, SPECIAL_NODEID);

    std::vector<NodeBucket> search_space_with_buckets;

    // Populate buckets with paths from all accessible nodes to destinations via backward searches
    for (std::uint32_t column_idx = 0; column_idx < target_indices.size(); ++column_idx)
    {
        const auto index = target_indices[column_idx];
        const auto &target_candidates = candidates_list[index];

        engine_working_data.InitializeOrClearManyToManyThreadLocalStorage(
            facade.GetNumberOfNodes(), facade.GetMaxBorderNodeID() + 1);
        auto &query_heap = *(engine_working_data.many_to_many_heap);

        if (DIRECTION == FORWARD_DIRECTION)
            insertTargetInHeap(query_heap, target_candidates);
        else
            insertSourceInHeap(query_heap, target_candidates);

        // explore search space
        while (!query_heap.Empty())
        {
            backwardRoutingStep<DIRECTION>(
                facade, column_idx, query_heap, search_space_with_buckets, target_candidates);
        }
    }

    // Order lookup buckets
    std::sort(search_space_with_buckets.begin(), search_space_with_buckets.end());

    // Find shortest paths from sources to all accessible nodes
    for (std::uint32_t row_idx = 0; row_idx < source_indices.size(); ++row_idx)
    {
        const auto source_index = source_indices[row_idx];
        const auto &source_candidates = candidates_list[source_index];

        // Clear heap and insert source nodes
        engine_working_data.InitializeOrClearManyToManyThreadLocalStorage(
            facade.GetNumberOfNodes(), facade.GetMaxBorderNodeID() + 1);

        auto &query_heap = *(engine_working_data.many_to_many_heap);

        if (DIRECTION == FORWARD_DIRECTION)
            insertSourceInHeap(query_heap, source_candidates);
        else
            insertTargetInHeap(query_heap, source_candidates);

        // Explore search space
        while (!query_heap.Empty())
        {
            forwardRoutingStep<DIRECTION>(facade,
                                          row_idx,
                                          number_of_sources,
                                          number_of_targets,
                                          query_heap,
                                          search_space_with_buckets,
                                          weights_table,
                                          durations_table,
                                          distances_table,
                                          middle_nodes_table,
                                          source_candidates);
        }
    }

    return std::make_pair(std::move(durations_table), std::move(distances_table));
}

} // namespace mld

// Dispatcher function for one-to-many and many-to-one tasks that can be handled by MLD differently:
//
// * one-to-many (many-to-one) tasks use a unidirectional forward (backward) Dijkstra search
//   with the candidate node level `min(GetQueryLevel(phantom_node, node, phantom_nodes)`
//   for all destination (source) phantom nodes
//
// * many-to-many search tasks use a bidirectional Dijkstra search
//   with the candidate node level `min(GetHighestDifferentLevel(phantom_node, node))`
//   Due to pruned backward search space it is always better to compute the durations matrix
//   when number of sources is less than targets. If number of targets is less than sources
//   then search is performed on a reversed graph with phantom nodes with flipped roles and
//   returning a transposed matrix.
template <>
std::pair<std::vector<EdgeDuration>, std::vector<EdgeDistance>>
manyToManySearch(SearchEngineData<mld::Algorithm> &engine_working_data,
                 const DataFacade<mld::Algorithm> &facade,
                 const std::vector<PhantomNodeCandidates> &candidates_list,
                 const std::vector<std::size_t> &source_indices,
                 const std::vector<std::size_t> &target_indices,
                 const bool calculate_distance)
{
    if (source_indices.size() == 1)
    { // TODO: check if target_indices.size() == 1 and do a bi-directional search
        return mld::oneToManySearch<FORWARD_DIRECTION>(engine_working_data,
                                                       facade,
                                                       candidates_list,
                                                       source_indices.front(),
                                                       target_indices,
                                                       calculate_distance);
    }

    if (target_indices.size() == 1)
    {
        return mld::oneToManySearch<REVERSE_DIRECTION>(engine_working_data,
                                                       facade,
                                                       candidates_list,
                                                       target_indices.front(),
                                                       source_indices,
                                                       calculate_distance);
    }

    if (target_indices.size() < source_indices.size())
    {
        return mld::manyToManySearch<REVERSE_DIRECTION>(engine_working_data,
                                                        facade,
                                                        candidates_list,
                                                        target_indices,
                                                        source_indices,
                                                        calculate_distance);
    }

    return mld::manyToManySearch<FORWARD_DIRECTION>(engine_working_data,
                                                    facade,
                                                    candidates_list,
                                                    source_indices,
                                                    target_indices,
                                                    calculate_distance);
}

} // namespace routing_algorithms
} // namespace engine
} // namespace osrm


text:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="hr">
<context>
    <name>CommentsPage</name>
    <message>
        <location filename="../qml/pages/CommentsPage.qml" line="51"/>
        <source>Copy external url</source>
        <translation>Kopiraj vanjski URL</translation>
    </message>
    <message>
        <location filename="../qml/pages/CommentsPage.qml" line="60"/>
        <source>Reply</source>
        <translation>Odgovori</translation>
    </message>
    <message>
        <location filename="../qml/pages/CommentsPage.qml" line="67"/>
        <source>Refresh</source>
        <translation>Aktualiziraj</translation>
    </message>
    <message>
        <location filename="../qml/pages/CommentsPage.qml" line="80"/>
        <source>Load more</source>
        <translation>Učitaj više</translation>
    </message>
    <message>
        <location filename="../qml/pages/CommentsPage.qml" line="96"/>
        <source>Comments</source>
        <translation>Komentari</translation>
    </message>
</context>
<context>
    <name>ItemDelegate</name>
    <message>
        <location filename="../qml/pages/ItemDelegate.qml" line="52"/>
        <source>point</source>
        <translation>točka</translation>
    </message>
    <message>
        <location filename="../qml/pages/ItemDelegate.qml" line="54"/>
        <source>points</source>
        <translation>točke</translation>
    </message>
    <message>
        <location filename="../qml/pages/ItemDelegate.qml" line="60"/>
        <source>comment</source>
        <translation>komentar</translation>
    </message>
    <message>
        <location filename="../qml/pages/ItemDelegate.qml" line="62"/>
        <source>comments</source>
        <translation>komentari</translation>
    </message>
</context>
<context>
    <name>RepliesPage</name>
    <message>
        <location filename="../qml/pages/RepliesPage.qml" line="48"/>
        <source>Reply</source>
        <translation>Odgovori</translation>
    </message>
    <message>
        <location filename="../qml/pages/RepliesPage.qml" line="55"/>
        <source>Refresh</source>
        <translation>Aktualiziraj</translation>
    </message>
    <message>
        <location filename="../qml/pages/RepliesPage.qml" line="68"/>
        <source>Load more</source>
        <translation>Učitaj više</translation>
    </message>
    <message>
        <location filename="../qml/pages/RepliesPage.qml" line="84"/>
        <source>Replies</source>
        <translation>Odgovori</translation>
    </message>
</context>
<context>
    <name>Reply</name>
    <message>
        <location filename="../qml/pages/Reply.qml" line="44"/>
        <source>Error when sending</source>
        <translation>Greška tijekom slanja</translation>
    </message>
    <message>
        <location filename="../qml/pages/Reply.qml" line="46"/>
        <source>Commented!</source>
        <translation>Komentirano!</translation>
    </message>
    <message>
        <location filename="../qml/pages/Reply.qml" line="61"/>
        <source>Reply</source>
        <translation>Odgovori</translation>
    </message>
    <message>
        <location filename="../qml/pages/Reply.qml" line="68"/>
        <source>Text</source>
        <translation>Tekst</translation>
    </message>
    <message>
        <location filename="../qml/pages/Reply.qml" line="73"/>
        <source>Add Comment</source>
        <translation>Dodaj komentar</translation>
    </message>
</context>
<context>
    <name>ReplyDelegate</name>
    <message>
        <location filename="../qml/pages/ReplyDelegate.qml" line="59"/>
        <source>reply</source>
        <translation>odgovor</translation>
    </message>
    <message>
        <location filename="../qml/pages/ReplyDelegate.qml" line="61"/>
        <source>replies</source>
        <translation>odgovori</translation>
    </message>
</context>
<context>
    <name>Settings</name>
    <message>
        <location filename="../qml/pages/Settings.qml" line="61"/>
        <source>Logout</source>
        <translation>Odjava</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="113"/>
        <source>Login failed</source>
        <translation>Prijava neuspjela</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="76"/>
        <source>Settings</source>
        <translation>Postavke</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="82"/>
        <source>Username</source>
        <translation>Korisničko ime</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="90"/>
        <source>Password</source>
        <translation>Lozinka</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="98"/>
        <location filename="../qml/pages/Settings.qml" line="186"/>
        <source>Login</source>
        <translation>Prijava</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="130"/>
        <source>User details</source>
        <translation>Podaci korisnika</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="136"/>
        <source>created</source>
        <translation>stvoreno</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="142"/>
        <source>karma</source>
        <translation>karma</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="148"/>
        <source>About</source>
        <translation>Informacije</translation>
    </message>
    <message>
        <location filename="../qml/pages/Settings.qml" line="184"/>
        <source>Logged</source>
        <translation>Zabilježeno</translation>
    </message>
</context>
<context>
    <name>StoriesListView</name>
    <message>
        <location filename="../qml/pages/StoriesListView.qml" line="49"/>
        <source>Settings</source>
        <translation>Postavke</translation>
    </message>
    <message>
        <location filename="../qml/pages/StoriesListView.qml" line="56"/>
        <source>Submit</source>
        <translation>Pošalji</translation>
    </message>
    <message>
        <location filename="../qml/pages/StoriesListView.qml" line="63"/>
        <source>Refresh</source>
        <translation>Aktualiziraj</translation>
    </message>
    <message>
        <location filename="../qml/pages/StoriesListView.qml" line="72"/>
        <source>Load more</source>
        <translation>Učitaj više</translation>
    </message>
</context>
<context>
    <name>Submit</name>
    <message>
        <location filename="../qml/pages/Submit.qml" line="45"/>
        <source>Submitted!</source>
        <translation>Poslano!</translation>
    </message>
    <message>
        <location filename="../qml/pages/Submit.qml" line="60"/>
        <location filename="../qml/pages/Submit.qml" line="96"/>
        <source>Submit</source>
        <translation>Pošalji</translation>
    </message>
    <message>
        <location filename="../qml/pages/Submit.qml" line="67"/>
        <source>Title</source>
        <translation>Naslov</translation>
    </message>
    <message>
        <location filename="../qml/pages/Submit.qml" line="75"/>
        <source>Url</source>
        <translation>Url</translation>
    </message>
    <message>
        <location filename="../qml/pages/Submit.qml" line="81"/>
        <source>or</source>
        <translation>ili</translation>
    </message>
    <message>
        <location filename="../qml/pages/Submit.qml" line="89"/>
        <source>Text</source>
        <translation>Tekst</translation>
    </message>
    <message>
        <location filename="../qml/pages/Submit.qml" line="43"/>
        <source>Error during submission</source>
        <translation>Greška tijekom slanja</translation>
    </message>
</context>
</TS>


text:
<!DOCTYPE frameset SYSTEM "frameset.dtd">
<frameset>
    <predicate lemma="critique">
        <note>
            Frames file for 'critique' based on frame file for 'criticize'.  No
            Verbnet entry
        </note>

        <roleset id="critique.01" name="offer an oppinion judgement,or to criticize" vncls="-">
            <roles>
                <role descr="critiquer" n="0"/>
                <role descr="entity being critiqued" n="1"/>
            </roles>

            <example name="transtitive">
                <text>
                    Hong Kong director Stanley Kuan echoes this sentiment, * saying that
                    many films by Taiwanese directors tackling cultural identity and
                    critiquing status quo, couldcould never have been made * in Hong Kong,
                    perhaps because of distortions effected * by colonial education, or due
                    to political or commercial considerations.
                </text>
                <arg n="0">many films by Taiwanese directors</arg>
                <rel>critiquing</rel>
                <arg n="1">the status quo</arg>
            </example>

            <note>
                Frame created by Arrick
            </note>

        </roleset>
    </predicate>
</frameset>


text:
var fluid_2_0_0 = fluid_2_0_0 || {};

(function ($, fluid) {
    "use strict";

    fluid.registerNamespace("fluid.prefs");

    /*******************************************************************************
     * Base auxiliary schema grade
     *******************************************************************************/

    fluid.defaults("fluid.prefs.auxSchema", {
        gradeNames: ["fluid.component"],
        auxiliarySchema: {
            "loaderGrades": ["fluid.prefs.separatedPanel"]
        }
    });

    /**
     * Look up the value on the given source object by using the path.
     * Takes a template string containing tokens in the form of "@source-path-to-value".
     * Returns a value (any type) or undefined if the path is not found.
     *
     * @param {object}    root       an object to retrieve the returned value from
     * @param {String}    pathRef    a string that the path to the requested value is embedded into
     *
     * Example:
     * 1. Parameters:
     * source:
     * {
     *     path1: {
     *         path2: "here"
     *     }
     * }
     *
     * template: "@path1.path2"
     *
     * 2. Return: "here"
     */
    fluid.prefs.expandSchemaValue = function (root, pathRef) {
        if (pathRef.charAt(0) !== "@") {
            return pathRef;
        }

        return fluid.get(root, pathRef.substring(1));
    };

    fluid.prefs.addAtPath = function (root, path, object) {
        var existingObject = fluid.get(root, path);
        fluid.set(root, path, $.extend(true, {}, existingObject, object));

        return root;
    };

    // only works with top level elements
    fluid.prefs.removeKey = function (root, key) {
        var value = root[key];
        delete root[key];
        return value;
    };

    fluid.prefs.rearrangeDirect = function (root, toPath, sourcePath) {
        var result = {};
        var sourceValue = fluid.prefs.removeKey(root, sourcePath);
        if (sourceValue) {
            fluid.set(result, toPath, sourceValue);
        }
        return result;
    };

    fluid.prefs.addCommonOptions = function (root, path, commonOptions, templateValues) {
        templateValues = templateValues || {};

        var existingValue = fluid.get(root, path);

        if (!existingValue) {
            return root;
        }

        var opts = {}, mergePolicy = {};

        fluid.each(commonOptions, function (value, key) {
            // Adds "container" option only for view and renderer components
            if (key === "container") {
                var componentType = fluid.get(root, [path, "type"]);
                var componentOptions = fluid.defaults(componentType);
                // Note that this approach is not completely reliable, although it has been reviewed as "good enough" -
                // a grade which modifies the creation signature of its principal type would cause numerous other problems.
                // We can review this awkward kind of "anticipatory logic" when the new renderer arrives.
                if (fluid.get(componentOptions, ["argumentMap", "container"]) === undefined) {
                    return false;
                }
            }
            // Merge grade names defined in aux schema and system default grades
            if (key.indexOf("gradeNames") !== -1) {
                mergePolicy[key] = fluid.arrayConcatPolicy;
            }

            key = fluid.stringTemplate(key, templateValues);
            value = typeof (value) === "string" ? fluid.stringTemplate(value, templateValues) : value;

            fluid.set(opts, key, value);
        });

        fluid.set(root, path, fluid.merge(mergePolicy, existingValue, opts));

        return root;
    };

    fluid.prefs.containerNeeded = function (root, path) {
        var componentType = fluid.get(root, [path, "type"]);
        var componentOptions = fluid.defaults(componentType);
        return (fluid.hasGrade(componentOptions, "fluid.viewComponent") || fluid.hasGrade(componentOptions, "fluid.rendererComponent"));
    };

    fluid.prefs.checkPrimarySchema = function (primarySchema, prefKey) {
        if (!primarySchema) {
            fluid.fail("The primary schema for " + prefKey + " is not defined.");
        }
        return !!primarySchema;
    };

    fluid.prefs.expandSchemaComponents = function (auxSchema, type, prefKey, componentConfig, index, commonOptions, modelCommonOptions, mappedDefaults) {
        var componentOptions = fluid.copy(componentConfig) || {};
        var components = {};
        var initialModel = {};

        var componentName = fluid.prefs.removeKey(componentOptions, "type");
        var regexp = new RegExp("\\.", "g");
        var memberName = componentName.replace(regexp,  "_");
        var flattenedPrefKey = prefKey.replace(regexp,  "_");

        if (componentName) {

            components[memberName] = {
                type: componentName,
                options: componentOptions
            };

            var selectors = fluid.prefs.rearrangeDirect(componentOptions, memberName, "container");
            var templates = fluid.prefs.rearrangeDirect(componentOptions, memberName, "template");
            var messages = fluid.prefs.rearrangeDirect(componentOptions, memberName, "message");

            var preferenceMap = fluid.defaults(componentName).preferenceMap;

            var map = preferenceMap[prefKey];
            var prefSchema = mappedDefaults[prefKey];

            fluid.each(map, function (primaryPath, internalPath) {
                if (fluid.prefs.checkPrimarySchema(prefSchema, prefKey)) {
                    var opts = {};
                    if (internalPath.indexOf("model.") === 0) {
                        var internalModelName = internalPath.slice(6);
                        // Set up the binding in "rules" accepted by the modelRelay base grade of every panel
                        fluid.set(opts, "model", fluid.get(opts, "model") || {});
                        fluid.prefs.addCommonOptions(opts, "model", modelCommonOptions, {
                            internalModelName: internalModelName,
                            externalModelName: flattenedPrefKey
                        });
                        fluid.set(initialModel, ["members", "initialModel", "preferences", flattenedPrefKey], prefSchema[primaryPath]);
                    } else {
                        fluid.set(opts, internalPath, prefSchema[primaryPath]);
                    }
                    $.extend(true, componentOptions, opts);
                }
            });

            fluid.prefs.addCommonOptions(components, memberName, commonOptions, {
                prefKey: memberName
            });

            fluid.prefs.addAtPath(auxSchema, [type, "components"], components);
            fluid.prefs.addAtPath(auxSchema, [type, "selectors"], selectors);
            fluid.prefs.addAtPath(auxSchema, ["templateLoader", "resources"], templates);
            fluid.prefs.addAtPath(auxSchema, ["messageLoader", "resources"], messages);
            fluid.prefs.addAtPath(auxSchema, "initialModel", initialModel);
        }

        return auxSchema;
    };

    /**
     * Expands a all "@" path references from an auxiliary schema.
     * Note that you cannot chain "@" paths.
     *
     *  @param {object} schemaToExpand the shcema which will be expanded
     *  @param {object} altSource an alternative look up object. This is primarily used for the internal recursive call.
     *  @return {object} an expaneded version of the schema.
     */
    fluid.prefs.expandSchemaImpl = function (schemaToExpand, altSource) {
        var expandedSchema = fluid.copy(schemaToExpand);
        altSource = altSource || expandedSchema;

        fluid.each(expandedSchema, function (value, key) {
            if (typeof value === "object") {
                expandedSchema[key] = fluid.prefs.expandSchemaImpl(value, altSource);
            } else if (typeof value === "string") {
                var expandedVal = fluid.prefs.expandSchemaValue(altSource, value);
                if (expandedVal !== undefined) {
                    expandedSchema[key] = expandedVal;
                } else {
                    delete expandedSchema[key];
                }
            }
        });
        return expandedSchema;
    };

    fluid.prefs.expandCompositePanels = function (auxSchema, compositePanelList, panelIndex, panelCommonOptions, subPanelCommonOptions,
        compositePanelBasedOnSubCommonOptions, panelModelCommonOptions, mappedDefaults) {
        var panelsToIgnore = [];

        fluid.each(compositePanelList, function (compositeDetail, compositeKey) {
            var compositePanelOptions = {};
            var components = {};
            var initialModel = {};
            var selectors = {};
            var templates = {};
            var messages = {};
            var selectorsToIgnore = [];

            var thisCompositeOptions = fluid.copy(compositeDetail);
            fluid.set(compositePanelOptions, "type", thisCompositeOptions.type);
            delete thisCompositeOptions.type;

            selectors = fluid.prefs.rearrangeDirect(thisCompositeOptions, compositeKey, "container");
            templates = fluid.prefs.rearrangeDirect(thisCompositeOptions, compositeKey, "template");
            messages = fluid.prefs.rearrangeDirect(thisCompositeOptions, compositeKey, "message");

            var subPanelList = []; // list of subpanels to generate options for
            var subPanels = {};
            var subPanelRenderOn = {};

            // thisCompositeOptions.panels can be in two forms:
            // 1. an array of names of panels that should always be rendered;
            // 2. an object that describes what panels should be always rendered,
            //    and what panels should be rendered when a preference is turned on
            // The loop below is only needed for processing the latter.
            if (fluid.isPlainObject(thisCompositeOptions.panels) && !fluid.isArrayable(thisCompositeOptions.panels)) {
                fluid.each(thisCompositeOptions.panels, function (subpanelArray, pref) {
                    subPanelList = subPanelList.concat(subpanelArray);
                    if (pref !== "always") {
                        fluid.each(subpanelArray, function (onePanel) {
                            fluid.set(subPanelRenderOn, onePanel, pref);
                        });
                    }
                });
            } else {
                subPanelList = thisCompositeOptions.panels;
            }

            fluid.each(subPanelList, function (subPanelID) {
                panelsToIgnore.push(subPanelID);
                var subPanelPrefsKey = fluid.get(auxSchema, [subPanelID, "type"]);
                var safeSubPanelPrefsKey = fluid.prefs.subPanel.safePrefKey(subPanelPrefsKey);
                selectorsToIgnore.push(safeSubPanelPrefsKey);

                var subPanelOptions = fluid.copy(fluid.get(auxSchema, [subPanelID, "panel"]));
                var subPanelType = fluid.get(subPanelOptions, "type");

                fluid.set(subPanels, [safeSubPanelPrefsKey, "type"], subPanelType);
                var renderOn = fluid.get(subPanelRenderOn, subPanelID);
                if (renderOn) {
                    fluid.set(subPanels, [safeSubPanelPrefsKey, "options", "renderOnPreference"], renderOn);
                }

                // Deal with preferenceMap related options
                var map = fluid.defaults(subPanelType).preferenceMap[subPanelPrefsKey];
                var prefSchema = mappedDefaults[subPanelPrefsKey];

                fluid.each(map, function (primaryPath, internalPath) {
                    if (fluid.prefs.checkPrimarySchema(prefSchema, subPanelPrefsKey)) {
                        var opts;
                        if (internalPath.indexOf("model.") === 0) {
                            // Set up the binding in "rules" accepted by the modelRelay base grade of every panel
                            fluid.set(compositePanelOptions, ["options", "model"], fluid.get(compositePanelOptions, ["options", "model"]) || {});
                            fluid.prefs.addCommonOptions(compositePanelOptions, ["options", "model"], panelModelCommonOptions, {
                                internalModelName: safeSubPanelPrefsKey,
                                externalModelName: safeSubPanelPrefsKey
                            });
                            fluid.set(initialModel, ["members", "initialModel", "preferences", safeSubPanelPrefsKey], prefSchema[primaryPath]);
                        } else {
                            opts = opts || {options: {}};
                            fluid.set(opts, "options." + internalPath, prefSchema[primaryPath]);
                        }
                        $.extend(true, subPanels[safeSubPanelPrefsKey], opts);
                    }
                });

                fluid.set(templates, safeSubPanelPrefsKey, fluid.get(subPanelOptions, "template"));
                fluid.set(messages, safeSubPanelPrefsKey, fluid.get(subPanelOptions, "message"));

                fluid.set(compositePanelOptions, ["options", "selectors", safeSubPanelPrefsKey], fluid.get(subPanelOptions, "container"));
                fluid.set(compositePanelOptions, ["options", "resources"], fluid.get(compositePanelOptions, ["options", "resources"]) || {});

                fluid.prefs.addCommonOptions(compositePanelOptions.options, "resources", compositePanelBasedOnSubCommonOptions, {
                    subPrefKey: safeSubPanelPrefsKey
                });

                // add additional options from the aux schema for subpanels
                delete subPanelOptions.type;
                delete subPanelOptions.template;
                delete subPanelOptions.message;
                delete subPanelOptions.container;
                fluid.set(subPanels, [safeSubPanelPrefsKey, "options"], $.extend(true, {}, fluid.get(subPanels, [safeSubPanelPrefsKey, "options"]), subPanelOptions));

                fluid.prefs.addCommonOptions(subPanels, safeSubPanelPrefsKey, subPanelCommonOptions, {
                    compositePanel: compositeKey,
                    prefKey: safeSubPanelPrefsKey
                });
            });
            delete thisCompositeOptions.panels;

            // add additional options from the aux schema for the composite panel
            fluid.set(compositePanelOptions, ["options"], $.extend(true, {}, compositePanelOptions.options, thisCompositeOptions));
            fluid.set(compositePanelOptions, ["options", "selectorsToIgnore"], selectorsToIgnore);
            fluid.set(compositePanelOptions, ["options", "components"], subPanels);

            components[compositeKey] = compositePanelOptions;

            fluid.prefs.addCommonOptions(components, compositeKey, panelCommonOptions, {
                prefKey: compositeKey
            });

            // Add onto auxSchema
            fluid.prefs.addAtPath(auxSchema, ["panels", "components"], components);
            fluid.prefs.addAtPath(auxSchema, ["panels", "selectors"], selectors);
            fluid.prefs.addAtPath(auxSchema, ["templateLoader", "resources"], templates);
            fluid.prefs.addAtPath(auxSchema, ["messageLoader", "resources"], messages);
            fluid.prefs.addAtPath(auxSchema, "initialModel", initialModel);
            $.extend(true, auxSchema, {panelsToIgnore: panelsToIgnore});
        });

        return auxSchema;
    };

    // Processes the auxiliary schema to output an object that contains all grade component definitions
    // required for building the preferences editor, uiEnhancer and the settings store. These grade components
    // are: panels, enactors, initialModel, messageLoader, templateLoader and terms.
    // These grades are consumed and integrated by builder.js
    // (https://github.com/fluid-project/infusion/blob/master/src/framework/preferences/js/Builder.js)
    fluid.prefs.expandSchema = function (schemaToExpand, indexes, topCommonOptions, elementCommonOptions, mappedDefaults) {
        var auxSchema = fluid.prefs.expandSchemaImpl(schemaToExpand);
        auxSchema.namespace = auxSchema.namespace || "fluid.prefs.created_" + fluid.allocateGuid();

        var terms = fluid.get(auxSchema, "terms");
        if (terms) {
            delete auxSchema.terms;
            fluid.set(auxSchema, ["terms", "terms"], terms);
        }

        var compositePanelList = fluid.get(auxSchema, "groups");
        if (compositePanelList) {
            fluid.prefs.expandCompositePanels(auxSchema, compositePanelList, fluid.get(indexes, "panel"),
                fluid.get(elementCommonOptions, "panel"), fluid.get(elementCommonOptions, "subPanel"),
                fluid.get(elementCommonOptions, "compositePanelBasedOnSub"), fluid.get(elementCommonOptions, "panelModel"),
                mappedDefaults);
        }

        fluid.each(auxSchema, function (category, prefName) {
            // TODO: Replace this cumbersome scheme with one based on an extensible lookup to handlers
            var type = "panel";
            // Ignore the subpanels that are only for composing composite panels
            if (category[type] && !fluid.contains(auxSchema.panelsToIgnore, prefName)) {
                fluid.prefs.expandSchemaComponents(auxSchema, "panels", category.type, category[type], fluid.get(indexes, type),
                    fluid.get(elementCommonOptions, type), fluid.get(elementCommonOptions, type + "Model"), mappedDefaults);
            }

            type = "enactor";
            if (category[type]) {
                fluid.prefs.expandSchemaComponents(auxSchema, "enactors", category.type, category[type], fluid.get(indexes, type),
                    fluid.get(elementCommonOptions, type), fluid.get(elementCommonOptions, type + "Model"), mappedDefaults);
            }

            fluid.each(["template", "message"], function (type) {
                if (prefName === type) {
                    fluid.set(auxSchema, [type + "Loader", "resources", "prefsEditor"], auxSchema[type]);
                    delete auxSchema[type];
                }
            });

        });

        // Remove subPanels array. It is to keep track of the panels that are only used as sub-components of composite panels.
        if (auxSchema.panelsToIgnore) {
            delete auxSchema.panelsToIgnore;
        }

        // Add top common options
        fluid.each(topCommonOptions, function (topOptions, type) {
            fluid.prefs.addCommonOptions(auxSchema, type, topOptions);
        });

        return auxSchema;
    };

    fluid.defaults("fluid.prefs.auxBuilder", {
        gradeNames: ["fluid.prefs.auxSchema"],
        mergePolicy: {
            elementCommonOptions: "noexpand"
        },
        topCommonOptions: {
            panels: {
                gradeNames: ["fluid.prefs.prefsEditor"]
            },
            enactors: {
                gradeNames: ["fluid.uiEnhancer"]
            },
            templateLoader: {
                gradeNames: ["fluid.resourceLoader"]
            },
            messageLoader: {
                gradeNames: ["fluid.resourceLoader"]
            },
            initialModel: {
                gradeNames: ["fluid.prefs.initialModel"]
            },
            terms: {
                gradeNames: ["fluid.component"]
            }
        },
        elementCommonOptions: {
            panel: {
                "createOnEvent": "onPrefsEditorMarkupReady",
                "container": "{prefsEditor}.dom.%prefKey",
                "options.gradeNames": "fluid.prefs.prefsEditorConnections",
                "options.resources.template": "{templateLoader}.resources.%prefKey",
                "options.messageBase": "{messageLoader}.resources.%prefKey.resourceText"
            },
            panelModel: {
                "%internalModelName": "{prefsEditor}.model.preferences.%externalModelName"
            },
            compositePanelBasedOnSub: {
                "%subPrefKey": "{templateLoader}.resources.%subPrefKey"
            },
            subPanel: {
                "container": "{%compositePanel}.dom.%prefKey",
                "options.messageBase": "{messageLoader}.resources.%prefKey.resourceText"
            },
            enactor: {
                "container": "{uiEnhancer}.container"
            },
            enactorModel: {
                "%internalModelName": "{uiEnhancer}.model.%externalModelName"
            }
        },
        indexes: {
            panel: {
                expander: {
                    func: "fluid.indexDefaults",
                    args: ["panelsIndex", {
                        gradeNames: "fluid.prefs.panel",
                        indexFunc: "fluid.prefs.auxBuilder.prefMapIndexer"
                    }]
                }
            },
            enactor: {
                expander: {
                    func: "fluid.indexDefaults",
                    args: ["enactorsIndex", {
                        gradeNames: "fluid.prefs.enactor",
                        indexFunc: "fluid.prefs.auxBuilder.prefMapIndexer"
                    }]
                }
            }
        },
        mappedDefaults: {},
        expandedAuxSchema: {
            expander: {
                func: "fluid.prefs.expandSchema",
                args: [
                    "{that}.options.auxiliarySchema",
                    "{that}.options.indexes",
                    "{that}.options.topCommonOptions",
                    "{that}.options.elementCommonOptions",
                    "{that}.options.mappedDefaults"
                ]
            }
        }
    });

    fluid.prefs.auxBuilder.prefMapIndexer = function (defaults) {
        return fluid.keys(defaults.preferenceMap);
    };

})(jQuery, fluid_2_0_0);


text:
<component name="ProjectCodeStyleConfiguration">
  <code_scheme name="Project" version="173">
    <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="15" />
    <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="2" />
    <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
      <value />
    </option>
    <option name="IMPORT_LAYOUT_TABLE">
      <value>
        <package name="" withSubpackages="true" static="false" />
        <package name="de.exxcellent" withSubpackages="true" static="false" />
        <package name="" withSubpackages="true" static="true" />
      </value>
    </option>
    <option name="RIGHT_MARGIN" value="140" />
    <option name="WRAP_WHEN_TYPING_REACHES_RIGHT_MARGIN" value="true" />
    <option name="FORMATTER_TAGS_ENABLED" value="true" />
    <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
    <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
    <option name="WHILE_ON_NEW_LINE" value="true" />
    <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
    <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
    <option name="CALL_PARAMETERS_WRAP" value="1" />
    <option name="PREFER_PARAMETERS_WRAP" value="true" />
    <option name="EXTENDS_KEYWORD_WRAP" value="1" />
    <option name="THROWS_KEYWORD_WRAP" value="1" />
    <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
    <option name="BINARY_OPERATION_WRAP" value="1" />
    <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
    <option name="TERNARY_OPERATION_WRAP" value="1" />
    <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
    <option name="ARRAY_INITIALIZER_WRAP" value="1" />
    <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
    <option name="WRAP_COMMENTS" value="true" />
    <option name="IF_BRACE_FORCE" value="3" />
    <option name="DOWHILE_BRACE_FORCE" value="3" />
    <option name="WHILE_BRACE_FORCE" value="3" />
    <option name="FOR_BRACE_FORCE" value="3" />
    <JSCodeStyleSettings version="0">
      <option name="FORCE_SEMICOLON_STYLE" value="true" />
      <option name="USE_DOUBLE_QUOTES" value="false" />
      <option name="FORCE_QUOTE_STYlE" value="true" />
      <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
      <option name="SPACES_WITHIN_IMPORTS" value="true" />
      <option name="INDENT_CHAINED_CALLS" value="false" />
    </JSCodeStyleSettings>
    <JavaCodeStyleSettings>
      <option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="15" />
      <option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="2" />
      <option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
        <value />
      </option>
      <option name="IMPORT_LAYOUT_TABLE">
        <value>
          <package name="" withSubpackages="true" static="false" />
          <package name="de.exxcellent" withSubpackages="true" static="false" />
          <package name="" withSubpackages="true" static="true" />
        </value>
      </option>
      <option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
      <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
      <option name="JD_P_AT_EMPTY_LINES" value="false" />
      <option name="JD_KEEP_EMPTY_LINES" value="false" />
      <option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
      <option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
      <option name="JD_KEEP_EMPTY_RETURN" value="false" />
      <option name="JD_PRESERVE_LINE_FEEDS" value="true" />
    </JavaCodeStyleSettings>
    <XML>
      <option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
    </XML>
    <codeStyleSettings language="GSP">
      <indentOptions>
        <option name="INDENT_SIZE" value="2" />
      </indentOptions>
    </codeStyleSettings>
    <codeStyleSettings language="Groovy">
      <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
      <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
      <option name="CALL_PARAMETERS_WRAP" value="1" />
      <option name="PREFER_PARAMETERS_WRAP" value="true" />
      <option name="EXTENDS_KEYWORD_WRAP" value="1" />
      <option name="THROWS_KEYWORD_WRAP" value="1" />
      <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
      <option name="BINARY_OPERATION_WRAP" value="1" />
      <option name="TERNARY_OPERATION_WRAP" value="1" />
      <option name="KEEP_SIMPLE_BLOCKS_IN_ONE_LINE" value="true" />
      <option name="IF_BRACE_FORCE" value="1" />
      <option name="WHILE_BRACE_FORCE" value="1" />
      <option name="FOR_BRACE_FORCE" value="1" />
      <indentOptions>
        <option name="INDENT_SIZE" value="2" />
      </indentOptions>
    </codeStyleSettings>
    <codeStyleSettings language="JAVA">
      <option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
      <option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
      <option name="WHILE_ON_NEW_LINE" value="true" />
      <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
      <option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
      <option name="CALL_PARAMETERS_WRAP" value="1" />
      <option name="PREFER_PARAMETERS_WRAP" value="true" />
      <option name="EXTENDS_KEYWORD_WRAP" value="1" />
      <option name="THROWS_KEYWORD_WRAP" value="1" />
      <option name="METHOD_CALL_CHAIN_WRAP" value="1" />
      <option name="BINARY_OPERATION_WRAP" value="1" />
      <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
      <option name="TERNARY_OPERATION_WRAP" value="1" />
      <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
      <option name="ARRAY_INITIALIZER_WRAP" value="1" />
      <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
      <option name="IF_BRACE_FORCE" value="3" />
      <option name="DOWHILE_BRACE_FORCE" value="3" />
      <option name="WHILE_BRACE_FORCE" value="3" />
      <option name="FOR_BRACE_FORCE" value="3" />
    </codeStyleSettings>
    <codeStyleSettings language="JavaScript">
      <option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
      <option name="WHILE_ON_NEW_LINE" value="true" />
      <option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
      <option name="CALL_PARAMETERS_WRAP" value="1" />
      <option name="BINARY_OPERATION_WRAP" value="1" />
      <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
      <option name="TERNARY_OPERATION_WRAP" value="1" />
      <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
      <option name="KEEP_SIMPLE_BLOCKS_IN_ONE_LINE" value="true" />
      <option name="KEEP_SIMPLE_METHODS_IN_ONE_LINE" value="true" />
      <option name="ARRAY_INITIALIZER_WRAP" value="1" />
      <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
      <option name="IF_BRACE_FORCE" value="3" />
      <option name="DOWHILE_BRACE_FORCE" value="3" />
      <option name="WHILE_BRACE_FORCE" value="3" />
      <option name="FOR_BRACE_FORCE" value="3" />
      <indentOptions>
        <option name="INDENT_SIZE" value="2" />
        <option name="CONTINUATION_INDENT_SIZE" value="2" />
        <option name="TAB_SIZE" value="2" />
      </indentOptions>
    </codeStyleSettings>
    <codeStyleSettings language="TypeScript">
      <option name="WHILE_ON_NEW_LINE" value="true" />
      <option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
      <option name="CALL_PARAMETERS_WRAP" value="1" />
      <option name="EXTENDS_KEYWORD_WRAP" value="1" />
      <option name="BINARY_OPERATION_WRAP" value="1" />
      <option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
      <option name="TERNARY_OPERATION_WRAP" value="1" />
      <option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
      <option name="ARRAY_INITIALIZER_WRAP" value="1" />
      <option name="ARRAY_INITIALIZER_LBRACE_ON_NEXT_LINE" value="true" />
      <option name="IF_BRACE_FORCE" value="3" />
      <option name="DOWHILE_BRACE_FORCE" value="3" />
      <option name="WHILE_BRACE_FORCE" value="3" />
      <option name="FOR_BRACE_FORCE" value="3" />
    </codeStyleSettings>
  </code_scheme>
</component>


text:
package com.otogami.web.controller;

public class LambdaControllerHolder implements ControllerHolder{

	private LambdaController controller;

	public LambdaControllerHolder(LambdaController controller) {
		this.controller=controller;
	}

	public LambdaController getController(){
		return controller;
	}

	@Override
	public HolderType getType(){
		return HolderType.LambdaHolder;
	}

}