text:
require 'simple_form'
require 'simple_form/form_builder'

module Aktooor
  class FormBuilder < SimpleForm::FormBuilder
    include FormTransformer

    def ooor_input(attribute_name, attrs={}, &block)
      attribute_name = attribute_name.to_s
      options = {}
      attrs.each { |k, v| options[k] = v if v && !v.blank? }
      options[:oe_type] = options[:widget] || fields[attribute_name]['type']
      options[:as] = Ooor::Base.to_rails_type(options[:oe_type])
      options[:hint] ||= fields[attribute_name]['help']
      options[:required] ||= fields[attribute_name]['required'] || false
      options[:style] ||= {}
      options.delete(:width)
      options.delete('width')
      options.delete(:style).delete('width')

      if options.delete(:readonly)
        options[:disabled] = true
      elsif fields[attribute_name]['readonly']
        status = @object.attributes['state'] || 'draft'
        if fields[attribute_name]['states'] && fields[attribute_name]['states'][status] && x=fields[attribute_name]['states'][status][0]
          options[:disabled] = x[0] if x[0] = 'readonly'
        else
          options[:disabled] = fields[attribute_name]['readonly']
        end
      end
      options[:as] = 'hidden' if options[:invisible]
      adapt_label(attribute_name, options)
      capture_on_change(attribute_name, options) if options[:on_change_js]
      dispatch_input(attribute_name, options)
    end

    def adapt_label(attribute_name, options)
      if options[:nolabel]
        if @labels[attribute_name] #TODO study if we can do closer to OE
          options[:label] ||= fields[attribute_name]['string']
          options[:label_html] = {class: "col-md-3"}
        else
          options[:label] = false
        end
      else
        options[:label] ||= fields[attribute_name]['string']
      end
    end

    def oe_form_label(attrs)
      @labels ||= {}
      @labels[attrs[:for]] = attrs[:label]
      return ""
    end

    def ooor_button(label, options)
      @template.link_to(label, options) do
        "<button type='button' class='btn btn-primary'>#{label}</button>".html_safe #todo Bootstrap icon?
      end
    end

    def ooor_image_field(name, options)
      self.multipart = true
      if fields[name]['type'] == 'char' # it's just an image URL, image binary shouldn't be posted to OpenERP!
        method = "ooor_special_file_#{name}"
        url = @object.attributes[name] || @object.send(name) || "http://www.placehold.it/180x180/EFEFEF/AAAAAA&text=#{I18n.t('No+Image', :default => 'No+Image')}"
        image_placeholder = ""
      else
        method = name
        image_placeholder = ""
      end
      options[:class] = 'fileinput'
      html = <<-EOS

#{label(name, label: (options[:label] || options.delete('string') || fields[name]['string']), class: 'string control-label', required: options[:required])}

    #{image_placeholder}

    Select imageChange#{file_field(method, options)}
    Remove

      EOS
      html.html_safe
    end

    def ooor_many2one_field(name, options) #TODO make work if reference
      rel_name = "#{name}_id"

      if @object.class.polymorphic_m2o_associations.keys.index(name)
        options[:disabled] = true # TODO edition of reference field not supported yet by Aktooor
        if @object.associations[name]
          rel_id = @object.associations[name].split(',')[1]
          rel_key = @object.associations[name].split(',')[0]
          rel_path = (rel_key).gsub('.', '-')
          rel_klass = @object.class.const_get(rel_key)
          rel_value = rel_klass.name_get([rel_id.to_i], ooor_context)[0][1]
        else
          rel_value = ""
          rel_path = ""
        end
      else
        if @object.associations[name]
          if @object.associations[name].is_a?(Array)
            rel_id = @object.associations[name][0]
            rel_value = @object.associations[name][1]
          else
            rel_id = @object.associations[name]
            rel_klass = @object.class.const_get(@object.class.all_fields[name]['relation'])
            rel_value = rel_klass.name_get([rel_id.to_i], ooor_context)[0][1]
          end
        else
          rel_id = @object.associations[name] || @object.send(rel_name.to_sym)
          if rel_id
            rel_klass = @object.class.const_get(@object.class.all_fields[name]['relation'])
            rel_value = rel_klass.name_get([rel_id.to_i], ooor_context)[0][1]
          else
            rel_value = ''
          end
        end

        rel_path = fields[name]['relation'].gsub('.', '-')
      end

      ajax_path = "/ooorest/#{rel_path}.json"
      opts = {label: (options[:label] || options.delete('string') || fields[name]['string']), class: 'string control-label', required: options[:required]}
      opts[:label_html] = opts.except(:label, :required, :as)
the_label = SimpleForm::Inputs::Base.new(self, name, nil, nil, opts).label

      block = <<-EOS

#{the_label}
<input type='hidden' id='#{@object_name}_#{name}' name='#{@object_name}[#{name}]' value='#{rel_id}' value-name='#{rel_value}'/>

       EOS

      capture_association_js(name, options)
      return block.html_safe
    end

    def ooor_many2many_field(name, options)
      rel_name = "#{name}_ids"
      rel_path = fields[name]['relation'].gsub('.', '-')
      ajax_path = "/ooorest/#{rel_path}.json" #TODO use URL generator
      val = @object.send(rel_name.to_sym)
      if !val || val.is_a?(String) && val.is_blank? || val.is_a?(Array) && val.empty?
        val = []
        rel_ids_string = ""
        rel_value = ''
      else
        val = val.split(",") if val.is_a?(String)
        rel_ids = val.map! {|i| i.is_a?(Ooor::Base) ? i.id : i.to_i}
        rel_ids = [rel_ids] if rel_ids && !rel_ids.is_a?(Array)
        rel_ids_string = rel_ids.join(",")
        rel_klass = @object.class.const_get(fields[name]['relation']) #@object.class.reflect_on_association(:categ_id).klass
        objects = rel_klass.name_get(rel_ids)
        if objects
          rel_value = objects.map {|i| i[1]}.join(',')
        else
          rel_value = ''
        end
      end

      block = <<-EOS

#{label(name, label: (options[:label] || options.delete('string') || fields[name]['string']), class: 'string control-label', required: options[:required])}
<input type='hidden' id='#{@object_name}_#{name}' name='#{@object_name}[#{name}]' value='#{rel_ids_string}' value-name='#{rel_value}'/>

      EOS

      capture_association_js(name, options)
      return block.html_safe
    end

    def capture_on_change(name, options)
      @template.content_for :js do
        javascript = <<-EOS
$('##{@object_name}_#{name}').change(function() {
  #{options[:on_change_js]};
});
        EOS
        javascript.html_safe
      end
    end

    def capture_association_js(name, options)
      rel_path = fields[name]['relation'].gsub('.', '-')
      ajax_path = "/ooorest/#{rel_path}.json"
      if ['many2many_tags', 'many2many'].index(options[:oe_type]) #multiple
        multiple = "true"
        init_selection = <<-EOS
initSelection: function (element, callback) {
        var data = [];
        var ids = $(element).attr('value').split(',')
        var c = 0;
        $($(element).attr('value-name').split(',')).each(function () {
            data.push({name: this, id: ids[c]});
            c += 1;
        });
        callback(data);
    },
EOS
        maximum_selection_size = "maximumSelectionSize: #{options[:maximum_selection_size] || 15},"
      else
        multiple = "false"
        init_selection = <<-EOS
initSelection: function (element, callback) {
      var elementText = $(element).attr('value-name');
      callback({name: elementText});
    },
EOS
        maximum_selection_size = ""
      end

      @template.content_for :js do
        javascript = <<-EOS
$(document).ready(function() {
  $('##{@object_name}_#{name}').select2({
    placeholder: '#{fields[name]['string']}',
    width: 'element',
    minimumInputLength: #{options[:mininum_input_length] || 2},
    multiple: #{multiple},
    #{maximum_selection_size}
    formatSelection: function(category) {
      return category.name;
    },
    #{init_selection}
    formatResult: function(item) {
      return item.name;
    },
    ajax: {
      url: '#{ajax_path}',
      data: function (name, page) {
        return {
          q: name, // search term
          limit: 20,
          fields: ['name'],
          domain: eval(#{options[:domain_js] || '[]'}),
        }
      },
      dataType: 'json',
      results: function(data, page) {
        return { results: $.map( data, function(categ, i) {
          return categ;
        } ) }
      }
    }
  });

if (#{options[:disabled] == true}) {
  $('##{@object_name}_#{name}').select2('readonly', true);
}
});
        EOS
        javascript.html_safe
      end
    end

    def dispatch_input(name, options={}) #TODO other OE attrs!
      case options[:oe_type]
      when 'image'
        ooor_image_field(name, options)
      when 'many2one'
        ooor_many2one_field(name, options)
      when 'reference'
        ooor_many2one_field(name, options)
      when 'many2many'
        ooor_many2many_field(name, options)
      when 'many2many_tags'
        ooor_many2many_field(name, options)
      when 'mail_followers'
        options[:disabled] = true
        ooor_many2many_field(name, options)
      when 'html'
        text_area(name, options)
      when 'selection'
        if @object.associations[name].is_a?(Array)
          selected_value = @object.associations[name][0]
        elsif @object.associations[name]
          selected_value = @object.associations[name]
        else
          selected = @object.send(name.to_sym)
          selected_value = selected.is_a?(Ooor::Base) ? selected.id : selected
        end
        if options[:collection]
          collection = options[:collection]
        elsif fields[name]['type'] == 'many2one' # it's a many2one with a selection widget
          rel_klass = @object.class.const_get(fields[name]['relation'])
          if options[:domain_rb]
            collection_ids = rel_klass.search(options[:domain_rb])
            collection = rel_klass.name_get(collection_ids).map {|i| [i[1], i[0]]}
          else
            collection = rel_klass.name_search("%").map {|i| [i[1], i[0]]}
          end
          collection = [['-', '']] + collection unless fields[name]['required']
        else
          collection = fields[name]['selection'].map {|i| [i[1], i[0]]}
        end
        input name, options.merge(collection: collection, as: 'select', selected: selected_value)
      when 'statusbar'
        input name, options.merge(collection: fields[name]['selection'].map{|i|[i[1], i[0]]}, as: 'select')
      #simple_form from now on:
      when 'one2many'
        html = label(name, label: (options[:label] || options.delete('string') || fields[name]['string']), class: 'string control-label', required: options[:required])
        html << "
".html_safe
        html << (simple_fields_for name.to_sym do |item|
          @template.render 'nested_form', :f => item
        end)
        html << @template.link_to_add_association(self, name.to_sym, {:partial => 'nested_form'}) do #TODO if block given use it instead
"

    <button type='button' class='btn btn-success btn-lg'> Add </button>

".html_safe
        end
        html << "
".html_safe
        html.html_safe
      when 'mail_thread' #TODO this is only a poor demo fallback:
        options[:disabled] = true
        ooor_many2many_field(name, options)
      else
        input(name, options)
      end
    end

  end
end


text:
<?php
    /**
     * @author Manuel Thalmann <m@nuth.ch>
     * @license Apache-2.0
     */
    namespace System\Collections;
    use System\Object;
    {
        /**
         * Supports a simple iteration over a collection.
         *
         * @property-read mixed $Current
         * Gets the element in the collection at the current position of the enumerator.
         *
         * @property-read mixed $Valid
         * Gets a value indicating whether the current item could be determined.
         */
        class Enumerator extends Object implements \Iterator
        {
            /**
             * The function to iterate.
             *
             * @var \Closure
             */
            private $function;

            /**
             * The iterator.
             *
             * @var \Iterator
             */
            private $innerIterator;

            /**
             * Initializes a new instance of the Enumerator class with a function to iterate.
             *
             * @param \Closure $function
             * The function to iterate.
             */
            public function Enumerator1(\Closure $function)
            {
                $this->function = $function;
                $this->innerIterator = $function();
            }

            /**
             * @ignore
             * @return mixed
             */
            public function getCurrent()
            {
                return $this->current();
            }

            /**
             * @ignore
             * @return bool
             */
            public function getValid() : bool
            {
                return $this->valid();
            }

            /**
             * Returns the current element.
             *
             * @return mixed
             * The current element.
             */
            public function current()
            {
                return $this->innerIterator->current();
            }

            /**
             * Returns the key of the current element.
             *
             * @return mixed
             * The key of the current element.
             */
            public function key()
            {
                return $this->innerIterator->key();
            }

            /**
             * Advances the enumerator to the next element of the collection.
             *
             * @return void
             */
            public function next()
            {
                $this->innerIterator->next();
            }

            /**
             * Resets the current position to its initial state.
             *
             * @return void
             */
            public function rewind()
            {
                $this->innerIterator = ($this->function)();
            }

            /**
             * Returns a value indicating whether the current element is valid.
             *
             * @return bool
             * A value indicating whether the current element is valid.
             */
            public function valid() : bool
            {
                return $this->innerIterator->valid();
            }

            /**
             * Advances the enumerator to the next element of the collection.
             *
             * @return bool
             * **true** if the enumerator was successfully advanced to the next element; **false** if the enumerator has passed the end of the collection.
             */
            public function MoveNext() : bool
            {
                $this->next();
                return $this->Valid;
            }

            /**
             * Sets the enumerator to its initial position, which is before the first element in the collection.
             *
             * @return void
             */
            public function Reset()
            {
                $this->rewind();
            }
        }
    }
?>

redpajama_set_name: RedPajamaGithub


text:
import React, { PropTypes } from 'react';

const Legend = ({ info }) => {
  return (

      {info.map(infoItem => {
        let color = infoItem.color;
        let label = infoItem.label;
        return (

                  fiber_manual_record {label}

);
      })}

  );
};

const { array } = PropTypes;

Legend.propTypes = {
  info: array.isRequired
};

export default Legend;


text:
package com.intellij.util.indexing.impl.forward;

import com.intellij.util.indexing.IndexExtension;
import com.intellij.util.indexing.IndexId;
import com.intellij.util.indexing.impl.CollectionInputDataDiffBuilder;
import com.intellij.util.indexing.impl.InputData;
import com.intellij.util.indexing.impl.InputDataDiffBuilder;
import com.intellij.util.indexing.impl.InputIndexDataExternalizer;
import com.intellij.util.io.DataExternalizer;
import com.intellij.util.io.KeyDescriptor;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import java.util.Collection;
import java.util.Set;

//@ApiStatus.Experimental
public class KeyCollectionForwardIndexAccessor<Key, Value> extends AbstractForwardIndexAccessor<Key, Value, Collection<Key>> {
  public KeyCollectionForwardIndexAccessor(@Nonnull DataExternalizer<Collection<Key>> externalizer) {
    super(externalizer);
  }

  public KeyCollectionForwardIndexAccessor(@Nonnull IndexExtension<Key, Value, ?> extension) {
    this(extension.getKeyDescriptor(), extension.getName());
  }

  public KeyCollectionForwardIndexAccessor(@Nonnull KeyDescriptor<Key> externalizer, @Nonnull IndexId<Key, Value> indexId) {
    super(new InputIndexDataExternalizer<>(externalizer, indexId));
  }

  @Override
  protected InputDataDiffBuilder<Key, Value> createDiffBuilder(int inputId, @Nullable Collection<Key> keys) {
    return new CollectionInputDataDiffBuilder<>(inputId, keys);
  }

  @Nullable
  @Override
  public Collection<Key> convertToDataType(@Nonnull InputData<Key, Value> data) {
    Set<Key> keys = data.getKeyValues().keySet();
    return keys.isEmpty() ? null : keys;
  }

  @Override
  protected int getBufferInitialSize(@Nonnull Collection<Key> keys) {
    return 4 * keys.size();
  }
}


text:
package com.letv.shop.activity.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@Controller
@RequestMapping("tc")
public class TcController {
    //抢购信息列表页
    @RequestMapping(value = "",method = {RequestMethod.GET, RequestMethod.POST})
    public String tc() {

        return "/tc/list";
    }

    @RequestMapping(value = "/create/{rushType}", method = RequestMethod.GET)
    public String create(ModelMap model,@PathVariable("rushType") Byte rushType) {

        return "/tc/create"+rushType;
    }
    //抢购信息列表页
    @RequestMapping(value = "tc",method = {RequestMethod.GET, RequestMethod.POST})
    public String tc1() {

        return "/tc/tc";
    }
}


text:
<?php

require_once( AMP__DIR__ . '/includes/embeds/class-amp-base-embed-handler.php' );

// Much of this class is borrowed from Jetpack embeds
class AMP_DailyMotion_Embed_Handler extends AMP_Base_Embed_Handler {

	const URL_PATTERN = '#https?:\/\/(www\.)?dailymotion\.com\/video\/.*#i';
	const RATIO = 0.5625;

	protected $DEFAULT_WIDTH = 600;
	protected $DEFAULT_HEIGHT = 338;

	private static $script_slug = 'amp-dailymotion';
	private static $script_src = 'https://cdn.ampproject.org/v0/amp-dailymotion-0.1.js';

	function __construct( $args = array() ) {
		parent::__construct( $args );

		if ( isset( $this->args['content_max_width'] ) ) {
			$max_width = $this->args['content_max_width'];
			$this->args['width'] = $max_width;
			$this->args['height'] = round( $max_width * self::RATIO );
		}
	}

	function register_embed() {
		wp_embed_register_handler( 'amp-dailymotion', self::URL_PATTERN, array( $this, 'oembed' ), -1 );
		add_shortcode( 'dailymotion', array( $this, 'shortcode' ) );
	}

	public function unregister_embed() {
		wp_embed_unregister_handler( 'amp-dailymotion', -1 );
		remove_shortcode( 'dailymotion' );
	}

	public function get_scripts() {
		if ( ! $this->did_convert_elements ) {
			return array();
		}

		return array( self::$script_slug => self::$script_src );
	}

	public function shortcode( $attr ) {
		$video_id = false;

		if ( isset( $attr['id'] ) ) {
			$video_id = $attr['id'];
		} elseif ( isset( $attr[0] ) ) {
			$video_id = $attr[0];
		} elseif ( function_exists( 'shortcode_new_to_old_params' ) ) {
			$video_id = shortcode_new_to_old_params( $attr );
		}

		if ( empty( $video_id ) ) {
			return '';
		}

		return $this->render( array(
			'video_id' => $video_id,
		) );
	}

	public function oembed( $matches, $attr, $url, $rawattr ) {
		$video_id = $this->get_video_id_from_url( $url );
		return $this->render( array(
			'video_id' => $video_id,
		) );
	}

	public function render( $args ) {
		$args = wp_parse_args( $args, array(
			'video_id' => false,
		) );

		if ( empty( $args['video_id'] ) ) {
			return AMP_HTML_Utils::build_tag( 'a', array( 'href' => esc_url( $args['url'] ), 'class' => 'amp-wp-embed-fallback' ), esc_html( $args['url'] ) );
		}

		$this->did_convert_elements = true;

		return AMP_HTML_Utils::build_tag(
			'amp-dailymotion',
			array(
				'data-videoid' => $args['video_id'],
				'layout' => 'responsive',
				'width' => $this->args['width'],
				'height' => $this->args['height'],
			)
		);
	}

	private function get_video_id_from_url( $url ) {
		$parsed_url = AMP_WP_Utils::parse_url( $url );
		parse_str( $parsed_url['path'], $path );
		$tok = explode( '/', $parsed_url['path'] );
		$tok = explode( '_', $tok[2] );
		$video_id = $tok[0];

		return $video_id;
	}
}


text:
<?php

namespace Drupal\entity_test\Entity;

use Drupal\Core\Entity\EntityPublishedInterface;
use Drupal\Core\Entity\EntityPublishedTrait;
use Drupal\Core\Entity\EntityTypeInterface;

/**
 * Defines the test entity class.
 *
 * @ContentEntityType(
 *   id = "entity_test_revpub",
 *   label = @Translation("Test entity - revisions and publishing status"),
 *   handlers = {
 *     "access" = "Drupal\entity_test\EntityTestAccessControlHandler",
 *     "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
 *     "form" = {
 *       "default" = "Drupal\entity_test\EntityTestForm",
 *       "delete" = "Drupal\entity_test\EntityTestDeleteForm",
 *       "delete-multiple-confirm" = "Drupal\Core\Entity\Form\DeleteMultipleForm"
 *     },
 *     "view_builder" = "Drupal\entity_test\EntityTestViewBuilder",
 *   },
 *   base_table = "entity_test_revpub",
 *   revision_table = "entity_test_revpub_revision",
 *   admin_permission = "administer entity_test content",
 *   show_revision_ui = TRUE,
 *   entity_keys = {
 *     "id" = "id",
 *     "uuid" = "uuid",
 *     "revision" = "revision_id",
 *     "bundle" = "type",
 *     "label" = "name",
 *     "langcode" = "langcode",
 *     "published" = "status",
 *   },
 *   links = {
 *     "add-form" = "/entity_test_rev/add",
 *     "canonical" = "/entity_test_rev/manage/{entity_test_rev}",
 *     "delete-form" = "/entity_test/delete/entity_test_rev/{entity_test_rev}",
 *     "delete-multiple-form" = "/entity_test_rev/delete_multiple",
 *     "edit-form" = "/entity_test_rev/manage/{entity_test_rev}/edit",
 *     "revision" = "/entity_test_rev/{entity_test_rev}/revision/{entity_test_rev_revision}/view",
 *   }
 * )
 */
class EntityTestRevPub extends EntityTestRev implements EntityPublishedInterface {

  use EntityPublishedTrait;

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields = parent::baseFieldDefinitions($entity_type);

    // Add the publishing status field.
    $fields += static::publishedBaseFieldDefinitions($entity_type);

    return $fields;
  }

}


text:
using ArmnnDriver   = armnn_driver::ArmnnDriver;
using DriverOptions = armnn_driver::DriverOptions;

using namespace driverTestHelpers;
using namespace android::hardware;

using HalPolicy = hal_1_3::HalPolicy;

static const float TOLERANCE = 1.0f;

namespace
{

template<typename T>
RequestArgument CreateRequestArgument(const std::vector<T>& value, unsigned int poolIndex)
{
    V1_0::DataLocation inputInloc = {};
    inputInloc.poolIndex = poolIndex;
    inputInloc.offset = 0;
    inputInloc.length = value.size() * sizeof(T);
    RequestArgument inputRequestArgument = {};
    inputRequestArgument.location = inputInloc;
    inputRequestArgument.dimensions = hidl_vec<uint32_t>{};
    return inputRequestArgument;
}

// Helper function to create an OperandLifeTime::NO_VALUE for testing.
// To be used on optional input operands that have no values - these are valid and should be tested.
HalPolicy::OperandLifeTime CreateNoValueLifeTime(const hidl_vec<uint32_t>& dimensions)
{
    // Only create a NO_VALUE for optional operands that have no elements
    if (dimensions.size() == 0 || dimensions[0] == 0)
    {
        return HalPolicy::OperandLifeTime::NO_VALUE;
    }
    return HalPolicy::OperandLifeTime::CONSTANT_COPY;
}

void ExecuteModel(const armnn_driver::hal_1_3::HalPolicy::Model& model,
                  armnn_driver::ArmnnDriver& driver,
                  const V1_0::Request& request)
{
    android::sp<V1_3::IPreparedModel> preparedModel = PrepareModel_1_3(model, driver);
    if (preparedModel.get() != nullptr)
    {
        Execute(preparedModel, request);
    }
}

// Add our own tests here since we skip the qlstm tests which Google supplies (because of non-const weights)
void QLstmTestImpl(const hidl_vec<uint32_t>&   inputDimensions,
                   const std::vector<int8_t>&   inputValue,
                   const hidl_vec<uint32_t>&    inputToInputWeightsDimensions,
                   const std::vector<int8_t>&   inputToInputWeightsValue,
                   const hidl_vec<uint32_t>&    inputToForgetWeightsDimensions,
                   const std::vector<int8_t>&   inputToForgetWeightsValue,
                   const hidl_vec<uint32_t>&    inputToCellWeightsDimensions,
                   const std::vector<int8_t>&   inputToCellWeightsValue,
                   const hidl_vec<uint32_t>&    inputToOutputWeightsDimensions,
                   const std::vector<int8_t>&   inputToOutputWeightsValue,
                   const hidl_vec<uint32_t>&    recurrentToInputWeightsDimensions,
                   const std::vector<int8_t>&   recurrentToInputWeightsValue,
                   const hidl_vec<uint32_t>&    recurrentToForgetWeightsDimensions,
                   const std::vector<int8_t>&   recurrentToForgetWeightsValue,
                   const hidl_vec<uint32_t>&    recurrentToCellWeightsDimensions,
                   const std::vector<int8_t>&   recurrentToCellWeightsValue,
                   const hidl_vec<uint32_t>&    recurrentToOutputWeightsDimensions,
                   const std::vector<int8_t>&   recurrentToOutputWeightsValue,
                   const hidl_vec<uint32_t>&    cellToInputWeightsDimensions,
                   const std::vector<int16_t>&  cellToInputWeightsValue,
                   const hidl_vec<uint32_t>&    cellToForgetWeightsDimensions,
                   const std::vector<int16_t>&  cellToForgetWeightsValue,
                   const hidl_vec<uint32_t>&    cellToOutputWeightsDimensions,
                   const std::vector<int16_t>&  cellToOutputWeightsValue,
                   const hidl_vec<uint32_t>&    inputGateBiasDimensions,
                   const std::vector<int32_t>&  inputGateBiasValue,
                   const hidl_vec<uint32_t>&    forgetGateBiasDimensions,
                   const std::vector<int32_t>&  forgetGateBiasValue,
                   const hidl_vec<uint32_t>&    cellBiasDimensions,
                   const std::vector<int32_t>&  cellBiasValue,
                   const hidl_vec<uint32_t>&    outputGateBiasDimensions,
                   const std::vector<int32_t>&  outputGateBiasValue,
                   const hidl_vec<uint32_t>&    projectionWeightsDimensions,
                   const std::vector<int8_t>&   projectionWeightsValue,
                   const hidl_vec<uint32_t>&    projectionBiasDimensions,
                   const std::vector<int32_t>&  projectionBiasValue,
                   const hidl_vec<uint32_t>&    outputPreviousTimeStepInDimensions,
                   const std::vector<int8_t>&   outputPreviousTimeStepInValue,
                   const hidl_vec<uint32_t>&    cellStatePreviousTimeStepInDimensions,
                   const std::vector<int16_t>&  cellStatePreviousTimeStepInValue,
                   const hidl_vec<uint32_t>&    inputLayerNormWeightsDimensions,
                   const std::vector<int16_t>&  inputLayerNormWeightsValue,
                   const hidl_vec<uint32_t>&    forgetLayerNormWeightsDimensions,
                   const std::vector<int16_t>&  forgetLayerNormWeightsValue,
                   const hidl_vec<uint32_t>&    cellLayerNormWeightsDimensions,
                   const std::vector<int16_t>&  cellLayerNormWeightsValue,
                   const hidl_vec<uint32_t>&    outputLayerNormWeightsDimensions,
                   const std::vector<int16_t>&  outputLayerNormWeightsValue,
                   const float&                 cellClipValue,
                   const float&                 projectionClipValue,
                   const float&                 matMulInputGateValue,
                   const float&                 matMulForgetGateValue,
                   const float&                 matMulCellGateValue,
                   const float&                 matMulOutputGateValue,
                   const int32_t&               projInputZeroPointValue,
                   const float&                 projInputScaleValue,
                   const hidl_vec<uint32_t>&    outputStateOutDimensions,
                   const std::vector<int8_t>&   outputStateOutValue,
                   const hidl_vec<uint32_t>&    cellStateOutDimensions,
                   const std::vector<int16_t>&  cellStateOutValue,
                   const hidl_vec<uint32_t>&    outputDimensions,
                   const std::vector<int8_t>&   outputValue,
                   armnn::Compute               compute)
{
    auto driver = std::make_unique<ArmnnDriver>(DriverOptions(compute));
    HalPolicy::Model model = {};

    // Scale/Offset quantization info
    float inputScale    = 0.0078125f;
    int32_t inputOffset = 0;

    int32_t hiddenStateZeroPoint = 0;
    float hiddenStateScale       = 0.007f;

    float outputScale    = hiddenStateScale;
    int32_t outputOffset = hiddenStateZeroPoint;

    float cellStateScale    = 3.05176e-05f;
    float cellWeightsScale  = 1.0f;
    int32_t cellStateOffset = 0;

    float weightsScale    = 0.00784314f;
    int32_t weightsOffset = 0;

    float layerNormScale    = 3.05182e-05f;
    int32_t layerNormOffset = 0;

    float biasScale    = layerNormScale / 1024;
    int32_t biasOffset = 0;

    // Inputs:
    // 00: The input to the LSTM cell. Type: ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED Shape: [batchSize, inputSize]
    AddInputOperand<HalPolicy>(model,
                               inputDimensions,
                               HalPolicy::OperandType::TENSOR_QUANT8_ASYMM_SIGNED,
                               inputScale,
                               inputOffset);

    // 01: The input-to-input weights. Optional. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, inputSize]
    AddTensorOperand<HalPolicy>(model,
                                inputToInputWeightsDimensions,
                                inputToInputWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(inputToInputWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 02: The input-to-forget weights. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, inputSize]
    AddTensorOperand<HalPolicy>(model,
                                inputToForgetWeightsDimensions,
                                inputToForgetWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(inputToForgetWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 03: The input-to-cell weights. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, inputSize]
    AddTensorOperand<HalPolicy>(model,
                                inputToCellWeightsDimensions,
                                inputToCellWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(inputToCellWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 04: The input-to-output weights. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, inputSize]
    AddTensorOperand<HalPolicy>(model,
                                inputToOutputWeightsDimensions,
                                inputToOutputWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(inputToOutputWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 05: The recurrent-to-input weights. Optional. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM
    //     Shape: [numUnits, outputSize]
    AddTensorOperand<HalPolicy>(model,
                                recurrentToInputWeightsDimensions,
                                recurrentToInputWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(recurrentToInputWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 06: The recurrent-to-forget weights. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, outputSize]
    AddTensorOperand<HalPolicy>(model,
                                recurrentToForgetWeightsDimensions,
                                recurrentToForgetWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(recurrentToForgetWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 07: The recurrent-to-cell weights. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, outputSize]
    AddTensorOperand<HalPolicy>(model,
                                recurrentToCellWeightsDimensions,
                                recurrentToCellWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(recurrentToCellWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 08: The recurrent-to-output weights. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [numUnits, outputSize]
    AddTensorOperand<HalPolicy>(model,
                                recurrentToOutputWeightsDimensions,
                                recurrentToOutputWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(recurrentToOutputWeightsDimensions),
                                weightsScale,
                                weightsOffset);

    // 09: The cell-to-input weights (for peephole). Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM
    //     Shape: [numUnits]
    AddTensorOperand<HalPolicy>(model,
                                cellToInputWeightsDimensions,
                                cellToInputWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT16_SYMM ,
                                CreateNoValueLifeTime(cellToInputWeightsDimensions),
                                cellWeightsScale,
                                weightsOffset);

    // 10: The cell-to-forget weights (for peephole). Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM
    //     Shape: [numUnits].
    AddTensorOperand<HalPolicy>(model,
                                cellToForgetWeightsDimensions,
                                cellToForgetWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                CreateNoValueLifeTime(cellToForgetWeightsDimensions),
                                cellWeightsScale,
                                weightsOffset);

    // 11: The cell-to-output weights (for peephole). Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM
    //     Shape: [numUnits]
    AddTensorOperand<HalPolicy>(model,
                                cellToOutputWeightsDimensions,
                                cellToOutputWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                CreateNoValueLifeTime(cellToOutputWeightsDimensions),
                                cellWeightsScale,
                                weightsOffset);

    // 12: The input gate bias. Quantized with scale being the product of input and weights scales
    //     and zeroPoint equal to 0. Optional. Type: ANEURALNETWORKS_TENSOR_INT32 Shape: [numUnits]
    AddTensorOperand<HalPolicy>(model,
                                inputGateBiasDimensions,
                                inputGateBiasValue,
                                HalPolicy::OperandType::TENSOR_INT32,
                                CreateNoValueLifeTime(inputGateBiasDimensions),
                                biasScale,
                                biasOffset);

    // 13: The forget gate bias. Quantized with scale being the product of input and weights scales
    //     and zeroPoint equal to 0. Type: ANEURALNETWORKS_TENSOR_INT32 Shape: [numUnits]
    AddTensorOperand<HalPolicy>(model,
                                forgetGateBiasDimensions,
                                forgetGateBiasValue,
                                HalPolicy::OperandType::TENSOR_INT32,
                                CreateNoValueLifeTime(forgetGateBiasDimensions),
                                biasScale,
                                biasOffset);

    // 14: The cell bias. Quantized with scale being the product of input and weights scales and zeroPoint equal to 0.
    //     Type: ANEURALNETWORKS_TENSOR_INT32 Shape: [numUnits]
    AddTensorOperand<HalPolicy>(model,
                                cellBiasDimensions,
                                cellBiasValue,
                                HalPolicy::OperandType::TENSOR_INT32,
                                CreateNoValueLifeTime(cellBiasDimensions),
                                biasScale,
                                biasOffset);

    // 15: The output gate bias. Quantized with scale being the product of input and weights scales
    //     and zeroPoint equal to 0. Type: ANEURALNETWORKS_TENSOR_INT32 Shape: [numUnits]
    AddTensorOperand<HalPolicy>(model,
                                outputGateBiasDimensions,
                                outputGateBiasValue,
                                HalPolicy::OperandType::TENSOR_INT32,
                                CreateNoValueLifeTime(outputGateBiasDimensions),
                                biasScale,
                                biasOffset);

    // 16: The projection weights. Optional. Type: ANEURALNETWORKS_TENSOR_QUANT8_SYMM Shape: [outputSize, numUnits]
    AddTensorOperand<HalPolicy>(model,
                                projectionWeightsDimensions,
                                projectionWeightsValue,
                                HalPolicy::OperandType::TENSOR_QUANT8_SYMM,
                                CreateNoValueLifeTime(projectionWeightsDimensions),
                                0.00392157f,
                                weightsOffset);

    // 17: The projection bias. Quantized with scale being the product of input and weights scales
    //     and zeroPoint equal to 0. Optional. Type: ANEURALNETWORKS_TENSOR_INT32 Shape: [outputSize]
    AddTensorOperand<HalPolicy>(model,
                                projectionBiasDimensions,
                                projectionBiasValue,
                                HalPolicy::OperandType::TENSOR_INT32,
                                CreateNoValueLifeTime(projectionBiasDimensions),
                                0.0f,
                                biasOffset);

    // 18: The output from the previous time step. Type: ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED
    //     Shape: [batchSize, outputSize]
    AddInputOperand<HalPolicy>(model,
                               outputPreviousTimeStepInDimensions,
                               HalPolicy::OperandType::TENSOR_QUANT8_ASYMM_SIGNED,
                               cellStateScale,
                               inputOffset);

    // 19: The cell state from the previous time step. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM
    //     Shape: [batchSize, numUnits]
    AddInputOperand<HalPolicy>(model,
                               cellStatePreviousTimeStepInDimensions,
                               HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                               cellStateScale,
                               cellStateOffset);

    // If any of the tensors have a value all normalization tensors are set
    if (!inputLayerNormWeightsValue.empty()  ||
        !forgetLayerNormWeightsValue.empty() ||
        !cellLayerNormWeightsValue.empty()   ||
        !outputLayerNormWeightsValue.empty())
    {
        // Normalization:
        // 20: The input layer normalization weights. Used to rescale normalized inputs to activation at input gate.
        //      Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM Shape: [numUnits]
        AddTensorOperand<HalPolicy>(model,
                                    inputLayerNormWeightsDimensions,
                                    inputLayerNormWeightsValue,
                                    HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                    CreateNoValueLifeTime(inputLayerNormWeightsDimensions),
                                    layerNormScale,
                                    layerNormOffset);

        // 21: The forget layer normalization weights. Used to rescale normalized inputs to activation at forget gate.
        //     Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM Shape: [numUnits]
        AddTensorOperand<HalPolicy>(model,
                                    forgetLayerNormWeightsDimensions,
                                    forgetLayerNormWeightsValue,
                                    HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                    CreateNoValueLifeTime(forgetLayerNormWeightsDimensions),
                                    layerNormScale,
                                    layerNormOffset);

        // 22: The cell layer normalization weights. Used to rescale normalized inputs to activation at cell gate.
        //     Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM Shape: [numUnits]
        AddTensorOperand<HalPolicy>(model,
                                    cellLayerNormWeightsDimensions,
                                    cellLayerNormWeightsValue,
                                    HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                    CreateNoValueLifeTime(cellLayerNormWeightsDimensions),
                                    layerNormScale,
                                    layerNormOffset);

        // 23: The output layer normalization weights. Used to rescale normalized inputs to activation at output gate.
        //     Optional. Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM Shape: [numUnits]
        AddTensorOperand<HalPolicy>(model,
                                    outputLayerNormWeightsDimensions,
                                    outputLayerNormWeightsValue,
                                    HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                    CreateNoValueLifeTime(outputLayerNormWeightsDimensions),
                                    layerNormScale,
                                    layerNormOffset);
    }

    // Constant scalar values
    // 24: The cell clip. If provided the cell state is clipped by this value prior to the cell output activation.
    //     Optional. Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, cellClipValue);

    // Constant scalar values
    // 25: The projection clip. If provided and projection is enabled, this is used for clipping the projected values.
    //     Optional. Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, projectionClipValue);

    // Constant scalar values
    // 26: The scale of the intermediate result of matmul, i.e. input to layer normalization, at input gate.
    //     Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, matMulInputGateValue);

    // Constant scalar values
    // 27: The scale of the intermediate result of matmul, i.e. input to layer normalization, at forget gate.
    //     Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, matMulForgetGateValue);

    // Constant scalar values
    // 28: The scale of the intermediate result of matmul, i.e. input to layer normalization, at cell gate.
    //     Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, matMulCellGateValue);

    // Constant scalar values
    // 29: The scale of the intermediate result of matmul, i.e. input to layer normalization, at output gate.
    //     Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, matMulOutputGateValue);

    // Constant scalar values
    // 30: The zero point of the hidden state, i.e. input to projection. Type: ANEURALNETWORKS_INT32.
    AddIntOperand<HalPolicy>(model, projInputZeroPointValue);

    // Constant scalar values
    // 31: The scale of the hidden state, i.e. input to projection. Type: ANEURALNETWORKS_FLOAT32.
    AddFloatOperand<HalPolicy>(model, projInputScaleValue);

    // Outputs:
    //  0: The output state (out). Type: ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED Shape: [batchSize, outputSize]
    AddOutputOperand<HalPolicy>(model,
                                outputStateOutDimensions,
                                HalPolicy::OperandType::TENSOR_QUANT8_ASYMM_SIGNED,
                                cellStateScale,
                                cellStateScale);

    //  1: The cell state (out). Type: ANEURALNETWORKS_TENSOR_QUANT16_SYMM Shape: [batchSize, numUnits].
    AddOutputOperand<HalPolicy>(model,
                                cellStateOutDimensions,
                                HalPolicy::OperandType::TENSOR_QUANT16_SYMM,
                                cellStateScale,
                                cellStateOffset);

    //  2: The output. This is effectively the same as the current "output state (out)" value.
    //     Type: ANEURALNETWORKS_TENSOR_QUANT8_ASYMM_SIGNED Shape: [batchSize, outputSize]
    AddOutputOperand<HalPolicy>(model,
                                outputDimensions,
                                HalPolicy::OperandType::TENSOR_QUANT8_ASYMM_SIGNED,
                                cellStateScale,
                                cellStateScale);

    // make the QUANTIZED_LSTM operation
    model.main.operations.resize(1);
    model.main.operations[0].type = HalPolicy::OperationType::QUANTIZED_LSTM;

    model.main.operations[0].inputs = hidl_vec<uint32_t> { 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11,
                                                          12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
                                                          24, 25, 26, 27, 28, 29, 30, 31};
    model.main.operations[0].outputs = hidl_vec<uint32_t> {32, 33, 34};

    // define the input values
    hidl_vec<RequestArgument> inputArguments;
    inputArguments.resize(3);

    inputArguments[0] = CreateRequestArgument<int8_t>(inputValue, 0);
    inputArguments[1] = CreateRequestArgument<int8_t>(outputPreviousTimeStepInValue, 1);
    inputArguments[2] = CreateRequestArgument<int16_t>(cellStatePreviousTimeStepInValue, 2);

    // define the expected output values
    hidl_vec<RequestArgument> outputArguments;
    outputArguments.resize(3);

    outputArguments[0] = CreateRequestArgument<int8_t>(outputStateOutValue, 3);
    outputArguments[1] = CreateRequestArgument<int16_t>(cellStateOutValue, 4);
    outputArguments[2] = CreateRequestArgument<int8_t>(outputValue, 5);

    android::hardware::neuralnetworks::V1_0::Request request = {};
    request.inputs  = inputArguments;
    request.outputs = outputArguments;

    // set the input data
    AddPoolAndSetData(inputValue.size(), request, inputValue.data());
    AddPoolAndSetData(outputPreviousTimeStepInValue.size(), request, outputPreviousTimeStepInValue.data());
    AddPoolAndSetData(cellStatePreviousTimeStepInValue.size(), request, cellStatePreviousTimeStepInValue.data());

    // add memory for the outputs
    android::sp<IMemory> outputStateOutMemory = AddPoolAndGetData<int8_t>(outputStateOutValue.size(), request);
    int8_t* outputStateOutData = static_cast<int8_t*>(static_cast<void*>(outputStateOutMemory->getPointer()));

    android::sp<IMemory> cellStateOutMemory = AddPoolAndGetData<int16_t>(cellStateOutValue.size(), request);
    int16_t* cellStateOutData = static_cast<int16_t*>(static_cast<void*>(cellStateOutMemory->getPointer()));

    android::sp<IMemory> outputMemory = AddPoolAndGetData<int8_t>(outputValue.size(), request);
    int8_t* outputData = static_cast<int8_t*>(static_cast<void*>(outputMemory->getPointer()));

    // make the prepared model and run the execution
    ExecuteModel(model, *driver, request);

    // check the results
    for (size_t i = 0; i < outputStateOutValue.size(); ++i)
    {
        DOCTEST_CHECK_MESSAGE(outputStateOutValue[i] == doctest::Approx( outputStateOutData[i] ).epsilon(TOLERANCE),
                              "outputStateOut[" << i << "]: " << outputStateOutValue[i] << " != "
                              << outputStateOutData[i]);
    }

    // CELL STATE OUTPUT Does not match currently: IVGCVSW-4860 Verify remaining VTS tests (2) for QLSTM
    // Comment out for now
    // for (size_t i = 0; i < cellStateOutValue.size(); ++i)
    // {
    //    BOOST_TEST(TolerantCompareEqual(cellStateOutValue[i], cellStateOutData[i]),
    //               "cellStateOut[" << i << "]: " << cellStateOutValue[i] << " != " << cellStateOutData[i]);
    //}

    for (size_t i = 0; i < outputValue.size(); ++i)
    {
        DOCTEST_CHECK_MESSAGE(outputValue[i] == doctest::Approx( outputData[i] ).epsilon(TOLERANCE),
                              "output[" << i << "]: " << outputValue[i] << " != " << outputData[i]);
    }
}

void QLstmWithProjection(armnn::Compute compute)
{
    // This replicates android/frameworks/ml/nn/runtime/test/specs/V1_3/qlstm_projection.mod.py
    // with values from android/frameworks/ml/nn/runtime/test/generated/spec_V1_3/qlstm_projection.example.cpp
    // and weights, biases and scalars passed as CONSTANT_COPY tensors (instead of SUBGRAPH_INPUT tensors).

    uint32_t batchSize  = 2;
    uint32_t inputSize  = 5;
    uint32_t outputSize = 3;
    uint32_t numUnits   = 4;

    // Inputs:
    hidl_vec<uint32_t> inputDimensions{batchSize, inputSize};
    std::vector<int8_t> inputValue{ 90, 102, 13, 26, 38, 102, 13, 26, 51, 64};

    hidl_vec<uint32_t> inputToInputWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToInputWeightsValue{   64,  77,   89, -102,
                                                  -115,  13,   25,   38,
                                                   -51,  64, -102,   89,
                                                   -77,  64,  -51,  -64,
                                                   -51, -38,  -25,  -13 };

    hidl_vec<uint32_t> inputToForgetWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToForgetWeightsValue{ -77,  -13,  38,  25,
                                                   115,  -64, -25, -51,
                                                    38, -102, -51,  38,
                                                   -64,  -51, -77,  38,
                                                   -51,  -77, -64, -64 };

    hidl_vec<uint32_t> inputToCellWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToCellWeightsValue{  -51, -38, -25, -13,
                                                  -64,  64, -25, -38,
                                                  -25, -77,  77, -13,
                                                  -51, -38, -89,  89,
                                                 -115, -64, 102,  77 };

    hidl_vec<uint32_t> inputToOutputWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToOutputWeightsValue{ -102, -51, -25, -115,
                                                    -13, -89,  38,  -38,
                                                   -102, -25,  77,  -25,
                                                     51, -89, -38,  -64,
                                                     13,  64, -77,  -51 };

    hidl_vec<uint32_t> recurrentToInputWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToInputWeightsValue{ -25, -38, 51, 13, -64, 115, -25, -38, -89, 6, -25, -77 };

    hidl_vec<uint32_t> recurrentToForgetWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToForgetWeightsValue{ -64, -38, -64, -25, 77, 51, 115, 38, -13, 25, 64, 25 };

    hidl_vec<uint32_t> recurrentToCellWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToCellWeightsValue{ -38, 25, 13, -38, 102, -10, -25, 38, 102, -77, -13, 25 };

    hidl_vec<uint32_t> recurrentToOutputWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToOutputWeightsValue{ 38, -13, 13, -25, -64, -89, -25, -77, -13, -51, -89, -25 };

    hidl_vec<uint32_t> cellToInputWeightsDimensions{0};
    std::vector<int16_t> cellToInputWeightsValue;

    hidl_vec<uint32_t> cellToForgetWeightsDimensions{0};
    std::vector<int16_t> cellToForgetWeightsValue;

    hidl_vec<uint32_t> cellToOutputWeightsDimensions{0};
    std::vector<int16_t> cellToOutputWeightsValue;

    hidl_vec<uint32_t> inputGateBiasDimensions{numUnits};
    std::vector<int32_t> inputGateBiasValue{ 644245, 3221226, 4724464, 8160438 };

    hidl_vec<uint32_t> forgetGateBiasDimensions{numUnits};
    std::vector<int32_t> forgetGateBiasValue{ 2147484, -6442451, -4294968, 2147484 };

    hidl_vec<uint32_t> cellBiasDimensions{numUnits};
    std::vector<int32_t> cellBiasValue{-1073742, 15461883, 5368709, 1717987 };

    hidl_vec<uint32_t> outputGateBiasDimensions{numUnits};
    std::vector<int32_t> outputGateBiasValue{ 1073742, -214748, 4294968, 2147484 };

    hidl_vec<uint32_t> projectionWeightsDimensions{outputSize, numUnits};
    std::vector<int8_t> projectionWeightsValue{ -25, 51, 3, -51, 25, 127, 77, 20, 18, 51, -102, 51 };

    hidl_vec<uint32_t> projectionBiasDimensions{outputSize};
    std::vector<int32_t> projectionBiasValue{ 0, 0, 0 };

    hidl_vec<uint32_t> outputStateInDimensions{batchSize, outputSize};
    std::vector<int8_t> outputStateInValue{ 0, 0, 0, 0, 0, 0 };

    hidl_vec<uint32_t> cellStateInDimensions{batchSize, numUnits};
    std::vector<int16_t> cellStateInValue{ 0, 0, 0, 0, 0, 0, 0, 0 };

    // Normalization:
    hidl_vec<uint32_t> inputLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> inputLayerNormWeightsValue{ 3277, 6553, 9830, 16384 };

    hidl_vec<uint32_t> forgetLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> forgetLayerNormWeightsValue{ 6553, 6553, 13107, 9830 };

    hidl_vec<uint32_t> cellLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> cellLayerNormWeightsValue{ 22937, 6553, 9830, 26214 };

    hidl_vec<uint32_t> outputLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> outputLayerNormWeightsValue{ 19660, 6553, 6553, 16384 };

    float cellClipValue           = 0.0f;
    float projectionClipValue     = 0.0f;
    float inputIntermediateScale  = 0.007059f;
    float forgetIntermediateScale = 0.007812f;
    float cellIntermediateScale   = 0.007059f;
    float outputIntermediateScale = 0.007812f;
    int32_t hiddenStateZeroPoint  = 0;
    float hiddenStateScale        = 0.007f;

    // Outputs:
    hidl_vec<uint32_t> outputStateOutDimensions{batchSize, outputSize};
    std::vector<int8_t> outputStateOutValue{ 127, 127, -108, -67, 127, 127 };

    hidl_vec<uint32_t> cellStateOutDimensions{batchSize, numUnits};
    std::vector<int16_t> cellStateOutValue { -14650, 8939, 5771, 6715, -11843, 7847, 1508, 12939 };

    hidl_vec<uint32_t> outputDimensions{batchSize, outputSize};
    std::vector<int8_t> outputValue { 127, 127, -108, -67, 127, 127 };

    QLstmTestImpl(inputDimensions,                       inputValue,
                  inputToInputWeightsDimensions,         inputToInputWeightsValue,
                  inputToForgetWeightsDimensions,        inputToForgetWeightsValue,
                  inputToCellWeightsDimensions,          inputToCellWeightsValue,
                  inputToOutputWeightsDimensions,        inputToOutputWeightsValue,
                  recurrentToInputWeightsDimensions,     recurrentToInputWeightsValue,
                  recurrentToForgetWeightsDimensions,    recurrentToForgetWeightsValue,
                  recurrentToCellWeightsDimensions,      recurrentToCellWeightsValue,
                  recurrentToOutputWeightsDimensions,    recurrentToOutputWeightsValue,
                  cellToInputWeightsDimensions,          cellToInputWeightsValue,
                  cellToForgetWeightsDimensions,         cellToForgetWeightsValue,
                  cellToOutputWeightsDimensions,         cellToOutputWeightsValue,
                  inputGateBiasDimensions,               inputGateBiasValue,
                  forgetGateBiasDimensions,              forgetGateBiasValue,
                  cellBiasDimensions,                    cellBiasValue,
                  outputGateBiasDimensions,              outputGateBiasValue,
                  projectionWeightsDimensions,           projectionWeightsValue,
                  projectionBiasDimensions,              projectionBiasValue,
                  outputStateInDimensions,               outputStateInValue,
                  cellStateInDimensions,                 cellStateInValue,
                  inputLayerNormWeightsDimensions,       inputLayerNormWeightsValue,
                  forgetLayerNormWeightsDimensions,      forgetLayerNormWeightsValue,
                  cellLayerNormWeightsDimensions,        cellLayerNormWeightsValue,
                  outputLayerNormWeightsDimensions,      outputLayerNormWeightsValue,
                  cellClipValue,
                  projectionClipValue,
                  inputIntermediateScale,
                  forgetIntermediateScale,
                  cellIntermediateScale,
                  outputIntermediateScale,
                  hiddenStateZeroPoint,
                  hiddenStateScale,
                  outputStateOutDimensions,              outputStateOutValue,
                  cellStateOutDimensions,                cellStateOutValue,
                  outputDimensions,                      outputValue,
                  compute);
}

void QLstmWithNoProjection(armnn::Compute compute)
{
    // This replicates android/frameworks/ml/nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py
    // with values from android/frameworks/ml/nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp
    // and weights, biases and scalars passed as CONSTANT_COPY tensors (instead of SUBGRAPH_INPUT tensors).

    uint32_t batchSize  = 2;
    uint32_t inputSize  = 5;
    uint32_t outputSize = 4;
    uint32_t numUnits   = 4;

    // Inputs:
    hidl_vec<uint32_t> inputDimensions{batchSize, inputSize};
    std::vector<int8_t> inputValue { 90, 102, 13, 26, 38, 102, 13, 26, 51, 64 };

    hidl_vec<uint32_t> inputToInputWeightsDimensions{0, 0};
    std::vector<int8_t> inputToInputWeightsValue;

    hidl_vec<uint32_t> inputToForgetWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToForgetWeightsValue { -77, -13,  38,  25,  115,
                                                    -64, -25, -51,  38, -102,
                                                    -51,  38, -64, -51,  -77,
                                                     38, -51, -77, -64,  -64 };

    hidl_vec<uint32_t> inputToCellWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToCellWeightsValue { -51,  -38, -25, -13, -64,
                                                   64,  -25, -38, -25, -77,
                                                   77,  -13, -51, -38, -89,
                                                   89, -115, -64, 102,  77 };

    hidl_vec<uint32_t> inputToOutputWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToOutputWeightsValue { -102, -51, -25, -115, -13,
                                                     -89,  38, -38, -102, -25,
                                                      77, -25,  51,  -89, -38,
                                                     -64,  13,  64,  -77, -51 };

    hidl_vec<uint32_t> recurrentToInputWeightsDimensions{0, 0};
    std::vector<int8_t> recurrentToInputWeightsValue;

    hidl_vec<uint32_t> recurrentToForgetWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToForgetWeightsValue { -64, -38, -64, -25,
                                                         77,  51, 115,  38,
                                                        -13,  25,  64,  25,
                                                         25,  38, -13,  51 };

    hidl_vec<uint32_t> recurrentToCellWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToCellWeightsValue { -38,  25,  13, -38,
                                                      102, -10, -25,  38,
                                                      102, -77, -13,  25,
                                                       38, -13,  25,  64 };

    hidl_vec<uint32_t> recurrentToOutputWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToOutputWeightsValue {  38, -13,  13, -25,
                                                        -64, -89, -25, -77,
                                                        -13, -51, -89, -25,
                                                         13,  64,  25, -38 };

    hidl_vec<uint32_t> cellToInputWeightsDimensions{0};
    std::vector<int16_t> cellToInputWeightsValue;

    hidl_vec<uint32_t> cellToForgetWeightsDimensions{0};
    std::vector<int16_t> cellToForgetWeightsValue;

    hidl_vec<uint32_t> cellToOutputWeightsDimensions{0};
    std::vector<int16_t> cellToOutputWeightsValue;

    hidl_vec<uint32_t> inputGateBiasDimensions{0};
    std::vector<int32_t> inputGateBiasValue;

    hidl_vec<uint32_t> forgetGateBiasDimensions{numUnits};
    std::vector<int32_t> forgetGateBiasValue { 2147484, -6442451, -4294968, 2147484 };

    hidl_vec<uint32_t> cellBiasDimensions{numUnits};
    std::vector<int32_t> cellBiasValue { -1073742, 15461883, 5368709, 1717987 };

    hidl_vec<uint32_t> outputGateBiasDimensions{numUnits};
    std::vector<int32_t> outputGateBiasValue { 1073742, -214748, 4294968, 2147484 };

    hidl_vec<uint32_t> projectionWeightsDimensions{0, 0};
    std::vector<int8_t> projectionWeightsValue;

    hidl_vec<uint32_t> projectionBiasDimensions{0};
    std::vector<int32_t> projectionBiasValue;

    hidl_vec<uint32_t> outputStateInDimensions{batchSize, outputSize};
    std::vector<int8_t> outputStateInValue { 0, 0, 0, 0, 0, 0, 0, 0 };

    hidl_vec<uint32_t> cellStateInDimensions{batchSize, numUnits};
    std::vector<int16_t> cellStateInValue { 0, 0, 0, 0, 0, 0, 0, 0 };

    // Normalization:
    hidl_vec<uint32_t> inputLayerNormWeightsDimensions{0};
    std::vector<int16_t> inputLayerNormWeightsValue;

    hidl_vec<uint32_t> forgetLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> forgetLayerNormWeightsValue { 6553, 6553, 13107, 9830 };

    hidl_vec<uint32_t> cellLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> cellLayerNormWeightsValue { 22937, 6553, 9830, 26214 };

    hidl_vec<uint32_t> outputLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> outputLayerNormWeightsValue { 19660, 6553, 6553, 16384 };

    float cellClipValue           = 0.0f;
    float projectionClipValue     = 0.0f;
    float inputIntermediateScale  = 0.007059f;
    float forgetIntermediateScale = 0.007812f;
    float cellIntermediateScale   = 0.007059f;
    float outputIntermediateScale = 0.007812f;
    int32_t hiddenStateZeroPoint  = 0;
    float hiddenStateScale        = 0.007f;

    // Outputs:
    hidl_vec<uint32_t> outputStateOutDimensions{batchSize, outputSize};
    std::vector<int8_t> outputStateOutValue { -15, 21, 14, 20, -15, 15, 5, 27 };

    hidl_vec<uint32_t> cellStateOutDimensions{batchSize, numUnits};
    std::vector<int16_t> cellStateOutValue { -11692, 9960, 5491, 8861, -9422, 7726, 2056, 13149 };

    hidl_vec<uint32_t> outputDimensions{batchSize, outputSize};
    std::vector<int8_t> outputValue { -15, 21, 14, 20, -15, 15, 5, 27 };

    QLstmTestImpl(inputDimensions,                       inputValue,
                  inputToInputWeightsDimensions,         inputToInputWeightsValue,
                  inputToForgetWeightsDimensions,        inputToForgetWeightsValue,
                  inputToCellWeightsDimensions,          inputToCellWeightsValue,
                  inputToOutputWeightsDimensions,        inputToOutputWeightsValue,
                  recurrentToInputWeightsDimensions,     recurrentToInputWeightsValue,
                  recurrentToForgetWeightsDimensions,    recurrentToForgetWeightsValue,
                  recurrentToCellWeightsDimensions,      recurrentToCellWeightsValue,
                  recurrentToOutputWeightsDimensions,    recurrentToOutputWeightsValue,
                  cellToInputWeightsDimensions,          cellToInputWeightsValue,
                  cellToForgetWeightsDimensions,         cellToForgetWeightsValue,
                  cellToOutputWeightsDimensions,         cellToOutputWeightsValue,
                  inputGateBiasDimensions,               inputGateBiasValue,
                  forgetGateBiasDimensions,              forgetGateBiasValue,
                  cellBiasDimensions,                    cellBiasValue,
                  outputGateBiasDimensions,              outputGateBiasValue,
                  projectionWeightsDimensions,           projectionWeightsValue,
                  projectionBiasDimensions,              projectionBiasValue,
                  outputStateInDimensions,               outputStateInValue,
                  cellStateInDimensions,                 cellStateInValue,
                  inputLayerNormWeightsDimensions,       inputLayerNormWeightsValue,
                  forgetLayerNormWeightsDimensions,      forgetLayerNormWeightsValue,
                  cellLayerNormWeightsDimensions,        cellLayerNormWeightsValue,
                  outputLayerNormWeightsDimensions,      outputLayerNormWeightsValue,
                  cellClipValue,
                  projectionClipValue,
                  inputIntermediateScale,
                  forgetIntermediateScale,
                  cellIntermediateScale,
                  outputIntermediateScale,
                  hiddenStateZeroPoint,
                  hiddenStateScale,
                  outputStateOutDimensions,              outputStateOutValue,
                  cellStateOutDimensions,                cellStateOutValue,
                  outputDimensions,                      outputValue,
                  compute);
}

void DynamicOutputQLstmWithNoProjection(armnn::Compute compute)
{
    // This replicates android/frameworks/ml/nn/runtime/test/specs/V1_3/qlstm_noprojection.mod.py
    // with values from android/frameworks/ml/nn/runtime/test/generated/spec_V1_3/qlstm_noprojection.example.cpp
    // and weights, biases and scalars passed as CONSTANT_COPY tensors (instead of SUBGRAPH_INPUT tensors)
    // and made cellStateOutput dynamic.

    uint32_t batchSize  = 2;
    uint32_t inputSize  = 5;
    uint32_t outputSize = 4;
    uint32_t numUnits   = 4;

    // Inputs:
    hidl_vec<uint32_t> inputDimensions{batchSize, inputSize};
    std::vector<int8_t> inputValue { 90, 102, 13, 26, 38, 102, 13, 26, 51, 64 };

    hidl_vec<uint32_t> inputToInputWeightsDimensions{0, 0};
    std::vector<int8_t> inputToInputWeightsValue;

    hidl_vec<uint32_t> inputToForgetWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToForgetWeightsValue { -77, -13,  38,  25,  115,
                                                    -64, -25, -51,  38, -102,
                                                    -51,  38, -64, -51,  -77,
                                                    38, -51, -77, -64,  -64 };

    hidl_vec<uint32_t> inputToCellWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToCellWeightsValue { -51,  -38, -25, -13, -64,
                                                  64,  -25, -38, -25, -77,
                                                  77,  -13, -51, -38, -89,
                                                  89, -115, -64, 102,  77 };

    hidl_vec<uint32_t> inputToOutputWeightsDimensions{numUnits, inputSize};
    std::vector<int8_t> inputToOutputWeightsValue { -102, -51, -25, -115, -13,
                                                    -89,  38, -38, -102, -25,
                                                    77, -25,  51,  -89, -38,
                                                    -64,  13,  64,  -77, -51 };

    hidl_vec<uint32_t> recurrentToInputWeightsDimensions{0, 0};
    std::vector<int8_t> recurrentToInputWeightsValue;

    hidl_vec<uint32_t> recurrentToForgetWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToForgetWeightsValue { -64, -38, -64, -25,
                                                        77,  51, 115,  38,
                                                        -13,  25,  64,  25,
                                                        25,  38, -13,  51 };

    hidl_vec<uint32_t> recurrentToCellWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToCellWeightsValue { -38,  25,  13, -38,
                                                      102, -10, -25,  38,
                                                      102, -77, -13,  25,
                                                      38, -13,  25,  64 };

    hidl_vec<uint32_t> recurrentToOutputWeightsDimensions{numUnits, outputSize};
    std::vector<int8_t> recurrentToOutputWeightsValue {  38, -13,  13, -25,
                                                         -64, -89, -25, -77,
                                                         -13, -51, -89, -25,
                                                         13,  64,  25, -38 };

    hidl_vec<uint32_t> cellToInputWeightsDimensions{0};
    std::vector<int16_t> cellToInputWeightsValue;

    hidl_vec<uint32_t> cellToForgetWeightsDimensions{0};
    std::vector<int16_t> cellToForgetWeightsValue;

    hidl_vec<uint32_t> cellToOutputWeightsDimensions{0};
    std::vector<int16_t> cellToOutputWeightsValue;

    hidl_vec<uint32_t> inputGateBiasDimensions{0};
    std::vector<int32_t> inputGateBiasValue;

    hidl_vec<uint32_t> forgetGateBiasDimensions{numUnits};
    std::vector<int32_t> forgetGateBiasValue { 2147484, -6442451, -4294968, 2147484 };

    hidl_vec<uint32_t> cellBiasDimensions{numUnits};
    std::vector<int32_t> cellBiasValue { -1073742, 15461883, 5368709, 1717987 };

    hidl_vec<uint32_t> outputGateBiasDimensions{numUnits};
    std::vector<int32_t> outputGateBiasValue { 1073742, -214748, 4294968, 2147484 };

    hidl_vec<uint32_t> projectionWeightsDimensions{0, 0};
    std::vector<int8_t> projectionWeightsValue;

    hidl_vec<uint32_t> projectionBiasDimensions{0};
    std::vector<int32_t> projectionBiasValue;

    hidl_vec<uint32_t> outputStateInDimensions{batchSize, outputSize};
    std::vector<int8_t> outputStateInValue { 0, 0, 0, 0, 0, 0, 0, 0 };

    hidl_vec<uint32_t> cellStateInDimensions{batchSize, numUnits};
    std::vector<int16_t> cellStateInValue { 0, 0, 0, 0, 0, 0, 0, 0 };

    // Normalization:
    hidl_vec<uint32_t> inputLayerNormWeightsDimensions{0};
    std::vector<int16_t> inputLayerNormWeightsValue;

    hidl_vec<uint32_t> forgetLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> forgetLayerNormWeightsValue { 6553, 6553, 13107, 9830 };

    hidl_vec<uint32_t> cellLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> cellLayerNormWeightsValue { 22937, 6553, 9830, 26214 };

    hidl_vec<uint32_t> outputLayerNormWeightsDimensions{numUnits};
    std::vector<int16_t> outputLayerNormWeightsValue { 19660, 6553, 6553, 16384 };

    float cellClipValue           = 0.0f;
    float projectionClipValue     = 0.0f;
    float inputIntermediateScale  = 0.007059f;
    float forgetIntermediateScale = 0.007812f;
    float cellIntermediateScale   = 0.007059f;
    float outputIntermediateScale = 0.007812f;
    int32_t hiddenStateZeroPoint  = 0;
    float hiddenStateScale        = 0.007f;

    // Outputs:
    hidl_vec<uint32_t> outputStateOutDimensions{batchSize, outputSize};
    std::vector<int8_t> outputStateOutValue { -15, 21, 14, 20, -15, 15, 5, 27 };

    hidl_vec<uint32_t> cellStateOutDimensions{};
    std::vector<int16_t> cellStateOutValue { -11692, 9960, 5491, 8861, -9422, 7726, 2056, 13149 };

    hidl_vec<uint32_t> outputDimensions{batchSize, outputSize};
    std::vector<int8_t> outputValue { -15, 21, 14, 20, -15, 15, 5, 27 };

    QLstmTestImpl(inputDimensions,                       inputValue,
                  inputToInputWeightsDimensions,         inputToInputWeightsValue,
                  inputToForgetWeightsDimensions,        inputToForgetWeightsValue,
                  inputToCellWeightsDimensions,          inputToCellWeightsValue,
                  inputToOutputWeightsDimensions,        inputToOutputWeightsValue,
                  recurrentToInputWeightsDimensions,     recurrentToInputWeightsValue,
                  recurrentToForgetWeightsDimensions,    recurrentToForgetWeightsValue,
                  recurrentToCellWeightsDimensions,      recurrentToCellWeightsValue,
                  recurrentToOutputWeightsDimensions,    recurrentToOutputWeightsValue,
                  cellToInputWeightsDimensions,          cellToInputWeightsValue,
                  cellToForgetWeightsDimensions,         cellToForgetWeightsValue,
                  cellToOutputWeightsDimensions,         cellToOutputWeightsValue,
                  inputGateBiasDimensions,               inputGateBiasValue,
                  forgetGateBiasDimensions,              forgetGateBiasValue,
                  cellBiasDimensions,                    cellBiasValue,
                  outputGateBiasDimensions,              outputGateBiasValue,
                  projectionWeightsDimensions,           projectionWeightsValue,
                  projectionBiasDimensions,              projectionBiasValue,
                  outputStateInDimensions,               outputStateInValue,
                  cellStateInDimensions,                 cellStateInValue,
                  inputLayerNormWeightsDimensions,       inputLayerNormWeightsValue,
                  forgetLayerNormWeightsDimensions,      forgetLayerNormWeightsValue,
                  cellLayerNormWeightsDimensions,        cellLayerNormWeightsValue,
                  outputLayerNormWeightsDimensions,      outputLayerNormWeightsValue,
                  cellClipValue,
                  projectionClipValue,
                  inputIntermediateScale,
                  forgetIntermediateScale,
                  cellIntermediateScale,
                  outputIntermediateScale,
                  hiddenStateZeroPoint,
                  hiddenStateScale,
                  outputStateOutDimensions,              outputStateOutValue,
                  cellStateOutDimensions,                cellStateOutValue,
                  outputDimensions,                      outputValue,
                  compute);
}

} // anonymous namespace

// Support is not added yet
//TEST_CASE(QLSTMWithProjectionTest, COMPUTE_DEVICES)
//{
//     QLstmWithProjection(sample);
//}

DOCTEST_TEST_SUITE("QLSTMTests_CpuRef")
{

    DOCTEST_TEST_CASE("QLSTMWithNoProjectionTest_CpuRef")
    {
        QLstmWithNoProjection(armnn::Compute::CpuRef);
    }

    DOCTEST_TEST_CASE("DynamicOutputQLstmWithNoProjection_CpuRef")
    {
        DynamicOutputQLstmWithNoProjection(armnn::Compute::CpuRef);
    }

}
#ifdef ARMCOMPUTECL_ENABLED
DOCTEST_TEST_SUITE("QLSTMTests_CpuAcc")
{

    DOCTEST_TEST_CASE("QLSTMWithNoProjectionTest_CpuAcc")
    {
        QLstmWithNoProjection(armnn::Compute::CpuAcc);
    }

    DOCTEST_TEST_CASE("DynamicOutputQLstmWithNoProjection_CpuAcc")
    {
        DynamicOutputQLstmWithNoProjection(armnn::Compute::CpuAcc);
    }

}
#endif


text:
SPEC_BEGIN(UIFontTests)

describe(@"UIFont+Allocation: ", ^{

    __block UIFont *resultingFont = nil;

    context(@"when creating a font with type 'bold' ", ^{

        beforeEach(^{

            resultingFont = [UIFont fontWithType:FontTypeBold andSize:14.0f];
        });

        it(@"should have the font name HelveticaNeue-Bold", ^{

            [[resultingFont.fontName should] equal:@"HelveticaNeue-Bold"];
        });
    });
});

SPEC_END


text:
const passport = require('passport')
const logger = require('../logger.js')
const Task = require('../models/task')
const ArchivedTask = require('../models/archivedtask')

const helpers = require('./helpers.js')
const archiveTasks = helpers.archiveTasks

const archive = require('express').Router()
archive.use(passport.authenticate('bearer', { session: false }))

archive.get('/', (req, res) => {
  ArchivedTask.findAll({
    where: {
      userId: req.user
    }
  })
    .then(data => {
      res.send(data)
    })
    .catch(err => {
      res.status(500).send(err)
    })
})
archive.post('/:listid', (req, res) => {
  const tasks = {}
  if (typeof req.body.tasks !== 'undefined') {
    tasks.tasks = req.body.tasks.join(',')
  }
  archiveTasks(tasks, req.user, req.params.listid)
    .then(tasks => {
      res.send({ message: 'Successfully archived tasks.', data: tasks })
    })
    .catch(err => {
      logger.error(
        {
          userId: req.user,
          listId: req.params.listId,
          err: err
        },
        'archive error'
      )
      res.status(err.code).send(err)
    })
})

module.exports = archive


text:
/* This file was generated by SableCC's ObjectMacro. */

package org.sablecc.objectmacro.errormessage;

class CacheBuilder {

    private String expansion = null;

    public String getExpansion() {

        return this.expansion;
    }

    public void setExpansion(
            String expansion) {

        this.expansion = expansion;
    }
}


text:
"""
	networklearner(Adj, fl_train, fl_exec, fr_train, ft_exec [;kwargs])

Constructs an untrained cell that when piped data inside, returns a network learner trained
function cell based on the input data and labels.

# Arguments
  * `x::AbstractMatrix` training data (used by `fl_train`, `fl_exec`; if `use_local_data==true`, it is also used by `fr_train`)
  * `Adj::Vector{AbstractAdjacency}` a vector containing the observation relational structures (adjacency objects)
  * `fl_train` local model training 'function'; can be anything that supports the call `fl_train((X,y))`
  * `fl_exec` local model prediction 'function'; can be anything that supports the call `fl_exec(Ml,X)` where `Ml = fl_train((X,y))`
  * `fr_train` relational model training `function`; can be anything that suports the call `fr_train((Xr,y))`
  * `fr_exec` relational model prediction `function`; can be anything that suports the call `fr_exec(Mr,Xr)` where `Mr = fr_train((Xr,y))`
  and `Xr` is a dataset of relational variables generated by the relational learner using the results of the local model prediction
  function and adjacency structures.

# Keyword arguments
  * `priors::Vector{Float64}` class priors (if applicable)
  * `learner::Symbol` relational learner (i.e. variable generator); available options `:rn`, `:wrn`, `:bayesrn` and `:cdrn` (default `:wrn`)
  * `inference::Symbol` collective inference method; available options `:rl`, `:ic` and `:gs` (default `:rl`)
  * `normalize::Bool` whether to normalize the relational variables per-observation to the L1 norm (default `true`)
  * `use_local_data::Bool` whether the relational model should use the local data provided (i.e. in `X`) (default `true`)
  * `f_targets::Function` function that extracts targets from estimates generated by the local/relational models
  (default `f_targets = x->MLDataPattern.targets(indmax,x)`)
  * `obsdim::Int` observation dimension (default `2`)
  * `tol::Float64` maximum admissible mean estimate error for collective inference convergence (default `1e-6`)
  * `κ::Float64` relaxation labeling starting constant, used if `learner == :rl` (default `1.0`)
  * `α::Float64` relaxation labeling decay constant, used if `learner == :rl` (default `0.99`)
  * `maxiter::Int` maximum number of iterations for collective inference (default `100`)
  * `bratio::Float64` percentage of iterations i.e. `maxiter` used for Gibbs sampling burn-in (default `0.1`)

Read the `NetworkLearning.jl` documentation for more information.
"""
networklearner(Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...) =
	FunctionCell(networklearner, (Adj, fl_train, fl_exec, fr_train, fr_exec), ModelProperties(), "Network Learner"; kwargs...)

############################
# DataCell/Array Interface #
############################
"""
	networklearner(x, Adj, fl_train, fl_exec, fr_train, ft_exec [;kwargs])

Trains a network learner model that using the data `x`.
"""
# Training
networklearner(x::T where T<:CellDataL, Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...) =
	networklearner((getx!(x), gety(x)), Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...)
networklearner(x::Tuple{T,S} where T<:AbstractVector where S<:AbstractVector, Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...) =
	networklearner((mat(x[1], LearnBase.ObsDim.Constant{2}()), x[2]), Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...)
networklearner(x::Tuple{T,S} where T<:AbstractMatrix where S<:AbstractVector, Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...) = begin

	@assert nobs(x[1]) == nobs(x[2]) "[networklearner] Expected $(nobs(x[1])) labels/values, got $(nobs(x[2]))."

	# Transform labels first
	enc = labelencn(x[2])
	yenc = label2ind.(x[2],enc)

	# Train model
	nldata = NetworkLearning.fit(NetworkLearning.NetworkLearnerObs, getobs(x[1]), yenc,
			      		Adj, fl_train, fl_exec, fr_train, fr_exec; kwargs...)

	# Build model properties
	modelprops = ModelProperties(nvars(x[1]), length(enc.label), enc)

	FunctionCell(networklearner, Model(nldata, modelprops), "Network Learner")

end

# Execution
networklearner(x::T where T<:CellData, model::Model{<:NetworkLearning.AbstractNetworkLearner}) =
	datacell(networklearner(getx!(x), model), gety(x))

networklearner(x::T where T<:AbstractVector, model::Model{<:NetworkLearning.AbstractNetworkLearner}) =
	networklearner(mat(x, LearnBase.ObsDim.Constant{2}()), model)

networklearner(x::T where T<:AbstractMatrix, model::Model{<:NetworkLearning.AbstractNetworkLearner}) =
	NetworkLearning.predict(model.data, getobs(x))


text:
<?php

/**
 * @namespace
 */
namespace Yandex\Common;

/**
 * Class Version
 * @package Yandex\Common
 */
class Version
{
    public static $version = '0.2.0';
}


text:
/**
 * Tests for `ClientPosition`
 */

goog.module('goog.positioning.clientPositionTest');
goog.setTestOnly();

const ClientPosition = goog.require('goog.positioning.ClientPosition');
const Corner = goog.require('goog.positioning.Corner');
const TagName = goog.require('goog.dom.TagName');
const dom = goog.require('goog.dom');
const style = goog.require('goog.style');
const testSuite = goog.require('goog.testing.testSuite');

/**
 * Prefabricated popup element for convenient. This is created during
 * setUp and is not attached to the document at the beginning of the
 * test.
 * @type {Element}
 */
let popupElement;
let testArea;
const POPUP_HEIGHT = 100;
const POPUP_WIDTH = 150;

function assertPageOffset(expectedX, expectedY, el) {
  const offsetCoordinate = style.getPageOffset(el);
  assertEquals('x-coord page offset is wrong.', expectedX, offsetCoordinate.x);
  assertEquals('y-coord page offset is wrong.', expectedY, offsetCoordinate.y);
}
testSuite({
  setUp() {
    testArea = dom.getElement('test-area');

    // Enlarges the test area to 5000x5000px so that we can be confident
    // that scrolling the document to some small (x,y) value would work.
    style.setSize(testArea, 5000, 5000);

    window.scrollTo(0, 0);

    popupElement = dom.createDom(TagName.DIV);
    style.setSize(popupElement, POPUP_WIDTH, POPUP_HEIGHT);
    popupElement.style.position = 'absolute';

    // For ease of debugging.
    popupElement.style.background = 'blue';
  },

  tearDown() {
    popupElement = null;
    dom.removeChildren(testArea);
    testArea.setAttribute('style', '');
  },

  testClientPositionWithZeroViewportOffset() {
    dom.appendChild(testArea, popupElement);

    const x = 300;
    const y = 200;
    const pos = new ClientPosition(x, y);

    pos.reposition(popupElement, Corner.TOP_LEFT);
    assertPageOffset(x, y, popupElement);

    pos.reposition(popupElement, Corner.TOP_RIGHT);
    assertPageOffset(x - POPUP_WIDTH, y, popupElement);

    pos.reposition(popupElement, Corner.BOTTOM_LEFT);
    assertPageOffset(x, y - POPUP_HEIGHT, popupElement);

    pos.reposition(popupElement, Corner.BOTTOM_RIGHT);
    assertPageOffset(x - POPUP_WIDTH, y - POPUP_HEIGHT, popupElement);
  },

  testClientPositionWithSomeViewportOffset() {
    dom.appendChild(testArea, popupElement);

    const x = 300;
    const y = 200;
    const scrollX = 135;
    const scrollY = 270;
    window.scrollTo(scrollX, scrollY);

    const pos = new ClientPosition(x, y);
    pos.reposition(popupElement, Corner.TOP_LEFT);
    assertPageOffset(scrollX + x, scrollY + y, popupElement);
  },

  testClientPositionWithPositionContext() {
    const contextAbsoluteX = 90;
    const contextAbsoluteY = 110;
    const x = 300;
    const y = 200;

    const contextElement = dom.createDom(TagName.DIV, undefined, popupElement);
    style.setPosition(contextElement, contextAbsoluteX, contextAbsoluteY);
    contextElement.style.position = 'absolute';
    dom.appendChild(testArea, contextElement);

    const pos = new ClientPosition(x, y);
    pos.reposition(popupElement, Corner.TOP_LEFT);
    assertPageOffset(x, y, popupElement);
  },
});


text:
import apisauce from 'apisauce';
import { info, builds, jobs, views, que, load, login, logout } from '../Services/';

// our "constructor"
const create = (baseURL = 'http://') => {
  // ------
  // STEP 1
  // ------
  //
  // Create and configure an apisauce-based api object.
  //
  const api = apisauce.create({
    // base URL is read from the "constructor"
    baseURL,
    // here are some default headers
    headers: {
      'Cache-Control': 'no-cache',
      'Connection': 'keep-alive',
      'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31',
      'Accept-Language': 'en-US,en;q=0.8'
    },
    // 10 second timeout...
    timeout: 10000
  });

  // Wrap api's addMonitor to allow the calling code to attach
  // additional monitors in the future.
  const addMonitor = api.addMonitor((response) => {
    // Monitors are called passively after every request.
  });

  const updateDefaultBaseURL = (data) => {
    const protocol = data.https ? 'https' : 'http';
    api.axiosInstance.defaults.baseURL = `${protocol}://${data.host}:${data.port}`;
  };

  // ------
  // STEP 2
  // ------
  //
  // Define some functions that call the api.  The goal is to provide
  // a thin wrapper of the api layer providing nicer feeling functions
  // rather than "get", "post" and friends.
  //
  // I generally don't like wrapping the output at this level because
  // sometimes specific actions need to be take on `403` or `401`, etc.
  //
  // Since we can't hide from that, we embrace it by getting out of the
  // way at this level.
  //

  const getJenkinsJobs = () => jobs.getJobs(api);
  const getJenkinsViews = () => views.getViews(api);
  const getQueAPI = () => que.getQueApi(api);
  const getLoadAPI = () => load.getLoadApi(api);
  const getBuilds = (job) => builds.getBuilds(api, job);
  const getBuild = (job, buildNumber) => builds.getBuild(api, job, buildNumber);
  const getJenkinsInfo = () => info.getInfo(api);
  const startJob = (job) =>  jobs.getJob(api, job);
  const startLogin = (username, password, instanceName, host, port, https) => {
    updateDefaultBaseURL({host, port, https});
    return login.attemptLogin(api, username, password, https);
  };
  const startLogout = () => logout.attemptLogout(api);

  // ------
  // STEP 3
  // ------
  //
  // Return back a collection of functions that we would consider our
  // interface.  Most of the time it'll be just the list of all the
  // methods in step 2.
  //
  // Notice we're not returning back the `api` created in step 1?  That's
  // because it is scoped privately.  This is one way to create truly
  // private scoped goodies in JavaScript.
  //
  return {
    // a list of the API functions from step 2
    getJenkinsInfo,
    getJenkinsJobs,
    getJenkinsViews,
    getQueAPI,
    getLoadAPI,
    getBuild,
    getBuilds,
    startLogin,
    startLogout,
    startJob,
    // additional utilities
    addMonitor
  };
};

// let's return back our create method as the default.
export default {
  create
};


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System.Runtime.InteropServices;

namespace Microsoft.Diagnostics.Runtime.DacInterface
{
    [StructLayout(LayoutKind.Sequential)]
    public readonly struct MethodDescData
    {
        public readonly uint HasNativeCode;
        public readonly uint IsDynamic;
        public readonly ushort SlotNumber;
        public readonly ClrDataAddress NativeCodeAddr;

        // Useful for breaking when a method is jitted.
        public readonly ClrDataAddress AddressOfNativeCodeSlot;

        public readonly ClrDataAddress MethodDesc;
        public readonly ClrDataAddress MethodTable;
        public readonly ClrDataAddress Module;

        public readonly uint MDToken;
        public readonly ClrDataAddress GCInfo;
        public readonly ClrDataAddress GCStressCodeCopy;

        // This is only valid if bIsDynamic is true
        public readonly ClrDataAddress ManagedDynamicMethodObject;

        public readonly ClrDataAddress RequestedIP;

        // Gives info for the single currently active version of a method
        public readonly RejitData RejitDataCurrent;

        // Gives info corresponding to requestedIP (for !ip2md)
        public readonly RejitData RejitDataRequested;

        // Total number of rejit versions that have been jitted
        public readonly uint JittedRejitVersions;
    }
}


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

namespace Mystify.Model
{
    public class Corner
    {
        public readonly double Width;
        public readonly double Height;

        public double X { get; private set; }
        public double Y { get; private set; }

        public double Xvel { get; private set; }
        public double Yvel { get; private set; }
        private const double minVel = .5;
        private const double maxVel = 1;

        private readonly Random Rand;

        public readonly List<Point> Points = new List<Point>();
        public readonly int PointsToKeep;

        public Point PointF { get { return new Point(X, Y); } }

        public Corner(Random rand, double width, double height, int pointsToKeep)
        {
            Rand = rand;
            Width = width;
            Height = height;
            PointsToKeep = pointsToKeep;
            X = rand.NextDouble() * width;
            Y = rand.NextDouble() * height;
            Xvel = RandomVelocity(true);
            Yvel = RandomVelocity(true);
        }

        private double RandomVelocity(bool canBeNegative = false)
        {
            double vel = minVel + Rand.NextDouble() * (maxVel - minVel);
            if (canBeNegative && Rand.NextDouble() < .5)
                vel *= -1;
            return vel;
        }

        public void Advance(double speed = 1)
        {
            X += Xvel * speed;
            Y += Yvel * speed;
            Points.Add(new Point(X, Y));
            if (Points.Count > PointsToKeep)
                Points.RemoveRange(0, Points.Count - PointsToKeep);
            BounceOffEdges();
        }

        private void BounceOffEdges()
        {
            if (X <= 0) Xvel = RandomVelocity();
            if (Y <= 0) Yvel = RandomVelocity();
            if (X > Width) Xvel = -RandomVelocity();
            if (Y > Height) Yvel = -RandomVelocity();
        }
    }
}


text:
Thumbnail Creation of images
============================

This plugin creates thumbnails for all of the images found under a specific directory, in various thumbnail sizes.
It requires `PIL` to function properly since `PIL` is used to resize the images, and the thumbnail will only be re-built
if it doesn't already exist (to save processing time).

Installation
-------------

Set up like any other plugin, making sure to set `PLUGIN_PATH` and add `thumbnailer` to the `PLUGINS` list.

[PIL](http://www.pythonware.com/products/pil/) or [Pillow](http://pillow.readthedocs.org/en/latest/installation.html#)
is required. If you choose Pillow, you need to install some additional
[external libraries](http://www.pythonware.com/products/pil/) to add support for image types like `jpg`.

Configuration
-------------

* `IMAGE_PATH` is the path to the image directory. It should reside inside your content directory, and defaults to "pictures".
* `THUMBNAIL_DIR` is the path to the output sub-directory where the thumbnails are generated.
* `THUMBNAIL_SIZES` is a dictionary mapping size name to size specifications.
  The generated filename will be `originalname_thumbnailname.ext` unless `THUMBNAIL_KEEP_NAME` is set.
* `THUMBNAIL_KEEP_NAME` is a Boolean that, if set, puts the file with the original name in a thumbnailname folder, named like the key in `THUMBNAIL_SIZES`.
* `THUMBNAIL_KEEP_TREE` is a Boolean that, if set, saves the image directory tree.

Sizes can be specified using any of the following formats:

* wxh will resize to exactly wxh cropping as necessary to get that size
* wx? will resize so that the width is the specified size, and the height will scale to retain aspect ratio
* ?xh same as wx? but will height being a set size
* s is a shorthand for wxh where w=h


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Using as: SubSection</title>

<meta name="description" content="Using as: SubSection">
<meta name="keywords" content="Using as: SubSection">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="AS-Index.html#AS-Index" rel="index" title="AS Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Pseudo-Ops.html#Pseudo-Ops" rel="up" title="Pseudo Ops">
<link href="Symver.html#Symver" rel="next" title="Symver">
<link href="Struct.html#Struct" rel="prev" title="Struct">

Next: Symver, Previous: Struct, Up: Pseudo Ops   [Contents][Index]

7.89 .subsection <var>name</var>

This is one of the ELF section stack manipulation directives.  The others are
.section (see Section), .pushsection (see PushSection),
.popsection (see PopSection), and .previous
(see Previous).

This directive replaces the current subsection with name.  The current
section is not changed.  The replaced subsection is put onto the section stack
in place of the then current top of stack subsection.


text:
package com.piketec.tpt.api.constants.steps;

import com.piketec.tpt.api.steplist.MessageBoxStep;

/**
 * For further information, please refer to the User Guide, Message Box Step.
 *
 * @deprecated Will be removed in TPT-18. Use {@link MessageBoxStep} instead.
 */
@Deprecated
public interface MessageBox extends AbstractStep {

  @Deprecated
  public static final String MESSAGE = "message";

  @Deprecated
  public static final String CHANNEL = "channel";

  @Deprecated
  public static final String TERMINATIONEXP = "termination-expression";

  @Deprecated
  public static final String MESSAGEBOXTYPES = "message-box-type";

}


text:
import os
from setuptools import setup

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name = "Chronyk",
    version = "1.0.1",

    packages = ["chronyk"],
    install_requires = [],

    author = 'Felix "KoffeinFlummi" Wiegand',
    author_email = "koffeinflummi@gmail.com",
    description = "A library for parsing human-written times and dates.",
    long_description = read("README.rst"),
    license = "MIT",
    keywords = "time date clock human parser timezone",
    url = "https://github.com/KoffeinFlummi/Chronyk",
    classifiers = [
        "Intended Audience :: Developers",
        "License :: OSI Approved :: MIT License",
        "Natural Language :: English",
        "Programming Language :: Python :: 3.2",
        "Programming Language :: Python :: 3.3",
        "Programming Language :: Python :: 3.4"
    ]
)


text:
PicturIt
========

Free, secure image hosting created by Scratchers for Scratchers

Eventually will be hosted online, and we will try to get it whitelisted by Scratch

## Contributing ##

Message us on Scratch and we can add you if you want to contribute

## Testing during development ##

To test this, paste the contents into an apache server (or anything that supports PHP, MySQL and .htaccess). Then, enable
the PHP fileinfo extension by uncommenting the `extension=php_fileinfo.(dll|so)` line in `php.ini`
finally, create a MySQL user and database as in `databaselib.php`'s global vars.


text:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <CurrentInvoice_FindByDateIntervalResponse xmlns="http://e-conomic.com">
      <CurrentInvoice_FindByDateIntervalResult>
        <CurrentInvoiceHandle>
          <Id>1</Id>
        </CurrentInvoiceHandle>
      </CurrentInvoice_FindByDateIntervalResult>
    </CurrentInvoice_FindByDateIntervalResponse>
  </soap:Body>
</soap:Envelope>