text:
<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/aiplatform/v1/study.proto

namespace Google\Cloud\AIPlatform\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * Represents specification of a Study.
 *
 * Generated from protobuf message google.cloud.aiplatform.v1.StudySpec
 */
class StudySpec extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. Metric specs for the Study.
     *
     * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StudySpec.MetricSpec metrics = 1 [(.google.api.field_behavior) = REQUIRED];
     */
    private $metrics;
    /**
     * Required. The set of parameters to tune.
     *
     * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StudySpec.ParameterSpec parameters = 2 [(.google.api.field_behavior) = REQUIRED];
     */
    private $parameters;
    /**
     * The search algorithm specified for the Study.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.Algorithm algorithm = 3;
     */
    private $algorithm = 0;
    /**
     * The observation noise level of the study.
     * Currently only supported by the Vertex AI Vizier service. Not supported by
     * HyperparameterTuningJob or TrainingPipeline.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ObservationNoise observation_noise = 6;
     */
    private $observation_noise = 0;
    /**
     * Describe which measurement selection type will be used
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MeasurementSelectionType measurement_selection_type = 7;
     */
    private $measurement_selection_type = 0;
    protected $automated_stopping_spec;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\DecayCurveAutomatedStoppingSpec $decay_curve_stopping_spec
     *           The automated early stopping spec using decay curve rule.
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\MedianAutomatedStoppingSpec $median_automated_stopping_spec
     *           The automated early stopping spec using median rule.
     *     @type \Google\Cloud\AIPlatform\V1\StudySpec\ConvexAutomatedStoppingSpec $convex_automated_stopping_spec
     *           The automated early stopping spec using convex stopping rule.
     *     @type array<\Google\Cloud\AIPlatform\V1\StudySpec\MetricSpec>|\Google\Protobuf\Internal\RepeatedField $metrics
     *           Required. Metric specs for the Study.
     *     @type array<\Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec>|\Google\Protobuf\Internal\RepeatedField $parameters
     *           Required. The set of parameters to tune.
     *     @type int $algorithm
     *           The search algorithm specified for the Study.
     *     @type int $observation_noise
     *           The observation noise level of the study.
     *           Currently only supported by the Vertex AI Vizier service. Not supported by
     *           HyperparameterTuningJob or TrainingPipeline.
     *     @type int $measurement_selection_type
     *           Describe which measurement selection type will be used
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\Study::initOnce();
        parent::__construct($data);
    }

    /**
     * The automated early stopping spec using decay curve rule.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4;
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\DecayCurveAutomatedStoppingSpec|null
     */
    public function getDecayCurveStoppingSpec()
    {
        return $this->readOneof(4);
    }

    public function hasDecayCurveStoppingSpec()
    {
        return $this->hasOneof(4);
    }

    /**
     * The automated early stopping spec using decay curve rule.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4;
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\DecayCurveAutomatedStoppingSpec $var
     * @return $this
     */
    public function setDecayCurveStoppingSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\DecayCurveAutomatedStoppingSpec::class);
        $this->writeOneof(4, $var);

        return $this;
    }

    /**
     * The automated early stopping spec using median rule.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MedianAutomatedStoppingSpec median_automated_stopping_spec = 5;
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\MedianAutomatedStoppingSpec|null
     */
    public function getMedianAutomatedStoppingSpec()
    {
        return $this->readOneof(5);
    }

    public function hasMedianAutomatedStoppingSpec()
    {
        return $this->hasOneof(5);
    }

    /**
     * The automated early stopping spec using median rule.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MedianAutomatedStoppingSpec median_automated_stopping_spec = 5;
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\MedianAutomatedStoppingSpec $var
     * @return $this
     */
    public function setMedianAutomatedStoppingSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\MedianAutomatedStoppingSpec::class);
        $this->writeOneof(5, $var);

        return $this;
    }

    /**
     * The automated early stopping spec using convex stopping rule.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9;
     * @return \Google\Cloud\AIPlatform\V1\StudySpec\ConvexAutomatedStoppingSpec|null
     */
    public function getConvexAutomatedStoppingSpec()
    {
        return $this->readOneof(9);
    }

    public function hasConvexAutomatedStoppingSpec()
    {
        return $this->hasOneof(9);
    }

    /**
     * The automated early stopping spec using convex stopping rule.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9;
     * @param \Google\Cloud\AIPlatform\V1\StudySpec\ConvexAutomatedStoppingSpec $var
     * @return $this
     */
    public function setConvexAutomatedStoppingSpec($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\StudySpec\ConvexAutomatedStoppingSpec::class);
        $this->writeOneof(9, $var);

        return $this;
    }

    /**
     * Required. Metric specs for the Study.
     *
     * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StudySpec.MetricSpec metrics = 1 [(.google.api.field_behavior) = REQUIRED];
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMetrics()
    {
        return $this->metrics;
    }

    /**
     * Required. Metric specs for the Study.
     *
     * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StudySpec.MetricSpec metrics = 1 [(.google.api.field_behavior) = REQUIRED];
     * @param array<\Google\Cloud\AIPlatform\V1\StudySpec\MetricSpec>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMetrics($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\StudySpec\MetricSpec::class);
        $this->metrics = $arr;

        return $this;
    }

    /**
     * Required. The set of parameters to tune.
     *
     * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StudySpec.ParameterSpec parameters = 2 [(.google.api.field_behavior) = REQUIRED];
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getParameters()
    {
        return $this->parameters;
    }

    /**
     * Required. The set of parameters to tune.
     *
     * Generated from protobuf field repeated .google.cloud.aiplatform.v1.StudySpec.ParameterSpec parameters = 2 [(.google.api.field_behavior) = REQUIRED];
     * @param array<\Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setParameters($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\AIPlatform\V1\StudySpec\ParameterSpec::class);
        $this->parameters = $arr;

        return $this;
    }

    /**
     * The search algorithm specified for the Study.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.Algorithm algorithm = 3;
     * @return int
     */
    public function getAlgorithm()
    {
        return $this->algorithm;
    }

    /**
     * The search algorithm specified for the Study.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.Algorithm algorithm = 3;
     * @param int $var
     * @return $this
     */
    public function setAlgorithm($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\StudySpec\Algorithm::class);
        $this->algorithm = $var;

        return $this;
    }

    /**
     * The observation noise level of the study.
     * Currently only supported by the Vertex AI Vizier service. Not supported by
     * HyperparameterTuningJob or TrainingPipeline.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ObservationNoise observation_noise = 6;
     * @return int
     */
    public function getObservationNoise()
    {
        return $this->observation_noise;
    }

    /**
     * The observation noise level of the study.
     * Currently only supported by the Vertex AI Vizier service. Not supported by
     * HyperparameterTuningJob or TrainingPipeline.
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.ObservationNoise observation_noise = 6;
     * @param int $var
     * @return $this
     */
    public function setObservationNoise($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\StudySpec\ObservationNoise::class);
        $this->observation_noise = $var;

        return $this;
    }

    /**
     * Describe which measurement selection type will be used
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MeasurementSelectionType measurement_selection_type = 7;
     * @return int
     */
    public function getMeasurementSelectionType()
    {
        return $this->measurement_selection_type;
    }

    /**
     * Describe which measurement selection type will be used
     *
     * Generated from protobuf field .google.cloud.aiplatform.v1.StudySpec.MeasurementSelectionType measurement_selection_type = 7;
     * @param int $var
     * @return $this
     */
    public function setMeasurementSelectionType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\AIPlatform\V1\StudySpec\MeasurementSelectionType::class);
        $this->measurement_selection_type = $var;

        return $this;
    }

    /**
     * @return string
     */
    public function getAutomatedStoppingSpec()
    {
        return $this->whichOneof("automated_stopping_spec");
    }

}


text:
MACRO(VTK_WRAP_TCL2 TARGET)
  # convert to the WRAP3 signature
  SET(MODE SOURCE_LIST)
  SET(SOURCES)
  FOREACH(ARG ${ARGN})
    SET (MODE_CHANGED 0)
    IF ("${ARG}" MATCHES SOURCES)
      SET (MODE SOURCE_LIST)
      SET(MODE_CHANGED 1)
    ENDIF ()
    IF ("${ARG}" MATCHES COMMANDS)
      SET (MODE COMMANDS)
      SET(MODE_CHANGED 1)
    ENDIF ()
    IF (NOT MODE_CHANGED)
      IF (MODE MATCHES SOURCES)
        SET(SOURCES ${SOURCES} ${ARG})
      ENDIF ()
      IF (MODE MATCHES COMMANDS)
        SET(COMMANDS ${COMMANDS} ${ARG})
      ENDIF ()
      IF (MODE MATCHES SOURCE_LIST)
        SET(SOURCE_LIST_NAME "${ARG}")
        SET (MODE SOURCES)
      ENDIF ()
    ENDIF ()
  ENDFOREACH()

  VTK_WRAP_TCL3(${TARGET} ${SOURCE_LIST_NAME} "${SOURCES}" "${COMMANDS}")
ENDMACRO()

MACRO(VTK_WRAP_TCL3 TARGET SRC_LIST_NAME SOURCES COMMANDS)
  if(NOT VTK_WRAP_TCL_INIT_EXE)
    if(TARGET vtkWrapTclInit)
      set(VTK_WRAP_TCL_INIT_EXE vtkWrapTclInit)
    else()
      message(SEND_ERROR
        "VTK_WRAP_TCL_INIT_EXE not specified when calling VTK_WRAP_TCL3")
    endif()
  endif()
  if(NOT VTK_WRAP_TCL_EXE)
    if(TARGET vtkWrapTcl)
      set(VTK_WRAP_TCL_EXE vtkWrapTcl)
    else()
      message(SEND_ERROR
        "VTK_WRAP_TCL_EXE not specified when calling VTK_WRAP_TCL3")
    endif()
  endif()

  IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
    SET(verbatim "")
    SET(quote "\"")
  ELSE()
    SET(verbatim "VERBATIM")
    SET(quote "")
  ENDIF()

  # Initialize the custom target counter.
  IF(VTK_WRAP_TCL_NEED_CUSTOM_TARGETS)
    SET(VTK_WRAP_TCL_CUSTOM_COUNT "")
    SET(VTK_WRAP_TCL_CUSTOM_NAME ${TARGET})
    SET(VTK_WRAP_TCL_CUSTOM_LIST)
  ENDIF()

  # start writing the input file for the init file
  SET(VTK_WRAPPER_INIT_DATA "${TARGET}")
  IF (${ARGC} GREATER 4)
    SET(VTK_WRAPPER_INIT_DATA
      "${VTK_WRAPPER_INIT_DATA}\nVERSION ${ARGV4}")
  ENDIF ()

  # all the include directories
  if(VTK_WRAP_INCLUDE_DIRS)
    set(TMP_INCLUDE_DIRS ${VTK_WRAP_INCLUDE_DIRS})
  else()
    set(TMP_INCLUDE_DIRS ${VTK_INCLUDE_DIRS})
  endif()

  # collect the common wrapper-tool arguments
  set(_common_args)
  get_directory_property(_def_list DEFINITION COMPILE_DEFINITIONS)
  foreach(TMP_DEF ${_def_list})
    set(_common_args "${_common_args}-D${TMP_DEF}\n")
  endforeach()
  foreach(INCLUDE_DIR ${TMP_INCLUDE_DIRS})
    set(_common_args "${_common_args}-I\"${INCLUDE_DIR}\"\n")
  endforeach()
  if(VTK_WRAP_HINTS)
    set(_common_args "${_common_args}--hints \"${VTK_WRAP_HINTS}\"\n")
  endif()
  if(KIT_HIERARCHY_FILE)
    set(_common_args "${_common_args}--types \"${KIT_HIERARCHY_FILE}\"\n")
  endif()

  # write wrapper-tool arguments to a file
  string(STRIP "${_common_args}" CMAKE_CONFIGURABLE_FILE_CONTENT)
  set(_args_file ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}.args)
  configure_file(${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in
                 ${_args_file} @ONLY)

  # for each class
  FOREACH(FILE ${SOURCES})
    # should we wrap the file?
    GET_SOURCE_FILE_PROPERTY(TMP_WRAP_EXCLUDE ${FILE} WRAP_EXCLUDE)

    # if we should wrap it
    IF (NOT TMP_WRAP_EXCLUDE)

      # what is the filename without the extension
      GET_FILENAME_COMPONENT(TMP_FILENAME ${FILE} NAME_WE)

      # the input file might be full path so handle that
      GET_FILENAME_COMPONENT(TMP_FILEPATH ${FILE} PATH)

      # compute the input filename
      IF (TMP_FILEPATH)
        SET(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.h)
      ELSE ()
        SET(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.h)
      ENDIF ()

      # add the info to the init file
      SET(VTK_WRAPPER_INIT_DATA
        "${VTK_WRAPPER_INIT_DATA}\n${TMP_FILENAME}")

      # new source file is nameTcl.cxx, add to resulting list
      SET(${SRC_LIST_NAME} ${${SRC_LIST_NAME}}
        ${TMP_FILENAME}Tcl.cxx)

      # add custom command to output
      ADD_CUSTOM_COMMAND(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Tcl.cxx
        DEPENDS ${VTK_WRAP_TCL_EXE} ${VTK_WRAP_HINTS} ${TMP_INPUT} ${_args_file}
        ${KIT_HIERARCHY_FILE}
        COMMAND ${VTK_WRAP_TCL_EXE}
        ARGS
        ${TMP_HINTS}
        "${quote}@${_args_file}${quote}"
        "-o" "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Tcl.cxx${quote}"
        "${quote}${TMP_INPUT}${quote}"
        COMMENT "Tcl Wrapping - generating ${TMP_FILENAME}Tcl.cxx"
        ${verbatim}
        )

      # Add this output to a custom target if needed.
      IF(VTK_WRAP_TCL_NEED_CUSTOM_TARGETS)
        SET(VTK_WRAP_TCL_CUSTOM_LIST ${VTK_WRAP_TCL_CUSTOM_LIST}
          ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}Tcl.cxx)
        SET(VTK_WRAP_TCL_CUSTOM_COUNT ${VTK_WRAP_TCL_CUSTOM_COUNT}x)
        IF(VTK_WRAP_TCL_CUSTOM_COUNT MATCHES "^${VTK_WRAP_TCL_CUSTOM_LIMIT}$")
          SET(VTK_WRAP_TCL_CUSTOM_NAME ${VTK_WRAP_TCL_CUSTOM_NAME}Hack)
          ADD_CUSTOM_TARGET(${VTK_WRAP_TCL_CUSTOM_NAME} DEPENDS ${VTK_WRAP_TCL_CUSTOM_LIST})
          SET(KIT_TCL_DEPS ${VTK_WRAP_TCL_CUSTOM_NAME})
          SET(VTK_WRAP_TCL_CUSTOM_LIST)
          SET(VTK_WRAP_TCL_CUSTOM_COUNT)
        ENDIF()
      ENDIF()
    ENDIF ()
  ENDFOREACH()

  # finish the data file for the init file
  FOREACH(CMD ${COMMANDS})
    SET(VTK_WRAPPER_INIT_DATA
      "${VTK_WRAPPER_INIT_DATA}\nCOMMAND ${CMD}")
  ENDFOREACH()

  SET(dir ${CMAKE_CURRENT_SOURCE_DIR})
  CONFIGURE_FILE(
    ${VTK_CMAKE_DIR}/vtkWrapperInit.data.in
    ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
    @ONLY
    )

  ADD_CUSTOM_COMMAND(
    OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx
    DEPENDS ${VTK_WRAP_TCL_INIT_EXE}
    ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data
    COMMAND ${VTK_WRAP_TCL_INIT_EXE}
    ARGS
    "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.data${quote}"
    "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TARGET}Init.cxx${quote}"
    COMMENT "Tcl Wrapping - generating ${TARGET}Init.cxx"
    ${verbatim}
    )

  # Create the Init File
  SET(${SRC_LIST_NAME} ${${SRC_LIST_NAME}} ${TARGET}Init.cxx)
ENDMACRO()

IF (VTK_WRAP_TCL_FIND_LIBS)
  GET_FILENAME_COMPONENT(_CURRENT_DIR  "${CMAKE_CURRENT_LIST_FILE}" PATH)
  INCLUDE("${_CURRENT_DIR}/FindTCL.cmake")

  IF(VTK_WRAP_TCL AND NOT TCL_FOUND)
    MESSAGE(FATAL_ERROR "Tcl was not found. Install the Tcl development package (see http://tcl.tk or ActiveState Tcl) and set the appropriate variables (TCL_INCLUDE_PATH, TCL_LIBRARY, TCL_TCLSH) or disable VTK_WRAP_TCL.")
  ENDIF()

  IF(VTK_USE_TK AND NOT TK_FOUND)
    MESSAGE(FATAL_ERROR "Tk was not found. Install the Tk development package (see http://tcl.tk or ActiveState Tcl) and set the appropriate variables (TK_INCLUDE_PATH, TK_LIBRARY, TK_WISH) or disable VTK_USE_TK.")
  ENDIF()

  SET(VTK_TCL_LIBRARIES ${TCL_LIBRARY})
  IF(TCL_LIBRARY_DEBUG)
    SET(VTK_TCL_LIBRARIES optimized ${TCL_LIBRARY} debug ${TCL_LIBRARY_DEBUG})
  ENDIF()
  IF(UNIX)
    # The tcl library needs the math library on unix.
    SET(VTK_TCL_LIBRARIES ${VTK_TCL_LIBRARIES} m)
  ENDIF()
  IF(TK_FOUND)
    SET(VTK_TK_LIBRARIES ${TK_LIBRARY} ${VTK_TCL_LIBRARIES})
    IF(TK_LIBRARY_DEBUG)
      SET(VTK_TK_LIBRARIES optimized ${TK_LIBRARY} debug ${TK_LIBRARY_DEBUG} ${VTK_TCL_LIBRARIES})
    ENDIF()
  ENDIF()
  INCLUDE(${VTK_CMAKE_DIR}/vtkTclTkMacros.cmake)
  # Hide useless settings provided by FindTCL.
  FOREACH(entry
          TK_WISH)
    SET(${entry} "${${entry}}" CACHE INTERNAL "This value is not used by VTK.")
  ENDFOREACH()

  # Need Tk sources on windows
  IF(WIN32)
    FIND_PATH(TK_XLIB_PATH
              X11/Xlib.h ${TK_INCLUDE_PATH}
              ${TK_INCLUDE_PATH}/../xlib)
    MARK_AS_ADVANCED(TK_XLIB_PATH)
  ENDIF()

ENDIF ()

# VS 6 does not like needing to run a huge number of custom commands
# when building a single target.  Generate some extra custom targets
# that run the custom commands before the main target is built.  This
# is a hack to work-around the limitation.  The test to enable it is
# done here since it does not need to be done for every macro
# invocation.
IF(CMAKE_GENERATOR STREQUAL "Visual Studio 6")
  SET(VTK_WRAP_TCL_NEED_CUSTOM_TARGETS 1)
  SET(VTK_WRAP_TCL_CUSTOM_LIMIT x)
  # Limit the number of custom commands in each target
  # to 2^7.
  FOREACH(t 1 2 3 4 5 6 7)
    SET(VTK_WRAP_TCL_CUSTOM_LIMIT
      ${VTK_WRAP_TCL_CUSTOM_LIMIT}${VTK_WRAP_TCL_CUSTOM_LIMIT})
  ENDFOREACH()
ENDIF()

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Drupal\quickedit;

use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Field\FieldItemListInterface;

/**
 * Interface for generating in-place editing metadata.
 */
interface MetadataGeneratorInterface {

  /**
   * Generates in-place editing metadata for an entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity, in the language in which one of its fields is being edited.
   *
   * @return array
   *   An array containing metadata with the following keys:
   *   - label: the user-visible label for the entity in the given language.
   */
  public function generateEntityMetadata(EntityInterface $entity);

  /**
   * Generates in-place editing metadata for an entity field.
   *
   * @param \Drupal\Core\Field\FieldItemListInterface $items
   *   The field values to be in-place edited.
   * @param string $view_mode
   *   The view mode the field should be rerendered in.
   *
   * @return array
   *   An array containing metadata with the following keys:
   *   - label: the user-visible label for the field.
   *   - access: whether the current user may edit the field or not.
   *   - editor: which editor should be used for the field.
   *   - aria: the ARIA label.
   *   - custom: (optional) any additional metadata that the editor provides.
   */
  public function generateFieldMetadata(FieldItemListInterface $items, $view_mode);

}


text:
package navmesh;

import gnu.trove.map.hash.TIntObjectHashMap;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.NoSuchElementException;

/**
 * Provides a representation of the open (unobstructed) space above solid
 * surfaces in a voxel field.
 *
For this type of heightfield, spans represent the floor and ceiling
 * of the open spaces.

 *
WARNING: This class has very little protections build into it.  It
 * is basically an uncontrolled data structure with convenience functions.

 *

 *
 *

 * @see Introduction to Height Fields
 */
public final class OpenHeightfield
    extends BoundedField
{
    /*
     * Recast Reference: rcCompactHeightfield in Recast.h
     * The internal structure of this class is very different from Recast.
     * See: http://www.critterai.org/nmgen_diffs for the reason.
     */

    /**
     * An iterator that will iterate through all spans within a
     * height field. (Not just the base spans.)
     *
Behavior of the iterator is undefined if the interator's source
     * is changed during iteration.

     * The iterator returned by {@link OpenHeightfield#dataIterator()}.
     */
    public final class OpenHeightFieldIterator
        implements Iterator<OpenHeightSpan>
    {

        // See reset() for initialization information.

        private int mNextWidth;
        private int mNextDepth;
        private OpenHeightSpan mNext;

        private int mLastWidth;
        private int mLastDepth;

        /**
         * Constructor.
         */
        private OpenHeightFieldIterator()
        {
            reset();
        }

        /**
         * The depth index of the last span returned by {@link #next()}
         * @return The depth index of the last span returned by {@link #next()}
         */
        public int depthIndex() { return mLastDepth; }

        /**
         * {@inheritDoc}
         */
        @Override
        public boolean hasNext()
        {
            return (mNext != null);
        }

        /**
         * {@inheritDoc}
         */
        @Override
        public OpenHeightSpan next()
        {
            if (mNext == null)
                throw new NoSuchElementException();
            // Select value cursor.
            OpenHeightSpan next = mNext;
            mLastWidth = mNextWidth;
            mLastDepth = mNextDepth;
            // Move the cursor to the next value.
            moveToNext();
            return next;
        }

        /**
         * {@inheritDoc}
         * This operation is not supported.
         */
        @Override
        public void remove()
        {
            throw new UnsupportedOperationException();
        }

        /**
         * Resets the iterator so that it can be re-used.
         */
        public void reset()
        {
            mNextWidth = 0;
            mNextDepth = 0;
            mNext = null;
            mLastWidth = 0;
            mLastDepth = 0;
            moveToNext();
        }

        /**
         * The width index of the last span returned by {@link #next()}
         * @return The width index of the last span returned by {@link #next()}
         */
        public int widthIndex() { return mLastWidth; }

        /**
         * This operation is called in order to move the
         * cursor to the next span after the {@link #next()} operation
         * has selected its span to return.
         */
        private void moveToNext()
        {
            if (mNext != null)
            {
                // There is a current cell selected.
                if (mNext.next() != null)
                {
                    // The current cell has a next. Select it
                    mNext = mNext.next();
                    return;
                }
                else mNextWidth++;  // Move to next cell.
            }
            // Need to find the next grid location that contains a span.
            // Loop until one is found or no more are available.
            for (int depthIndex = mNextDepth
                    ; depthIndex < depth()
                    ; depthIndex++)
            {
                for (int widthIndex = mNextWidth
                        ; widthIndex < width()
                        ; widthIndex++)
                {
                    int index = gridIndex(widthIndex, depthIndex);

                    if( index >= 0 ) {
                        OpenHeightSpan span = mSpans.get(index);

                        if (span != null)
                        {
                            // A span was found.  Set the cursor to it.
                            mNext = span;
                            mNextWidth = widthIndex;
                            mNextDepth = depthIndex;
                            return;
                        }
                    }
                }
                mNextWidth = 0;
            }
            // If got here then there are no more spans.
            // Set values to indicate the end of iteration.
            mNext = null;
            mNextDepth = -1;
            mNextWidth = -1;
        }
    }

    /**
     * Indicates that a value is unknown and need to be derived.
     */
    private static final int UNKNOWN = -1;
    private int mSpanCount = 0;

    // These next fields are derived only when the value is needed.

    private int mRegionCount = 0;

    /**
     * The maximum distance a span is from a border span.
     */
    private int mMaxBorderDistance = UNKNOWN;

    /**
     * The minimum distance a span is from a border span.
     */
    private int mMinBorderDistance = UNKNOWN;

    /**
     * Key = Grid index from {@link #gridIndex(int, int)}.
     * Value = The first (lowest) span in the grid column.
     */
    //private final Hashtable<Integer, OpenHeightSpan> mSpans =
    //    new Hashtable<Integer, OpenHeightSpan>();
    public final TIntObjectHashMap<OpenHeightSpan> mSpans = new TIntObjectHashMap<>();

    /**
     * Constructor
     * @param gridBoundsMin The minimum bounds of the field in the form
     * (minX, minY, minZ).
     * @param gridBoundsMax The maximum bounds of the field in the form
     * (maxX, maxY, maxZ).
     * @param cellSize The size of the cells.  (The grid that forms the base
     * of the field.)
     * @param cellHeight The height increment of the field.
     * @throws IllegalArgumentException If the bounds are null or the
     * wrong size.
     */
    public OpenHeightfield(float[] gridBoundsMin
            , float[] gridBoundsMax
            , float cellSize, float cellHeight)
        throws IllegalArgumentException
    {
        super(gridBoundsMin, gridBoundsMax, cellSize, cellHeight);
    }

    /**
     * Puts the span at the grid location, replacing any spans already at the
     * location. The added span becomes the new base span for the location.
     *
WARNING: The span count must be manually updated to reflect changes
     * in span count

     *
Behavior is undefined if the indices are invalid.

     * @param widthIndex The width index of the grid location to add the
     * span to.  (0 <= value < {@link #width()})
     * @param depthIndex The depth index of the grid location to add the
     * span to.  (0 <= value < {@link #depth()})
     * @param span The span to put at the grid location.
     * @return The original base span that was in the grid location, or null
     * if there was no pre-existing span in the location.
     */
    public OpenHeightSpan addData(int widthIndex
            , int depthIndex
            , OpenHeightSpan span)
    {
        return mSpans.put(gridIndex(widthIndex, depthIndex), span);
    }

    /**
     * Resets the border distance values so they will
     * be recacluated the next time they are needed.
     */
    public void clearBorderDistanceBounds()
    {
        mMaxBorderDistance = UNKNOWN;
        mMinBorderDistance = UNKNOWN;
    }

    /**
     * An iterator for the heightfields spans.
     * The returned iterator does not support the
     * {@link Iterator#remove()} operation.
     */
    public OpenHeightFieldIterator dataIterator()
    {
        return this.new OpenHeightFieldIterator();
    }

    /**
     * Retrieves the base (lowest) grid for the specified grid location.
     *
Behavior is undefined if the indices are invalid.

     * @param widthIndex The width index of the grid location the span is
     * located in. (0 <= value < {@link #width()})
     * @param depthIndex The depth index of the grid location the span is
     * located in. (0 <= value < {@link #depth()})
     * @return The base (lowest) span for the specified grid location.  Null
     * if there is no data for the grid location.
     */
    public OpenHeightSpan getData(int widthIndex, int depthIndex)
    {
        int gridindex = gridIndex(widthIndex, depthIndex);
        if( gridindex < 0 ) return null;
        return mSpans.get(gridindex);
    }

    /**
     * Increments the span count.
     *
IMPORTANT: There is no automatic span count updates.  Span count
     * must be managed manually.

     * @return The new span count.
     */
    public int incrementSpanCount() { return ++mSpanCount; }

    /**
     * The maximum distance a span in the heightfield is from its
     * nearest border.
     * @return The maximum distance a span in the heightfield is from
     * its nearest border.
     */
    public int maxBorderDistance()
    {
        if (mMaxBorderDistance == UNKNOWN)
            calcBorderDistanceBounds();
        return mMaxBorderDistance;
    }

    /**
     * The minimum distance a span in the height field is from its nearest
     * border. (Usually zero.  But can depend on the generation method.)
     * @return The minimum distance a span in the height field is from its
     * nearest border.
     */
    public int minBorderDistance()
    {
        if (mMinBorderDistance == UNKNOWN)
            calcBorderDistanceBounds();
        return mMinBorderDistance;
    }

    /**
     * Sends a tab delimited table of the distance field values to
     * standard out.
     *
Only the lowest spans in the field are output.  So this operation
     * is really only suitable for simple tests on fields
     * that don't contain overlapping spans.

     *
Columns: Width

     * Rows: Depth

     */
    public void printDistanceField()
    {
        System.out.println("Distance Field (Spans: " + mSpanCount + ")");
        final OpenHeightFieldIterator iter = new OpenHeightFieldIterator();
        int depth = -1;
        System.out.print("\t");
        for (int width = 0; width < width(); width++)
            System.out.print(width + "\t");
        while (iter.hasNext())
        {
            OpenHeightSpan span = iter.next();
            if (iter.depthIndex() != depth)
                System.out.print("\n" + ++depth + "\t");
            System.out.print(span.distanceToBorder() + "\t");
        }
        System.out.println();
    }

    /**
     * Sends a tab delimited table of the region ID values to standard out.
     *
Only the lowest spans in the field are output.  So this operation
     * is really only suitable for simple tests on fields
     * that don't contain overlapping spans.

     *
Columns: Width

     * Rows: Depth

     */
    public void printRegionField()
    {
        System.out.println("Distance Field (Spans: " + mSpanCount
                + ", Regions: " + mRegionCount + ")");
        System.out.print("\t");
        for (int width = 0; width < width(); width++)
            System.out.print(width + "\t");
        for (int iDepth = 0; iDepth < depth(); iDepth++)
        {
            System.out.print("\n" + iDepth + "\t");
            for (int iWidth = 0; iWidth < width(); iWidth++)
            {
                OpenHeightSpan span = getData(iWidth, iDepth);
                if (span == null)
                    System.out.print(" \t");
                else
                    System.out.print(span.regionID() + "\t");
            }
        }
        System.out.println();
    }

    /**
     * The number of regions in the height field.
     *
Includes the null region.  So unless all spans are in the
     * null region, this value will be >= 2.  (E.g. The null region and at
     * least one  other region.)

     */
    public int regionCount() { return mRegionCount; }

    /**
     * Sets the region count.
     *
The region count is expected to be zero based with the zero
     * region representing the null region.  So the region count is
     * expected to be one more that the maximum region value.  E.g. If the
     * highest region value is 14, then the region count is 15.

     *
IMPORTANT: There is no automatic region count management.
     * Region count must be managed manually.

     * @param value The new region count.
     */
    public void setRegionCount(int value) { mRegionCount = value; }

    /**
     * The number of spans in the heightfield.
     *
A value of zero indicates an empty heightfield.

     */
    public int spanCount() { return mSpanCount; }

    /**
     * Calculates the min/max distance a span in the field is from it
     * nearest border. Allows on-demand calculation of this information.
     */
    private void calcBorderDistanceBounds()
    {
        if (mSpanCount == 0)
            return;

        // Default the values.
        mMinBorderDistance = Integer.MAX_VALUE;
        mMaxBorderDistance = UNKNOWN;

        // Iterate through all spans and reset the values if new min/max's are
        // found.
        OpenHeightFieldIterator iter =
            this.new OpenHeightFieldIterator();
        while (iter.hasNext())
        {
            OpenHeightSpan span = iter.next();
            mMinBorderDistance = Math.min(mMinBorderDistance
                    , span.distanceToBorder());
            mMaxBorderDistance = Math.max(mMaxBorderDistance
                    , span.distanceToBorder());
        }
        if (mMinBorderDistance == Integer.MAX_VALUE)
            // There ware a problem locating the maximum.
            // So set it back to unknown.
            mMinBorderDistance = UNKNOWN;

    }

}


text:
import {Port} from './port';

export class Entity {
	name: string;
	architecture: string;
	parent_name: string;
	level: number;
	ports: Port[];
}


text:
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;

namespace srvcon
{
    [RunInstaller(true)]
    public class CustomServiceInstaller : Installer
    {
        public CustomServiceInstaller()
        {
            var process = new ServiceProcessInstaller
            {
                Account = ServiceAccount.LocalSystem
            };

            var service = new ServiceInstaller
            {
                ServiceName = InstallHelper.InstallServiceName
            };

            Installers.Add(process);
            Installers.Add(service);
        }
    }
}


text:
#ifndef __cpel_util_h__
#define __cpel_util_h__

/*
 * Our idea of an event, as opposed to a CPEL event
 */
typedef struct evt_ {
    u64 timestamp;
    u32 track_id;
    u32 event_id;
    u32 datum;
} evt_t;

evt_t *the_events;

/*
 * Track object, so we can sort the tracks alphabetically and
 * fix the events later
 */
typedef struct track_ {
    u32 original_index;
    u32 strtab_offset;
} track_t;

track_t *the_tracks;
u32 *track_alpha_map;

event_definition_t *the_event_definitions;
i64 min_timestamp;

/* Hash tables, used to find previous instances of the same items */
uword *the_track_hash;
uword *the_msg_event_hash;
uword *the_strtab_hash;
uword *the_pidtid_hash;
uword *the_pid_to_name_hash;
u8 *the_strtab;

u32 find_or_add_strtab(void *s_arg);
u32 find_or_add_track(void *s_arg);
u32 find_or_add_event(void *s_arg, char *datum_format);
int write_string_table(FILE *ofp);
int write_cpel_header(FILE *ofp, u32 nsections);
int write_event_defs(FILE *ofp);
u64 ntohll (u64 x);
int write_events(FILE *ofp, u64 clock_ticks_per_second);
int write_track_defs(FILE *ofp);
void cpel_util_init (void);
void alpha_sort_tracks(void);
void fixup_event_tracks(void);

#endif /* __cpel_util_h__ */


text:
<?xml version="1.0" encoding="utf-8"?>
<!--This file demonstrates 3 different possible templates, as is the max for this file. For help on choosing a template, visit http://msdn.microsoft.com/en-us/library/ie/dn456348(v=vs.85).aspx -->
<tile>
  <!-- version="2" must be specified, as that's what Windows 8.1 (the only version of Windows that can pin website Live Tiles to the Start Screen) recognizes-->
  <visual lang="en-US" version="2">
    <!--The template="" attribute defines the template you're using. See the above linked site for help on choosing a template. The branding="" attribute can be set to name, logo, or none, and displays the branding of the site on the Live Tile accordingly-->
    <binding template="TileSquare150x150PeekImageAndText04" branding="name">
      <!--Each image tag must have a unique id="" attribute, with each value being one larger than the last. This specifies the order in which the images will be displayed-->
      <image id="1" src="img/firstImage.jpg"/>
      <!--Each text tag must have a unique id="" attribute, with each value being one higher than the other. This specifies the order in which the text will be displayed, the style of the text, and the image that the text corresponds to-->
      <text id="1">First Image</text>
    </binding>
    <binding template="TileWide310x150ImageAndText01" branding="name">
      <image id="1" src="img/firstImage.jpg"/>
      <text id="1">First Image</text>
    </binding>
    <binding template="TileSquare310x310SmallImagesAndTextList01" branding="name">
      <image id="1" src="img/firstImage.jpg"/>
      <image id="2" src="img/secondImage.jpg"/>
      <image id="3" src="img/thirdImage.jpg"/>
      <text id="1">Title Text 1</text>
      <text id="2">Body Text 1.1</text>
      <text id="3">Body Text 1.2</text>
      <text id="4">Title Text 2</text>
      <text id="5">Body Text 2.1</text>
      <text id="6">Body Text 2.2</text>
      <text id="7">Title Text 3</text>
      <text id="8">Body Text 3.1</text>
      <text id="9">Body Text 3.2</text>
    </binding>
  </visual>
</tile>


text:
import java.io.FileNotFoundException;
public class Q20
{

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

        if (args.length != 3)
        {
             System.out.println(
                    "Usage: java ReplaceText File oldString newString");
             System.exit(0);
        }

        java.io.File file = new java.io.File(args[0]);
        if (!file.exists())
        {
            System.out.println("Source file " + args[0] + " does not exist");
            System.exit(0);
        }
        System.out.println(file.getAbsolutePath());

        java.util.Scanner input = new java.util.Scanner(file);
        StringBuilder stringBuilder = new StringBuilder();
        while(input.hasNextLine())
        {
            String s1 = input.nextLine();
            stringBuilder.append(s1.replaceAll(args[1], args[2]));
            stringBuilder.append("\r\n");
        }
        input.close();

        java.io.PrintWriter output = new java.io.PrintWriter(args[0]);
        output.print(stringBuilder.toString());
        output.close();
    }
}


text:
from six import iteritems

class Portfolio(dict):
    """ Portfolio object where keys are stock symbols and
    values are share counts. You can pass these into a backtest
    to start with an initial basket of stocks.

    Note:
        Subclasses dict in v0.1
    """

    def __unicode__(self):
        return self.__repr__()

    def __str__(self):
        return self.__repr__()

    def __repr__(self):
        shares = []
        for key, value in iteritems(self):
            shares.append("%s=%s" % (key, value))
        share_info = ", ".join(shares)
        return "Portfolio(%s)" % share_info


text:
package com.navercorp.pinpoint.common.server.bo.serializer.trace.v2;

import com.google.common.collect.Lists;
import com.navercorp.pinpoint.common.buffer.Buffer;
import com.navercorp.pinpoint.common.buffer.FixedBuffer;
import com.navercorp.pinpoint.common.server.bo.RandomTSpan;
import com.navercorp.pinpoint.common.server.bo.SpanBo;
import com.navercorp.pinpoint.common.server.bo.SpanChunkBo;
import com.navercorp.pinpoint.common.server.bo.SpanEventBo;
import com.navercorp.pinpoint.common.server.bo.thrift.SpanFactory;
import com.navercorp.pinpoint.thrift.dto.TSpan;
import com.navercorp.pinpoint.thrift.dto.TSpanChunk;
import com.navercorp.pinpoint.thrift.dto.TSpanEvent;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.nio.ByteBuffer;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author Woonduk Kang(emeroad)
 */
public class SpanEncoderTest {

    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    private static final int REPEAT_COUNT = 10;

    private final RandomTSpan randomTSpan = new RandomTSpan();
    private final SpanFactory spanFactory = new SpanFactory();

    private SpanEncoder spanEncoder = new SpanEncoderV0();
    private SpanDecoder spanDecoder = new SpanDecoderV0();

    @Test
    public void testEncodeSpanColumnValue_simpleSpan() throws Exception {

        SpanBo spanBo = randomSpan();
        assertSpan(spanBo);

    }

    @Test
    public void testEncodeSpanColumnValue_simpleSpan_N() throws Exception {
        for (int i = 0; i < REPEAT_COUNT; i++) {
            testEncodeSpanColumnValue_simpleSpan();
        }
    }

    @Test
    public void testEncodeSpanColumnValue_complexSpan() throws Exception {

        SpanBo spanBo = randomComplexSpan();
        assertSpan(spanBo);

    }

    @Test
    public void testEncodeSpanColumnValue_complexSpan_N() throws Exception {
        for (int i = 0; i < REPEAT_COUNT; i++) {
            testEncodeSpanColumnValue_complexSpan();
        }
    }

    @Test
    public void testEncodeSpanColumnValue_simpleSpanChunk() throws Exception {

        SpanChunkBo spanChunkBo = randomSpanChunk();
        assertSpanChunk(spanChunkBo);

    }

    @Test
    public void testEncodeSpanColumnValue_simpleSpanChunk_N() throws Exception {
        for (int i = 0; i < REPEAT_COUNT; i++) {
            testEncodeSpanColumnValue_simpleSpanChunk();
        }
    }

    @Test
    public void testEncodeSpanColumnValue_complexSpanChunk() throws Exception {

        SpanChunkBo spanChunkBo = randomComplexSpanChunk();
        assertSpanChunk(spanChunkBo);

    }

    @Test
    public void testEncodeSpanColumnValue_complexSpanChunk_N() throws Exception {
        for (int i = 0; i < REPEAT_COUNT; i++) {
            testEncodeSpanColumnValue_complexSpanChunk();
        }
    }

    private long getCollectorAcceptTime() {
        long currentTime = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30);
        long randomSeed = RandomUtils.nextLong(0, TimeUnit.DAYS.toMillis(60));
        return currentTime - randomSeed;
    }

    private Buffer wrapBuffer(ByteBuffer byteBuffer) {
        byte[] buffer = new byte[byteBuffer.remaining()];
        byteBuffer.get(buffer);
        return new FixedBuffer(buffer);
    }

    private SpanBo randomSpan() {
        TSpan tSpan = randomTSpan.randomTSpan();
        return spanFactory.buildSpanBo(tSpan);
    }

    public SpanBo randomComplexSpan() {
        TSpan tSpan = randomTSpan.randomTSpan();
        TSpanEvent tSpanEvent1 = randomTSpan.randomTSpanEvent((short) 1);
        TSpanEvent tSpanEvent2 = randomTSpan.randomTSpanEvent((short) 2);
        TSpanEvent tSpanEvent3 = randomTSpan.randomTSpanEvent((short) 3);
        TSpanEvent tSpanEvent4 = randomTSpan.randomTSpanEvent((short) 5);

        tSpan.setSpanEventList(Lists.newArrayList(tSpanEvent1, tSpanEvent2, tSpanEvent3, tSpanEvent4));
        return spanFactory.buildSpanBo(tSpan);
    }

    private SpanChunkBo randomSpanChunk() {
        TSpanChunk tSpanChunk = randomTSpan.randomTSpanChunk();
        return spanFactory.buildSpanChunkBo(tSpanChunk);
    }

    public SpanChunkBo randomComplexSpanChunk() {
        TSpanChunk tSpanChunk = randomTSpan.randomTSpanChunk();
        TSpanEvent tSpanEvent1 = randomTSpan.randomTSpanEvent((short) 1);
        TSpanEvent tSpanEvent2 = randomTSpan.randomTSpanEvent((short) 2);
        TSpanEvent tSpanEvent3 = randomTSpan.randomTSpanEvent((short) 3);
        TSpanEvent tSpanEvent4 = randomTSpan.randomTSpanEvent((short) 5);

        tSpanChunk.setSpanEventList(Lists.newArrayList(tSpanEvent1, tSpanEvent2, tSpanEvent3, tSpanEvent4));
        return spanFactory.buildSpanChunkBo(tSpanChunk);
    }

    private void assertSpan(SpanBo spanBo) {
        spanBo.setCollectorAcceptTime(getCollectorAcceptTime());

        SpanEncodingContext<SpanBo> encodingContext = new SpanEncodingContext<SpanBo>(spanBo);
        Buffer qualifier = wrapBuffer(spanEncoder.encodeSpanQualifier(encodingContext));
        Buffer column = wrapBuffer(spanEncoder.encodeSpanColumnValue(encodingContext));

        SpanDecodingContext decodingContext = new SpanDecodingContext();
        decodingContext.setTransactionId(spanBo.getTransactionId());
        decodingContext.setCollectorAcceptedTime(spanBo.getCollectorAcceptTime());

        SpanBo decode = (SpanBo) spanDecoder.decode(qualifier, column, decodingContext);
        // TODO Check CI log
        // logger.debug("span dump \noriginal spanBo:{} \ndecode spanBo:{} ", spanBo, decode);

        List<String> notSerializedField = Lists.newArrayList("parentApplicationId", "parentApplicationServiceType");
        List<String> excludeField = Lists.newArrayList("annotationBoList", "spanEventBoList");
        notSerializedField.addAll(excludeField);
        Assert.assertTrue(EqualsBuilder.reflectionEquals(decode, spanBo, notSerializedField));

        logger.debug("{} {}", spanBo.getAnnotationBoList(), decode.getAnnotationBoList());
        Assert.assertTrue("annotation", EqualsBuilder.reflectionEquals(spanBo.getAnnotationBoList(), decode.getAnnotationBoList()));

        List<SpanEventBo> spanEventBoList = spanBo.getSpanEventBoList();
        List<SpanEventBo> decodedSpanEventBoList = decode.getSpanEventBoList();
        Assert.assertTrue(EqualsBuilder.reflectionEquals(spanEventBoList, decodedSpanEventBoList));
    }

    private void assertSpanChunk(SpanChunkBo spanChunkBo) {
        spanChunkBo.setCollectorAcceptTime(getCollectorAcceptTime());

        SpanEncodingContext<SpanChunkBo> encodingContext = new SpanEncodingContext<>(spanChunkBo);
        Buffer qualifier = wrapBuffer(spanEncoder.encodeSpanChunkQualifier(encodingContext));
        Buffer column = wrapBuffer(spanEncoder.encodeSpanChunkColumnValue(encodingContext));

        SpanDecodingContext decodingContext = new SpanDecodingContext();
        decodingContext.setTransactionId(spanChunkBo.getTransactionId());
        decodingContext.setCollectorAcceptedTime(spanChunkBo.getCollectorAcceptTime());

        SpanChunkBo decode = (SpanChunkBo) spanDecoder.decode(qualifier, column, decodingContext);
        // TODO Check CI log
        // logger.debug("spanChunk dump \noriginal spanChunkBo:{} \ndecode spanChunkBo:{} ", spanChunkBo, decode);

        List<String> notSerializedField = Lists.newArrayList("endPoint", "serviceType", "applicationServiceType");
        List<String> excludeField = Lists.newArrayList("spanEventBoList", "localAsyncId");
        notSerializedField.addAll(excludeField);
        Assert.assertTrue(EqualsBuilder.reflectionEquals(decode, spanChunkBo, notSerializedField));

        List<SpanEventBo> spanEventBoList = spanChunkBo.getSpanEventBoList();
        List<SpanEventBo> decodedSpanEventBoList = decode.getSpanEventBoList();
        Assert.assertTrue(EqualsBuilder.reflectionEquals(spanEventBoList, decodedSpanEventBoList));

    }

    @Test
    public void testEncodeSpanColumnValue_spanEvent_startTimeDelta_equals() {
        SpanBo spanBo = randomComplexSpan();
        SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
        SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
        spanEventBo1.setStartElapsed(spanEventBo0.getStartElapsed());

        assertSpan(spanBo);
    }

    @Test
    public void testEncodeSpanColumnValue_spanEvent_depth_equals() {
        SpanBo spanBo = randomComplexSpan();
        SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
        SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
        spanEventBo1.setDepth(spanEventBo0.getDepth());

        assertSpan(spanBo);
    }

    @Test
    public void testEncodeSpanColumnValue_spanEvent_service_equals() {
        SpanBo spanBo = randomComplexSpan();
        SpanEventBo spanEventBo0 = spanBo.getSpanEventBoList().get(0);
        SpanEventBo spanEventBo1 = spanBo.getSpanEventBoList().get(1);
        spanEventBo1.setServiceType(spanEventBo0.getServiceType());

        assertSpan(spanBo);
    }
}


text:
/* eslint no-restricted-syntax: off */
import { join } from 'path';
import { writeFileSync } from 'fs';
import Providers, { find, ofAPIType } from '../src/providers/Providers';

process.on('uncaughtException', err => {
  throw err;
});

describe('Providers', () => {
  const providers = Providers();

  beforeAll(() => {
    // Temporary way of outputing providers
    writeFileSync(
      join(__dirname, '..', 'compat-db.json'),
      JSON.stringify(providers)
    );
  });

  describe('Constraints', () => {
    it('should have record count in between expected counts', () => {
      expect(ofAPIType('css').length).toBeGreaterThan(300);
      expect(ofAPIType('js').length).toBeGreaterThan(10000);
      expect(ofAPIType('css').length).toBeLessThan(2000);
      expect(ofAPIType('js').length).toBeLessThan(13000);
    });
  });

  describe('Vendor Prefixes', () => {
    it('should not have vendor prefixes', () => {
      const properties = ['protoChainId', 'id', 'name'];
      providers.forEach(rule => {
        properties.forEach(property => {
          expect(rule[property]).not.toContain('moz');
          expect(rule[property]).not.toContain('webkit');
          expect(rule[property]).not.toContain('moz');
        });
      });
    });
  });

  describe('API Filtering', () => {
    it('should return filtered CSS APIs', () => {
      const filteredAPIs = ofAPIType('css');

      for (const api of filteredAPIs) {
        expect(api).toHaveProperty('type', 'css-api');
      }
    });

    it('should return filtered JS APIs', () => {
      const filteredAPIs = ofAPIType('js');

      for (const api of filteredAPIs) {
        expect(api).toHaveProperty('type', 'js-api');
      }
    });

    it('should return filtered HTML APIs', () => {
      const filteredAPIs = ofAPIType('html');

      for (const api of filteredAPIs) {
        expect(api).toHaveProperty('type', 'html-api');
      }
    });
  });

  describe('API Resolution', () => {
    it('should resolve HTML API', () => {
      const api = find('width');
      expect(api).toBeDefined();
    });

    it('should resolve CSS API', () => {
      for (const api of ['width', 'display', 'flex', 'grid', 'font-size']) {
        const resolved = find(api);

        expect(resolved).toHaveProperty('type', 'css-api');
        expect(resolved).toHaveProperty('type', 'css-api');
      }
    });

    describe('Specific API Tests', () => {
      const records = ofAPIType('js');

      describe('JS APIs', () => {
        it('should get contain non-style related APIs', () => {
          records.filter(record => record.protoChain.includes('navigator'));
        });

        it('should contain requestAnimationFrame record', () => {
          const record = find('requestAnimationFrame');
          expect(record).toBeDefined();
          expect(record.protoChain).toContain('requestAnimationFrame');
        });

        it('should contain currentScript record', () => {
          const record = find('currentScript');
          expect(record).toBeDefined();
          expect(record.protoChain).toContain('document');
          expect(record.protoChain).toContain('currentScript');
        });

        it('should contain PaymentRequest record', () => {
          const [record] = records.filter(e =>
            e.protoChain.includes('PaymentRequest')
          );

          expect(record).toBeDefined();
          expect(record.protoChain).toContain('PaymentRequest');
        });

        it.skip('should contain WebAssembly record', () => {
          const [record] = records.filter(e =>
            e.protoChain.includes('WebAssembly')
          );

          expect(record).toBeDefined();
          expect(record.protoChain).toContain('WebAssembly');
        });

        it.skip('should contain WebAssembly.compile record', () => {
          const [record] = records
            .filter(e => e.protoChain.includes('WebAssembly'))
            .filter(e => e.protoChain.includes('compile'));

          expect(record).toBeDefined();
          expect(record.protoChain).toContain('WebAssembly');
          expect(record.protoChain).toContain('compile');
        });

        it('should contain supports record', () => {
          const [record] = records
            .filter(e => e.protoChain.includes('CSS'))
            .filter(e => e.protoChain.includes('supports'));

          expect(record).toBeDefined();
          expect(record.protoChain).toContain('CSS');
          expect(record.protoChain).toContain('supports');
        });

        it('should contain fetch record', () => {
          const [record] = records.filter(e => e.protoChain.includes('fetch'));

          expect(record).toBeDefined();
          expect(record.protoChain).toContain('fetch');
        });

        it('should contain applicationCache record', () => {
          const record = find('applicationCache');
          expect(record).toBeDefined();
          expect(record.protoChain).toContain('applicationCache');
        });

        it('should contain math record', () => {
          const methods = ['cos', 'acos', 'sin', 'asin', 'asin'];
          for (const method of methods) {
            const record = find(method);
            expect(record).toBeDefined();
            expect(record.protoChain).toContain('Math');
            expect(record.protoChain).toContain(method);
          }
        });

        it('should contain requestIdleCallback record', () => {
          const record = find('requestIdleCallback');
          expect(record).toBeDefined();
          expect(record.protoChain).toContain('requestIdleCallback');
        });

        it('should contain IntersectionObserver record', () => {
          const record = find('IntersectionObserver');
          expect(record).toBeDefined();
          expect(record.protoChain).toContain('IntersectionObserver');
        });

        it('should contain createImageBitmap record', () => {
          const record = find('createImageBitmap');
          expect(record).toBeDefined();
          expect(record.protoChain).toContain('createImageBitmap');
        });

        it('should contain navigator.serviceWorker record', () => {
          expect(
            records.find(
              record =>
                record.protoChain.includes('navigator') &&
                record.protoChain.includes('serviceWorker')
            )
          ).toBeDefined();

          expect(
            records.find(record =>
              record.protoChain.includes('requestAnimationFrame')
            )
          ).toBeDefined();

          expect(
            records.find(
              record =>
                record.protoChain.includes('ServiceWorkerRegistration') &&
                record.protoChain.includes('getNotifications')
            )
          ).toBeDefined();

          expect(
            records.find(
              record =>
                record.protoChain.includes('ServiceWorkerRegistration') &&
                record.protoChain.includes('getNotifications')
            )
          ).toBeDefined();

          expect(
            records.find(
              record =>
                record.protoChain.includes('ServiceWorkerMessageEvent') &&
                record.protoChain.includes('ports')
            )
          ).toBeDefined();

          expect(
            records.find(
              record =>
                record.protoChain.includes('ServiceWorkerMessageEvent') &&
                record.protoChain.includes('source')
            )
          ).toBeDefined();
        });
      });

      describe('CSS APIs', () => {
        it('should not have capital letters in id and name', () => {
          for (const record of ofAPIType('css')) {
            expect(record.id).toEqual(record.id.toLocaleLowerCase());
            expect(record.name).toEqual(record.name.toLocaleLowerCase());
          }
        });
      });

      it('should get borderTopRightRadius', () => {
        expect(find('borderTopRightRadius')).toEqual({
          id: 'borderTopRightRadius',
          name: 'borderTopRightRadius',
          specNames: ['css-background-3'],
          type: 'js-api',
          specIsFinished: false,
          protoChainId: 'CSSStyleDeclaration.borderTopRightRadius',
          protoChain: ['CSSStyleDeclaration', 'borderTopRightRadius']
        });
      });

      it('should get border-top-right-radius', () => {
        expect(find('border-top-right-radius')).toEqual({
          id: 'border-top-right-radius',
          name: 'border-top-right-radius',
          specNames: ['css-background-3'],
          type: 'css-api',
          specIsFinished: false,
          protoChain: ['CSSStyleDeclaration', 'borderTopRightRadius'],
          protoChainId: 'CSSStyleDeclaration.borderTopRightRadius'
        });
      });

      it('should get css flex', () => {
        expect(ofAPIType('css').find(record => record.id === 'flex')).toEqual({
          id: 'flex',
          name: 'flex',
          specNames: ['css-flexbox-1'],
          type: 'css-api',
          specIsFinished: false,
          protoChain: ['CSSStyleDeclaration', 'flex'],
          protoChainId: 'CSSStyleDeclaration.flex'
        });
      });

      it('should get js flex', () => {
        expect(ofAPIType('js').find(record => record.id === 'flex')).toEqual({
          id: 'flex',
          name: 'flex',
          specNames: ['css-flexbox-1'],
          type: 'js-api',
          specIsFinished: false,
          protoChain: ['CSSStyleDeclaration', 'flex'],
          protoChainId: 'CSSStyleDeclaration.flex'
        });
      });
    });
  });
});


text:
<!DOCTYPE html>

    {{template "_head.html"}}

    {{template "_header.html" .}}

            Enter Password to Continue

          <form method="POST" action="" class="panel-body">

                Employee Number

                <input type="text" name="employeeNumber">

                Password

                <input type="password" name="password">

                <button type="submit" class="btn btn-primary form-control">Submit</button>

          </form>


text:
"""Command parsing module for TensorFlow Debugger (tfdbg)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import ast
from collections import namedtuple
import re
import sys

_BRACKETS_PATTERN = re.compile(r"\[[^\]]*\]")
_QUOTES_PATTERN = re.compile(r"\"[^\"]*\"")
_WHITESPACE_PATTERN = re.compile(r"\s+")

_NUMBER_PATTERN = re.compile(r"[-+]?(\d+(\.\d*)?|\.\d+)([eE][-+]?\d+)?")

Interval = namedtuple("Interval",
                      ["start", "start_included", "end", "end_included"])

def parse_command(command):
  """Parse command string into a list of arguments.

  - Disregards whitespace inside double quotes and brackets.
  - Strips paired leading and trailing double quotes in arguments.
  - Splits the command at whitespace.

  Nested double quotes and brackets are not handled.

  Args:
    command: (str) Input command.

  Returns:
    (list of str) List of arguments.
  """

  command = command.strip()
  if not command:
    return []

  brackets_intervals = [f.span() for f in _BRACKETS_PATTERN.finditer(command)]
  quotes_intervals = [f.span() for f in _QUOTES_PATTERN.finditer(command)]
  whitespaces_intervals = [
      f.span() for f in _WHITESPACE_PATTERN.finditer(command)
  ]

  if not whitespaces_intervals:
    return [command]

  arguments = []
  idx0 = 0
  for start, end in whitespaces_intervals + [(len(command), None)]:
    # Skip whitespace stretches enclosed in brackets or double quotes.

    if not any(interval[0] < start < interval[1]
               for interval in brackets_intervals + quotes_intervals):
      argument = command[idx0:start]

      # Strip leading and trailing double quote if they are paired.
      if argument.startswith("\"") and argument.endswith("\""):
        argument = argument[1:-1]
      arguments.append(argument)
      idx0 = end

  return arguments

def extract_output_file_path(args):
  """Extract output file path from command arguments.

  Args:
    args: (list of str) command arguments.

  Returns:
    (list of str) Command arguments with the output file path part stripped.
    (str or None) Output file path (if any).

  Raises:
    SyntaxError: If there is no file path after the last ">" character.
  """

  if args and args[-1].endswith(">"):
    raise SyntaxError("Redirect file path is empty")
  elif args and args[-1].startswith(">"):
    try:
      _parse_interval(args[-1])
      if len(args) > 1 and args[-2].startswith("-"):
        output_file_path = None
      else:
        output_file_path = args[-1][1:]
        args = args[:-1]
    except ValueError:
      output_file_path = args[-1][1:]
      args = args[:-1]
  elif len(args) > 1 and args[-2] == ">":
    output_file_path = args[-1]
    args = args[:-2]
  elif args and args[-1].count(">") == 1:
    gt_index = args[-1].index(">")
    if gt_index > 0 and args[-1][gt_index - 1] == "=":
      output_file_path = None
    else:
      output_file_path = args[-1][gt_index + 1:]
      args[-1] = args[-1][:gt_index]
  elif len(args) > 1 and args[-2].endswith(">"):
    output_file_path = args[-1]
    args = args[:-1]
    args[-1] = args[-1][:-1]
  else:
    output_file_path = None

  return args, output_file_path

def parse_tensor_name_with_slicing(in_str):
  """Parse tensor name, potentially suffixed by slicing string.

  Args:
    in_str: (str) Input name of the tensor, potentially followed by a slicing
      string. E.g.: Without slicing string: "hidden/weights/Variable:0", with
      slicing string: "hidden/weights/Variable:0[1, :]"

  Returns:
    (str) name of the tensor
    (str) slicing string, if any. If no slicing string is present, return "".
  """

  if in_str.count("[") == 1 and in_str.endswith("]"):
    tensor_name = in_str[:in_str.index("[")]
    tensor_slicing = in_str[in_str.index("["):]
  else:
    tensor_name = in_str
    tensor_slicing = ""

  return tensor_name, tensor_slicing

def validate_slicing_string(slicing_string):
  """Validate a slicing string.

  Check if the input string contains only brackets, digits, commas and
  colons that are valid characters in numpy-style array slicing.

  Args:
    slicing_string: (str) Input slicing string to be validated.

  Returns:
    (bool) True if and only if the slicing string is valid.
  """

  return bool(re.search(r"^\[(\d|,|\s|:)+\]$", slicing_string))

def _parse_slices(slicing_string):
  """Construct a tuple of slices from the slicing string.

  The string must be a valid slicing string.

  Args:
    slicing_string: (str) Input slicing string to be parsed.

  Returns:
    tuple(slice1, slice2, ...)

  Raises:
    ValueError: If tensor_slicing is not a valid numpy ndarray slicing str.
  """
  parsed = []
  for slice_string in slicing_string[1:-1].split(","):
    indices = slice_string.split(":")
    if len(indices) == 1:
      parsed.append(int(indices[0].strip()))
    elif 2 <= len(indices) <= 3:
      parsed.append(
          slice(*[
              int(index.strip()) if index.strip() else None for index in indices
          ]))
    else:
      raise ValueError("Invalid tensor-slicing string.")
  return tuple(parsed)

def parse_indices(indices_string):
  """Parse a string representing indices.

  For example, if the input is "[1, 2, 3]", the return value will be a list of
  indices: [1, 2, 3]

  Args:
    indices_string: (str) a string representing indices. Can optionally be
      surrounded by a pair of brackets.

  Returns:
    (list of int): Parsed indices.
  """

  # Strip whitespace.
  indices_string = re.sub(r"\s+", "", indices_string)

  # Strip any brackets at the two ends.
  if indices_string.startswith("[") and indices_string.endswith("]"):
    indices_string = indices_string[1:-1]

  return [int(element) for element in indices_string.split(",")]

def parse_ranges(range_string):
  """Parse a string representing numerical range(s).

  Args:
    range_string: (str) A string representing a numerical range or a list of
      them. For example:
        "[-1.0,1.0]", "[-inf, 0]", "[[-inf, -1.0], [1.0, inf]]"

  Returns:
    (list of list of float) A list of numerical ranges parsed from the input
      string.

  Raises:
    ValueError: If the input doesn't represent a range or a list of ranges.
  """

  range_string = range_string.strip()
  if not range_string:
    return []

  if "inf" in range_string:
    range_string = re.sub(r"inf", repr(sys.float_info.max), range_string)

  ranges = ast.literal_eval(range_string)
  if isinstance(ranges, list) and not isinstance(ranges[0], list):
    ranges = [ranges]

  # Verify that ranges is a list of list of numbers.
  for item in ranges:
    if len(item) != 2:
      raise ValueError("Incorrect number of elements in range")
    elif not isinstance(item[0], (int, float)):
      raise ValueError("Incorrect type in the 1st element of range: %s" %
                       type(item[0]))
    elif not isinstance(item[1], (int, float)):
      raise ValueError("Incorrect type in the 2nd element of range: %s" %
                       type(item[0]))

  return ranges

def parse_memory_interval(interval_str):
  """Convert a human-readable memory interval to a tuple of start and end value.

  Args:
    interval_str: (`str`) A human-readable str representing an interval
      (e.g., "[10kB, 20kB]", "<100M", ">100G"). Only the units "kB", "MB", "GB"
      are supported. The "B character at the end of the input `str` may be
      omitted.

  Returns:
    `Interval` object where start and end are in bytes.

  Raises:
    ValueError: if the input is not valid.
  """
  str_interval = _parse_interval(interval_str)
  interval_start = 0
  interval_end = float("inf")
  if str_interval.start:
    interval_start = parse_readable_size_str(str_interval.start)
  if str_interval.end:
    interval_end = parse_readable_size_str(str_interval.end)
  if interval_start > interval_end:
    raise ValueError(
        "Invalid interval %s. Start of interval must be less than or equal "
        "to end of interval." % interval_str)
  return Interval(interval_start, str_interval.start_included,
                  interval_end, str_interval.end_included)

def parse_time_interval(interval_str):
  """Convert a human-readable time interval to a tuple of start and end value.

  Args:
    interval_str: (`str`) A human-readable str representing an interval
      (e.g., "[10us, 20us]", "<100s", ">100ms"). Supported time suffixes are
      us, ms, s.

  Returns:
    `Interval` object where start and end are in microseconds.

  Raises:
    ValueError: if the input is not valid.
  """
  str_interval = _parse_interval(interval_str)
  interval_start = 0
  interval_end = float("inf")
  if str_interval.start:
    interval_start = parse_readable_time_str(str_interval.start)
  if str_interval.end:
    interval_end = parse_readable_time_str(str_interval.end)
  if interval_start > interval_end:
    raise ValueError(
        "Invalid interval %s. Start must be before end of interval." %
        interval_str)
  return Interval(interval_start, str_interval.start_included,
                  interval_end, str_interval.end_included)

def _parse_interval(interval_str):
  """Convert a human-readable interval to a tuple of start and end value.

  Args:
    interval_str: (`str`) A human-readable str representing an interval
      (e.g., "[1M, 2M]", "<100k", ">100ms"). The items following the ">", "<",
      ">=" and "<=" signs have to start with a number (e.g., 3.0, -2, .98).
      The same requirement applies to the items in the parentheses or brackets.

  Returns:
    Interval object where start or end can be None
    if the range is specified as "<N" or ">N" respectively.

  Raises:
    ValueError: if the input is not valid.
  """
  interval_str = interval_str.strip()
  if interval_str.startswith("<="):
    if _NUMBER_PATTERN.match(interval_str[2:].strip()):
      return Interval(start=None, start_included=False,
                      end=interval_str[2:].strip(), end_included=True)
    else:
      raise ValueError("Invalid value string after <= in '%s'" % interval_str)
  if interval_str.startswith("<"):
    if _NUMBER_PATTERN.match(interval_str[1:].strip()):
      return Interval(start=None, start_included=False,
                      end=interval_str[1:].strip(), end_included=False)
    else:
      raise ValueError("Invalid value string after < in '%s'" % interval_str)
  if interval_str.startswith(">="):
    if _NUMBER_PATTERN.match(interval_str[2:].strip()):
      return Interval(start=interval_str[2:].strip(), start_included=True,
                      end=None, end_included=False)
    else:
      raise ValueError("Invalid value string after >= in '%s'" % interval_str)
  if interval_str.startswith(">"):
    if _NUMBER_PATTERN.match(interval_str[1:].strip()):
      return Interval(start=interval_str[1:].strip(), start_included=False,
                      end=None, end_included=False)
    else:
      raise ValueError("Invalid value string after > in '%s'" % interval_str)

  if (not interval_str.startswith(("[", "("))
      or not interval_str.endswith(("]", ")"))):
    raise ValueError(
        "Invalid interval format: %s. Valid formats are: [min, max], "
        "(min, max), <max, >min" % interval_str)
  interval = interval_str[1:-1].split(",")
  if len(interval) != 2:
    raise ValueError(
        "Incorrect interval format: %s. Interval should specify two values: "
        "[min, max] or (min, max)." % interval_str)

  start_item = interval[0].strip()
  if not _NUMBER_PATTERN.match(start_item):
    raise ValueError("Invalid first item in interval: '%s'" % start_item)
  end_item = interval[1].strip()
  if not _NUMBER_PATTERN.match(end_item):
    raise ValueError("Invalid second item in interval: '%s'" % end_item)

  return Interval(start=start_item,
                  start_included=(interval_str[0] == "["),
                  end=end_item,
                  end_included=(interval_str[-1] == "]"))

def parse_readable_size_str(size_str):
  """Convert a human-readable str representation to number of bytes.

  Only the units "kB", "MB", "GB" are supported. The "B character at the end
  of the input `str` may be omitted.

  Args:
    size_str: (`str`) A human-readable str representing a number of bytes
      (e.g., "0", "1023", "1.1kB", "24 MB", "23GB", "100 G".

  Returns:
    (`int`) The parsed number of bytes.

  Raises:
    ValueError: on failure to parse the input `size_str`.
  """

  size_str = size_str.strip()
  if size_str.endswith("B"):
    size_str = size_str[:-1]

  if size_str.isdigit():
    return int(size_str)
  elif size_str.endswith("k"):
    return int(float(size_str[:-1]) * 1024)
  elif size_str.endswith("M"):
    return int(float(size_str[:-1]) * 1048576)
  elif size_str.endswith("G"):
    return int(float(size_str[:-1]) * 1073741824)
  else:
    raise ValueError("Failed to parsed human-readable byte size str: \"%s\"" %
                     size_str)

def parse_readable_time_str(time_str):
  """Parses a time string in the format N, Nus, Nms, Ns.

  Args:
    time_str: (`str`) string consisting of an integer time value optionally
      followed by 'us', 'ms', or 's' suffix. If suffix is not specified,
      value is assumed to be in microseconds. (e.g. 100us, 8ms, 5s, 100).

  Returns:
    Microseconds value.
  """
  def parse_positive_float(value_str):
    value = float(value_str)
    if value < 0:
      raise ValueError(
          "Invalid time %s. Time value must be positive." % value_str)
    return value

  time_str = time_str.strip()
  if time_str.endswith("us"):
    return int(parse_positive_float(time_str[:-2]))
  elif time_str.endswith("ms"):
    return int(parse_positive_float(time_str[:-2]) * 1e3)
  elif time_str.endswith("s"):
    return int(parse_positive_float(time_str[:-1]) * 1e6)
  return int(parse_positive_float(time_str))

def evaluate_tensor_slice(tensor, tensor_slicing):
  """Call eval on the slicing of a tensor, with validation.

  Args:
    tensor: (numpy ndarray) The tensor value.
    tensor_slicing: (str or None) Slicing of the tensor, e.g., "[:, 1]". If
      None, no slicing will be performed on the tensor.

  Returns:
    (numpy ndarray) The sliced tensor.

  Raises:
    ValueError: If tensor_slicing is not a valid numpy ndarray slicing str.
  """

  _ = tensor

  if not validate_slicing_string(tensor_slicing):
    raise ValueError("Invalid tensor-slicing string.")

  return tensor[_parse_slices(tensor_slicing)]


text:
'use strict';

var crc16 = require('./crc16');
var crc32 = require('./crc32');
var model = require('./model');
var front = require('hexo-front-matter');
var fs = require('hexo-fs');

function org_get_abbrlink(data) {
    var r = data.content.match(/#\+ABBRLINK:.*\n/);
    if (r) {
        data.abbrlink = r[0].split(':')[1].trim();
    }
    else
    {
        data.abbrlink = ''
    }
        return data
}

let logic = function(data) {
    var log = this.log;
    if (data.layout == 'post') {
        let abbrlink
        if (!/.*\.org/.test(data.source)){
            abbrlink = data.abbrlink
        }
        else
        {
            abbrlink = org_get_abbrlink(data).abbrlink
        }
        if (!abbrlink) {
			var opt_alg = ((this.config.abbrlink && this.config.abbrlink.alg) ? this.config.abbrlink.alg : 'crc16');
			var opt_rep = ((this.config.abbrlink && this.config.abbrlink.rep) ? this.config.abbrlink.rep : 'dec')

			let res = (opt_alg == 'crc32' ? crc32.str(data.title) >>> 0 : crc16(data.title) >>> 0);
			//check this abbrlink is already exist then get a different one
			abbrlink = model.check(res);
			//set abbrlink to hex or dec
			abbrlink = opt_rep == 'hex' ? abbrlink.toString(16) : abbrlink;
            data.abbrlink = abbrlink;
            let postStr;
            if (!/.*\.org/.test(data.source)){
            //re parse front matter
            var tmpPost = front.parse(data.raw);
            //add new generated link
            tmpPost.abbrlink = abbrlink;
            //process post
                postStr = front.stringify(tmpPost);
            postStr = '---\n' + postStr;
            fs.writeFileSync(data.full_source, postStr, 'utf-8');
            }
            else
            {
                postStr = data.raw.split("\n")
                postStr.splice(2,0,'#+ABBRLINK: ' + abbrlink)
                fs.writeFileSync(data.full_source, postStr.join('\n'), 'utf-8');
            }
            log.i("Generate link %s for post [%s]", abbrlink, data.title);
        }
        model.add(abbrlink);
    }
    return data
}

module.exports = logic;


text:
<bill session="111" type="s" number="461" updated="2009-03-07T14:28:18-05:00">
	<status><introduced date="1235451600" datetime="2009-02-24"/></status>

	<introduced date="1235451600" datetime="2009-02-24"/>
	<titles>
		<title type="official" as="introduced">A bill to amend the Internal Revenue Code of 1986 to extend and modify the railroad track maintenance credit.</title>
	</titles>
	<sponsor id="300068"/>
	<cosponsors>
		<cosponsor id="300030" joined="2009-02-24"/>
	</cosponsors>
	<actions>
		<action date="1235451600" datetime="2009-02-24"><text>Read twice and referred to the Committee on Finance.</text></action>
	</actions>
	<committees>
		<committee name="Senate Finance" subcommittee="" activity="Referral, In Committee" />
	</committees>
	<relatedbills>
		<bill relation="identical" session="111" type="h" number="1132" />
	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>
	<summary>

	</summary>
</bill>


text:
checkurl () {
  url=$1
  curl $url -o /dev/null
  echo $?
}

service=$1
host=$2
port=$3

if [[ -z "$service" || -z "$host" ]]; then
  echo "UNKNOWN: Invalid arguments; Usage: check_webui.sh service_name host_name";
  exit 3;
fi

case "$service" in

jobtracker)
    jtweburl="http://$host:$port"
    if [[ `checkurl "$jtweburl"` -ne 0 ]]; then
      echo "WARNING: Jobtracker web UI not accessible : $jtweburl";
      exit 1;
    fi
    ;;
namenode)
    nnweburl="http://$host:$port"
    if [[ `checkurl "$nnweburl"` -ne 0 ]] ; then
      echo "WARNING: NameNode Web UI not accessible : $nnweburl";
      exit 1;
    fi
    ;;
jobhistory)
    jhweburl="http://$host:$port/jobhistoryhome.jsp"
    if [[ `checkurl "$jhweburl"` -ne 0 ]]; then
      echo "WARNING: HistoryServer Web UI not accessible : $jhweburl";
      exit 1;
    fi
    ;;
hbase)
    hbaseweburl="http://$host:$port/master-status"
    if [[ `checkurl "$hbaseweburl"` -ne 0 ]]; then
      echo "WARNING: HBase Master Web UI not accessible : $hbaseweburl";
      exit 1;
    fi
    ;;
resourcemanager)
    rmweburl="http://$host:$port/cluster"
    if [[ `checkurl "$rmweburl"` -ne 0 ]]; then
      echo "WARNING: ResourceManager Web UI not accessible : $rmweburl";
      exit 1;
    fi
    ;;
historyserver2)
    hsweburl="http://$host:$port/jobhistory"
    if [[ `checkurl "$hsweburl"` -ne 0 ]]; then
      echo "WARNING: HistoryServer Web UI not accessible : $hsweburl";
      exit 1;
    fi
    ;;
*) echo "UNKNOWN: Invalid service name [$service], valid options [jobtracker|jobhistory|hbase|namenode|resourcemanager|historyserver2]"
   exit 3
   ;;
esac

echo "OK: Successfully accessed $service Web UI"
exit 0;


text:
from pprint import pprint

from django.db import DatabaseError, transaction

def exec_reativa_pedido(cursor, pedido):

    def update_pedido():
        sql = f"""
            UPDATE PEDI_100 ped -- pedido de venda
            SET
              ped.STATUS_PEDIDO = 0
            , ped.COD_CANCELAMENTO = 0
            , ped.DATA_CANC_VENDA = ''
            , ped.VALOR_SALDO_PEDI = ped.VALOR_LIQ_ITENS
            WHERE 1=1
              AND ped.PEDIDO_VENDA = {pedido}
              AND ped.STATUS_PEDIDO <> 0
              AND ped.COD_CANCELAMENTO <> 0
              AND ped.DATA_CANC_VENDA IS NOT NULL
              AND ped.VALOR_SALDO_PEDI = 0
        """
        cursor.execute(sql)

    def update_itens():
        sql = f"""
            UPDATE PEDI_110 i -- item de pedido de venda
            SET
              i.COD_CANCELAMENTO = 0
            , i.DT_CANCELAMENTO = NULL
            WHERE 1=1
              AND i.PEDIDO_VENDA = {pedido}
              AND i.COD_CANCELAMENTO <> 0
              AND i.DT_CANCELAMENTO IS NOT NULL
        """
        cursor.execute(sql)

    try:
        with transaction.atomic():
            update_pedido()
            update_itens()
    except DatabaseError:
        return False

    return True


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements.  See the NOTICE file
distributed with this work for additional information
regarding copyright ownership.  The ASF licenses this file
to you 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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

	<modelVersion>4.0.0</modelVersion>

	<parent>
		<groupId>org.apache.flink</groupId>
		<artifactId>flink-table</artifactId>
		<version>1.17-SNAPSHOT</version>
	</parent>

	<artifactId>flink-table-api-java</artifactId>
	<name>Flink : Table : API Java</name>
	<description>
		This module contains the Table/SQL API for writing table programs
		within the table ecosystem using the Java programming language.
	</description>

	<packaging>jar</packaging>

	<dependencies>
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-table-common</artifactId>
			<version>${project.version}</version>
		</dependency>

		<!-- test dependencies -->

		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-table-common</artifactId>
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>

		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-core</artifactId>
			<version>${project.version}</version>
			<type>test-jar</type>
			<scope>test</scope>
		</dependency>
		<dependency>
			<groupId>org.apache.flink</groupId>
			<artifactId>flink-test-utils-junit</artifactId>
		</dependency>
	</dependencies>

	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-jar-plugin</artifactId>
				<executions>
					<execution>
						<goals>
							<goal>test-jar</goal>
						</goals>
					</execution>
				</executions>
				<configuration>
					<excludes>
						<!-- test-jar is still used by JUnit4 modules -->
						<exclude>META-INF/services/org.junit.jupiter.api.extension.Extension</exclude>
					</excludes>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>


text:
package com.javalearning.elasticsearchexample.repositories;

import com.javalearning.elasticsearchexample.model.Book;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

/**
 * Created by renqun.yuan on 2015/10/30.
 */
public interface BookRepository extends ElasticsearchRepository<Book, String> {
    Page<Book> findByName(String name, Pageable pageable);
}


text:
Kwc.Abstract.Image.ImageFile = Ext.extend(Kwf.Form.File, {

    _completeValue: null,

    afterRender: function() {
        Kwc.Abstract.Image.ImageFile.superclass.afterRender.call(this);
        this.deleteButton.setText(trlKwf('delete'));
        this.uploadButton.setText(trlKwf('Upload Image'));
    },

    getImageWidth: function () {
        return this._completeValue.imageWidth;
    },

    getImageHeight: function () {
        return this._completeValue.imageHeight;
    },

    setValue: function (value) {
        this._completeValue = value;
        if (value.uploadId) {
            this.uploadButton.setText(trlKwf('Change Image'));
        } else {
            this.uploadButton.setText(trlKwf('Upload Image'));
        }
        Kwc.Abstract.Image.ImageFile.superclass.setValue.call(this, value);
    }
});

Ext.reg('kwc.imagefile', Kwc.Abstract.Image.ImageFile);


text:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.wikimedia.commons"
    android:versionCode="9"
    android:versionName="1.0alpha1" >

    <uses-sdk
        android:minSdkVersion="9"
        android:targetSdkVersion="17" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
    <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
    <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
    <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
    <uses-permission android:name="android.permission.READ_SYNC_STATS"/>
    <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

    <application
        android:name=".CommonsApplication"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:supportsRtl="true" >
        <activity android:name="org.acra.CrashReportDialog"
                  android:theme="@android:style/Theme.Dialog"
                  android:launchMode="singleInstance"
                  android:excludeFromRecents="true"
                  android:finishOnTaskLaunch="true" />

        <activity
            android:name=".auth.LoginActivity"
            android:theme="@style/NoTitle" >
        </activity>
        <activity
            android:name=".ShareActivity"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            >
            <intent-filter>
                <action android:name="android.intent.action.SEND" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="audio/ogg" />
            </intent-filter>
        </activity>
        <activity
                android:name=".MultipleShareActivity"
                android:icon="@drawable/ic_launcher"
                android:label="@string/app_name"
                >
            <intent-filter>
                <action android:name="android.intent.action.SEND_MULTIPLE" />

                <category android:name="android.intent.category.DEFAULT" />

                <data android:mimeType="image/*" />
                <data android:mimeType="audio/ogg" />
            </intent-filter>
        </activity>

        <activity
                android:name=".contributions.ContributionsActivity"
                android:icon="@drawable/ic_launcher"
                android:label="@string/app_name"
                 >
            <intent-filter>
                <category android:name="android.intent.category.LAUNCHER"/>
                <action android:name="android.intent.action.MAIN"/>
             </intent-filter>
        </activity>
        <activity
            android:name=".SettingsActivity"
            android:label="@string/title_activity_settings"
            />
        <activity android:name=".AboutActivity" android:label="@string/title_activity_about"/>
        <service android:name="UploadService" >
        </service>
        <service
            android:name=".auth.WikiAccountAuthenticatorService"
            android:exported="true"
            android:process=":auth" >
            <intent-filter>
                <action android:name="android.accounts.AccountAuthenticator" />
            </intent-filter>

            <meta-data
                android:name="android.accounts.AccountAuthenticator"
                android:resource="@xml/authenticator" />
        </service>
        <service
                android:name=".contributions.ContributionsSyncService"
                android:exported="true">
            <intent-filter>
                <action
                        android:name="android.content.SyncAdapter" />
            </intent-filter>
            <meta-data
                    android:name="android.content.SyncAdapter"
                    android:resource="@xml/contributions_sync_adapter" />
        </service>

        <service
                android:name=".modifications.ModificationsSyncService"
                android:exported="true">
            <intent-filter>
                <action
                        android:name="android.content.SyncAdapter" />
            </intent-filter>
            <meta-data
                    android:name="android.content.SyncAdapter"
                    android:resource="@xml/modifications_sync_adapter" />
        </service>

        <provider
                android:name=".contributions.ContributionsContentProvider"
                android:label="@string/provider_contributions"
                android:syncable="true"
                android:authorities="org.wikimedia.commons.contributions.contentprovider"
                android:exported="false">
        </provider>
        <provider
                android:name=".modifications.ModificationsContentProvider"
                android:label="@string/provider_modifications"
                android:syncable="true"
                android:authorities="org.wikimedia.commons.modifications.contentprovider"
                android:exported="false">
        </provider>
        <provider
                android:name=".category.CategoryContentProvider"
                android:label="@string/provider_categories"
                android:syncable="false"
                android:authorities="org.wikimedia.commons.categories.contentprovider"
                android:exported="false">
        </provider>
    </application>

</manifest>


text:
Excon.defaults[:ssl_verify_peer] = false

module Gitlab
  module ExternalAuthorization
    class Client
      include ExternalAuthorization::Config

      REQUEST_HEADERS = {
        'Content-Type' => 'application/json',
        'Accept' => 'application/json'
      }.freeze

      def initialize(user, label)
        @user, @label = user, label
      end

      def request_access
        response = Gitlab::HTTP.post(
          service_url,
          post_params
        )
        ::Gitlab::ExternalAuthorization::Response.new(response)
      rescue *Gitlab::HTTP::HTTP_ERRORS => e
        raise ::Gitlab::ExternalAuthorization::RequestFailed.new(e)
      end

      private

      def allow_local_requests?
        Gitlab::CurrentSettings.allow_local_requests_from_system_hooks?
      end

      def post_params
        params = { headers: REQUEST_HEADERS,
                   body: body.to_json,
                   connect_timeout: timeout,
                   read_timeout: timeout,
                   write_timeout: timeout,
                   allow_local_requests: allow_local_requests? }

        if has_tls?
          params[:client_cert_data] = client_cert
          params[:client_key_data] = client_key
          params[:client_key_pass] = client_key_pass
        end

        params
      end

      def body
        @body ||= begin
                    body = {
                      user_identifier: @user.email,
                      project_classification_label: @label,
                      identities: @user.identities.map { |identity| { provider: identity.provider, extern_uid: identity.extern_uid } }
                    }

                    if @user.ldap_identity
                      body[:user_ldap_dn] = @user.ldap_identity.extern_uid
                    end

                    body
                  end
      end
    end
  end
end


text:
package com.github.deltaspikedbunit.teardown;

import com.github.deltaspikedbunit.annotation.DatabaseOperation;
import com.github.deltaspikedbunit.annotation.DatabaseTearDown;
import com.github.deltaspikedbunit.deltaspike.DatabaseNoRollbackTest;
import com.github.deltaspikedbunit.sample.inventory.entity.InventoryCategory;
import com.github.deltaspikedbunit.sample.inventory.repository.InventoryCategoryRepository;
import org.apache.deltaspike.testcontrol.api.junit.CdiTestRunner;
import org.junit.After;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;

import javax.inject.Inject;
import java.util.List;

@RunWith(CdiTestRunner.class)
@DatabaseNoRollbackTest
public class TruncateTearDownOnMethodTest {

    @Inject
    private InventoryCategoryRepository inventoryRepository;

    @Test
    @DatabaseTearDown(value = "../truncate-db.xml", type = DatabaseOperation.TRUNCATE_TABLE)
    public void test() throws Exception {
        List<InventoryCategory> categories = inventoryRepository.findAll();
        Assert.assertEquals(1, categories.size());
        Assert.assertEquals("existing_category", categories.get(0).getCategoryName());
    }

    @After
    public void afterTest() throws Exception {
        InventoryCategory category = inventoryRepository.findByName("existing_category");
        Assert.assertEquals(1000, category.getId());
        Assert.assertEquals(0, category.getItems().size());
    }

}


text:
var validate = require('/validation'),
    failedView,
    loginSuccess = function () {
      EveFinancial.StatusUpdatesPusher.pushNotification(EveFinancial.LoginSuccess);
      if (failedView !== undefined) {
        failedView.$().stop().hide('600');
      }
      EveFinancial.Router.router.transitionTo('dashboard');
    };

EveFinancial.User = Em.Object.create({
  /*  We treat a register the same as a login. The end result is the same - a logged in user
    even though it is possible we will hit the database with a new user */
  login: function (emailAddress, password) {
    ss.rpc('register.login', emailAddress, password, function (success) {
      if (!success) {
        /* There are two options here:
          1. Email address has already been taken for a new user.
          2. The password is wrong for the logged in user.
          We should just display that the login failed. */
        if (failedView === undefined) {
          failedView = EveFinancial.StatusUpdatesPusher.pushNotification(EveFinancial.LoginFailed);
        } else {
          failedView.rerender();
        }
      } else {
        loginSuccess();
      }
      setTimeout(function () {
        $('#register').text('Submit');
        $('#register').removeAttr('disabled');
      }, 500);
    });
    $('#register').text('Logging In');
    $('#register').attr('disabled', 'disabled');
  },
  sessionLogin: function () {
    ss.rpc('register.autologin', function (success) {
      if (success) {
        loginSuccess();
      }
    });
  }

});

EveFinancial.LoginFailed = EveFinancial.statusMessage.extend({
  alertType: 'alert-error alert alert-block',
  title: "Login Failed!",
  message: "The login details you have provided were incorrect. Please try again."
});

EveFinancial.LoginSuccess = EveFinancial.statusMessage.extend({
  alertType: 'alert-success alert alert-block',
  title: "Login Successful!",
  message: "Please use the enabled navigation menu to view your information."
});

EveFinancial.LoginView = Em.View.extend({
  templateName: 'user-register',
  didInsertElement: function () {
    ss.rpc('install.checkDb', function (success) {
      if (!success) {
        EveFinancial.get('router').transitionTo('install');
      } else {
        EveFinancial.User.sessionLogin();
        ss.rpc('eveapi.serverStatus.getStatus', function (result) {
          if (result.serveropen) {
            EveFinancial.ServerStatus.set('serverStatus', 'Online');
          } else {
            EveFinancial.ServerStatus.set('serverStatus', 'Offline');
          }
          EveFinancial.ServerStatus.set('onlinePlayers', result.onlineplayers);
        });
      }
    });
  }
});

EveFinancial.LoginController = Em.Controller.extend({
  register: function () {
    if (this.validate()) {
      EveFinancial.User.login($('#emailAddress').val(), $('#password').val());
    }
  },
  validate: function () {
    return (this.emailValidate() & this.passwordValidate());
  },
  emailValidate: function () {
    return validate.simpleValidate('#emailAddress');
  },
  passwordValidate: function () {
    return validate.simpleValidate('#password');
  },
  login: function () {
    EveFinancial.Router.router.transitionTo('login');
  }
});


text:
FROM gcr.io/oss-fuzz-base/base-builder

ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y -q && \
    apt-get update -y -q && \
    apt-get install -y -q --no-install-recommends \
        bison \
        build-essential \
        cmake \
        flex \
        libboost-all-dev \
        ninja-build \
        python3

RUN git clone --depth=1 --recurse-submodules \
    https://github.com/apache/arrow.git $SRC/arrow

COPY build.sh $SRC/


text:
namespace blimp {

TCPClientTransport::TCPClientTransport(const net::AddressList& addresses,
                                       net::NetLog* net_log)
    : addresses_(addresses), net_log_(net_log) {}

TCPClientTransport::~TCPClientTransport() {}

int TCPClientTransport::Connect(const net::CompletionCallback& callback) {
  DCHECK(!socket_);
  DCHECK(!callback.is_null());

  socket_.reset(
      new net::TCPClientSocket(addresses_, net_log_, net::NetLog::Source()));
  net::CompletionCallback completion_callback = base::Bind(
      &TCPClientTransport::OnTCPConnectComplete, base::Unretained(this));

  int result = socket_->Connect(completion_callback);
  if (result == net::ERR_IO_PENDING) {
    connect_callback_ = callback;
  } else if (result != net::OK) {
    socket_ = nullptr;
  }

  return result;
}

scoped_ptr<BlimpConnection> TCPClientTransport::TakeConnection() {
  DCHECK(connect_callback_.is_null());
  DCHECK(socket_);
  return make_scoped_ptr(new StreamSocketConnection(socket_.Pass()));
}

void TCPClientTransport::OnTCPConnectComplete(int result) {
  DCHECK(socket_);
  if (result != net::OK) {
    socket_ = nullptr;
  }
  base::ResetAndReturn(&connect_callback_).Run(result);
}

}  // namespace blimp


text: Start of restructured text documentation


text:
/*
* Based on the code from the following link:
* http://www.cs.uregina.ca/Links/class-info/170/07-templates/
*/

#ifndef MAIN_H_
#define MAIN_H_

template <typename Type>
void demoTemplate(Matrix<Type>&, Matrix<Type>&, Matrix<Type>&);

// Implementation

template <typename Type>
void demoTemplate(Matrix<Type>& M, Matrix<Type>& A, Matrix<Type>& B)
{

    M = A;
    cout << "\nMatrix set to the first matrix parameter" << endl;
    M.printMatrix();

    cout << "\nThe second Matrix parameter is:" << endl;
    B.printMatrix();

    M = M + B;

    cout << "\nMatrix incremented by second array" << endl;
    M.printMatrix();
}

#endif