text:
import {
  INFO_BUBBLE_TYPE_RIGHT_BUILDING,
  INFO_BUBBLE_TYPE_LEFT_BUILDING,
  infoBubble
} from '../info_bubble/info_bubble'
import { system } from '../preinit/system_capabilities'
import { getStreet, saveStreetToServerIfNecessary } from '../streets/data_model'
import { getElAbsolutePos } from '../util/helpers'
import { RandomGenerator } from '../util/random'
import { resumeFadeoutControls } from './resizing'
import { TILE_SIZE, drawSegmentImage } from './view'

const MAX_CANVAS_HEIGHT = 2048

const BUILDING_DESTINATION_SCREEN = 1
export const BUILDING_DESTINATION_THUMBNAIL = 2

export const BUILDING_SPACE = 360

export const DEFAULT_BUILDING_HEIGHT_LEFT = 4
export const DEFAULT_BUILDING_HEIGHT_RIGHT = 3
export const DEFAULT_BUILDING_VARIANT_LEFT = 'narrow'
export const DEFAULT_BUILDING_VARIANT_RIGHT = 'wide'
export const DEFAULT_BUILDING_HEIGHT_EMPTY = 1
export const DEFAULT_BUILDING_VARIANT_EMPTY = 'grass'

export const BUILDING_VARIANTS = ['waterfront', 'grass', 'fence', 'parking-lot',
  'residential', 'narrow', 'wide']
export const BUILDING_VARIANT_NAMES = ['Waterfront', 'Grass', 'Empty lot', 'Parking lot',
  'Home', 'Building', 'Building']

export const MAX_BUILDING_HEIGHT = 20

export function getBuildingAttributes (street, left) {
  let width, floorRoofWidth, variantsCount, tileset, floorHeight, roofHeight
  let mainFloorHeight, height, tilePositionX, tilePositionY
  var buildingVariant = left ? street.leftBuildingVariant : street.rightBuildingVariant
  var flooredBuilding = isFlooredBuilding(buildingVariant)

  // Non-directional

  switch (buildingVariant) {
    case 'narrow':
      width = 216
      floorRoofWidth = 216
      variantsCount = 1
      tileset = 2

      floorHeight = 10
      roofHeight = 2
      mainFloorHeight = 14
      break
    case 'wide':
      width = 396
      floorRoofWidth = 396
      variantsCount = 1
      tileset = 3

      floorHeight = 10
      roofHeight = 2
      mainFloorHeight = 14
      break
    case 'residential':
      width = 396
      floorRoofWidth = 240
      variantsCount = 0

      floorHeight = 10
      roofHeight = 6
      mainFloorHeight = 24.5
      break
    case 'waterfront':
      height = 12 * TILE_SIZE
      break
    case 'parking-lot':
      height = 28 * TILE_SIZE
      break
    case 'fence':
      height = 12 * TILE_SIZE
      break
    case 'grass':
      height = 6 * TILE_SIZE
      break
  }
  // Directional

  if (left) {
    switch (buildingVariant) {
      case 'narrow':
        tilePositionX = 1512 + 17
        tilePositionY = 576 - 1
        break
      case 'wide':
        tilePositionX = 1956
        tilePositionY = 576 - 24 * 2
        break
      case 'residential':
        tileset = 3
        tilePositionX = 1956 + 382 + 204
        tilePositionY = 576 + 740 / 2 - 1 - 12 + 8
        break
    }
  } else {
    switch (buildingVariant) {
      case 'narrow':
        tilePositionX = 1728 + 13
        tilePositionY = 576 - 1
        break
      case 'wide':
        tilePositionX = 2351
        tilePositionY = 576 - 24 * 2 - 1
        break
      case 'residential':
        tileset = 2
        tilePositionX = 1956 + 382 + 204 + 25 - 1008 - 12 - 1 + 48
        tilePositionY = 576 + 740 / 2 - 1 - 12 + 237 + 6
        break
    }
  }

  if (flooredBuilding) {
    var floorCount = left ? street.leftBuildingHeight : street.rightBuildingHeight
    height = (roofHeight + floorHeight * (floorCount - 1) + mainFloorHeight) * TILE_SIZE + 45
    var realHeight = height - 45 - 6
  }

  return {
    tilePositionX: tilePositionX,
    tilePositionY: tilePositionY,
    width: width,
    variantsCount: variantsCount,
    tileset: tileset,
    mainFloorHeight: mainFloorHeight,
    floorHeight: floorHeight,
    flooredBuilding: flooredBuilding,
    floorRoofWidth: floorRoofWidth,
    floorCount: floorCount,
    realHeight: realHeight,
    roofHeight: roofHeight,
    height: height,
    buildingVariant: buildingVariant
  }
}

// TODO change to array
export function isFlooredBuilding (buildingVariant) {
  if ((buildingVariant === 'narrow') || (buildingVariant === 'wide') ||
    (buildingVariant === 'residential')) {
    return true
  } else {
    return false
  }
}

export function drawBuilding (ctx, destination, street, left, totalWidth,
  totalHeight, bottomAligned, offsetLeft, offsetTop,
  multiplier) {
  let x, y, posShift, leftPos, tileset, width, height, offsetY, lastX, firstX
  let variant, currentX
  var attr = getBuildingAttributes(street, left)

  if (bottomAligned) {
    offsetTop += totalHeight - attr.height * multiplier
  }

  if (!attr.flooredBuilding) {
    switch (attr.buildingVariant) {
      case 'fence':
        tileset = 1
        if (left) {
          x = 1344 / 2
        } else {
          x = 1224 / 2
        }
        width = 48
        y = 0
        height = 168 + 12 - 24 - 24 - 24
        offsetY = 23 + 24
        offsetTop -= 45

        if (left) {
          posShift = (totalWidth % width) - 121
        } else {
          posShift = 25
        }
        break
      case 'grass':
        tileset = 1
        x = 1104 / 2
        width = 48
        y = 0
        height = 168 + 12
        offsetY = 23 + 24 - 6 * 12
        offsetTop -= 45

        if (left) {
          posShift = (totalWidth % width) - 121
        } else {
          posShift = 25
        }
        break

      case 'parking-lot':
        tileset = 3
        width = 216
        height = 576 / 2
        offsetY = 3 + 45
        offsetTop -= 45

        if (left) {
          posShift = (totalWidth % width) - width - width - 25
          y = 12 + 298

          x = 815 + 162 * 12
          lastX = 815 + 162 * 12 + 9 * 24
        } else {
          posShift = 25
          y = 12

          x = 815 + 162 * 12 + 9 * 24
          firstX = 815 + 162 * 12
        }
        break

      case 'waterfront':
        tileset = 1
        width = 120
        height = 192 / 2
        offsetY = 24 + 24 + 45
        offsetTop -= 45

        if (left) {
          posShift = (totalWidth % width) - width - width - 25
          y = 120

          x = 0
          lastX = 120
        } else {
          posShift = 25
          y = 456 / 2

          x = 120
          firstX = 0
        }
        break
    }

    var count = Math.floor(totalWidth / width) + 2

    for (let i = 0; i < count; i++) {
      if ((i === 0) && (typeof firstX !== 'undefined')) {
        currentX = firstX
      } else if ((i === count - 1) && (typeof lastX !== 'undefined')) {
        currentX = lastX
      } else {
        currentX = x
      }

      drawSegmentImage(tileset, ctx,
        currentX, y, width, height,
        offsetLeft + (posShift + i * width) * multiplier,
        offsetTop + offsetY * multiplier,
        width * multiplier,
        height * multiplier)
    }
  } else {
    // Floored buildings

    if (left) {
      leftPos = totalWidth - attr.width - 2
    } else {
      leftPos = 0
    }

    offsetTop -= 45

    // bottom floor

    drawSegmentImage(attr.tileset, ctx,
      attr.tilePositionX,
      attr.tilePositionY - 240 + 120 * attr.variantsCount,
      attr.width,
      attr.mainFloorHeight * TILE_SIZE + TILE_SIZE,
      offsetLeft + leftPos * multiplier,
      offsetTop + (attr.height - attr.mainFloorHeight * TILE_SIZE) * multiplier,
      attr.width * multiplier,
      (attr.mainFloorHeight * TILE_SIZE + TILE_SIZE) * multiplier)

    // middle floors

    var floorCorrection = left ? 0 : (attr.width - attr.floorRoofWidth)

    var randomGenerator = new RandomGenerator()
    randomGenerator.seed = 0

    for (let i = 1; i < attr.floorCount; i++) {
      if (attr.variantsCount === 0) {
        variant = 0
      } else {
        variant = Math.floor(randomGenerator.rand() * attr.variantsCount) + 1
      }

      drawSegmentImage(attr.tileset, ctx,
        attr.tilePositionX + floorCorrection,
        attr.tilePositionY - 240 + 120 * attr.variantsCount - (attr.floorHeight * TILE_SIZE * variant),
        attr.floorRoofWidth,
        attr.floorHeight * TILE_SIZE,
        offsetLeft + (leftPos + floorCorrection) * multiplier,
        offsetTop + attr.height * multiplier - (attr.mainFloorHeight + attr.floorHeight * i) * TILE_SIZE * multiplier,
        attr.floorRoofWidth * multiplier,
        attr.floorHeight * TILE_SIZE * multiplier)
    }

    // roof

    drawSegmentImage(attr.tileset, ctx,
      attr.tilePositionX + floorCorrection,
      attr.tilePositionY - 240 + 120 * attr.variantsCount - (attr.floorHeight * TILE_SIZE * attr.variantsCount + attr.roofHeight * TILE_SIZE),
      attr.floorRoofWidth,
      attr.roofHeight * TILE_SIZE,
      offsetLeft + (leftPos + floorCorrection) * multiplier,
      offsetTop + attr.height * multiplier - (attr.mainFloorHeight + attr.floorHeight * (attr.floorCount - 1) + attr.roofHeight) * TILE_SIZE * multiplier,
      attr.floorRoofWidth * multiplier,
      attr.roofHeight * TILE_SIZE * multiplier)
  }

  if ((street.remainingWidth < 0) && (destination === BUILDING_DESTINATION_SCREEN)) {
    ctx.save()
    ctx.globalCompositeOperation = 'source-atop'
    // TODO const
    ctx.fillStyle = 'rgba(204, 163, 173, .9)'
    ctx.fillRect(0, 0, totalWidth * system.hiDpi, totalHeight * system.hiDpi)
    ctx.restore()
  }
}

function createBuilding (el, left) {
  var street = getStreet()
  var totalWidth = el.offsetWidth
  var attr = getBuildingAttributes(street, left)
  var height = Math.min(MAX_CANVAS_HEIGHT, attr.height)
  var canvasEl = document.createElement('canvas')
  var oldCanvasEl = el.querySelector('canvas')

  canvasEl.width = totalWidth * system.hiDpi
  canvasEl.height = height * system.hiDpi
  canvasEl.style.width = totalWidth + 'px'
  canvasEl.style.height = height + 'px'

  // Replace previous canvas if present, otherwise append a new one
  if (oldCanvasEl) {
    el.replaceChild(canvasEl, oldCanvasEl)
  } else {
    el.appendChild(canvasEl)
  }

  var ctx = canvasEl.getContext('2d')
  drawBuilding(ctx, BUILDING_DESTINATION_SCREEN, street, left,
    totalWidth, height, true, 0, 0, 1.0)
}

export function buildingHeightUpdated () {
  saveStreetToServerIfNecessary()
  createBuildings()
}

export function changeBuildingHeight (left, increment) {
  let street = getStreet()
  if (left) {
    if (increment) {
      if (street.leftBuildingHeight < MAX_BUILDING_HEIGHT) {
        street.leftBuildingHeight++
      }
    } else if (street.leftBuildingHeight > 1) {
      street.leftBuildingHeight--
    }
  } else {
    if (increment) {
      if (street.rightBuildingHeight < MAX_BUILDING_HEIGHT) {
        street.rightBuildingHeight++
      }
    } else if (street.rightBuildingHeight > 1) {
      street.rightBuildingHeight--
    }
  }

  infoBubble.updateHeightInContents(left)
  buildingHeightUpdated()
}

export function createBuildings () {
  var leftEl = document.querySelector('#street-section-left-building')
  var rightEl = document.querySelector('#street-section-right-building')

  createBuilding(leftEl, true)
  createBuilding(rightEl, false)
}

export function onBuildingMouseEnter (event) {
  let type
  if (this.id === 'street-section-left-building') {
    type = INFO_BUBBLE_TYPE_LEFT_BUILDING
  } else {
    type = INFO_BUBBLE_TYPE_RIGHT_BUILDING
  }

  infoBubble.considerShowing(event, this, type)
  resumeFadeoutControls()
}

export function onBuildingMouseLeave (event) {
  if (event.pointerType !== 'mouse') return

  infoBubble.dontConsiderShowing()
}

export function updateBuildingPosition () {
  var el = document.querySelector('#street-section-editable')
  var pos = getElAbsolutePos(el)

  var width = pos[0] + 25

  if (width < 0) {
    width = 0
  }

  document.querySelector('#street-section-left-building').style.width = width + 'px'
  document.querySelector('#street-section-right-building').style.width = width + 'px'

  document.querySelector('#street-section-left-building').style.left = (-width + 25) + 'px'
  document.querySelector('#street-section-right-building').style.right = (-width + 25) + 'px'

  document.querySelector('#street-section-dirt').style.marginLeft = -width + 'px'
  document.querySelector('#street-section-dirt').style.marginRight = -width + 'px'
}

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="app_name">cocos2dx_luatests</string>
</resources>


text:
package com.rockhoppertech.music.modifiers;

/*
 * #%L
 * Rocky Music Core
 * %%
 * Copyright (C) 1996 - 2013 Rockhopper Technologies
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * #L%
 */

import com.rockhoppertech.music.Timed;

/**
 * Also see MusicVisitor for a more general GoF visitor.
 *
 * interface TimedModifier
 *
 * @author Gene De Lisa
 * @version $Revision$, $Date$
 * @since 1.0
 */
public interface TimedModifier extends Modifier {
	/**
	 * modify
	 *
	 * @param n
	 *            a Note value
	 */
	public void modify(Timed n);
}
/*
 * History:
 *
 * $Log$
 *
 * This version: $Revision$ Last modified: $Date$ Last modified by: $Author$
 */


text:
#ifndef TENSORFLOW_LITE_SUPPORT_CC_TASK_VISION_IMAGE_SEARCHER_H_
#define TENSORFLOW_LITE_SUPPORT_CC_TASK_VISION_IMAGE_SEARCHER_H_

#include <memory>
#include <vector>

#include "absl/status/status.h"  // from @com_google_absl
#include "absl/strings/string_view.h"  // from @com_google_absl
#include "tensorflow/lite/core/api/op_resolver.h"
#include "tensorflow/lite/core/shims/cc/kernels/register.h"
#include "tensorflow_lite_support/cc/port/statusor.h"
#include "tensorflow_lite_support/cc/task/processor/proto/search_result.pb.h"
#include "tensorflow_lite_support/cc/task/processor/search_postprocessor.h"
#include "tensorflow_lite_support/cc/task/vision/core/base_vision_task_api.h"
#include "tensorflow_lite_support/cc/task/vision/core/frame_buffer.h"
#include "tensorflow_lite_support/cc/task/vision/proto/bounding_box_proto_inc.h"
#include "tensorflow_lite_support/cc/task/vision/proto/image_searcher_options.pb.h"

namespace tflite {
namespace task {
namespace vision {

// Performs embedding extraction on images, followed by nearest-neighbor search
// in an index of embeddings through ScaNN.
// TODO(b/223535177): add pointer to README in the scann folder once available.
//
// The API expects a TFLite embedder model with optional, but strongly
// recommended, TFLite Model Metadata.
//
// Input tensor:
//   (kTfLiteUInt8/kTfLiteFloat32)
//    - image input of size `[batch x height x width x channels]`.
//    - batch inference is not supported (`batch` is required to be 1).
//    - only RGB inputs are supported (`channels` is required to be 3).
//    - if type is kTfLiteFloat32, NormalizationOptions are required to be
//      attached to the metadata for input normalization.
// Output tensor:
//   (kTfLiteUInt8/kTfLiteFloat32)
//    - `N` components corresponding to the `N` dimensions of the returned
//      feature vector for this output layer.
//    - Either 2 or 4 dimensions, i.e. `[1 x N]` or `[1 x 1 x 1 x N]`.
//
// TODO(b/180502532): add pointer to example model.
//
// A CLI demo tool is available for easily trying out this API, and provides
// example usage. See:
// examples/task/vision/desktop/image_searcher_demo.cc
class ImageSearcher
    : public BaseVisionTaskApi<tflite::task::processor::SearchResult> {
 public:
  using BaseVisionTaskApi::BaseVisionTaskApi;

  // Creates an ImageSearcher from the provided options. A non-default
  // OpResolver can be specified in order to support custom Ops or specify a
  // subset of built-in Ops.
  static tflite::support::StatusOr<std::unique_ptr<ImageSearcher>>
  CreateFromOptions(
      const ImageSearcherOptions& options,
      std::unique_ptr<tflite::OpResolver> resolver =
          absl::make_unique<tflite_shims::ops::builtin::BuiltinOpResolver>());

  // Performs embedding extraction on the provided FrameBuffer, followed by
  // nearest-neighbor search in the index.
  //
  // The FrameBuffer can be of any size and any of the supported formats, i.e.
  // RGBA, RGB, NV12, NV21, YV12, YV21. It is automatically pre-processed before
  // inference in order to (and in this order):
  // - resize it (with bilinear interpolation, aspect-ratio *not* preserved) to
  //   the dimensions of the model input tensor,
  // - convert it to the colorspace of the input tensor (i.e. RGB, which is the
  //   only supported colorspace for now),
  // - rotate it according to its `Orientation` so that inference is performed
  //   on an "upright" image.
  tflite::support::StatusOr<tflite::task::processor::SearchResult> Search(
      const FrameBuffer& frame_buffer);

  // Same as above, except the inference is performed only on the provided
  // region of interest. Note that the region of interest is not clamped, so
  // this method will fail if the region is out of bounds of the input image.
  tflite::support::StatusOr<tflite::task::processor::SearchResult> Search(
      const FrameBuffer& frame_buffer, const BoundingBox& roi);

  // Provides access to the opaque user info stored in the index file (if any),
  // in raw binary form. Returns an empty string if the index doesn't contain
  // user info.
  tflite::support::StatusOr<absl::string_view> GetUserInfo();

 protected:
  // The options used to build this ImageSearcher.
  std::unique_ptr<ImageSearcherOptions> options_;

  // Post-processing to transform the raw model outputs into embeddings, then
  // perform the nearest-neighbor search in the index.
  tflite::support::StatusOr<tflite::task::processor::SearchResult> Postprocess(
      const std::vector<const TfLiteTensor*>& output_tensors,
      const FrameBuffer& frame_buffer, const BoundingBox& roi) override;

  // Initializes the ImageSearcher.
  absl::Status Init(std::unique_ptr<ImageSearcherOptions> options);

  // Performs pre-initialization actions.
  virtual absl::Status PreInit();

 private:
  std::unique_ptr<tflite::task::processor::SearchPostprocessor> postprocessor_;
};

}  // namespace vision
}  // namespace task
}  // namespace tflite

#endif  // TENSORFLOW_LITE_SUPPORT_CC_TASK_VISION_IMAGE_SEARCHER_H_


text:
package org.appenders.log4j2.elasticsearch.hc;

import java.io.IOException;

/**
 * Allows to adapt {@link Request} instances to client-specific requests
 * @param <R> client-specific request type
 */
public interface RequestFactory<R> {

    R create(String url, Request request) throws IOException;

}


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

<TITLE>
Uses of Interface org.apache.hadoop.chukwa.extraction.demux.processor.mapper.MapProcessor (chukwa 0.4.0 API)
</TITLE>

<META NAME="date" CONTENT="2010-04-12">

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Interface
org.apache.hadoop.chukwa.extraction.demux.processor.mapper.MapProcessor

Packages that use MapProcessor

org.apache.hadoop.chukwa.extraction.demux.processor.mapper

org.apache.hadoop.chukwa.util

Uses of MapProcessor in org.apache.hadoop.chukwa.extraction.demux.processor.mapper

Classes in org.apache.hadoop.chukwa.extraction.demux.processor.mapper that implement MapProcessor

 class
AbstractProcessor

 class
ClientTraceProcessor

 class
DebugOutputProcessor

 class
DefaultProcessor

 class
Df

 class
HadoopLogProcessor

 class
HadoopMetricsProcessor

 class
Iostat

 class
JobConfProcessor

 class
JobLog

 class
JobLogHistoryProcessor

 class
JPluginMapper

 class
Log4jJobHistoryProcessor

 class
Log4JMetricsContextProcessor

 class
PbsNodes

 class
Ps

 class
Sar

 class
SysLog

 class
Top

 class
Torque

 class
TsProcessor

 class
YWatch

Methods in org.apache.hadoop.chukwa.extraction.demux.processor.mapper that return MapProcessor

static MapProcessor
MapProcessorFactory.getProcessor(String parserClass)

Uses of MapProcessor in org.apache.hadoop.chukwa.util

Methods in org.apache.hadoop.chukwa.util with parameters of type MapProcessor

static void
CreateRecordFile.makeTestSequenceFile(File inputFile,
                     org.apache.hadoop.fs.Path outputFile,
                     String clusterName,
                     String dataType,
                     String streamName,
                     MapProcessor processor)

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © ${year} The Apache Software Foundation


text:
package org.hibernate.demos.hsearchfeatureexamples.dto;

import java.util.List;
import javax.json.bind.annotation.JsonbPropertyOrder;

import lombok.Value;

@Value
@JsonbPropertyOrder({ "id", "name", "variants", "collection" })
public class TShirtOutputDto {

	public static TShirtOutputDto of(long id, String name) {
		return new TShirtOutputDto(id, name, null, null);
	}

	long id;
	String name;
	List<TShirtVariantDto> variants;
	FashionCollectionOutputDto collection;

}


text:
import logging
import json
import os
from urlparse import urlparse

import chrome_cache
import common_util
from loading_trace import LoadingTrace
from prefetch_view import PrefetchSimulationView
from request_dependencies_lens import RequestDependencyLens
import sandwich_runner
import wpr_backend

# Do not prefetch anything.
EMPTY_CACHE_DISCOVERER = 'empty-cache'

# Prefetches everything to load fully from cache (impossible in practice).
FULL_CACHE_DISCOVERER = 'full-cache'

# Prefetches the first resource following the redirection chain.
REDIRECTED_MAIN_DISCOVERER = 'redirected-main'

# All resources which are fetched from the main document and their redirections.
PARSER_DISCOVERER = 'parser'

# Simulation of HTMLPreloadScanner on the main document and their redirections.
HTML_PRELOAD_SCANNER_DISCOVERER = 'html-scanner'

SUBRESOURCE_DISCOVERERS = set([
  EMPTY_CACHE_DISCOVERER,
  FULL_CACHE_DISCOVERER,
  REDIRECTED_MAIN_DISCOVERER,
  PARSER_DISCOVERER,
  HTML_PRELOAD_SCANNER_DISCOVERER
])

def PatchWpr(wpr_archive_path):
  """Patches a WPR archive to get all resources into the HTTP cache and avoid
  invalidation and revalidations.

  Args:
    wpr_archive_path: Path of the WPR archive to patch.
  """
  # Sets the resources cache max-age to 10 years.
  MAX_AGE = 10 * 365 * 24 * 60 * 60
  CACHE_CONTROL = 'public, max-age={}'.format(MAX_AGE)

  wpr_archive = wpr_backend.WprArchiveBackend(wpr_archive_path)
  for url_entry in wpr_archive.ListUrlEntries():
    response_headers = url_entry.GetResponseHeadersDict()
    if 'cache-control' in response_headers and \
        response_headers['cache-control'] == CACHE_CONTROL:
      continue
    logging.info('patching %s' % url_entry.url)
    # TODO(gabadie): may need to patch Last-Modified and If-Modified-Since.
    # TODO(gabadie): may need to delete ETag.
    # TODO(gabadie): may need to take care of x-cache.
    #
    # Override the cache-control header to set the resources max age to MAX_AGE.
    #
    # Important note: Some resources holding sensitive information might have
    # cache-control set to no-store which allow the resource to be cached but
    # not cached in the file system. NoState-Prefetch is going to take care of
    # this case. But in here, to simulate NoState-Prefetch, we don't have other
    # choices but save absolutely all cached resources on disk so they survive
    # after killing chrome for cache save, modification and push.
    url_entry.SetResponseHeader('cache-control', CACHE_CONTROL)

    # TODO(gabadie): May need to extend Vary blacklist (referer?)
    #
    # All of these Vary and Pragma possibilities need to be removed from
    # response headers in order for Chrome to store a resource in HTTP cache and
    # not to invalidate it.
    #
    # Note: HttpVaryData::Init() in Chrome adds an implicit 'Vary: cookie'
    # header to any redirect.
    # TODO(gabadie): Find a way to work around this issue.
    url_entry.RemoveResponseHeaderDirectives('vary', {'*', 'cookie'})
    url_entry.RemoveResponseHeaderDirectives('pragma', {'no-cache'})

  wpr_archive.Persist()

def _FilterOutDataAndIncompleteRequests(requests):
  for request in filter(lambda r: not r.IsDataRequest(), requests):
    # The protocol is only known once the response has been received. But the
    # trace recording might have been stopped with still some JavaScript
    # originated requests that have not received any responses yet.
    if request.protocol is None:
      assert not request.HasReceivedResponse()
      assert request.initiator['type'] == 'script'
      continue
    if request.protocol not in {'http/0.9', 'http/1.0', 'http/1.1'}:
      raise RuntimeError('Unknown request protocol {}'.format(request.protocol))
    yield request

def PatchCacheArchive(cache_archive_path, loading_trace_path,
                      cache_archive_dest_path):
  """Patch the cache archive.

  Note: This method update the raw response headers of cache entries' to store
    the ones such as Set-Cookie that were pruned by the
    net::HttpCacheTransaction, and remove the stream index 2 holding resource's
    compile meta data.

  Args:
    cache_archive_path: Input archive's path to patch.
    loading_trace_path: Path of the loading trace that have recorded the cache
        archive <cache_archive_path>.
    cache_archive_dest_path: Archive destination's path.
  """
  trace = LoadingTrace.FromJsonFile(loading_trace_path)
  with common_util.TemporaryDirectory(prefix='sandwich_tmp') as tmp_path:
    cache_path = os.path.join(tmp_path, 'cache')
    chrome_cache.UnzipDirectoryContent(cache_archive_path, cache_path)
    cache_backend = chrome_cache.CacheBackend(cache_path, 'simple')
    cache_entries = set(cache_backend.ListKeys())
    logging.info('Original cache size: %d bytes' % cache_backend.GetSize())
    for request in _FilterOutDataAndIncompleteRequests(
        trace.request_track.GetEvents()):
      # On requests having an upload data stream such as POST requests,
      # net::HttpCache::GenerateCacheKey() prefixes the cache entry's key with
      # the upload data stream's session unique identifier.
      #
      # It is fine to not patch these requests since when reopening Chrome,
      # there is no way the entry can be reused since the upload data stream's
      # identifier will be different.
      #
      # The fact that these entries are kept in the cache after closing Chrome
      # properly by closing the Chrome tab as the ChromeControler.SetSlowDeath()
      # do is a known Chrome bug (crbug.com/610725).
      #
      # TODO(gabadie): Add support in ValidateCacheArchiveContent() and in
      #   VerifyBenchmarkOutputDirectory() for POST requests to be known as
      #   impossible to use from cache.
      if request.url not in cache_entries:
        if request.method != 'POST':
          raise RuntimeError('Unexpected method that is not found in cache.'
                             ''.format(request.method))
        continue
      # Chrome prunes Set-Cookie from response headers before storing them in
      # disk cache. Also, it adds implicit "Vary: cookie" header to all redirect
      # response headers. Sandwich manages the cache, but between recording the
      # cache and benchmarking the cookie jar is invalidated. This leads to
      # invalidation of all cacheable redirects.
      raw_headers = request.GetRawResponseHeaders()
      cache_backend.UpdateRawResponseHeaders(request.url, raw_headers)
      # NoState-Prefetch would only fetch the resources, but not parse them.
      cache_backend.DeleteStreamForKey(request.url, 2)
    chrome_cache.ZipDirectoryContent(cache_path, cache_archive_dest_path)
    logging.info('Patched cache size: %d bytes' % cache_backend.GetSize())

def ExtractDiscoverableUrls(loading_trace_path, subresource_discoverer):
  """Extracts discoverable resource urls from a loading trace according to a
  sub-resource discoverer.

  Args:
    loading_trace_path: The loading trace's path.
    subresource_discoverer: The sub-resources discoverer that should white-list
      the resources to keep in cache for the NoState-Prefetch benchmarks.

  Returns:
    A set of urls.
  """
  assert subresource_discoverer in SUBRESOURCE_DISCOVERERS, \
      'unknown prefetch simulation {}'.format(subresource_discoverer)

  # Load trace and related infos.
  logging.info('loading %s' % loading_trace_path)
  trace = LoadingTrace.FromJsonFile(loading_trace_path)
  dependencies_lens = RequestDependencyLens(trace)
  first_resource_request = trace.request_track.GetFirstResourceRequest()

  # Build the list of discovered requests according to the desired simulation.
  discovered_requests = []
  if subresource_discoverer == EMPTY_CACHE_DISCOVERER:
    pass
  elif subresource_discoverer == FULL_CACHE_DISCOVERER:
    discovered_requests = trace.request_track.GetEvents()
  elif subresource_discoverer == REDIRECTED_MAIN_DISCOVERER:
    discovered_requests = \
        [dependencies_lens.GetRedirectChain(first_resource_request)[-1]]
  elif subresource_discoverer == PARSER_DISCOVERER:
    discovered_requests = PrefetchSimulationView.ParserDiscoverableRequests(
        first_resource_request, dependencies_lens)
  elif subresource_discoverer == HTML_PRELOAD_SCANNER_DISCOVERER:
    discovered_requests = PrefetchSimulationView.PreloadedRequests(
        first_resource_request, dependencies_lens, trace)
  else:
    assert False

  whitelisted_urls = set()
  logging.info('white-listing %s' % first_resource_request.url)
  for request in _FilterOutDataAndIncompleteRequests(discovered_requests):
    logging.info('white-listing %s' % request.url)
    whitelisted_urls.add(request.url)
  return whitelisted_urls

def _PrintUrlSetComparison(ref_url_set, url_set, url_set_name):
  """Compare URL sets and log the diffs.

  Args:
    ref_url_set: Set of reference urls.
    url_set: Set of urls to compare to the reference.
    url_set_name: The set name for logging purposes.
  """
  assert type(ref_url_set) == set
  assert type(url_set) == set
  if ref_url_set == url_set:
    logging.info('  %d %s are matching.' % (len(ref_url_set), url_set_name))
    return
  missing_urls = ref_url_set.difference(url_set)
  unexpected_urls = url_set.difference(ref_url_set)
  logging.error('  %s are not matching (expected %d, had %d)' % \
      (url_set_name, len(ref_url_set), len(url_set)))
  logging.error('    List of %d missing resources:' % len(missing_urls))
  for url in sorted(missing_urls):
    logging.error('-     ' + url)
  logging.error('    List of %d unexpected resources:' % len(unexpected_urls))
  for url in sorted(unexpected_urls):
    logging.error('+     ' + url)

class RequestOutcome:
  All, ServedFromCache, NotServedFromCache = range(3)

def ListUrlRequests(trace, request_kind):
  """Lists requested URLs from a trace.

  Args:
    trace: (LoadingTrace) loading trace.
    request_kind: RequestOutcome indicating the subset of requests to output.

  Returns:
    set([str])
  """
  urls = set()
  for request_event in _FilterOutDataAndIncompleteRequests(
      trace.request_track.GetEvents()):
    if (request_kind == RequestOutcome.ServedFromCache and
        request_event.from_disk_cache):
      urls.add(request_event.url)
    elif (request_kind == RequestOutcome.NotServedFromCache and
        not request_event.from_disk_cache):
      urls.add(request_event.url)
    elif request_kind == RequestOutcome.All:
      urls.add(request_event.url)
  return urls

def VerifyBenchmarkOutputDirectory(benchmark_setup_path,
                                   benchmark_output_directory_path):
  """Verifies that all run inside the run_output_directory worked as expected.

  Args:
    benchmark_setup_path: Path of the JSON of the benchmark setup.
    benchmark_output_directory_path: Path of the benchmark output directory to
        verify.
  """
  # TODO(gabadie): What's the best way of propagating errors happening in here?
  benchmark_setup = json.load(open(benchmark_setup_path))
  cache_whitelist = set(benchmark_setup['cache_whitelist'])
  original_requests = set(benchmark_setup['url_resources'])
  original_cached_requests = original_requests.intersection(cache_whitelist)
  original_uncached_requests = original_requests.difference(cache_whitelist)
  all_sent_url_requests = set()

  # Verify requests from traces.
  run_id = -1
  while True:
    run_id += 1
    run_path = os.path.join(benchmark_output_directory_path, str(run_id))
    if not os.path.isdir(run_path):
      break
    trace_path = os.path.join(run_path, sandwich_runner.TRACE_FILENAME)
    if not os.path.isfile(trace_path):
      logging.error('missing trace %s' % trace_path)
      continue
    trace = LoadingTrace.FromJsonFile(trace_path)
    logging.info('verifying %s from %s' % (trace.url, trace_path))

    effective_requests = ListUrlRequests(trace, RequestOutcome.All)
    effective_cached_requests = \
        ListUrlRequests(trace, RequestOutcome.ServedFromCache)
    effective_uncached_requests = \
        ListUrlRequests(trace, RequestOutcome.NotServedFromCache)

    missing_requests = original_requests.difference(effective_requests)
    unexpected_requests = effective_requests.difference(original_requests)
    expected_cached_requests = \
        original_cached_requests.difference(missing_requests)
    missing_cached_requests = \
        expected_cached_requests.difference(effective_cached_requests)
    expected_uncached_requests = original_uncached_requests.union(
        unexpected_requests).union(missing_cached_requests)
    all_sent_url_requests.update(effective_uncached_requests)

    _PrintUrlSetComparison(original_requests, effective_requests,
                           'All resources')
    _PrintUrlSetComparison(expected_cached_requests, effective_cached_requests,
                           'Cached resources')
    _PrintUrlSetComparison(expected_uncached_requests,
                           effective_uncached_requests, 'Non cached resources')

  # Verify requests from WPR.
  wpr_log_path = os.path.join(
      benchmark_output_directory_path, sandwich_runner.WPR_LOG_FILENAME)
  logging.info('verifying requests from %s' % wpr_log_path)
  all_wpr_requests = wpr_backend.ExtractRequestsFromLog(wpr_log_path)
  all_wpr_urls = set()
  unserved_wpr_urls = set()
  wpr_command_colliding_urls = set()

  for request in all_wpr_requests:
    if request.is_wpr_host:
      continue
    if urlparse(request.url).path.startswith('/web-page-replay'):
      wpr_command_colliding_urls.add(request.url)
    elif request.is_served is False:
      unserved_wpr_urls.add(request.url)
    all_wpr_urls.add(request.url)

  _PrintUrlSetComparison(set(), unserved_wpr_urls,
                         'Distinct unserved resources from WPR')
  _PrintUrlSetComparison(set(), wpr_command_colliding_urls,
                         'Distinct resources colliding to WPR commands')
  _PrintUrlSetComparison(all_wpr_urls, all_sent_url_requests,
                         'Distinct resource requests to WPR')

def ReadSubresourceMapFromBenchmarkOutput(benchmark_output_directory_path):
  """Extracts a map URL-to-subresources for each navigation in benchmark
  directory.

  Args:
    benchmark_output_directory_path: Path of the benchmark output directory to
        verify.

  Returns:
    {url -> [URLs of sub-resources]}
  """
  url_subresources = {}
  run_id = -1
  while True:
    run_id += 1
    run_path = os.path.join(benchmark_output_directory_path, str(run_id))
    if not os.path.isdir(run_path):
      break
    trace_path = os.path.join(run_path, sandwich_runner.TRACE_FILENAME)
    if not os.path.isfile(trace_path):
      continue
    trace = LoadingTrace.FromJsonFile(trace_path)
    if trace.url in url_subresources:
      continue
    logging.info('lists resources of %s from %s' % (trace.url, trace_path))
    urls_set = set()
    for request_event in _FilterOutDataAndIncompleteRequests(
        trace.request_track.GetEvents()):
      if request_event.url not in urls_set:
        logging.info('  %s' % request_event.url)
        urls_set.add(request_event.url)
    url_subresources[trace.url] = [url for url in urls_set]
  return url_subresources

def ValidateCacheArchiveContent(ref_urls, cache_archive_path):
  """Validates a cache archive content.

  Args:
    ref_urls: Reference list of urls.
    cache_archive_path: Cache archive's path to validate.
  """
  # TODO(gabadie): What's the best way of propagating errors happening in here?
  logging.info('lists cached urls from %s' % cache_archive_path)
  with common_util.TemporaryDirectory() as cache_directory:
    chrome_cache.UnzipDirectoryContent(cache_archive_path, cache_directory)
    cached_urls = \
        chrome_cache.CacheBackend(cache_directory, 'simple').ListKeys()
  _PrintUrlSetComparison(set(ref_urls), set(cached_urls), 'cached resources')


text:
#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <signal.h>
#include <unistd.h>
#include <getopt.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>

#include "bundleAgent/common/include/constants.h"
#include "bundleAgent/common/include/config.h"

#include "lib/api/include/adtn.h"

#define DEFAULT_LIFETIME 30
#define DEFAULT_ADTN_PORT 65530

static void help(char *program_name) {
  printf( "%s is part of the SeNDA aDTN platform\n"
          "Usage: %s -m 'Message to send' -d 'node101' [options]\n"
          "Required options:\n"
          "       [-m | --message] message\t\t\tMessage to send\n"
          "       [-d | --destination] destination\t\t\tSet the destination of the message.\n"
          "Supported options:\n"
          "       [-P | --port] port\t\t\tDestination adtn port (default 65530).\n"
          "       [-f | --conf_file] config_file\t\tUse {config_file} config file instead of the default found at "DEFAULT_CONF_FILE_PATH"\n"
          "       [-l | --lifetime] lifetime\t\tSet {lifetime} seconds of lifetime of the message (default 30s).\n"
          "       [-h | --help]\t\t\t\tShows this help message.\n"
          , program_name, program_name);
}

int main(int argc, char *const *argv) {
  int opt = -1, option_index = 0, shm_fd = 0, sock = 0;
  char *config_file = NULL;
  char *destination = NULL;
  char *message = NULL;
  char *data_path = NULL;
  struct common *shm;
  long lifetime = 0;
  int dest_adtn_port = 0;
  sock_addr_t local;
  sock_addr_t dest;

  static struct option long_options[] = {
    {"destination", required_argument, 0, 'd'},
    {"conf_file", required_argument, 0, 'f'},
    {"message", required_argument, 0, 'm'},
    {"lifetime", required_argument, 0, 'l'},
    {"port", required_argument, 0, 'P'},
    {"help", no_argument, 0, 'h'},
    {0, 0, 0, 0}
  };

  while ((opt = getopt_long(argc, argv, "m:d:P:f:l:h", long_options,
                            &option_index))) {
    switch (opt) {
      case 'd':
        destination = strdup(optarg);
        break;
      case 'f':
        config_file = strdup(optarg);
        break;
      case 'm':
        message = strdup(optarg);
        break;
      case 'l':
        lifetime = strtol(optarg, NULL, 10);
        break;
      case 'P':
        dest_adtn_port = strtol(optarg, NULL, 10);
        break;
      case 'h':
      case '?':
        help(argv[0]);
        exit(0);
      default:
        break;
    }

    if (opt == -1)
      break;
  }
  if (destination == NULL || message == NULL) {
    help(argv[0]);
    exit(0);
  }

  if (config_file == NULL)
    config_file = DEFAULT_CONF_FILE_PATH;
  if (lifetime <= 0)
    lifetime = DEFAULT_LIFETIME;
  if (dest_adtn_port <= 0)
    dest_adtn_port = DEFAULT_ADTN_PORT;

  struct conf_list global_conf = {0};
  if (load_config("global", &global_conf, config_file) != 1) {
    printf("Config file %s not found.\n", config_file);
    exit(1);
  }
  if ((data_path = get_option_value("data", &global_conf)) == NULL) {
    printf("Config file does not have the data key set.\n");
    exit(1);
  }
  if (load_shared_memory_from_path(data_path, &shm, &shm_fd, 0) != 0) {
    printf("Is platform running?\n");
    exit(1);
  }

  local.id = strdup(shm->platform_id);
  local.adtn_port = dest_adtn_port;

  dest.id = destination;
  dest.adtn_port = dest_adtn_port;

  sock = adtn_socket(shm->config_file);

  if (adtn_bind(sock, &local) != 0) {
    printf("adtn_bind could not be performed.\n");
    exit(1);
  }
  if (adtn_setsockopt(sock, OP_LIFETIME, &lifetime) != 0)
    exit(1);

  if (adtn_sendto(sock, message, strlen(message), dest) != strlen(message)) {
    if (errno == EMSGSIZE) {
      printf("Error sending, message too big.\n");
    } else {
      printf("Error sendinf message.\n");
    }
    adtn_shutdown(sock);
    exit(1);
  }
  adtn_shutdown(sock);
  return 0;
}


text:
require 'spec_helper'

describe 'timecapsule', :type => 'class' do

  context "On a RedHat 7 OS" do
    let :facts do
      {
        :osfamily => 'RedHat'
        :operatingsystemmajrelease => '7'
      }
    end

    it {
      should contain_package('netatalk').with( { 'name' => 'netatalk' } )
      should contain_service('netatalk').with( { 'name' => 'netatalk' } )
      should contain_package('avahi').with( { 'name' => 'avahi' } )
      should contain_service('avahi-daemon').with( { 'name' => 'avahi-daemon' } )
      should contain_package('nss-mdns').with( { 'name' => 'nss-mdns' } )
      should contain_service('messagebus').with( { 'name' => 'messagebus' } )
      should contain_package('dbus').with( { 'name' => 'dbus' } )
    }
  end

  context "On an unknown OS" do
    let :facts do
      {
        :osfamily => 'Darwin'
      }
    end

    it {
      expect { should raise_error(Puppet::Error) }
    }
  end


text:
//
//  TRAccount.h
//  iTMRemote
//
//  Created by Igor Dvoeglazov on 18.07.14.
//  Copyright (c) 2014 Binoklev Studio. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TRAccount : NSObject

@property (retain, nonatomic) NSString *host;
@property (assign, nonatomic) BOOL ssl;
@property (assign, nonatomic) NSUInteger port;
@property (retain, nonatomic) NSString *directory;

@property (retain, nonatomic) NSString *lastDownloadPath;

@property (readonly, nonatomic) NSString *connectionString;

/**
 * save account properties to UserDefaults
 */
- (void)saveAccount;
/**
 * create and init account with settings from User Defaults
 * or nil if it doesn't exist
 */
+ (TRAccount*)savedAccount;

@end


text:
class IntRectangle {
    public:
    int x;
    int y;
    int width;
    int height;
};


text:
/* styles.js */
import css from 'styled-jsx/css'

/* should be identified as styled jsx style and hightlight */
// Scoped styles
export const button = css`button { color: hotpink; }`

// Global styles
export const body = css.global`body { margin: 0; }`

// Resolved styles
export const link = css.resolve`a { color: green; }`

/* shouldn't break original syntax highlight */
const resources = `partials.scss`


text:
import openpyxl
import os
import threading

from collections import OrderedDict
from dict_from_xlsx import dict_from_xlsx
from itertools import chain
from openpyxl.cell import column_index_from_string, get_column_letter

# ------------------------------------------------------------------------------

# report.py

# Creates an excel file with union and intersect

# ------------------------------------------------------------------------------

class Report(threading.Thread):

    def __init__(self, queue, directory, file_list):
        threading.Thread.__init__(self)
        self.queue = queue
        self.workbook = openpyxl.Workbook()

        self.directory = directory
        self.file_list = file_list
        self.file_path_list = [os.path.join(self.directory, x) for x in self.file_list]
        self.data_dicts = dict(zip(self.file_list,
                                   [dict_from_xlsx(x) for x in self.file_path_list]))

    def run(self):
        """
        Use to make excel sheet
        :return:
        """
        self.initialize_wb()
        self.fill_intersect_sheet()
        self.fill_union_sheet()
        for file in self.file_list:
            self.fill_data_sheet(file)
        self.save()
        self.queue.put('Status: done! saved as {}'.format(os.path.join(self.directory, 'IntersectUnion.xlsx')))

    def initialize_wb(self):
        """
        Create and name sheets
        :return:
        """
        sheet = self.workbook.active
        sheet.title = 'Intersect'
        self.workbook.create_sheet(title='Union')
        for file in self.file_list:
            self.workbook.create_sheet(title=file)

    def fill_intersect_sheet(self):
        sheet = self.workbook.get_sheet_by_name('Intersect')
        column_names = list(chain.from_iterable([self.data_dicts[x]['columns'].values()[2:] for x in self.file_list]))
        column_dict = OrderedDict(zip([get_column_letter(x) for x in range(3, len(column_names)+3)], column_names))

        column_files = list(chain.from_iterable([[x] * len(self.data_dicts[x]['columns'].values()[2:]) for x in self.file_list]))
        column_file_dict = OrderedDict(zip([get_column_letter(x) for x in range(3, len(column_names)+3)], column_files))

        # Formatting
        sheet.column_dimensions['A'].width = 40
        sheet.column_dimensions['B'].width = 15

        id_lists = [x.keys() for x in [z['rows'] for z in self.data_dicts.values()]]
        intersection = list(set.intersection(*map(set, id_lists)))

        row_index = 1
        for column in column_dict.keys():
            sheet.cell(row=row_index,
                       column=column_index_from_string(column)).value = column_file_dict[column]

        row_index += 1
        sheet.cell(row=row_index, column=1).value = 'Identified Proteins'
        sheet.cell(row=row_index, column=2).value = 'Accession Number'
        for column in column_dict.keys():
            sheet.cell(row=row_index, column=column_index_from_string(column)).value = column_dict[column]

        row_index += 1
        for protein_id in intersection:
            sheet.cell(row=row_index, column=1).value = self.data_dicts[self.file_list[0]]['rows'][protein_id]['Identified Proteins']
            sheet.cell(row=row_index, column=2).value = protein_id
            for column in column_dict.keys():
                sheet.cell(row=row_index,
                           column=column_index_from_string(column)).value = self.data_dicts[column_file_dict[column]]['rows'][protein_id][column_dict[column]]
            row_index += 1

    def fill_union_sheet(self):
        sheet = self.workbook.get_sheet_by_name('Union')
        column_names = list(chain.from_iterable([self.data_dicts[x]['columns'].values()[2:] for x in self.file_list]))
        column_dict = OrderedDict(zip([get_column_letter(x) for x in range(3, len(column_names)+3)], column_names))

        column_files = list(chain.from_iterable([[x] * len(self.data_dicts[x]['columns'].values()[2:]) for x in self.file_list]))
        column_file_dict = OrderedDict(zip([get_column_letter(x) for x in range(3, len(column_files)+3)], column_files))

        # Formatting
        sheet.column_dimensions['A'].width = 40
        sheet.column_dimensions['B'].width = 15

        id_lists = [x.keys() for x in [z['rows'] for z in self.data_dicts.values()]]
        union = list(set.union(*map(set, id_lists)))

        row_index = 1
        for column in column_dict.keys():
            sheet.cell(row=row_index,
                       column=column_index_from_string(column)).value = column_file_dict[column]

        row_index += 1
        sheet.cell(row=row_index, column=1).value = 'Identified Proteins'
        sheet.cell(row=row_index, column=2).value = 'Accession Number'
        for column in column_dict.keys():
            sheet.cell(row=row_index, column=column_index_from_string(column)).value = column_dict[column]

        row_index += 1
        for protein_id in union:
            try:
                sheet.cell(row=row_index, column=1).value = self.data_dicts[self.file_list[0]]['rows'][protein_id]['Identified Proteins']
            except KeyError:
                files_with_id = [x for x in self.file_list if protein_id in self.data_dicts[x]['rows'].keys()]
                sheet.cell(row=row_index,
                           column=1).value = self.data_dicts[files_with_id[0]]['rows'][protein_id]['Identified Proteins']
            sheet.cell(row=row_index, column=2).value = protein_id
            for column in column_dict.keys():
                try:
                    sheet.cell(row=row_index,
                               column=column_index_from_string(column)).value = self.data_dicts[column_file_dict[column]]['rows'][protein_id][column_dict[column]]
                except KeyError:
                    sheet.cell(row=row_index,
                               column=column_index_from_string(column)).value = ''
            row_index += 1

    def fill_data_sheet(self, file_name):
        sheet = self.workbook.get_sheet_by_name(file_name)

        # Formatting
        sheet.column_dimensions['A'].width = 40
        sheet.column_dimensions['B'].width = 15
        sheet.column_dimensions['C'].width = 15
        sheet.column_dimensions['D'].width = 15
        sheet.column_dimensions['E'].width = 15
        sheet.column_dimensions['F'].width = 15
        sheet.column_dimensions['G'].width = 15
        sheet.column_dimensions['H'].width = 15
        sheet.column_dimensions['I'].width = 15
        sheet.column_dimensions['J'].width = 15

        column_dict = self.data_dicts[file_name]['columns']
        rows_dict = self.data_dicts[file_name]['rows']
        columns = sorted(column_dict.keys())

        row_index = 1
        for column in columns:
            sheet.cell(row=row_index,
                       column=column_index_from_string(column)).value = column_dict[column]

        row_index += 1
        for accession_number in rows_dict.keys():
            for column in columns:
                sheet.cell(row=row_index,
                           column=column_index_from_string(column)).value = rows_dict[accession_number][column_dict[column]]
            row_index += 1

    def save(self):
        file_name = os.path.join(self.directory, 'IntersectUnion.xlsx')
        self.workbook.save(file_name)
        print 'saved to {}'.format(file_name)

if __name__ == '__main__':
    file_list = ['RS_1FDR_1.xlsx', 'RSE_1FDR_1.xlsx', 'RT_1FDR_1.xlsx']
    report = Report('/Users/SimonJung/Desktop/proteomics',
                    file_list)
    report.run()


text:
package org.okraAx.test;

import com.google.protobuf.Descriptors;
import com.google.protobuf.Descriptors.MethodDescriptor;
import com.google.protobuf.InvalidProtocolBufferException;
import com.google.protobuf.Message;
import org.junit.Test;
import org.okraAx.internal.v3.protobuf.GpbMessageDesc;
import org.okraAx.v3.chess.services.FyChessSi;
import org.okraAx.v3.room.beans.VoEnterRoom;

/**
 * @author TinyZ
 * @date 2017-02-28.
 */
public class GpbMessageDescTest {

    public static void main(String[] args) throws InvalidProtocolBufferException {

    }

    @Test
    public void testUnpack() throws InvalidProtocolBufferException {
        for (Descriptors.ServiceDescriptor serviceDescriptor : FyChessSi.getDescriptor().getServices()) {
            MethodDescriptor methodByName = serviceDescriptor.findMethodByName("onEnterRoom");
            if (methodByName != null) {
                GpbMessageDesc method = new GpbMessageDesc(methodByName);
                //
                VoEnterRoom message = VoEnterRoom.newBuilder()
                        .setRoomId(999)
                        .setSeat(8)
                        .build();
                Message unpack = method.unpack(message.toByteString());
                Message pack = method.pack(new Object[]{
                        999, 8, 10001L, "xx"
                });
                System.out.println();

            }
        }

    }

}


text:
package scala
package collection.mutable

import scala.collection.{SortedMapFactory, SortedMapFactoryDefaults}
import scala.language.higherKinds

/**
  * Base type for mutable sorted map collections
  */
trait SortedMap[K, V]
  extends collection.SortedMap[K, V]
    with Map[K, V]
    with SortedMapOps[K, V, SortedMap, SortedMap[K, V]]
    with SortedMapFactoryDefaults[K, V, SortedMap, Iterable, Map] {

  override def unsorted: Map[K, V] = this

  override def sortedMapFactory: SortedMapFactory[SortedMap] = SortedMap

  /** The same sorted map with a given default function.
    *  Note: The default is only used for `apply`. Other methods like `get`, `contains`, `iterator`, `keys`, etc.
    *  are not affected by `withDefault`.
    *
    *  Invoking transformer methods (e.g. `map`) will not preserve the default value.
    *
    *  @param d     the function mapping keys to values, used for non-present keys
    *  @return      a wrapper of the map with a default value
    */
  override def withDefault(d: K => V): SortedMap[K, V] = new SortedMap.WithDefault[K, V](this, d)

  /** The same map with a given default value.
    * Note: The default is only used for `apply`. Other methods like `get`, `contains`, `iterator`, `keys`, etc.
    * are not affected by `withDefaultValue`.
    *
    * Invoking transformer methods (e.g. `map`) will not preserve the default value.
    *
    * @param d default value used for non-present keys
    * @return a wrapper of the map with a default value
    */
  override def withDefaultValue(d: V): SortedMap[K, V] = new SortedMap.WithDefault[K, V](this, _ => d)
}

trait SortedMapOps[K, V, +CC[X, Y] <: Map[X, Y] with SortedMapOps[X, Y, CC, _], +C <: SortedMapOps[K, V, CC, C]]
  extends collection.SortedMapOps[K, V, CC, C]
    with MapOps[K, V, Map, C] {

  def unsorted: Map[K, V]

  @deprecated("Use m.clone().addOne((k,v)) instead of m.updated(k, v)", "2.13.0")
  override def updated[V1 >: V](key: K, value: V1): CC[K, V1] =
    clone().asInstanceOf[CC[K, V1]].addOne((key, value))
}

@SerialVersionUID(3L)
object SortedMap extends SortedMapFactory.Delegate[SortedMap](TreeMap) {

  @SerialVersionUID(3L)
  final class WithDefault[K, V](underlying: SortedMap[K, V], defaultValue: K => V)
    extends Map.WithDefault[K, V](underlying, defaultValue)
      with SortedMap[K, V]
      with SortedMapOps[K, V, SortedMap, WithDefault[K, V]]
      with Serializable {

    override def sortedMapFactory: SortedMapFactory[SortedMap] = underlying.sortedMapFactory

    def iteratorFrom(start: K): scala.collection.Iterator[(K, V)] = underlying.iteratorFrom(start)

    def keysIteratorFrom(start: K): scala.collection.Iterator[K] = underlying.keysIteratorFrom(start)

    implicit def ordering: Ordering[K] = underlying.ordering

    def rangeImpl(from: Option[K], until: Option[K]): WithDefault[K, V] =
      new WithDefault[K, V](underlying.rangeImpl(from, until), defaultValue)

    // Need to override following methods to match type signatures of `SortedMap.WithDefault`
    // for operations preserving default value
    override def subtractOne(elem: K): WithDefault.this.type = { underlying.subtractOne(elem); this }

    override def addOne(elem: (K, V)): WithDefault.this.type = { underlying.addOne(elem); this }

    override def empty: WithDefault[K, V] = new WithDefault[K, V](underlying.empty, defaultValue)

    override def concat[V2 >: V](suffix: collection.IterableOnce[(K, V2)]): SortedMap[K, V2] =
      underlying.concat(suffix).withDefault(defaultValue)

    override protected def fromSpecific(coll: scala.collection.IterableOnce[(K, V)]): WithDefault[K, V] =
      new WithDefault[K, V](sortedMapFactory.from(coll), defaultValue)

    override protected def newSpecificBuilder: Builder[(K, V), WithDefault[K, V]] =
      SortedMap.newBuilder.mapResult((p: SortedMap[K, V]) => new WithDefault[K, V](p, defaultValue))
  }
}


text:
@interface SURControlServiceImp : NSObject<SURControllerService>

+ (SURControlServiceImp *)sharedService;
@end


text:
.class public LIrreducibleLoop;
.super Ljava/lang/Object;

# Test case in which `inner_back_edge` is not dominated by `inner_header` and
# causes `outer_back_edge` to not be dominated by `outer_header`. HGraphBuilder
# not do a fix-point iteration and would miss the path to `outer_back_edge`
# through `inner_back_edge` and incorrectly label the outer loop non-irreducible.

## CHECK-START: int IrreducibleLoop.dominance(int) builder (after)
## CHECK:         Add irreducible:true

.method public static dominance(I)I
    .registers 2

    if-eqz p0, :outer_header
    goto :inner_back_edge

    :outer_header
    if-eqz p0, :inner_header

    :outer_branch_exit
    if-eqz p0, :outer_merge
    return p0

    :inner_header
    goto :outer_merge

    :inner_back_edge
    goto :inner_header

    :outer_merge
    if-eqz p0, :inner_back_edge

    :outer_back_edge
    add-int/2addr p0, p0
    goto :outer_header

.end method


text:
<?xml version="1.0" encoding="UTF-8"?>
    <databaseChangeLog xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.liquibase.org/xml/ns/dbchangelog">
        <!-- Initialise DB -->
        <include relativeToChangelogFile="true" file="db/{{schema_name}}-init.xml" />

        <!-- DB Models/Tables -->
        <include relativeToChangelogFile="true" file="Categories/Category.db.yml" />
        <include relativeToChangelogFile="true" file="Classifications/Classification.db.yml" />
        <include relativeToChangelogFile="true" file="Examples/Example.db.yml" />

        <!-- Intialise Model Data -->
        <include relativeToChangelogFile="true" file="Categories/Category.init.xml" />
        <include relativeToChangelogFile="true" file="Classifications/Classification.init.xml" />
        <include relativeToChangelogFile="true" file="Examples/Example.init.xml" />

        <!-- Set Tags To Latest Version -->
        <include relativeToChangelogFile="true" file="db/{{schema_name}}-tags.yml" />
    </databaseChangeLog>


text:
//
//  FKFlickrMachinetagsGetRecentValues.h
//  FlickrKit
//
//  Generated by FKAPIBuilder on 19 Sep, 2014 at 10:49.
//  Copyright (c) 2013 DevedUp Ltd. All rights reserved. http://www.devedup.com
//
//  DO NOT MODIFY THIS FILE - IT IS MACHINE GENERATED

#import "FKFlickrAPIMethod.h"

typedef enum {
	FKFlickrMachinetagsGetRecentValuesError_InvalidAPIKey = 100,		 /* The API key passed was not valid or has expired. */
	FKFlickrMachinetagsGetRecentValuesError_ServiceCurrentlyUnavailable = 105,		 /* The requested service is temporarily unavailable. */
	FKFlickrMachinetagsGetRecentValuesError_WriteOperationFailed = 106,		 /* The requested operation failed due to a temporary issue. */
	FKFlickrMachinetagsGetRecentValuesError_FormatXXXNotFound = 111,		 /* The requested response format was not found. */
	FKFlickrMachinetagsGetRecentValuesError_MethodXXXNotFound = 112,		 /* The requested method was not found. */
	FKFlickrMachinetagsGetRecentValuesError_InvalidSOAPEnvelope = 114,		 /* The SOAP envelope send in the request could not be parsed. */
	FKFlickrMachinetagsGetRecentValuesError_InvalidXMLRPCMethodCall = 115,		 /* The XML-RPC request document could not be parsed. */
	FKFlickrMachinetagsGetRecentValuesError_BadURLFound = 116,		 /* One or more arguments contained a URL that has been used for abuse on Flickr. */

} FKFlickrMachinetagsGetRecentValuesError;

/*

Fetch recently used (or created) machine tags values.

Response:

<values namespace="taxonomy" predicate="common" page="1" total="500" perpage="500" pages="1">
    <value usage="4" namespace="taxonomy" predicate="common"
           first_added="1244232796" last_added="1244232796">maui chaff flower</value>

    <!-- and so on... -->
</values>

*/
@interface FKFlickrMachinetagsGetRecentValues : NSObject <FKFlickrAPIMethod>

/* A namespace that all values should be restricted to. */
@property (nonatomic, copy) NSString *namespace;

/* A predicate that all values should be restricted to. */
@property (nonatomic, copy) NSString *predicate;

/* Only return machine tags values that have been added since this timestamp, in epoch seconds.   */
@property (nonatomic, copy) NSString *added_since;

@end


text:
from typing import List

class ResourceInformation:

    """
    Class to hold information about a type of Resource. A resource could be a GPU, FPGA, etc.
    The array of addresses are resource specific and its up to the user to interpret the address.

    One example is GPUs, where the addresses would be the indices of the GPUs

    .. versionadded:: 3.0.0

    Parameters
    ----------
    name : str
        the name of the resource
    addresses : list
        a list of strings describing the addresses of the resource

    Notes
    -----
    This API is evolving.

    See Also
    --------
    :class:`pyspark.resource.ResourceProfile`
    """

    def __init__(self, name: str, addresses: List[str]):
        self._name = name
        self._addresses = addresses

    @property
    def name(self) -> str:
        """
        Returns
        -------
        str
            the name of the resource
        """
        return self._name

    @property
    def addresses(self) -> List[str]:
        """
        Returns
        -------
        list
            a list of strings describing the addresses of the resource
        """
        return self._addresses


text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl"  href="./testcase.xsl"?>
<test_definition>
  <suite name="tct-deviceorientation-w3c-tests" launcher="xwalk" extension="crosswalk" category="W3C/HTML5 APIs">
    <set name="Orientation" type="js">
      <capabilities>
        <capability name="accelerometer"/>
      </capabilities>
      <testcase purpose="Check if the DeviceAccelerationt.x attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceAcceleration_x_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceAcceleration_attributes_test.html?total_num=6&amp;locator_key=id&amp;value=1</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="x" interface="DeviceAcceleration" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceAcceleration.x is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceAcceleration_x_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceAcceleration_attributes_test.html?total_num=6&amp;locator_key=id&amp;value=2</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="x" interface="DeviceAcceleration" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceAccelerationt.y attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceAcceleration_y_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceAcceleration_attributes_test.html?total_num=6&amp;locator_key=id&amp;value=3</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="y" interface="DeviceAcceleration" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceAcceleration.y is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceAcceleration_y_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceAcceleration_attributes_test.html?total_num=6&amp;locator_key=id&amp;value=4</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="y" interface="DeviceAcceleration" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceAccelerationt.z attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceAcceleration_z_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceAcceleration_attributes_test.html?total_num=6&amp;locator_key=id&amp;value=5</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="z" interface="DeviceAcceleration" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceAcceleration.z is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceAcceleration_z_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceAcceleration_attributes_test.html?total_num=6&amp;locator_key=id&amp;value=6</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="z" interface="DeviceAcceleration" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceMotionEvent.acceleration method exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceMotionEvent_acceleration_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=1</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="acceleration" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceMotionEvent.acceleration is type of DeviceAcceleration" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceMotionEvent_acceleration_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=2</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="acceleration" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceMotionEvent.accelerationincludinggravity method exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceMotionEvent_accelerationincludinggravity_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=3</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="accelerationIncludingGravity" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceMotionEvent.accelerationIncludingGravity is type of DeviceAcceleration" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceMotionEvent_accelerationIncludingGravity_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=4</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="accelerationIncludingGravity" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceMotionEvent.interval attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceMotionEvent_interval_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=5</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="interval" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceMotionEvent.rotationRate attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceMotionEvent_rotationrate_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=6</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="rotationRate" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceMotionEvent.rotationRate is type of DeviceRotationRate" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceMotionEvent_rotationRate_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceMotionEvent_attributes_test.html?total_num=7&amp;locator_key=id&amp;value=7</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="rotationRate" interface="DeviceMotionEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceOrientationEvent.absolute attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceOrientationEvent_absolute_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=1</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="absolute" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceOrientationEvent.absolute is type of boolean" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceOrientationEvent_absolute_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=2</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="absolute" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceOrientationEvent.alpha attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceOrientationEvent_alpha_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=3</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="alpha" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceOrientationEvent.alpha is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceOrientationEvent_alpha_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=4</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="alpha" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceOrientationEvent.beta attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceOrientationEvent_beta_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=5</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="beta" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceOrientationEvent.beta is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceOrientationEvent_beta_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=6</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="beta" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceOrientationEvent.gamma attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceOrientationEvent_gamma_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=7</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="gamma" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceOrientationEvent.gamma is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceOrientationEvent_gamma_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceOrientationEvent_attributes_test.html?total_num=8&amp;locator_key=id&amp;value=8</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="gamma" interface="DeviceOrientationEvent" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#deviceorientation</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceRotationRate.alpha attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceRotationRate_alpha_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceRotationRate_attributes_test.html?total_num=4&amp;locator_key=id&amp;value=1</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="alpha" interface="DeviceRotationRate" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if DeviceRotationRate.alpha is type of double" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P2" id="DeviceRotationRate_alpha_type">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceRotationRate_attributes_test.html?total_num=4&amp;locator_key=id&amp;value=2</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="alpha" interface="DeviceRotationRate" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceRotationRate.beta attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceRotationRate_beta_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceRotationRate_attributes_test.html?total_num=4&amp;locator_key=id&amp;value=3</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="beta" interface="DeviceRotationRate" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
      <testcase purpose="Check if the DeviceRotationRate.gamma attribute exists" type="compliance" status="approved" component="WebAPI/Device/Device Orientation Event Specification (Partial)" execution_type="auto" priority="P1" id="DeviceRotationRate_gamma_entry">
        <description>
          <test_script_entry>/opt/tct-deviceorientation-w3c-tests/deviceorientation/DeviceRotationRate_attributes_test.html?total_num=4&amp;locator_key=id&amp;value=4</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion element_type="attribute" element_name="gamma" interface="DeviceRotationRate" specification="Device Orientation Event Specification (Partial)" section="Device" category="Tizen W3C API Specifications"/>
            <spec_url>http://www.w3.org/TR/2011/WD-orientation-event-20111201/#devicemotion</spec_url>
            <spec_statement/>
          </spec>
        </specs>
      </testcase>
    </set>
  </suite>
</test_definition>


text:
namespace blink {

struct GridSpan;
class ComputedStyle;
class GridPosition;
class NGGridNamedLineCollection;

// This is a utility class with all the code related to grid items positions
// resolution.
class NGGridLineResolver {
  DISALLOW_NEW();

 public:
  explicit NGGridLineResolver(const ComputedStyle& grid_style)
      : style_(&grid_style) {}

  wtf_size_t ExplicitGridColumnCount(
      wtf_size_t auto_repeat_columns_count,
      wtf_size_t subgrid_span_size = kNotFound) const;

  wtf_size_t ExplicitGridRowCount(
      wtf_size_t auto_repeat_rows_count,
      wtf_size_t subgrid_span_size = kNotFound) const;

  wtf_size_t SpanSizeForAutoPlacedItem(const ComputedStyle&,
                                       GridTrackSizingDirection) const;

  GridSpan ResolveGridPositionsFromStyle(
      const ComputedStyle&,
      GridTrackSizingDirection,
      wtf_size_t auto_repeat_tracks_count,
      bool is_parent_grid_container = false,
      wtf_size_t subgrid_span_size = kNotFound) const;

 private:
  const NamedGridLinesMap& NamedLinesMapForDirection(
      GridTrackSizingDirection track_direction) const;

  const ComputedGridTrackList& ComputedGridTrackListForDirection(
      GridTrackSizingDirection track_direction) const;

  GridSpan ResolveGridPositionAgainstOppositePosition(
      int opposite_line,
      const GridPosition& position,
      GridPositionSide side,
      wtf_size_t auto_repeat_tracks_count,
      wtf_size_t subgrid_span_size) const;

  GridSpan ResolveNamedGridLinePositionAgainstOppositePosition(
      int opposite_line,
      const GridPosition& position,
      wtf_size_t auto_repeat_tracks_count,
      GridPositionSide side,
      wtf_size_t subgrid_span_size) const;

  int ResolveGridPositionFromStyle(const GridPosition& position,
                                   GridPositionSide side,
                                   wtf_size_t auto_repeat_tracks_count,
                                   bool is_parent_grid_container,
                                   wtf_size_t subgrid_span_size) const;

  wtf_size_t ExplicitGridSizeForSide(GridPositionSide side,
                                     wtf_size_t auto_repeat_tracks_count,
                                     wtf_size_t subgrid_span_size) const;

  wtf_size_t LookAheadForNamedGridLine(
      int start,
      wtf_size_t number_of_lines,
      wtf_size_t grid_last_line,
      NGGridNamedLineCollection& lines_collection) const;

  int LookBackForNamedGridLine(
      int end,
      wtf_size_t number_of_lines,
      int grid_last_line,
      NGGridNamedLineCollection& lines_collection) const;

  wtf_size_t SpanSizeFromPositions(const GridPosition& initial_position,
                                   const GridPosition& final_position) const;

  int ResolveNamedGridLinePositionFromStyle(const GridPosition& position,
                                            GridPositionSide side,
                                            wtf_size_t auto_repeat_tracks_count,
                                            wtf_size_t subgrid_span_size) const;

  void InitialAndFinalPositionsFromStyle(
      const ComputedStyle& grid_item_style,
      GridTrackSizingDirection track_direction,
      GridPosition& initial_position,
      GridPosition& final_position) const;

  GridSpan DefiniteGridSpanWithNamedSpanAgainstOpposite(
      int opposite_line,
      const GridPosition& position,
      GridPositionSide side,
      int last_line,
      NGGridNamedLineCollection& lines_collection) const;

  scoped_refptr<const ComputedStyle> style_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_LAYOUT_NG_GRID_NG_GRID_LINE_RESOLVER_H_


text:
timer Package
=============

:mod:`api` Module
-----------------

.. automodule:: pyface.timer.api
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`do_later` Module
----------------------

.. automodule:: pyface.timer.do_later
    :members:
    :undoc-members:
    :show-inheritance:

:mod:`timer` Module
-------------------

.. automodule:: pyface.timer.timer
    :members:
    :undoc-members:
    :show-inheritance:


text:
#include <inviwo/core/links/linkconditions.h>
#include <inviwo/core/common/inviwoapplication.h>
#include <inviwo/core/properties/propertyconvertermanager.h>

namespace inviwo {

bool SimpleCondition::canLink(const Property* src, const Property* dst) {
    return InviwoApplication::getPtr()->getPropertyConverterManager()->canConvert(src, dst);
}

bool PartiallyMatchingIdCondition::canLink(const Property* src, const Property* dst) {
    bool canLink = false;
    // conversion to lower case
    std::string srcIdentifier = src->getIdentifier();
    std::transform(srcIdentifier.begin(), srcIdentifier.end(), srcIdentifier.begin(), tolower);
    std::string dstIdentifier = dst->getIdentifier();
    std::transform(dstIdentifier.begin(), dstIdentifier.end(), dstIdentifier.begin(), tolower);
    std::string srcClassName = src->getClassIdentifier();
    std::transform(srcClassName.begin(), srcClassName.end(), srcClassName.begin(), tolower);
    std::string dstClassName = dst->getClassIdentifier();
    std::transform(dstClassName.begin(), dstClassName.end(), dstClassName.begin(), tolower);

    // does class name occurs in identifiers
    if (srcIdentifier.find(dstClassName) != std::string::npos &&
        dstIdentifier.find(srcClassName) != std::string::npos)
        canLink = true;

    // does identifier occur in other identifier
    if (srcIdentifier.find(dstIdentifier) != std::string::npos ||
        dstIdentifier.find(srcIdentifier) != std::string::npos)
        canLink = true;

    return canLink;
}

bool AutoLinker::canLink(const Property* src, const Property* dst,
                         LinkingConditions givenConditions) {
    int satisfiedConditions = 0;

    // does properties have same class names
    if ((givenConditions & LinkMatchingTypes) &&
        dst->getClassIdentifier() == src->getClassIdentifier())
        satisfiedConditions |= ((int)LinkMatchingTypes);

    // does partially matching identifier strings
    if ((givenConditions & LinkMatchingId) && PartiallyMatchingIdCondition::canLink(src, dst))
        satisfiedConditions |= ((int)LinkMatchingId);

    if (givenConditions == satisfiedConditions && givenConditions) return true;

    return false;
}
}


text:
namespace glTF_2_0
{
	//-------------------------------------------------------------------------

	AssetT* createAsset_default(const char* name);

	Document* const createDocument(const char* name)
	{
		auto instance		  = std::unique_ptr<Document>{new Document};
		instance->root		  = Root_t{new RootT};
		instance->root->asset = Asset_t{createAsset_default(name)};

		return instance.release();
	}

	//---

	void destroyDocument(Document* const doc)
	{
		if (doc)
		{
			delete doc;
		}
	}

	//---
	// document creation

	std::unique_ptr<Document, decltype(&destroyDocument)> createDocumentPtr(const std::string& name)
	{
		return std::unique_ptr<Document, decltype(&destroyDocument)>{createDocument(name.c_str()), &destroyDocument};
	}

	//---

	bool verifyDocument(const Document* const doc)
	{
		KHUTILS_ASSERT_PTR(doc);
		KHUTILS_ASSERT_PTR(doc->root);
		auto& root = doc->root;

		auto viewOk = std::all_of(root->bufferViews.begin(), root->bufferViews.end(), [&](auto& view) {
			KHUTILS_ASSERT_PTR(view);
			return isValidBufferId(doc, view->buffer);
		});

		auto accOk = std::all_of(root->accessors.begin(), root->accessors.end(), [&](auto& acc) {
			KHUTILS_ASSERT_PTR(acc);
			return isValidBufferViewId(doc, acc->bufferView);
		});

		std::vector<AccessorT*> accessors;
		accessors.reserve(root->accessors.size());
		std::transform(root->accessors.begin(), root->accessors.end(), std::back_inserter(accessors), [](auto& acc) {
			return acc.get();
		});

		std::sort(accessors.begin(), accessors.end(), [](auto lhv, auto rhv) { return lhv->bufferView < rhv->bufferView; });
		accessors.resize(std::distance(accessors.begin(), std::unique(accessors.begin(), accessors.end(), [](auto lhv, auto rhv) { return lhv->bufferView == rhv->bufferView; })));
		auto uniqueBufferViews = accessors.size() == root->accessors.size();

		return viewOk && accOk && uniqueBufferViews;
	}

	//-------------------------------------------------------------------------
	//-------------------------------------------------------------------------

}	// namespace glTF_2_0


text:
/**
 * Created by Patrik Valkovic
 * 09.12.2018.
 */

'use strict'

const Command = require('./Command')

class HistoryCommand extends Command {

    constructor(groupManager) {
        super();
        this.groupManager = groupManager;
    }

    can(content){
        return content.startsWith('/history')
    }

    process(client, content){
        if(client.lastGroup === null) {
            client.socket.write('You aren\'t in the group\n')
            return false
        }

        client.lastGroup.history(client, this.groupManager.width)
    }

}

module.exports = HistoryCommand


text:
"use strict";
//# sourceMappingURL=dataset.schema.js.map


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

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/title" />

        <EditText
            android:id="@+id/title"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:inputType="text" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/value" />

        <EditText
            android:id="@+id/value"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:inputType="numberSigned|numberDecimal" />
    </LinearLayout>

</LinearLayout>