text:
import {expect} from 'chai';
import {args} from './node-args';

describe('Node Args module', function () {
    it('Should get default values', function () {
        const argv = ['a', 'b'];
        const obj = args(argv);

        expect(obj).to.have.property('_').that.deep.equals(argv);
        expect(obj).to.have.property('additional').that.deep.equals([]);
    });

    it('Should get additional values', function () {
        const argv = ['a', 'b', 'c', 'd'];
        const obj = args(argv);

        expect(obj.additional).to.be.deep.equal(['c', 'd']);
    });

    it('Should get shorthand values', function () {
        const argv = ['a', 'b', 'c', '-ab', '-cd=2', '-e', 'false', '-f', 'something'];
        const obj = args(argv);

        expect(obj).to.have.deep.property('a', true);
        expect(obj).to.have.deep.property('b', true);
        expect(obj).to.have.deep.property('c', 2);
        expect(obj).to.have.deep.property('d', 2);
        expect(obj).to.have.deep.property('e', false);
        expect(obj).to.have.deep.property('f', 'something');
    });

    it('Should get named values', function () {
        const argv = ['a', 'b', 'c', '--abc', '--def=2', '--g', 'false', '--h', 'something'];
        const obj = args(argv);

        expect(obj).to.have.deep.property('abc', true);
        expect(obj).to.have.deep.property('def', 2);
        expect(obj).to.have.deep.property('g', false);
        expect(obj).to.have.deep.property('h', 'something');
    });

    it('Should handle wrong values', function () {
        const argv = ['a', 'b', '-', 'c', '--', '-', 'd', '-g', '--'];
        const obj = args(argv);

        expect(obj).to.exist;
        expect(Object.keys(obj)).to.be.deep.equal(['_', 'additional', 'g']);
        expect(obj).to.have.deep.property('additional').that.deep.equals(['c', 'd']);
        expect(obj).to.have.deep.property('g', true);
    });

    it('Should get true value for left variables', function () {
        const argv = ['a', 'b', '-cd'];
        const obj = args(argv);

        expect(obj).to.exist;
        expect(Object.keys(obj).sort()).to.be.deep.equals(['_', 'additional', 'c', 'd']);
        expect(obj).to.has.deep.property('c', true);
        expect(obj).to.has.deep.property('d', true);
    });
});


text:
import java.util.*;
class ListNode {
    int val;
    ListNode next;
    ListNode(int x) {val = x;}
}
class TreeNode {
    int val;
    TreeNode left, right;
    TreeNode(int x){val = x;}
}
class RandomListNode {
    int label;
    RandomListNode next, random;
    RandomListNode(int x) { this.label = x; }
};

class Solution {
    public RandomListNode copyRandomList(RandomListNode head) {
        if(head == null) return null;
        RandomListNode copy = new RandomListNode(head.label);
        RandomListNode pre_head = new RandomListNode(0);
        HashMap<RandomListNode, RandomListNode> map =
            new HashMap<RandomListNode, RandomListNode>();
        pre_head.next = copy;
        map.put(head, copy);
        while(head != null) {
            if(head.next != null && !map.containsKey(head.next)) {
                copy.next = new RandomListNode(head.next.label);
                map.put(head.next, copy.next);
            }
            if(head.random != null && !map.containsKey(head.random)) {
                copy.random = new RandomListNode(head.random.label);
                map.put(head.random, copy.random);
            }
            copy.next = map.get(head.next);
            copy.random = map.get(head.random);
            head = head.next;
            copy = copy.next;
        }
        return pre_head.next;
    }
    RandomListNode genRandomList(int[] A) {
        RandomListNode head = new RandomListNode(0), node=head;
        ArrayList<RandomListNode> B = new ArrayList<RandomListNode>();
        for(int i = 0; i < A.length; i+=2) {
            node.next = new RandomListNode(A[i]);
            node = node.next;
            B.add(node);
        }
        node = head.next;
        for(int i = 1; i < A.length; i+=2) {
            if(A[i] != -1) {
                node.random = B.get(A[i]);
            }
            node = node.next;
        }
        return head.next;
    }
    ArrayList<Integer> flattenRandomList(RandomListNode head) {
        ArrayList<Integer> A = new ArrayList<Integer>();
        RandomListNode node = head;
        HashMap<RandomListNode, Integer> map =
            new HashMap<RandomListNode, Integer>();
        int i;
        i = 0;
        while(node != null) {
            A.add(i/2);
            A.add(0);
            map.put(node, i/2);
            node = node.next;
            i += 2;
        }
        node = head;
        i = 1;
        while(node != null) {
            if(node.random != null) {
                A.set(i, map.get(node.random));
            }else {
                A.set(i, -1);
            }
            node = node.next;
            i += 2;
        }
        return A;
    }

//        System.out.print();

//        System.out.println();

    void printAL2(ArrayList<ArrayList<Integer>> A) {
        if(A == null) return;
        for(int i =0; i < A.size(); i++ ) {
            for(int j= 0; j < A.get(i).size(); j++ ) {
                System.out.print(A.get(i).get(j)+" ");
            }
            System.out.println();
        }
        System.out.println();
    }

    void printAL(ArrayList<Integer> A) {
        if(A == null) return;
        for(int i = 0; i < A.size(); i++) {
                System.out.print(A.get(i)+" ");
            }
        System.out.println();
    }

    void printAr(int[] A) {
        if(A == null) return;
        for(int i = 0; i < A.length; i++) {
                System.out.print(A[i]+" ");
            }
        System.out.println();
    }

    void printLN(ListNode head) {
        while(head != null) {
            System.out.print(head.val+" ");
            head = head.next;
        }
        System.out.println();
    }

    ListNode genList(int[] A) {
        if(A == null) return null;
        ListNode head = new ListNode(0), node = head;
        for(int i = 0 ; i < A.length; i++) {
            node.next = new ListNode(A[i]);
            node = node.next;
        }
        return head.next;
    }

    TreeNode growTree(int[] A) {
        if(A == null || A.length == 0) return null;
        LinkedList<TreeNode> queue = new LinkedList<TreeNode>();
        TreeNode root = new TreeNode(A[0]), node = root;
        queue.offer(node);
        for(int i = 1; i < A.length; i++ ) {
            node = queue.poll();
            if(A[i] != -1) {
                node.left = new TreeNode(A[i]);
                queue.offer(node.left);
            }
            i += 1;
            if(i == A.length) break;
            if(A[i] != -1) {
                node.right = new TreeNode(A[i]);
                queue.offer(node.right);
            }
        }
        return root;
    }
    void printTree(TreeNode root) {
        LinkedList<TreeNode> queue = new LinkedList<TreeNode>();
        queue.offer(root);
        while(true) {
            try {
                root = queue.pop();
            }catch(Exception ex) {
                break;
            }
            if(root == null) {
                System.out.print("# ");
            }else {
                System.out.print(root.val+" ");
                queue.offer(root.left);
                queue.offer(root.right);
            }
        }
        System.out.println();
    }
}

public class  CopyRandomList{
    public static void main(String[] args) {
        Solution sol = new Solution();
        int[][] A = {{0,-1},{0,1,1,1},{0,1,1,2,2,-1,3,1}};
        //int[][] B = {{}};
        RandomListNode head, copy;

        for(int i = 0; i < A.length ; i++) {
            head = sol.genRandomList(A[i]);
            sol.printAL(sol.flattenRandomList(head));
            copy = sol.copyRandomList(head);
            sol.printAL(sol.flattenRandomList(copy));
        }
/*
        sol.printTree(sol.growTree(A[i]));
        System.out.print();
        System.out.println();
*/
    }
}

redpajama_set_name: RedPajamaGithub


text:
require 'spec_helper'

module Spree
  describe Admin::StockTransfersController do
    stub_authorization!

    let!(:stock_transfer1) {
      StockTransfer.create do |transfer|
        transfer.source_location_id = 1
        transfer.destination_location_id = 2
        transfer.reference = 'PO 666'
      end }

    let!(:stock_transfer2) {
      StockTransfer.create do |transfer|
        transfer.source_location_id = 3
        transfer.destination_location_id = 4
        transfer.reference = 'PO 666'
      end }

    context "#index" do
      it "gets all transfers without search criteria" do
        spree_get :index
        assigns[:stock_transfers].count.should eq 2
      end

      it "searches by source location" do
        spree_get :index, :q => { :source_location_id_eq => 1 }
        assigns[:stock_transfers].count.should eq 1
        assigns[:stock_transfers].should include(stock_transfer1)
      end

      it "searches by destination location" do
        spree_get :index, :q => { :destination_location_id_eq => 4 }
        assigns[:stock_transfers].count.should eq 1
        assigns[:stock_transfers].should include(stock_transfer2)
      end
    end
  end
end


text:
package main

import (
	"fmt"
	"time"
)

type UserResult struct {
	Level         int
	Username      string
	ExemptReson   string
	LastLoginDate time.Time
}

func NewUserResults() []*UserResult {
	return []*UserResult{}
}

type Result struct {
	Desc       string
	Successful []*UserResult
	Failure    []*UserResult
	Exempt     []*UserResult
	StartedAt  time.Time
	EndedAt    string
}

func NewResult(desc string) *Result {
	return &Result{
		Desc:       desc,
		Successful: NewUserResults(),
		Failure:    NewUserResults(),
		Exempt:     NewUserResults(),
		StartedAt:  time.Now(),
	}
}

func (r *Result) String() string {
	return fmt.Sprintf(
		"Started: %s, Ran %v. Success: %v, Exempt: %v Ended: %v",
		r.StartedAt, r.Desc, len(r.Successful), len(r.Exempt), r.EndedAt,
	)
}


text:
package org.elasticsearch.action.bulk;

import com.google.common.collect.Iterators;
import org.elasticsearch.action.ActionResponse;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.unit.TimeValue;

import java.io.IOException;
import java.util.Iterator;

/**
 * A response of a bulk execution. Holding a response for each item responding (in order) of the
 * bulk requests. Each item holds the index/type/id is operated on, and if it failed or not (with the
 * failure message).
 */
public class BulkResponse extends ActionResponse implements Iterable<BulkItemResponse> {

    private BulkItemResponse[] responses;
    private long tookInMillis;

    BulkResponse() {
    }

    public BulkResponse(BulkItemResponse[] responses, long tookInMillis) {
        this.responses = responses;
        this.tookInMillis = tookInMillis;
    }

    /**
     * How long the bulk execution took.
     */
    public TimeValue took() {
        return new TimeValue(tookInMillis);
    }

    /**
     * How long the bulk execution took.
     */
    public TimeValue getTook() {
        return took();
    }

    /**
     * How long the bulk execution took in milliseconds.
     */
    public long tookInMillis() {
        return tookInMillis;
    }

    /**
     * How long the bulk execution took in milliseconds.
     */
    public long getTookInMillis() {
        return tookInMillis();
    }

    /**
     * Has anything failed with the execution.
     */
    public boolean hasFailures() {
        for (BulkItemResponse response : responses) {
            if (response.failed()) {
                return true;
            }
        }
        return false;
    }

    public String buildFailureMessage() {
        StringBuilder sb = new StringBuilder();
        sb.append("failure in bulk execution:");
        for (int i = 0; i < responses.length; i++) {
            BulkItemResponse response = responses[i];
            if (response.failed()) {
                sb.append("\n[").append(i)
                        .append("]: index [").append(response.index()).append("], type [").append(response.type()).append("], id [").append(response.id())
                        .append("], message [").append(response.failureMessage()).append("]");
            }
        }
        return sb.toString();
    }

    /**
     * The items representing each action performed in the bulk operation (in the same order!).
     */
    public BulkItemResponse[] items() {
        return responses;
    }

    @Override
    public Iterator<BulkItemResponse> iterator() {
        return Iterators.forArray(responses);
    }

    @Override
    public void readFrom(StreamInput in) throws IOException {
        super.readFrom(in);
        responses = new BulkItemResponse[in.readVInt()];
        for (int i = 0; i < responses.length; i++) {
            responses[i] = BulkItemResponse.readBulkItem(in);
        }
        tookInMillis = in.readVLong();
    }

    @Override
    public void writeTo(StreamOutput out) throws IOException {
        super.writeTo(out);
        out.writeVInt(responses.length);
        for (BulkItemResponse response : responses) {
            response.writeTo(out);
        }
        out.writeVLong(tookInMillis);
    }
}


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

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.communote.server.persistence.messaging.config (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

com.communote.server.persistence.messaging.config

Interfaces

MessagerConnectorConfigDao

Classes

MessagerConnectorConfigDaoBase

MessagerConnectorConfigDaoImpl


text:
package org.bitsofinfo.s3.toc;

import java.util.HashSet;
import java.util.List;
import java.util.Queue;
import java.util.Set;

import org.apache.log4j.Logger;

import com.amazonaws.event.ProgressEvent;
import com.amazonaws.event.ProgressListener;
import com.amazonaws.services.s3.AmazonS3Client;
import com.amazonaws.services.s3.model.ListObjectsRequest;
import com.amazonaws.services.s3.model.ObjectListing;
import com.amazonaws.services.s3.model.S3ObjectSummary;

public class S3BucketObjectLister implements Runnable, SourceTOCGenerator, ProgressListener {

	private static final Logger logger = Logger.getLogger(S3BucketObjectLister.class);

	private AmazonS3Client s3Client = null;
	private String s3BucketName = null;
	private boolean running = true;
	private int tocInfosGenerated = 0;

	public Set<TocInfo> generateTOC(Queue<TocInfo> tocQueue) throws Exception {
		Thread loggingThread = new Thread(this);

		Set<TocInfo> toc = new HashSet<TocInfo>();
		loggingThread.start();

		scanBucket(toc,tocQueue);

		this.running = false; // stop logging
		return toc;
	}

	private void scanBucket(Set<TocInfo> toc, Queue<TocInfo> tocQueue) throws Exception {

		ListObjectsRequest listRequest = new ListObjectsRequest();
		listRequest.setBucketName(s3BucketName);
		// listRequest.setGeneralProgressListener(this);
		listRequest.setMaxKeys(1000);

		String nextMarker = null;
		ObjectListing objectListing = null;

		while(true) {

			objectListing = s3Client.listObjects(listRequest);

			List<S3ObjectSummary> objectSummaries = objectListing.getObjectSummaries();

			for (S3ObjectSummary objSummary : objectSummaries) {
				String key = objSummary.getKey();

				TocInfo tocInfo = new TocInfo(key, objSummary.getSize());

				// is it a "dir/" ?
				if (key.lastIndexOf("/") == (key.length() - 1)) {
					tocInfo.isDirectory = true;
				} else {
					tocInfo.isDirectory = false;
				}

				toc.add(tocInfo);
				tocQueue.add(tocInfo);
				tocInfosGenerated++; // increment for logging

			}

			// for pagination
			nextMarker = objectListing.getNextMarker();
			if (nextMarker == null) {
				break;
			} else {
				listRequest.setMarker(nextMarker);
				logger.debug("scanBucket() nextMarker we will request listing for => " + nextMarker);
			}
		}

	}

	@Override
	public void progressChanged(ProgressEvent progressEvent) {
		logger.debug("progressChanged() " +progressEvent.getEventType() +
				       " bytes:" + progressEvent.getBytes() +
				      " bytesTransferred: " + progressEvent.getBytesTransferred());
	}

	public void run() {
		while (running) {
			try {
				logger.info("\nGenerated TOC current size: " + tocInfosGenerated + "\n");
				Thread.currentThread().sleep(15000);

			} catch(Exception ignore){}
		}
	}

	public AmazonS3Client getS3Client() {
		return s3Client;
	}

	public void setS3Client(AmazonS3Client s3Client) {
		this.s3Client = s3Client;
	}

	public String getS3BucketName() {
		return s3BucketName;
	}

	public void setS3BucketName(String s3BucketName) {
		this.s3BucketName = s3BucketName;
	}

}


text:
const Observer = class extends Set {
  addListener (listener) {
    super.add(listener)
  }

  removeListener (listener) {
    super.delete(listener)
  }

  notify () {
    this.forEach(v => v.listen(this))
  }

  listen () {throw 1}
  has () {throw 1}
  delete () {throw 1}
  add () {throw 1}
}


text:
/** @ingroup Group_USBClassMS
 *  @defgroup Group_USBClassMassStorageHost Mass Storage Class Host Mode Driver
 *
 *  @section Sec_Dependencies Module Source Dependencies
 *  The following files must be built with any user project that uses this module:
 *    - LPCUSBlib/Drivers/USB/Class/Host/MassStorage.c (Makefile source module name: LPCUSBlib_SRC_USBCLASS)
 *
 *  @section Sec_ModDescription Module Description
 *  Host Mode USB Class driver framework interface, for the Mass Storage USB Class driver.
 *
 *  @{
 */

#ifndef __MS_CLASS_HOST_H__
#define __MS_CLASS_HOST_H__

	/* Includes: */
		#include "../../USB.h"
		#include "../Common/MassStorageClassCommon.h"

	/* Enable C linkage for C++ Compilers: */
		#if defined(__cplusplus)
			extern "C" {
		#endif

	/* Preprocessor Checks: */
		#if !defined(__INCLUDE_FROM_MS_DRIVER)
			#error Do not include this file directly. Include LPCUSBlib/Drivers/USB.h instead.
		#endif

	/* Public Interface - May be used in end-application: */
		/* Macros: */
			/** Error code for some Mass Storage Host functions, indicating a logical (and not hardware) error. */
			#define MS_ERROR_LOGICAL_CMD_FAILED              0x80

		/* Type Defines: */
			/** @brief Mass Storage Class Host Mode Configuration and State Structure.
			 *
			 *  Class state structure. An instance of this structure should be made within the user application,
			 *  and passed to each of the Mass Storage class driver functions as the \c MSInterfaceInfo parameter. This
			 *  stores each Mass Storage interface's configuration and state information.
			 */
			typedef struct
			{
				struct
				{
					uint8_t  DataINPipeNumber; /**< Pipe number of the Mass Storage interface's IN data pipe. */
					bool     DataINPipeDoubleBank; /**< Indicates if the Mass Storage interface's IN data pipe should use double banking. */

					uint8_t  DataOUTPipeNumber; /**< Pipe number of the Mass Storage interface's OUT data pipe. */
					bool     DataOUTPipeDoubleBank; /**< Indicates if the Mass Storage interface's OUT data pipe should use double banking. */
					uint8_t  PortNumber;		/**< Port number that this interface is running.
												*/
				} Config; /**< Config data for the USB class interface within the device. All elements in this section
				           *   must be set or the interface will fail to enumerate and operate correctly.
				           */
				struct
				{
					bool     IsActive; /**< Indicates if the current interface instance is connected to an attached device, valid
					                    *   after @ref MS_Host_ConfigurePipes() is called and the Host state machine is in the
					                    *   Configured state.
					                    */
					uint8_t  InterfaceNumber; /**< Interface index of the Mass Storage interface within the attached device. */

					uint16_t DataINPipeSize; /**< Size in bytes of the Mass Storage interface's IN data pipe. */
					uint16_t DataOUTPipeSize;  /**< Size in bytes of the Mass Storage interface's OUT data pipe. */

					uint32_t TransactionTag; /**< Current transaction tag for data synchronizing of packets. */
				} State; /**< State data for the USB class interface within the device. All elements in this section
						  *   may be set to initial values, but may also be ignored to default to sane values when
						  *   the interface is enumerated.
						  */
			} USB_ClassInfo_MS_Host_t;

			/** @brief SCSI Device LUN Capacity Structure.
			 *
			 *  SCSI capacity structure, to hold the total capacity of the device in both the number
			 *  of blocks in the current LUN, and the size of each block. This structure is filled by
			 *  the device when the @ref MS_Host_ReadDeviceCapacity() function is called.
			 */
			typedef struct
			{
				uint32_t Blocks; /**< Number of blocks in the addressed LUN of the device. */
				uint32_t BlockSize; /**< Number of bytes in each block in the addressed LUN. */
			} SCSI_Capacity_t;

		/* Enums: */
			enum MS_Host_EnumerationFailure_ErrorCodes_t
			{
				MS_ENUMERROR_NoError                    = 0, /**< Configuration Descriptor was processed successfully. */
				MS_ENUMERROR_InvalidConfigDescriptor    = 1, /**< The device returned an invalid Configuration Descriptor. */
				MS_ENUMERROR_NoCompatibleInterfaceFound = 2, /**< A compatible Mass Storage interface was not found in the device's Configuration Descriptor. */
				MS_ENUMERROR_PipeConfigurationFailed    = 3, /**< One or more pipes for the specified interface could not be configured correctly. */
			};

		/* Function Prototypes: */
			/** @brief Host interface configuration routine, to configure a given Mass Storage host interface instance using the
			 *  Configuration Descriptor read from an attached USB device. This function automatically updates the given Mass
			 *  Storage Host instance's state values and configures the pipes required to communicate with the interface if it
			 *  is found within the device. This should be called once after the stack has enumerated the attached device, while
			 *  the host state machine is in the Addressed state.
			 *
			 *  @param MSInterfaceInfo      : Pointer to a structure containing an MS Class host configuration and state.
			 *  @param ConfigDescriptorSize : Length of the attached device's Configuration Descriptor.
			 *  @param ConfigDescriptorData : Pointer to a buffer containing the attached device's Configuration Descriptor.
			 *
			 *  @return A value from the @ref MS_Host_EnumerationFailure_ErrorCodes_t enum.
			 */
			uint8_t MS_Host_ConfigurePipes(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                               uint16_t ConfigDescriptorSize,
			                               void* ConfigDescriptorData) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(3);

			/** @brief Sends a MASS STORAGE RESET control request to the attached device, resetting the Mass Storage Interface
			 *  and readying it for the next Mass Storage command. This should be called after a failed SCSI request to
			 *  ensure the attached Mass Storage device is ready to receive the next command.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *
			 *  @return A value from the @ref USB_Host_SendControlErrorCodes_t enum.
			 */
			uint8_t MS_Host_ResetMSInterface(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);

			/** @brief Sends a GET MAX LUN control request to the attached device, retrieving the index of the highest LUN (Logical
			 *  UNit, a logical drive) in the device. This value can then be used in the other functions of the Mass Storage
			 *  Host mode Class driver to address a specific LUN within the device.
			 *
			 *  @note Some devices do not support this request, and will STALL it when issued. To get around this,
			 *        on unsupported devices the max LUN index will be reported as zero and no error will be returned
			 *        if the device STALLs the request.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param MaxLUNIndex     : Pointer to a location where the highest LUN index value should be stored.
			 *
			 *  @return A value from the @ref USB_Host_SendControlErrorCodes_t enum.
			 */
			uint8_t MS_Host_GetMaxLUN(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                          uint8_t* const MaxLUNIndex) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);

			/** @brief Retrieves the Mass Storage device's inquiry data for the specified LUN, indicating the device characteristics and
			 *  properties.
			 *
			 *  @pre This function must only be called when the Host state machine is in the @ref HOST_STATE_Configured state or the
			 *       call will fail.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *  @param InquiryData     : Location where the read inquiry data should be stored.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED.
			 */
			uint8_t MS_Host_GetInquiryData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                               const uint8_t LUNIndex,
			                               SCSI_Inquiry_Response_t* const InquiryData) ATTR_NON_NULL_PTR_ARG(1)
			                               ATTR_NON_NULL_PTR_ARG(3);

			/** @brief Sends a TEST UNIT READY command to the device, to determine if it is ready to accept other SCSI commands.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED if not ready.
			 */
			uint8_t MS_Host_TestUnitReady(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                              const uint8_t LUNIndex) ATTR_NON_NULL_PTR_ARG(1);

			/** @brief Retrieves the total capacity of the attached USB Mass Storage device, in blocks, and block size.
			 *
			 *  @pre This function must only be called when the Host state machine is in the @ref HOST_STATE_Configured state or the
			 *       call will fail.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *  @param DeviceCapacity  : Pointer to the location where the capacity information should be stored.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED if not ready.
			 */
			uint8_t MS_Host_ReadDeviceCapacity(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                                   const uint8_t LUNIndex,
			                                   SCSI_Capacity_t* const DeviceCapacity) ATTR_NON_NULL_PTR_ARG(1)
			                                   ATTR_NON_NULL_PTR_ARG(3);

			/** @brief Retrieves the device sense data, indicating the current device state and error codes for the previously
			 *  issued command.
			 *
			 *  @pre This function must only be called when the Host state machine is in the @ref HOST_STATE_Configured state or the
			 *       call will fail.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *  @param SenseData       : Pointer to the location where the sense information should be stored.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED if not ready.
			 */
			uint8_t MS_Host_RequestSense(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                             const uint8_t LUNIndex,
			                             SCSI_Request_Sense_Response_t* const SenseData) ATTR_NON_NULL_PTR_ARG(1)
			                             ATTR_NON_NULL_PTR_ARG(3);

			/** @brief Issues a PREVENT MEDIUM REMOVAL command, to logically (or, depending on the type of device, physically) lock
			 *  the device from removal so that blocks of data on the medium can be read or altered.
			 *
			 *  @pre This function must only be called when the Host state machine is in the @ref HOST_STATE_Configured state or the
			 *       call will fail.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *  @param PreventRemoval  : Boolean \c true if the device should be locked from removal, \c false otherwise.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED if not ready.
			 */
			uint8_t MS_Host_PreventAllowMediumRemoval(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                                          const uint8_t LUNIndex,
			                                          const bool PreventRemoval) ATTR_NON_NULL_PTR_ARG(1);

			/** @brief Reads blocks of data from the attached Mass Storage device's medium.
			 *
			 *  @pre This function must only be called when the Host state machine is in the @ref HOST_STATE_Configured state or the
			 *       call will fail.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *  @param BlockAddress    : Starting block address within the device to read from.
			 *  @param Blocks          : Total number of blocks to read.
			 *  @param BlockSize       : Size in bytes of each block within the device.
			 *  @param BlockBuffer     : Pointer to where the read data from the device should be stored.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED if not ready.
			 */
			uint8_t MS_Host_ReadDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                                 const uint8_t LUNIndex,
			                                 const uint32_t BlockAddress,
			                                 const uint8_t Blocks,
			                                 const uint16_t BlockSize,
			                                 void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(6);

			/** @brief Writes blocks of data to the attached Mass Storage device's medium.
			 *
			 *  @pre This function must only be called when the Host state machine is in the @ref HOST_STATE_Configured state or the
			 *       call will fail.
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing a MS Class host configuration and state.
			 *  @param LUNIndex        : LUN index within the device the command is being issued to.
			 *  @param BlockAddress    : Starting block address within the device to write to.
			 *  @param Blocks          : Total number of blocks to read.
			 *  @param BlockSize       : Size in bytes of each block within the device.
			 *  @param BlockBuffer     : Pointer to where the data to write should be sourced from.
			 *
			 *  @return A value from the @ref Pipe_Stream_RW_ErrorCodes_t enum or @ref MS_ERROR_LOGICAL_CMD_FAILED if not ready.
			 */
			uint8_t MS_Host_WriteDeviceBlocks(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
			                                  const uint8_t LUNIndex,
			                                  const uint32_t BlockAddress,
			                                  const uint8_t Blocks,
			                                  const uint16_t BlockSize,
			                                  const void* BlockBuffer) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(6);

		/* Inline Functions: */
			/** @brief General management task for a given Mass Storage host class interface, required for the correct operation of
			 *  the interface. This should be called frequently in the main program loop, before the master USB management task
			 *  @ref USB_USBTask().
			 *
			 *  @param MSInterfaceInfo : Pointer to a structure containing an Mass Storage Class host configuration and state.
			 *	@return	Nothing
			 */
			static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1) ATTR_ALWAYS_INLINE;
			static inline void MS_Host_USBTask(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo)
			{
				(void)MSInterfaceInfo;
			}

	/* Private Interface - For use in library only: */
	#if !defined(__DOXYGEN__)
		/* Macros: */
			#define MS_COMMAND_DATA_TIMEOUT_MS        10000

		/* Function Prototypes: */
			#if defined(__INCLUDE_FROM_MASSSTORAGE_HOST_C)
				static uint8_t MS_Host_SendCommand(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
				                                   MS_CommandBlockWrapper_t* const SCSICommandBlock,
				                                   const void* const BufferPtr) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
				static uint8_t MS_Host_WaitForDataReceived(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo) ATTR_NON_NULL_PTR_ARG(1);
				static uint8_t MS_Host_SendReceiveData(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
				                                       MS_CommandBlockWrapper_t* const SCSICommandBlock,
				                                       void* BufferPtr) ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);
				static uint8_t MS_Host_GetReturnedStatus(USB_ClassInfo_MS_Host_t* const MSInterfaceInfo,
				                                         MS_CommandStatusWrapper_t* const SCSICommandStatus)
				                                         ATTR_NON_NULL_PTR_ARG(1) ATTR_NON_NULL_PTR_ARG(2);

				static uint8_t DCOMP_MS_Host_NextMSInterface(void* const CurrentDescriptor)
				                                             ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
				static uint8_t DCOMP_MS_Host_NextMSInterfaceEndpoint(void* const CurrentDescriptor)
				                                                     ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(1);
			#endif
	#endif

	/* Disable C linkage for C++ Compilers: */
		#if defined(__cplusplus)
			}
		#endif

#endif

/** @} */


text:
package pixlepix.auracascade.block.tile;

import cpw.mods.fml.common.network.NetworkRegistry;
import net.minecraft.block.Block;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.Explosion;
import net.minecraftforge.common.util.ForgeDirection;
import pixlepix.auracascade.AuraCascade;
import pixlepix.auracascade.block.AuraBlock;
import pixlepix.auracascade.data.AuraQuantity;
import pixlepix.auracascade.data.AuraQuantityList;
import pixlepix.auracascade.data.CoordTuple;
import pixlepix.auracascade.data.EnumAura;
import pixlepix.auracascade.network.PacketBurst;

import java.util.HashMap;
import java.util.LinkedList;

public class AuraTile extends TileEntity {

    public AuraQuantityList storage = new AuraQuantityList();
    public HashMap<CoordTuple, AuraQuantityList> burstMap = null;
    public LinkedList<CoordTuple> connected = new LinkedList<CoordTuple>();
    public boolean hasConnected = false;
    public int energy = 0;
    public int initialYValue = -1;

    //Used by Orange Aura
    public HashMap<CoordTuple, Integer> inducedBurstMap = new HashMap<CoordTuple, Integer>();

    public AuraTile() {
    }

    @Override
    public void readFromNBT(NBTTagCompound nbt) {

        super.readFromNBT(nbt);
        readCustomNBT(nbt);
    }

    protected void readCustomNBT(NBTTagCompound nbt) {
        NBTTagList storageNBT = nbt.getTagList("storage", 10);
        storage.readFromNBT(storageNBT);

        NBTTagList connectionsNBT = nbt.getTagList("connected", 10);
        connected = new LinkedList<CoordTuple>();
        for (int i = 0; i < connectionsNBT.tagCount(); i++) {
            NBTTagCompound coordNBT = connectionsNBT.getCompoundTagAt(i);
            int x = coordNBT.getInteger("x");
            int y = coordNBT.getInteger("y");
            int z = coordNBT.getInteger("z");
            CoordTuple coord = new CoordTuple(x, y, z);
            connected.add(coord);
        }

        hasConnected = nbt.getBoolean("hasConnected");
        energy = nbt.getInteger("energy");
        initialYValue = nbt.getInteger("initialYValue");

    }

    public boolean connectionBlockedByBlock(CoordTuple tuple) {
        Block block = tuple.getBlock(worldObj);
        return !block.isAir(worldObj, tuple.getX(), tuple.getY(), tuple.getZ()) && (block instanceof AuraBlock || block.isOpaqueCube());
    }

    @Override
    public void writeToNBT(NBTTagCompound nbt) {
        super.writeToNBT(nbt);
        writeCustomNBT(nbt);
    }

    protected void writeCustomNBT(NBTTagCompound nbt) {
        NBTTagList storageNBT = new NBTTagList();
        storage.writeToNBT(storageNBT);
        nbt.setTag("storage", storageNBT);

        NBTTagList connectionsNBT = new NBTTagList();
        for (CoordTuple tuple : connected) {
            NBTTagCompound coordNBT = new NBTTagCompound();
            coordNBT.setInteger("x", tuple.getX());
            coordNBT.setInteger("y", tuple.getY());
            coordNBT.setInteger("z", tuple.getZ());
            connectionsNBT.appendTag(coordNBT);
        }
        nbt.setTag("connected", connectionsNBT);

        nbt.setBoolean("hasConnected", hasConnected);
        nbt.setInteger("energy", energy);
        nbt.setInteger("initialYValue", initialYValue);
    }

    public boolean isOpenPath(CoordTuple target) {
        int dist = (int) new CoordTuple(this).dist(target);

        ForgeDirection direction = new CoordTuple(this).getDirectionTo(target);
        if (direction == ForgeDirection.UNKNOWN) {
            return false;
        }
        for (int i = 1; i < dist; i++) {
            CoordTuple between = new CoordTuple(this).add(direction, i);
            if (connectionBlockedByBlock(between)) {
                return false;
            }
        }
        return true;
    }

    public void verifyConnections() {
        LinkedList<CoordTuple> result = new LinkedList<CoordTuple>();
        for (CoordTuple next : connected) {
            TileEntity tile = next.getTile(worldObj);
            if (tile instanceof AuraTile && isOpenPath(next)) {
                if (!((AuraTile) tile).connected.contains(new CoordTuple(this))) {
                    ((AuraTile) tile).connected.add(new CoordTuple(this));
                }
                if (!result.contains(next)) {
                    result.add(next);
                }
            }
        }
        connected = result;
    }

    public void connect(int x2, int y2, int z2) {
        if (worldObj.getTileEntity(x2, y2, z2) instanceof AuraTile && worldObj.getTileEntity(x2, y2, z2) != this && isOpenPath(new CoordTuple(x2, y2, z2))) {
            AuraTile otherNode = (AuraTile) worldObj.getTileEntity(x2, y2, z2);
            otherNode.connected.add(new CoordTuple(this));
            this.connected.add(new CoordTuple(otherNode));
            //This should only happen on initial placement
            //Not on 'follow ups'
            if (!hasConnected) {
                burst(new CoordTuple(x2, y2, z2), "spell", EnumAura.WHITE_AURA, 1D);
            }

        }
    }

    public void burst(CoordTuple target, String particle, EnumAura aura, double composition) {

        AuraCascade.proxy.networkWrapper.sendToAllAround(new PacketBurst(new CoordTuple(this), target, particle, aura.r, aura.g, aura.b, composition), new NetworkRegistry.TargetPoint(worldObj.provider.dimensionId, xCoord, yCoord, zCoord, 32));

    }

    @Override
    public void updateEntity() {
        super.updateEntity();

        if ((!hasConnected || worldObj.getTotalWorldTime() % 200 == 0) && !worldObj.isRemote) {
            for (int i = 1; i < 16; i++) {
                for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
                    connect(xCoord + dir.offsetX * i, yCoord + dir.offsetY * i, zCoord + dir.offsetZ * i);
                }
            }
            //This initial check does *not* see if connections are blocked
            verifyConnections();
            hasConnected = true;
        }

        if (initialYValue != yCoord) {
            if (initialYValue == -1 || initialYValue == 0) {
                initialYValue = yCoord;
            } else {
                Explosion explosion = new Explosion(worldObj, null, xCoord, yCoord, zCoord, 2F);
                explosion.doExplosionA();
                explosion.doExplosionB(false);
                worldObj.setBlockToAir(xCoord, yCoord, zCoord);
            }
        }

        if (!worldObj.isRemote) {

            if (worldObj.getTotalWorldTime() % 20 == 0) {

                verifyConnections();
                energy = 0;
                burstMap = new HashMap<CoordTuple, AuraQuantityList>();
                double totalWeight = 0;
                for (CoordTuple tuple : connected) {
                    if (canTransfer(tuple)) {
                        totalWeight += getWeight(tuple);
                    }
                }
                //Add a balance so the node doesn't completley discharge
                //Based off 'sending aura to yourself'
                totalWeight += this instanceof AuraTileCapacitor ? 0 : 20 * 20;

                for (CoordTuple tuple : connected) {
                    double factor = getWeight(tuple) / totalWeight;
                    AuraTile other = (AuraTile) tuple.getTile(worldObj);
                    AuraQuantityList quantityList = new AuraQuantityList();
                    for (EnumAura enumAura : EnumAura.values()) {

                        if (canTransfer(tuple, enumAura)) {
                            int auraHere = storage.get(enumAura);
                            int auraThere = other.storage.get(enumAura);
                            int diff = Math.abs(auraHere - auraThere);
                            if (diff > 25) {
                                quantityList.add(new AuraQuantity(enumAura, (int) (auraHere * (float) factor)));
                            }

                        }
                    }
                    if (!quantityList.empty()) {
                        burstMap.put(tuple, quantityList);
                    }
                }
            }

        }
        if (worldObj.getTotalWorldTime() % 20 == 1) {
            verifyConnections();
            if (burstMap != null) {
                for (CoordTuple tuple : connected) {
                    if (burstMap.containsKey(tuple)) {
                        transferAura(tuple, burstMap.get(tuple), true);

                    }
                }
                burstMap = null;
            }
        }
        if (worldObj.getTotalWorldTime() % 20 == 2) {
            verifyConnections();
            if (inducedBurstMap != null) {
                for (CoordTuple tuple : connected) {
                    if (inducedBurstMap.containsKey(tuple)) {
                        int num = inducedBurstMap.get(tuple);
                        AuraTile otherTile = (AuraTile) tuple.getTile(worldObj);
                        int deltaFlow;
                        int altNum = 0;
                        if (otherTile.inducedBurstMap != null) {
                            altNum = otherTile.inducedBurstMap.containsKey(new CoordTuple(this)) ? otherTile.inducedBurstMap.get(new CoordTuple(this)) : 0;
                            deltaFlow = num - altNum;
                        } else {
                            deltaFlow = num;
                        }
                        if (deltaFlow > 0) {
                            AuraQuantityList auraToSend = (AuraQuantityList) storage.clone();
                            otherTile.inducedBurstMap.put(new CoordTuple(this), 0);
                            auraToSend.set(EnumAura.ORANGE_AURA, 0);
                            if (auraToSend.getTotalAura() > 0) {
                                auraToSend = auraToSend.percent(Math.min(1F, (float) deltaFlow / (float) storage.getTotalAura()) - storage.get(EnumAura.ORANGE_AURA));
                                transferAura(tuple, auraToSend, false);
                            }
                        } else {
                            inducedBurstMap.put(tuple, 0);
                            if (otherTile.inducedBurstMap != null) {
                                otherTile.inducedBurstMap.put(new CoordTuple(this), altNum - num);
                            }
                        }
                    }
                }
                inducedBurstMap = new HashMap<CoordTuple, Integer>();
            }
            worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
            worldObj.notifyBlockChange(xCoord, yCoord, zCoord, worldObj.getBlock(xCoord, yCoord, zCoord));
        }

        for (AuraQuantity quantity : storage.quantityList) {
            if (quantity.getNum() > 0) {
                quantity.getType().updateTick(worldObj, new CoordTuple(this), quantity);
            }
        }
    }

    public void transferAura(CoordTuple tuple, AuraQuantityList list, boolean triggerOrange) {
        if (storage.greaterThan(list)) {
            ((AuraTile) tuple.getTile(worldObj)).storage.add(list);
            storage.subtract(list);
            for (EnumAura aura : EnumAura.values()) {
                if (list.get(aura) > 0) {
                    burst(tuple, "square", aura, list.getComposition(aura));
                    int power = (int) ((yCoord - tuple.getY()) * list.get(aura) * aura.getRelativeMass(worldObj));
                    if (power > 0) {
                        ((AuraTile) tuple.getTile(worldObj)).receivePower(power, aura);
                    }
                    if (!(!triggerOrange && aura == EnumAura.ORANGE_AURA) && list.get(aura) != 0) {
                        aura.onTransfer(worldObj, new CoordTuple(this), new AuraQuantity(aura, list.get(aura)), new CoordTuple(this).getDirectionTo(tuple));
                    }
                }
            }
        }
    }

    public void receivePower(int power, EnumAura type) {
        energy += power;
    }

    @SuppressWarnings("SimplifiableIfStatement")
    public boolean canTransfer(CoordTuple tuple) {
        boolean isLower = tuple.getY() < yCoord;

        boolean isSame = tuple.getY() == yCoord;
        if (!(tuple.getTile(worldObj) instanceof AuraTile)) {
            return false;
        }
        if (!(isSame || isLower)) {
            return false;
        }
        return !(worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord) && !(this instanceof AuraTileBlack));

    }

    @SuppressWarnings("SimplifiableIfStatement")
    public boolean canTransfer(CoordTuple tuple, EnumAura aura) {
        if (!canTransfer(tuple)) {
            return false;
        }
        if (tuple.getY() != yCoord && aura == EnumAura.ORANGE_AURA) {
            return false;
        }
        if (tuple.getY() == yCoord && aura == EnumAura.BLACK_AURA) {
            return false;
        }
        return ((AuraTile) tuple.getTile(worldObj)).canReceive(new CoordTuple(this), aura);
    }

    public boolean canReceive(CoordTuple source, EnumAura aura) {
        return true;
    }

    public double getWeight(CoordTuple tuple) {
        return Math.pow(20 - tuple.dist(this), 2);
    }

    @Override
    public Packet getDescriptionPacket() {
        NBTTagCompound nbt = new NBTTagCompound();
        writeCustomNBT(nbt);
        return new S35PacketUpdateTileEntity(xCoord, yCoord, zCoord, -999, nbt);
    }

    @Override
    public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
        readCustomNBT(pkt.func_148857_g());
    }
}


text:
<template is="vr-template" element="vr-bigcubes" color1="red" color2="white" color3="blue">
  <vr-object mixin="cube" position="-8 3 0" rotation="30 45 0" material="color: ${color1}"></vr-object>
  <vr-object mixin="cube" position="0 2 2" rotation="30 45 0" material="color: ${color2}"></vr-object>
  <vr-object mixin="cube" position="7 -3 2" rotation="30 45 0" material="color: ${color3}"></vr-object>
</template>


text:
title: Implement Selection Sort
localeTitle: Implementar Selección Ordenar
---
## Implementar Selección Ordenar

### Método:

*   El ordenamiento por selección es uno de los algoritmos de clasificación más fáciles de entender e implementar.
*   Este algoritmo divide la matriz en dos partes:

1.  Ordenados
2.  Sin clasificar

*   La parte ordenada se encuentra al principio de la matriz y la parte sin clasificar después.
*   Cada paso, inicialmente asumimos que el primer elemento es el más pequeño, luego hacemos un ciclo a través de toda la matriz y _seleccionamos_ el elemento más pequeño. Al final del paso, intercambiamos el elemento más pequeño a la matriz ordenada.
*   Tiene **O (n 2 )** complejidad de tiempo.

### Solución:

```js
function swap(a, b, arr){
  let tmp = arr[a];
  arr[a] = arr[b];
  arr[b] = tmp;
 }
 function selectionSort(array) {
  for (let i = 0; i < array.length-1; i++){
    let min = i;
    for (let j = i+1; j < array.length; j++){
      if (array[min] > array[j]) min = j;
    }
    swap(i, min, array);
  }
  return array;
 }
```

### Referencias:

*   Lea acerca de la selección de selección en [Wikipedia](https://en.wikipedia.org/wiki/Selection_sort)


text:
"""Tests for evaluation_utils.py."""

from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import tensorflow as tf

from ..utils import evaluation_utils

class EvaluationUtilsTest(tf.test.TestCase):

  def testEvaluate(self):
    output = "nmt/testdata/deen_output"
    ref_bpe = "nmt/testdata/deen_ref_bpe"
    ref_spm = "nmt/testdata/deen_ref_spm"

    expected_bleu_score = 22.5855084573
    expected_rouge_score = 50.8429782599

    bpe_bleu_score = evaluation_utils.evaluate(
        ref_bpe, output, "bleu", "bpe")
    bpe_rouge_score = evaluation_utils.evaluate(
        ref_bpe, output, "rouge", "bpe")

    self.assertAlmostEqual(expected_bleu_score, bpe_bleu_score)
    self.assertAlmostEqual(expected_rouge_score, bpe_rouge_score)

    spm_bleu_score = evaluation_utils.evaluate(
        ref_spm, output, "bleu", "spm")
    spm_rouge_score = evaluation_utils.evaluate(
        ref_spm, output, "rouge", "spm")

    self.assertAlmostEqual(expected_rouge_score, spm_rouge_score)
    self.assertAlmostEqual(expected_bleu_score, spm_bleu_score)

  def testAccuracy(self):
    pred_output = "nmt/testdata/pred_output"
    label_ref = "nmt/testdata/label_ref"

    expected_accuracy_score = 60.00

    accuracy_score = evaluation_utils.evaluate(
        label_ref, pred_output, "accuracy")
    self.assertAlmostEqual(expected_accuracy_score, accuracy_score)

  def testWordAccuracy(self):
    pred_output = "nmt/testdata/pred_output"
    label_ref = "nmt/testdata/label_ref"

    expected_word_accuracy_score = 60.00

    word_accuracy_score = evaluation_utils.evaluate(
        label_ref, pred_output, "word_accuracy")
    self.assertAlmostEqual(expected_word_accuracy_score, word_accuracy_score)

if __name__ == "__main__":
  tf.test.main()


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <solar.blaz.date.week.WeekDatePicker
        android:id="@+id/date_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingTop="5dp"
        android:paddingBottom="5dp"
        android:textSize="18sp"
        android:textColor="@color/date_picker_text_color"
        app:wdp_labelTextSize="12sp"
        app:wdp_labelPadding="5dp"
        app:wdp_dayBackground="@drawable/date_picker_day_bg"
        app:wdp_indicatorDrawable="@drawable/date_picker_indicator"
        app:wdp_firstDayOfWeek="monday"/>

</LinearLayout>


text:
package org.hisp.dhis.android.core.arch.db.adapters.enums.internal;

import org.hisp.dhis.android.core.validation.ValidationRuleOperator;

public class ValidationRuleOperatorColumnAdapter extends EnumColumnAdapter<ValidationRuleOperator> {
    @Override
    protected Class<ValidationRuleOperator> getEnumClass() {
        return ValidationRuleOperator.class;
    }
}


text:
#pragma once

#include <cstdint>
#include <string>

#define adagfxswap(a, b) { int16_t t = a; a = b; b = t; }

namespace upm
{
    /**
     * @brief GFX helper class
     */
    class GFX {
        public:

            /**
             * Creates a GFX object
             *
             * @param w Screen width
             * @param h Screen height
             */
            GFX(int16_t w, int16_t h);

            /**
             * Empyt virtual destructor
             */
            virtual ~GFX() {};

            /**
             * Sends a pixel color (RGB) to the driver chip. This must be
             * defined by the subclass (pure virtual function).
             *
             * @param x Axis on the horizontal scale
             * @param y Axis on the vertical scale
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;

            /**
             * Draw a line.
             *
             * @param x0 Start of line x coordinate
             * @param y0 Start of line y coordinate
             * @param x1 End of line x coordinate
             * @param y1 End of line y coordinate
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void drawLine(int16_t x0,
                                  int16_t y0,
                                  int16_t x1,
                                  int16_t y1,
                                  uint16_t color);

            /**
             * Draws a vertical line using minimal SPI writes.
             *
             * @param x Axis on the horizontal scale to begin line
             * @param y Axis on the vertical scale to begin line
             * @param h Height of line in pixels
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void drawFastVLine(int16_t x,
                                       int16_t y,
                                       int16_t h,
                                       uint16_t color);

            /**
             * Draws a horizontal line using  minimal SPI writes.
             *
             * @param x Axis on the horizontal scale to begin line
             * @param y Axis on the vertical scale to begin line
             * @param w Width of line in pixels
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void drawFastHLine(int16_t x,
                                       int16_t y,
                                       int16_t w,
                                       uint16_t color);

            /**
             * Draws a rectangle (not filled).
             *
             * @param x Position of upper left corner on horizontal axis
             * @param y Position of upper left corner on vertical axis
             * @param w Width of rectangle
             * @param h Height of rectangle
             * @color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void drawRect(int16_t x,
                                  int16_t y,
                                  int16_t w,
                                  int16_t h,
                                  uint16_t color);

            /**
             * Draw a filled rectangle.
             *
             * @param x Axis on the horizontal scale of upper-left corner
             * @param y Axis on the vertical scale of upper-left corner
             * @param w Width of rectangle in pixels
             * @param h Height of rectangle in pixels
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void fillRect(int16_t x,
                                  int16_t y,
                                  int16_t w,
                                  int16_t h,
                                  uint16_t color);

            /**
             * Fill the screen with a single color.
             *
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            virtual void fillScreen(uint16_t color);

            /**
             * Invert colors on the display.
             *
             * @param i True or false to invert colors
             */
            virtual void invertDisplay(bool i);

            /**
             * Draw a circle outline.
             *
             * @param x0 Center point of circle on x-axis
             * @param y0 Center point of circle on y-axis
             * @param r Radius of circle
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);

            /**
             * Used to draw rounded corners.
             *
             * @param x0 Center point of circle on x-axis
             * @param y0 Center point of circle on y-axis
             * @param r Radius of circle
             * @param cornername Mask of corner number (1, 2, 4, 8)
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void drawCircleHelper(int16_t x0,
                                  int16_t y0,
                                  int16_t r,
                                  uint8_t cornername,
                                  uint16_t color);

            /**
             * Draws a filled circle.
             *
             * @param x0 Center point of circle on x-axis
             * @param y0 Center point of circle on y-axis
             * @param r Radius of circle
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color);

            /**
             * Used to draw a filled circle and rounded rectangles.
             *
             * @param x0 Center point of circle on x-axis
             * @param y0 Center point of circle on y-axis
             * @param r Radius of circle
             * @param cornername Mask of corner number (1, 2, 4, 8)
             * @param delta Line offset
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void fillCircleHelper(int16_t x0,
                                  int16_t y0,
                                  int16_t r,
                                  uint8_t cornername,
                                  int16_t delta,
                                  uint16_t color);

            /**
             * Draw a triangle.
             *
             * @param x0 First point coordinate on x-axis
             * @param y0 First point coordinate on y-axis
             * @param x1 Second point coordinate on x-axis
             * @param y1 Second point coordinate on y-axis
             * @param x2 Third point coordinate on x-axis
             * @param y2 Third point coordinate on y-axis
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void drawTriangle(int16_t x0,
                              int16_t y0,
                              int16_t x1,
                              int16_t y1,
                              int16_t x2,
                              int16_t y2,
                              uint16_t color);

            /**
             * Draw a filled triangle.
             *
             * @param x0 First point coordinate on x-axis
             * @param y0 First point coordinate on y-axis
             * @param x1 Second point coordinate on x-axis
             * @param y1 Second point coordinate on y-axis
             * @param x2 Third point coordinate on x-axis
             * @param y2 Third point coordinate on y-axis
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void fillTriangle(int16_t x0,
                              int16_t y0,
                              int16_t x1,
                              int16_t y1,
                              int16_t x2,
                              int16_t y2,
                              uint16_t color);

            /**
             * Draw a rectangle with rounded corners
             *
             * @param x0 X-axis coordinate of top-left corner
             * @param y0 Y-axis coordinate of top-left corner
             * @param w Width of rectangle
             * @param h height of rectangle
             * @param radius Radius of rounded corners
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void drawRoundRect(int16_t x0,
                               int16_t y0,
                               int16_t w,
                               int16_t h,
                               int16_t radius,
                               uint16_t color);

            /**
             * Draw a filled rectangle with rounded corners
             *
             * @param x0 X-axis coordinate of top-left corner
             * @param y0 Y-axis coordinate of top-left corner
             * @param w Width of rectangle
             * @param h height of rectangle
             * @param radius Radius of rounded corners
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void fillRoundRect(int16_t x0,
                               int16_t y0,
                               int16_t w,
                               int16_t h,
                               int16_t radius,
                               uint16_t color);

            /**
             * Draw a character at the specified point.
             *
             * @param x X-axis coordinate of the top-left corner
             * @param y Y-axis coordinate of the top-left corner
             * @param c Character to draw
             * @param color RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             * @param bg Background color (16-bit RGB)
             * @param size Font size
             */
            void drawChar(int16_t x,
                          int16_t y,
                          unsigned char c,
                          uint16_t color,
                          uint16_t bg,
                          uint8_t size);

            /**
             * Get the x-axis coordinate of the upper-left corner of the cursor.
             *
             * @return X-axis coordinate of the cursor
             */
            int16_t getCursorX(void) const;

            /**
             * Get the y-axis coordinate of the upper-left corner of the cursor.
             *
             * @return Y-axis coordinate of the cursor
             */
            int16_t getCursorY(void) const;

            /**
             * Set the cursor for writing text.
             *
             * @param x X-axis coordinate of the top-left corner of the cursor
             * @param y Y-axis coordinate of the top-left corner of the cursor
             */
            void setCursor(int16_t x, int16_t y);

            /**
             * Set the color for text.
             *
             * @param c RGB (16-bit) color (R[0-4], G[5-10], B[11-15]
             */
            void setTextColor(uint16_t c);

            /**
             * Set the color for text and text background (highlight).
             *
             * @param c Text color (RGB, 16-bit)
             * @param bg Background text color (RGB, 16-bit)
             */
            void setTextColor(uint16_t c, uint16_t bg);

            /**
             * Set the size of the text.
             *
             * @param s Font size (multiples of 8 pixel text height)
             */
            void setTextSize(uint8_t s);

            /**
             * Enable or disable text wrapping.
             *
             * @param w True to wrap text. False to truncate.
             */
            void setTextWrap(bool w);

            /**
             * Get the current rotation configuration of the screen.
             *
             * @return current rotation 0-3
             */
            uint8_t getRotation(void) const;

            /**
             * Sets the rotation of the screen. Can be overridden with another
             * screen-specific definition.
             *
             * @param r Rotation 0-3
             */
            void setRotation(uint8_t r);

            /**
             * Enable (or disable) Code Page 437-compatible charset.
             *
             * @param x True to enable CP437 charset. False to disable.
             */
            void cp437(bool x);

            /**
             * Write a character at the current cursor position. Definition
             * can be overridden with board-specific code.
             *
             * @param c Character to draw
             */
            virtual void write(uint8_t c);

            /**
             * Prints a string to the screen.
             *
             * @param msg Message to print
             */
            void print(std::string msg);

            /**
             * Get the current width of the screen.
             *
             * @return the width in pixels
             */
            int16_t width(void) const;

            /**
             * Get the current height of the screen.
             *
             * @return the height in pixels
             */
            int16_t height(void) const;

        protected:

            const int16_t WIDTH;
            const int16_t HEIGHT;

            int16_t _width;
            int16_t _height;

            uint8_t rotation;

            uint16_t textcolor;
            uint16_t textbgcolor;
            int16_t cursor_x;
            int16_t cursor_y;
            uint8_t textsize;
            bool wrap;
            bool _cp437;
            static const unsigned char font[];
    };
}


text:
/**
 * EsrTestServiceTestCase.java
 *
 * Test for bug 12636
 * Uses the Service interface to deal with WSDL instead of stubs.
 */

package test.wsdl.esr;

import org.apache.axis.transport.http.SimpleAxisWorker;
import org.apache.axis.utils.NetworkUtils;

import javax.xml.namespace.QName;

public class EsrTestServiceTestCase extends junit.framework.TestCase {
    public EsrTestServiceTestCase(java.lang.String name) {
        super(name);
    }

    public void testEsrTestWSDL() throws Exception {
        javax.xml.rpc.ServiceFactory serviceFactory = javax.xml.rpc.ServiceFactory.newInstance();
        java.net.URL url = new java.net.URL(new test.wsdl.esr.EsrTestServiceLocator().getEsrTestAddress() + "?WSDL");
        javax.xml.rpc.Service service = serviceFactory.createService(url, new test.wsdl.esr.EsrTestServiceLocator().getServiceName());
        assertTrue(service != null);
    }

    public void test1EsrTestEsrInOut() {
        // Using WSDL file to make a SOAP call
        try {
            String thisHost = NetworkUtils.getLocalHostname();
            String thisPort = System.getProperty("test.functional.ServicePort", "8080");

            //load wsdl file
            String wsdlLocation = "http://" + thisHost + ":" + thisPort + "/axis/services/EsrTest?WSDL";
            javax.xml.rpc.Service svc =
                    new org.apache.axis.client.Service(
                            wsdlLocation,
                            new javax.xml.namespace.QName("urn:esr.wsdl.test",
                                    "EsrTestService")
                    );

            //setting up the call
            javax.xml.rpc.Call call = svc.createCall(
                    new javax.xml.namespace.QName("urn:esr.wsdl.test",
                            "EsrTest"),
                    new javax.xml.namespace.QName("urn:esr.wsdl.test",
                                    "esrInOut")
            );

            //init in params
            Object[] soapInParams = new Object[]{new Short((short) 5)};

            //calling soap service
            Object ret = call.invoke(soapInParams);

            //printing output params
            java.util.Map outParams = call.getOutputParams();

            // Debug code if you need it
            /*
            java.util.Collection outs = outParams.values();
            java.util.Iterator it = outs.iterator();
            int i = 1;
            while (it.hasNext()) {
                System.out.println(i++ + ". " + it.next().toString());
            }
            */

            // Expecting a short and a double back
            assertEquals("Number of output parameters is wrong", outParams.size(), 2);
            Object s = outParams.get(new QName("echoVal"));
            assertNotNull("echoVal paramter is null", s);
            assertEquals("echoVal parameter is incorrect", (Short)s, new Short((short) 5) );
            Object sq = outParams.get(new QName("sqrtVal"));
            assertNotNull("sqrtVal paramter is null", sq);
            assertEquals("sqrtVal parameter is incorrect", ((Double)sq).doubleValue(), Math.sqrt(5), 0.001D );

        } catch (Exception e) {
            e.printStackTrace(System.out);
            throw new junit.framework.AssertionFailedError("Exception caught: " + e);
        }

    }

    public void test1EsrTestEsrInOut2() {
        // Using WSDL file to make a SOAP call
        try {
            String thisHost = NetworkUtils.getLocalHostname();
            String thisPort = System.getProperty("test.functional.ServicePort", "8080");

            //load wsdl file
            String wsdlLocation = "http://" + thisHost + ":" + thisPort + "/axis/services/EsrTest?WSDL";
            javax.xml.rpc.Service svc =
                    new org.apache.axis.client.Service(
                            wsdlLocation,
                            new javax.xml.namespace.QName("urn:esr.wsdl.test",
                                    "EsrTestService")
                    );

            //setting up the call
            javax.xml.rpc.Call call = svc.createCall(
                    new javax.xml.namespace.QName("urn:esr.wsdl.test",
                            "EsrTest"),
                    new javax.xml.namespace.QName("urn:esr.wsdl.test",
                                    "esrInOut2")
            );

			//init in params
			Object[] soapInParams = new Object[] {
                                              "token1",
                                              "token2",
                                              new Short((short)5) };

            //calling soap service
            Object ret = call.invoke(soapInParams);

            //printing output params
            java.util.Map outParams = call.getOutputParams();

            // Debug code if you need it
            /*
            java.util.Collection outs = outParams.values();
            java.util.Iterator it = outs.iterator();
            int i = 1;
            while (it.hasNext()) {
                System.out.println(i++ + ". " + it.next().toString());
            }
            */

            // Expecting a short and a double back
            assertEquals("Number of output parameters is wrong", outParams.size(), 2);
            Object s = outParams.get(new QName("echoVal"));
            assertNotNull("echoVal paramter is null", s);
            assertEquals("echoVal parameter is incorrect", (Short)s, new Short((short) 5) );
            Object sq = outParams.get(new QName("sqrtVal"));
            assertNotNull("sqrtVal paramter is null", sq);
            assertEquals("sqrtVal parameter is incorrect", ((Double)sq).doubleValue(), Math.sqrt(5), 0.001D );

        } catch (Exception e) {
            e.printStackTrace(System.out);
            throw new junit.framework.AssertionFailedError("Exception caught: " + e);
        }

    }
}


text:
/*jslint vars: true, plusplus: true, devel: true, nomen: true,  regexp: true, indent: 4, maxerr: 50 */
/*global define, brackets, $ */

define(function (require, exports, module) {
    "use strict";

    var _uploadDialog = null;

    var StartupState   = brackets.getModule("bramble/StartupState");
    var Path           = brackets.getModule("filesystem/impls/filer/BracketsFiler").Path;
    var CommandManager = brackets.getModule("command/CommandManager");
    var CMD_OPEN       = brackets.getModule("command/Commands").CMD_OPEN;
    var Dialogs        = brackets.getModule("widgets/Dialogs");
    var DragAndDrop    = brackets.getModule("utils/DragAndDrop");
    var KeyEvent       = brackets.getModule("utils/KeyEvent");
    var Strings        = brackets.getModule("strings");
    var Mustache       = brackets.getModule("thirdparty/mustache/mustache");

    var dialogHTML     = require("text!htmlContent/upload-files-dialog.html");

    // Not all browsers support access to camera
    var isCameraSupported = (function(navigator) {
        return !!(navigator.getUserMedia       ||
                  navigator.webkitGetUserMedia ||
                  navigator.mozGetUserMedia    ||
                  navigator.msGetUserMedia);
    }(window.navigator));

    function FileInput() {
        if (!$(".upload-files-input-elem")[0]){
            $(document.body)
                .append($('<input class="upload-files-input-elem" type="file" multiple />'));
        }
    }
    FileInput.prototype.getFiles = function() {
        return this.getElem$()[0].files;
    };
    FileInput.prototype.getElem$ = function() {
        return $(".upload-files-input-elem");
    };
    FileInput.prototype.remove = function() {
        this.getElem$().remove();
    };

    function FileUploadDialog() {
        this.fileInput = new FileInput();
        this.deferred = new $.Deferred();
    }
    FileUploadDialog.prototype.show = function() {
        var self = this;
        var deferred = self.deferred;

        // We ignore the promise returned by showModalDialogUsingTemplate, since we're managing the
        // lifecycle of the dialog ourselves.
        Dialogs.showModalDialogUsingTemplate(Mustache.render(dialogHTML, Strings), false);

        var $dlg = $(".upload-files-dialog.instance");
        var $dragFilesAreaDiv = $dlg.find(".drag-files-area");
        var $uploadFilesDiv = $dlg.find(".uploading-files");
        var $fromComputerButton = $dlg.find(".dialog-button[data-button-id='from-computer']");
        var $takeSelfieButton = $dlg.find(".dialog-button[data-button-id='take-selfie']");
        var $cancelButton = $dlg.find(".dialog-button[data-button-id='cancel']");
        var $dropZoneDiv = $dlg.find(".drop-zone");

        // Disable selfie button if not supported by browser
        if(!isCameraSupported) {
            $takeSelfieButton.attr("disabled", true);
        }

        // Hide the uploadingFiles div until a drop event
        $uploadFilesDiv.hide();

        $fromComputerButton.one("click", self._handleFromComputer.bind(self));
        $takeSelfieButton.one("click", self._handleTakeSelfie.bind(self));
        $cancelButton.one("click", function() {
            self.hide();
            self.destroy();
        });
        $(window.document.body).on("keyup.installDialog", self._handleKeyUp.bind(self));

        // Hook up drag-and-drop handling
        DragAndDrop.attachHandlers({
            elem: $dropZoneDiv[0],
            ondragover: function() {
                if(self._dragover) {
                    return;
                }
                self._dragover = true;
                $dragFilesAreaDiv.addClass("drag-over");
            },
            ondragleave: function() {
                delete self._dragover;
                $dragFilesAreaDiv.removeClass("drag-over");
            },
            ondrop: function() {
                // Turn off the other buttons
                $fromComputerButton.off("click", self._handleFromComputer.bind(self));
                $takeSelfieButton.off("click", self._handleTakeSelfie.bind(self));

                // Switch to the upload spinner
                $dragFilesAreaDiv.hide();
                $uploadFilesDiv.show();
            },
            onfilesdone: function() {
                self.hide();
                self.destroy();
            },
            autoRemoveHandlers: true
        });

        return deferred.promise();
    };
    FileUploadDialog.prototype._handleKeyUp = function(e) {
        var self = this;

        // Dismiss dialog on ESC
        if (e.keyCode === KeyEvent.DOM_VK_ESCAPE) {
            self.hide();
            self.destroy();
            self.deferred.resolve();
        }
    };
    FileUploadDialog.prototype._handleTakeSelfie = function() {
        var self = this;
        var deferred = self.deferred;

        self.hide();
        self.destroy();

        // Take a selfie, then show the image in the editor.
        CommandManager.execute("bramble.selfie")
            .done(function(filename) {
                // Get the absolute path to the new file and open
                filename = Path.join(StartupState.project("root"), filename);
                CommandManager.execute(CMD_OPEN, { fullPath: filename })
                    .then(deferred.resolve, deferred.reject);
            })
            .fail(deferred.reject);
    };
    FileUploadDialog.prototype._handleFromComputer = function() {
        var self = this;
        var deferred = self.deferred;

        self.hide();
        _uploadDialog = null;

        function _processFiles(e) {
            var files = self.fileInput.getFiles();
            DragAndDrop.processFiles(files, function(err) {
                self.destroy();

                if(err) {
                    deferred.reject();
                } else {
                    deferred.resolve();
                }
            });
        }

        // Trigger the <input type="file"> added previously to show and process files.
        var input = self.fileInput.getElem$();
        input.on("change", _processFiles);
        input.click();
    };
    FileUploadDialog.prototype.hide = function() {
        var self = this;
        $(window.document.body).off("keyup.installDialog", self._handleKeyUp);
        Dialogs.cancelModalDialogIfOpen("upload-files-dialog");
    };
    FileUploadDialog.prototype.destroy = function() {
        _uploadDialog = null;
        this.fileInput.remove();
    };

    function show() {
        if(_uploadDialog) {
           return _uploadDialog.deferred.promise();
        }

        _uploadDialog = new FileUploadDialog();
        return _uploadDialog.show();
    }

    exports.show = show;
});


text:
#ifndef KNOSSOS_LAUNCHER_BROWSER_KNOSSOS_FILE_RESULT_HANDLER
#define KNOSSOS_LAUNCHER_BROWSER_KNOSSOS_FILE_RESULT_HANDLER

#include "include/cef_base.h"
#include "include/cef_browser.h"

class KnossosFileResultHandler : public CefRunFileDialogCallback {
public:
  KnossosFileResultHandler(CefRefPtr<CefFrame> request_frame, int promise_id, bool multi);

  virtual void
  OnFileDialogDismissed(int selected_accept_filter,
                        const std::vector<CefString> &file_paths) override;

private:
  CefRefPtr<CefFrame> request_frame_;
  int promise_id_;
  bool multi_;

  IMPLEMENT_REFCOUNTING(KnossosFileResultHandler);
};

#endif /* KNOSSOS_LAUNCHER_BROWSER_KNOSSOS_FILE_RESULT_HANDLER */