text:
<?php

/**
 * Test suite for ezcConsoleArgument class.
 *
 * @package ConsoleTools
 * @subpackage Tests
 */
class ezcConsoleArgumentTest extends ezcTestCase
{

	public static function suite()
	{
		return new PHPUnit_Framework_TestSuite( "ezcConsoleArgumentTest" );
	}

    protected function setUp()
    {
    }

    public function testConstructorSuccess()
    {
        $arg = new ezcConsoleArgument(
            "testname",
            ezcConsoleInput::TYPE_INT,
            "Little short help",
            "Little long help",
            false,
            true,
            array( "test" )
        );
        $this->assertEquals( "testname", $arg->name );
        $this->assertEquals( ezcConsoleInput::TYPE_INT, $arg->type );
        $this->assertEquals( "Little short help", $arg->shorthelp );
        $this->assertEquals( "Little long help", $arg->longhelp );
        $this->assertEquals( false, $arg->mandatory );
        $this->assertEquals( array( "test" ), $arg->default );
        $this->assertEquals( true, $arg->multiple );
    }

    public function testConstructorFailure()
    {
        $exceptionThrown = false;
        try
        {
            $arg = new ezcConsoleArgument( 23 );
        }
        catch ( ezcBaseValueException $e )
        {
            $exceptionThrown = true;
        }
        $this->assertTrue( $exceptionThrown, "ezcBaseValueException not thrown on invalid name." );

        $exceptionThrown = false;
        try
        {
            $arg = new ezcConsoleArgument( "" );
        }
        catch ( ezcBaseValueException $e )
        {
            $exceptionThrown = true;
        }
        $this->assertTrue( $exceptionThrown, "ezcBaseValueException not thrown on invalid name." );
    }

    public function testGetAccessSuccess()
    {
        $arg = new ezcConsoleArgument( "testname" );
        $this->assertEquals( "testname", $arg->name );
        $this->assertEquals( ezcConsoleInput::TYPE_STRING, $arg->type );
        $this->assertEquals( "No help available.", $arg->shorthelp );
        $this->assertEquals( "There is no help for this argument available.", $arg->longhelp );
        $this->assertEquals( true, $arg->mandatory );
        $this->assertEquals( false, $arg->multiple );
        $this->assertEquals( null, $arg->default );
        $this->assertEquals( null, $arg->value );
    }

    public function testGetAccessFailure()
    {
        $arg = new ezcConsoleArgument( "testname" );
        try
        {
            echo $arg->foo;
        }
        catch ( ezcBasePropertyNotFoundException $e )
        {
            return;
        }
        $this->fail( "ezcBasePropertyNotFoundException not found on access to invalid property foo." );
    }

    public function testSetAccessSuccess()
    {
        $arg = new ezcConsoleArgument( "testname" );

        $this->assertSetProperty(
            $arg,
            "type",
            array( ezcConsoleInput::TYPE_STRING, ezcConsoleInput::TYPE_INT ),
            "ezcBaseValueException"
        );
        $this->assertSetProperty(
            $arg,
            "shorthelp",
            array( "", "foo" ),
            "ezcBaseValueException"
        );
        $this->assertSetProperty(
            $arg,
            "longhelp",
            array( "", "foo" ),
            "ezcBaseValueException"
        );
        $this->assertSetProperty(
            $arg,
            "mandatory",
            array( true, false ),
            "ezcBaseValueException"
        );
        $this->assertSetProperty(
            $arg,
            "multiple",
            array( true, false ),
            "ezcBaseValueException"
        );
        $this->assertSetProperty(
            $arg,
            "default",
            array( "", "foo", array( "foo", "bar" ), null ),
            "ezcBaseValueException"
        );
        $this->assertSetProperty(
            $arg,
            "value",
            array( "", "foo", array( "foo", "bar" ), null ),
            "ezcBaseValueException"
        );
    }

    public function testSetAccessFailure()
    {
        $arg = new ezcConsoleArgument( "testname" );

        $this->assertSetPropertyFails(
            $arg,
            "name",
            array( "", "foo", 1, true, array(), new stdClass() ),
            "ezcBasePropertyPermissionException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "type",
            array( "", "foo", 23, true, array(), new stdClass() ),
            "ezcBaseValueException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "shorthelp",
            array( 23, true, array(), new stdClass() ),
            "ezcBaseValueException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "longhelp",
            array( 23, true, array(), new stdClass() ),
            "ezcBaseValueException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "mandatory",
            array( "", "foo", 23, array(), new stdClass() ),
            "ezcBaseValueException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "multiple",
            array( "", "foo", 23, array(), new stdClass() ),
            "ezcBaseValueException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "default",
            array( new stdClass() ),
            "ezcBaseValueException"
        );
        $this->assertSetPropertyFails(
            $arg,
            "value",
            array( new stdClass() ),
            "ezcBaseValueException"
        );

        $this->assertSetPropertyFails(
            $arg,
            "foo",
            array( "foo" ),
            "ezcBasePropertyNotFoundException"
        );
    }
}
?>


text:
'use strict'

var isDefined = function (param) {
  return typeof param !== 'undefined';
}

/**
 * @deprecated will be changed in favor of isNotNull()
 * @param {Any} param
 */
var isDefinedAndNotNull = function (param) {
  return isNotNull(param);
}

/**
 * @deprecated will be changed in favor of isNotNaN()
 * @param {Any} param
 */
var isDefinedAndNotNaN = function (param) {
  return isNotNaN(param);
}

/**
 * @deprecated will be changed in favor of isNotEmpty()
 * @param {Any} param
 */
var isDefinedAndNotEmpty = function (param) {
  return isNotEmpty(param);
}

var isNotEmpty = function (param) {
  return (isDefinedAndNotNull(param) && param !== '');
}

var isNotNull = function (param) {
  return (isDefined(param) && param !== null);
}

var isEmpty = function (param) {
  return typeof param === 'undefined' || param === null || param == '';
}

var isNotNaN = function (param) {
  return (isDefinedAndNotNull(param) && !isNaN(param))
}

var isObject = function (param) {
  return (isDefinedAndNotNull(param) && typeof param === 'object')
}

var isFunction = function (param) {
  return (isDefinedAndNotNull(param) && typeof param === 'function')
}

var isNumber = function (param) {
  return (isDefinedAndNotNull(param) && !isNaN(parseFloat(param)) && isFinite(param))
}

module.exports = {
  isDefined: isDefined,
  isDefinedAndNotNull: isDefinedAndNotNull,
  isDefinedAndNotEmpty: isDefinedAndNotEmpty,
  isDefinedAndNotNaN: isDefinedAndNotNaN,
  isObject: isObject,
  isFunction: isFunction,
  isNumber: isNumber,
  isEmpty: isEmpty,
  isNotEmpty: isNotEmpty,
  isNotNaN: isNotNaN,
  isNotNull: isNotNull
}

redpajama_set_name: RedPajamaGithub


text:
#include "tensorflow/compiler/mlir/tensorflow/transforms/einsum.h"

#include <algorithm>
#include <cctype>
#include <climits>
#include <cstdint>

#include "absl/memory/memory.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Regex.h"
#include "mlir/Analysis/LoopAnalysis.h"  // from @llvm-project
#include "mlir/Dialect/StandardOps/IR/Ops.h"  // from @llvm-project
#include "mlir/IR/Attributes.h"  // from @llvm-project
#include "mlir/IR/OpImplementation.h"  // from @llvm-project
#include "mlir/IR/PatternMatch.h"  // from @llvm-project
#include "mlir/IR/StandardTypes.h"  // from @llvm-project
#include "mlir/Pass/Pass.h"  // from @llvm-project
#include "mlir/Support/LLVM.h"  // from @llvm-project
#include "mlir/Support/LogicalResult.h"  // from @llvm-project
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"  // from @llvm-project
#include "tensorflow/compiler/mlir/tensorflow/ir/tf_ops.h"
#include "tensorflow/compiler/mlir/tensorflow/utils/verification_utils.h"
#include "tensorflow/core/util/matmul_bcast.h"

namespace mlir {
namespace TF {

namespace {

TF::TransposeOp createTransposeOp(Value value, Location loc,
                                  llvm::ArrayRef<int32_t> permutation,
                                  PatternRewriter* rewriter) {
  auto value_type = value.getType().cast<RankedTensorType>();
  auto shape = value_type.getShape();
  auto perm_type = RankedTensorType::get(
      {static_cast<int32_t>(permutation.size())}, rewriter->getIntegerType(32));
  auto perm_attr = DenseElementsAttr::get(perm_type, permutation);
  auto perm_op = rewriter->create<ConstantOp>(loc, perm_type, perm_attr);
  SmallVector<int64_t, 4> transposed_shape(shape.begin(), shape.end());
  for (int i = 0, end = shape.size(); i < end; ++i) {
    transposed_shape[i] = shape[permutation[i]];
  }
  auto transposed_type =
      RankedTensorType::get(transposed_shape, value_type.getElementType());
  return rewriter->create<TF::TransposeOp>(loc, transposed_type, value,
                                           perm_op);
}

TF::ReshapeOp createReshapeOp(Value value, ArrayRef<int64_t> shape,
                              Type element_type, Location loc,
                              PatternRewriter* rewriter) {
  int64_t shape_rank = shape.size();
  auto shape_spec_type =
      RankedTensorType::get({shape_rank}, rewriter->getIntegerType(64));
  Type resultType = RankedTensorType::get(shape, element_type);
  auto constant_attr = DenseElementsAttr::get(shape_spec_type, shape);
  auto shape_tensor =
      rewriter->create<ConstantOp>(loc, shape_spec_type, constant_attr);
  return rewriter->create<TF::ReshapeOp>(loc, resultType, /*tensor=*/value,
                                         /*shape=*/shape_tensor);
}

struct EinsumDimensionNumbers {
  // Each field contains the list of dimensions appearing only in the specifed
  // arguments of the einsum op with natural ordering. For example `rhs_out`
  // contains the dimensions appearing in the RHS and the OUTPUT of the einsum
  // but not in the LHS.
  std::vector<int64_t> lhs;
  std::vector<int64_t> rhs;
  std::vector<std::tuple<int64_t, int64_t>> lhs_rhs;
  std::vector<std::tuple<int64_t, int64_t>> lhs_out;
  std::vector<std::tuple<int64_t, int64_t>> rhs_out;
  std::vector<std::tuple<int64_t, int64_t, int64_t>> lhs_rhs_out;
};

llvm::Optional<llvm::SmallDenseMap<char, int64_t>> EquationToMap(
    llvm::StringRef equation) {
  llvm::SmallDenseMap<char, int64_t> map;
  for (int64_t i = 0; i < equation.size(); ++i) {
    if (!std::isalpha(equation[i])) {
      // Unsupported character in the equation.
      return llvm::None;
    }
    if (map.count(equation[i])) {
      // Duplicate character in the equation.
      return llvm::None;
    }
    map.try_emplace(equation[i], i);
  }
  return map;
}

llvm::Optional<EinsumDimensionNumbers> GetEinsumDimensionNumbers(
    llvm::StringRef equation) {
  llvm::StringRef lhs_rhs;
  llvm::StringRef out;
  std::tie(lhs_rhs, out) = equation.split("->");
  if (lhs_rhs.empty() || out.empty()) return llvm::None;

  llvm::StringRef lhs;
  llvm::StringRef rhs;
  std::tie(lhs, rhs) = lhs_rhs.split(',');
  if (lhs.empty() || rhs.empty()) return llvm::None;

  auto lhs_map_or = EquationToMap(lhs);
  if (!lhs_map_or.hasValue()) return llvm::None;
  auto lhs_map = lhs_map_or.getValue();

  auto rhs_map_or = EquationToMap(rhs);
  if (!rhs_map_or.hasValue()) return llvm::None;
  auto rhs_map = rhs_map_or.getValue();

  auto out_map_or = EquationToMap(out);
  if (!out_map_or.hasValue()) return llvm::None;
  auto out_map = out_map_or.getValue();

  EinsumDimensionNumbers dnums;
  for (int64_t i = 0, e = lhs.size(); i < e; ++i) {
    auto rhs_index = rhs_map.find(lhs[i]);
    auto out_index = out_map.find(lhs[i]);
    if (rhs_index == rhs_map.end() && out_index == out_map.end()) {
      dnums.lhs.emplace_back(i);
    } else if (rhs_index == rhs_map.end()) {
      dnums.lhs_out.emplace_back(i, out_index->second);
    } else if (out_index == out_map.end()) {
      dnums.lhs_rhs.emplace_back(i, rhs_index->second);
    } else {
      dnums.lhs_rhs_out.emplace_back(i, rhs_index->second, out_index->second);
    }
  }
  for (int64_t i = 0, e = rhs.size(); i < e; ++i) {
    auto lhs_index = lhs_map.find(rhs[i]);
    auto out_index = out_map.find(rhs[i]);
    if (lhs_index == lhs_map.end()) {
      if (out_index == out_map.end()) {
        dnums.rhs.emplace_back(i);
      } else {
        dnums.rhs_out.emplace_back(i, out_index->second);
      }
    }
  }
  for (int64_t i = 0, e = out.size(); i < e; ++i) {
    auto lhs_index = lhs_map.find(out[i]);
    auto rhs_index = rhs_map.find(out[i]);
    if (lhs_index == lhs_map.end() && rhs_index == rhs_map.end()) {
      // out only isn't supported
      return llvm::None;
    }
  }
  return dnums;
}

std::vector<int64_t> inverseTransposeVector(
    llvm::ArrayRef<int64_t> input, llvm::ArrayRef<int32_t> permutation) {
  std::vector<int64_t> output(input.size());
  for (int64_t i = 0; i < input.size(); ++i) {
    output[permutation[i]] = input[i];
  }
  return output;
}

// Computes the transpositions required to convert dnums to one supported by
// tf.BatchMatmulV2 and returns the new set of dimension numbers with them.
LogicalResult transposeForBatchMatmul(
    const Location& loc, EinsumDimensionNumbers& dnums, Value* lhs, Value* rhs,
    std::vector<int32_t>* out_inverse_transpose, PatternRewriter* rewriter) {
  std::vector<int32_t> lhs_transpose;
  std::vector<int32_t> rhs_transpose;
  std::vector<int32_t> out_transpose;
  lhs_transpose.reserve(dnums.lhs_rhs_out.size() + dnums.lhs_out.size() +
                        dnums.lhs_rhs.size());
  rhs_transpose.reserve(dnums.lhs_rhs_out.size() + dnums.rhs_out.size() +
                        dnums.lhs_rhs.size());
  out_transpose.reserve(dnums.lhs_rhs_out.size() + dnums.lhs_out.size() +
                        dnums.rhs_out.size());
  for (int64_t i = 0, e = dnums.lhs_rhs_out.size(); i < e; ++i) {
    lhs_transpose.push_back(std::get<0>(dnums.lhs_rhs_out[i]));
    rhs_transpose.push_back(std::get<1>(dnums.lhs_rhs_out[i]));
    out_transpose.push_back(std::get<2>(dnums.lhs_rhs_out[i]));
    dnums.lhs_rhs_out[i] = std::make_tuple(i, i, i);
  }

  for (int64_t i = 0, e = dnums.lhs_out.size(); i < e; ++i) {
    lhs_transpose.push_back(std::get<0>(dnums.lhs_out[i]));
    out_transpose.push_back(std::get<1>(dnums.lhs_out[i]));
    dnums.lhs_out[i] =
        std::make_tuple(lhs_transpose.size() - 1, out_transpose.size() - 1);
  }
  for (int64_t i = 0, e = dnums.lhs_rhs.size(); i < e; ++i) {
    lhs_transpose.push_back(std::get<0>(dnums.lhs_rhs[i]));
    rhs_transpose.push_back(std::get<1>(dnums.lhs_rhs[i]));
    dnums.lhs_rhs[i] =
        std::make_tuple(lhs_transpose.size() - 1, rhs_transpose.size() - 1);
  }
  for (int64_t i = 0, e = dnums.rhs_out.size(); i < e; ++i) {
    rhs_transpose.push_back(std::get<0>(dnums.rhs_out[i]));
    out_transpose.push_back(std::get<1>(dnums.rhs_out[i]));
    dnums.rhs_out[i] =
        std::make_tuple(rhs_transpose.size() - 1, out_transpose.size() - 1);
  }

  out_inverse_transpose->resize(out_transpose.size());
  for (int64_t i = 0, e = out_transpose.size(); i < e; ++i) {
    out_inverse_transpose->at(out_transpose[i]) = i;
  }

  *lhs = createTransposeOp(*lhs, loc, lhs_transpose, rewriter);
  *rhs = createTransposeOp(*rhs, loc, rhs_transpose, rewriter);
  return success();
}

// Reshapes LHS and RHS to have B0,...,Bn,L,C and B0,...,Bn,C,R shape
// respectively while assuming that the initial shape for them is
// B0,...,Bn,L0,...,Ln,C0,...,Cn and B0,...,Bn,C0,...,Cn,R0,...,Rn respectively.
LogicalResult reshapeForBatchMatmul(const Location& loc,
                                    EinsumDimensionNumbers& dnums, Value* lhs,
                                    Value* rhs, std::vector<int64_t>* out_shape,
                                    PatternRewriter* rewriter) {
  RankedTensorType lhs_type = lhs->getType().cast<RankedTensorType>();
  RankedTensorType rhs_type = rhs->getType().cast<RankedTensorType>();

  std::vector<int64_t> lhs_shape;
  std::vector<int64_t> rhs_shape;
  lhs_shape.reserve(dnums.lhs_rhs_out.size() + dnums.lhs_out.size() + 1);
  rhs_shape.reserve(dnums.lhs_rhs_out.size() + 2);
  for (auto i : dnums.lhs_rhs_out) {
    int64_t b = lhs_type.getShape()[std::get<0>(i)];
    lhs_shape.push_back(b);
    rhs_shape.push_back(b);
    out_shape->push_back(b);
  }

  if (dnums.lhs_out.empty()) {
    lhs_shape.push_back(1);
    out_shape->push_back(1);
    dnums.lhs_out.emplace_back(lhs_shape.size() - 1, out_shape->size() - 1);
  } else if (dnums.lhs_rhs_out.empty()) {
    for (auto i : dnums.lhs_out) {
      int64_t b = lhs_type.getShape()[std::get<0>(i)];
      lhs_shape.push_back(b);
      out_shape->push_back(b);
    }
  } else {
    int64_t lhs_out_size = 1;
    for (auto i : dnums.lhs_out) {
      lhs_out_size *= lhs_type.getShape()[std::get<0>(i)];
    }
    lhs_shape.push_back(lhs_out_size);
    out_shape->push_back(lhs_out_size);
  }

  int64_t lhs_rhs_size = 1;
  for (auto i : dnums.lhs_rhs) {
    lhs_rhs_size *= lhs_type.getShape()[std::get<0>(i)];
  }
  lhs_shape.push_back(lhs_rhs_size);
  rhs_shape.push_back(lhs_rhs_size);

  int64_t rhs_size = 1;
  for (auto i : dnums.rhs_out) {
    rhs_size *= rhs_type.getShape()[std::get<0>(i)];
  }
  rhs_shape.push_back(rhs_size);
  out_shape->push_back(rhs_size);

  if (failed(VerifyShapeOfReshapeOp(lhs_shape)) ||
      failed(VerifyShapeOfReshapeOp(rhs_shape)))
    return failure();

  *lhs = createReshapeOp(*lhs, lhs_shape, lhs_type.getElementType(), loc,
                         rewriter);
  *rhs = createReshapeOp(*rhs, rhs_shape, rhs_type.getElementType(), loc,
                         rewriter);

  dnums.lhs_rhs.assign(
      {std::make_tuple(dnums.lhs_rhs_out.size() + dnums.lhs_out.size(),
                       dnums.lhs_rhs_out.size())});
  dnums.rhs_out.assign(
      {std::make_tuple(dnums.lhs_rhs_out.size() + dnums.lhs_out.size(),
                       dnums.lhs_rhs_out.size() + dnums.lhs_out.size())});
  return success();
}

LogicalResult rewriteToBatchMatmul(TF::EinsumOp op,
                                   EinsumDimensionNumbers dnums,
                                   PatternRewriter& rewriter) {
  if (!dnums.lhs.empty() || !dnums.rhs.empty()) return failure();

  auto inputs = op.inputs();
  if (inputs.size() != 2) return failure();
  Value lhs = inputs.front();
  Value rhs = inputs.back();

  RankedTensorType original_type =
      op.getResult().getType().dyn_cast_or_null<RankedTensorType>();
  if (!original_type) return failure();

  std::vector<int32_t> out_transpose;
  if (failed(transposeForBatchMatmul(op.getLoc(), dnums, &lhs, &rhs,
                                     &out_transpose, &rewriter)))
    return failure();

  std::vector<int64_t> matmul_shape;
  if (failed(reshapeForBatchMatmul(op.getLoc(), dnums, &lhs, &rhs,
                                   &matmul_shape, &rewriter)))
    return failure();

  std::vector<int64_t> reshape_shape =
      inverseTransposeVector(original_type.getShape(), out_transpose);
  if (failed(VerifyShapeOfReshapeOp(reshape_shape))) return failure();

  auto matmul_type =
      RankedTensorType::get(matmul_shape, original_type.getElementType());
  Value out = rewriter.create<TF::BatchMatMulV2Op>(
      op.getLoc(), matmul_type, lhs, rhs, rewriter.getBoolAttr(false),
      rewriter.getBoolAttr(false));

  out = createReshapeOp(out, reshape_shape, original_type.getElementType(),
                        op.getLoc(), &rewriter);
  out = createTransposeOp(out, op.getLoc(), out_transpose, &rewriter);

  rewriter.replaceOp(op, out);
  return success();
}

}  // namespace

LogicalResult ConvertTFEinsumOp::matchAndRewrite(
    TF::EinsumOp op, PatternRewriter& rewriter) const {
  const auto dnums_or = GetEinsumDimensionNumbers(op.equation());
  if (!dnums_or.hasValue()) return failure();
  const auto& dnums = dnums_or.getValue();

  RankedTensorType lhs =
      op.getOperand(0).getType().dyn_cast_or_null<RankedTensorType>();
  RankedTensorType rhs =
      op.getOperand(1).getType().dyn_cast_or_null<RankedTensorType>();
  if (!lhs || !rhs) return failure();

  return rewriteToBatchMatmul(op, dnums, rewriter);
}

// Transform Einsum to other TF Ops for the supported variants.
struct TransformEinsumPass
    : public PassWrapper<TransformEinsumPass, FunctionPass> {
  void runOnFunction() override;
};

void TransformEinsumPass::runOnFunction() {
  OwningRewritePatternList patterns;
  auto func = getFunction();

  patterns.insert<ConvertTFEinsumOp>(&getContext());
  applyPatternsAndFoldGreedily(func, std::move(patterns));
}

static PassRegistration<TransformEinsumPass> pass(
    "tf-einsum", "Transform Einsum to other TF Ops for the supported variants");

}  // namespace TF
}  // namespace mlir


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

<title>org.codehaus.groovy.runtime.dgmimpl (Groovy 2.1.7)</title>
<meta name="date" content="2013-09-05">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

org.codehaus.groovy.runtime.dgmimpl

Classes

NumberNumberDiv

NumberNumberMetaMethod

NumberNumberMetaMethod.NumberNumberCallSite

NumberNumberMinus

NumberNumberMultiply

NumberNumberPlus


text:
/*
 * Plugins
 */

var gulp = require('gulp');
var runSequence = require('run-sequence');
var logger = require('../utils/logger');

/*
 * Configuration
 */

var pathConfig = require('../config/gulp').paths;

/*
 * Task
 */

gulp.task('watch-development', function(done) {
  // Styles
  gulp.watch(pathConfig.sass, ['build-app-styles-development', 'build-vendor-styles-development']);

  // Scripts
  gulp.watch(pathConfig.scripts, ['build-app-scripts-development', 'document-app-scripts-development']);

  // Templates
  gulp.watch(pathConfig.templates, ['build-templates-development']);

  // Index
  gulp.watch(pathConfig.index, ['build-index-development']);
});


text:
package ui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GradientPaint;
import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import resources.PadConstants;
import ui.modules.MemoryInfo;

/**
 *
 * @author Mithusayel Murmu
 */
public class StatusPanel extends JPanel {
    private GradientPaint panelGradient;
    private int height;

    private MemoryInfo mem;
    private JLabel memLab;

    public StatusPanel(View view) {
        height = 24;

        Dimension dim = new Dimension(view.getWidth(), height);
        setPreferredSize(dim);

        setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Color.GRAY));

        memLab = new JLabel();
        mem = new MemoryInfo(height, memLab);
        setLayout(new FlowLayout());
        add(mem, BorderLayout.CENTER);
        add(memLab, BorderLayout.EAST);
    }

    public GradientPaint getPanelGradient() {
        if (panelGradient == null) {
            panelGradient = new GradientPaint(0, 0, PadConstants.PARENT_TOP_COLOR,
                    0, height, PadConstants.PARENT_BOT_COLOR);
        }

        return panelGradient;
    }

    @Override
    public void paintComponent(Graphics g) {
        Graphics2D g2 = (Graphics2D)g;

        g2.setPaint(getPanelGradient());
        g2.fillRect(0, 0, getWidth(), getHeight());
    }
}


text:
\hypertarget{classStack}{}\section{Stack$<$ T $>$ Class Template Reference}
\label{classStack}\index{Stack$<$ T $>$@{Stack$<$ T $>$}}

A L\+I\+FO template data structure; inherits from \hyperlink{classLinkedList}{Linked\+List}.

{\ttfamily \#include $<$Stack.\+hpp$>$}

Inheritance diagram for Stack$<$ T $>$\+:
% FIG 0

Collaboration diagram for Stack$<$ T $>$\+:
% FIG 1
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item
\hyperlink{classStack_aefee698059467258bbd79045aca62a63}{Stack} ()
\begin{DoxyCompactList}\small\item\em Initializes the \hyperlink{classStack}{Stack}. \end{DoxyCompactList}\item
void \hyperlink{classStack_a834448898d90c3e34d83cd281f014c29}{Push} (T \&new\+Item)
\begin{DoxyCompactList}\small\item\em Adds a new item to the top of the \hyperlink{classStack}{Stack}. \end{DoxyCompactList}\item
void \hyperlink{classStack_a197a49c3d95c29649cf35f756999c612}{Pop} ()
\begin{DoxyCompactList}\small\item\em Removes the top-\/most item. \end{DoxyCompactList}\item
T \& \hyperlink{classStack_a5f32282a27e73107035201f6a5568822}{Top} ()
\begin{DoxyCompactList}\small\item\em Returns the top-\/most item. \end{DoxyCompactList}\end{DoxyCompactItemize}

\subsection{Detailed Description}
\subsubsection*{template$<$typename T$>$\\*
class Stack$<$ T $>$}

A L\+I\+FO template data structure; inherits from \hyperlink{classLinkedList}{Linked\+List}.

Definition at line 8 of file Stack.\+hpp.

\subsection{Constructor \& Destructor Documentation}
\index{Stack@{Stack}!Stack@{Stack}}
\index{Stack@{Stack}!Stack@{Stack}}
\subsubsection[{\texorpdfstring{Stack()}{Stack()}}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ {\bf Stack}$<$ T $>$\+::{\bf Stack} (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\hypertarget{classStack_aefee698059467258bbd79045aca62a63}{}\label{classStack_aefee698059467258bbd79045aca62a63}

Initializes the \hyperlink{classStack}{Stack}.

Nothing needs to be added in here; it will already call the \hyperlink{classLinkedList}{Linked\+List}\textquotesingle{}s constructor.

Definition at line 16 of file Stack.\+hpp.

\begin{DoxyCode}
16             : \hyperlink{classLinkedList}{LinkedList<T>}()
17     \{
18     \}
\end{DoxyCode}

\subsection{Member Function Documentation}
\index{Stack@{Stack}!Pop@{Pop}}
\index{Pop@{Pop}!Stack@{Stack}}
\subsubsection[{\texorpdfstring{Pop()}{Pop()}}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ void {\bf Stack}$<$ T $>$\+::Pop (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\hypertarget{classStack_a197a49c3d95c29649cf35f756999c612}{}\label{classStack_a197a49c3d95c29649cf35f756999c612}

Removes the top-\/most item.

Calls the Pop\+Back function from \hyperlink{classLinkedList}{Linked\+List}.

\begin{DoxyReturn}{Returns}
$<$void$>$
\end{DoxyReturn}

Definition at line 37 of file Stack.\+hpp.

\begin{DoxyCode}
38     \{
39     \}
\end{DoxyCode}
\index{Stack@{Stack}!Push@{Push}}
\index{Push@{Push}!Stack@{Stack}}
\subsubsection[{\texorpdfstring{Push(\+T \&new\+Item)}{Push(T &newItem)}}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ void {\bf Stack}$<$ T $>$\+::Push (
\begin{DoxyParamCaption}
\item[{T \&}]{new\+Item}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\hypertarget{classStack_a834448898d90c3e34d83cd281f014c29}{}\label{classStack_a834448898d90c3e34d83cd281f014c29}

Adds a new item to the top of the \hyperlink{classStack}{Stack}.

New item to add to the \hyperlink{classLinkedList}{Linked\+List} via the Push\+Back function.

\begin{DoxyParams}{Parameters}
{\em $<$\+T\&$>$} & new\+Item \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
$<$void$>$
\end{DoxyReturn}

Definition at line 27 of file Stack.\+hpp.

\begin{DoxyCode}
28     \{
29     \}
\end{DoxyCode}
\index{Stack@{Stack}!Top@{Top}}
\index{Top@{Top}!Stack@{Stack}}
\subsubsection[{\texorpdfstring{Top()}{Top()}}]{\setlength{\rightskip}{0pt plus 5cm}template$<$typename T $>$ T\& {\bf Stack}$<$ T $>$\+::Top (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily [inline]}}\hypertarget{classStack_a5f32282a27e73107035201f6a5568822}{}\label{classStack_a5f32282a27e73107035201f6a5568822}

Returns the top-\/most item.

Returns the top-\/most item by using Get\+Back from the \hyperlink{classLinkedList}{Linked\+List}.

\begin{DoxyReturn}{Returns}
$<$T\&$>$
\end{DoxyReturn}

Definition at line 47 of file Stack.\+hpp.

\begin{DoxyCode}
48     \{
49     \}
\end{DoxyCode}

The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item
Data\+Structures/\hyperlink{Stack_8hpp}{Stack.\+hpp}\end{DoxyCompactItemize}


text: export default (obj) => obj !== null && typeof obj === 'object' && !Array.isArray(obj);


text:
<?php

namespace Complex;

class Exception extends \Exception
{
}


text:
require 'rubygems'
require 'test/unit'
require 'active_model'
require 'cnpj_validator'
require 'ostruct'

class Company < OpenStruct
  include ActiveModel::Validations
  validates :cnpj, :cnpj => true
end


text:
//===-- MainThreadCheckerRuntime.cpp ----------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#include "MainThreadCheckerRuntime.h"

#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/Variable.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/InstrumentationRuntimeStopInfo.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/RegularExpression.h"
#include "Plugins/Process/Utility/HistoryThread.h"

using namespace lldb;
using namespace lldb_private;

MainThreadCheckerRuntime::~MainThreadCheckerRuntime() {
  Deactivate();
}

lldb::InstrumentationRuntimeSP
MainThreadCheckerRuntime::CreateInstance(const lldb::ProcessSP &process_sp) {
  return InstrumentationRuntimeSP(new MainThreadCheckerRuntime(process_sp));
}

void MainThreadCheckerRuntime::Initialize() {
  PluginManager::RegisterPlugin(
      GetPluginNameStatic(), "MainThreadChecker instrumentation runtime plugin.",
      CreateInstance, GetTypeStatic);
}

void MainThreadCheckerRuntime::Terminate() {
  PluginManager::UnregisterPlugin(CreateInstance);
}

lldb_private::ConstString MainThreadCheckerRuntime::GetPluginNameStatic() {
  return ConstString("MainThreadChecker");
}

lldb::InstrumentationRuntimeType MainThreadCheckerRuntime::GetTypeStatic() {
  return eInstrumentationRuntimeTypeMainThreadChecker;
}

const RegularExpression &
MainThreadCheckerRuntime::GetPatternForRuntimeLibrary() {
  static RegularExpression regex(llvm::StringRef("libMainThreadChecker.dylib"));
  return regex;
}

bool MainThreadCheckerRuntime::CheckIfRuntimeIsValid(
    const lldb::ModuleSP module_sp) {
  static ConstString test_sym("__main_thread_checker_on_report");
  const Symbol *symbol =
      module_sp->FindFirstSymbolWithNameAndType(test_sym, lldb::eSymbolTypeAny);
  return symbol != nullptr;
}

StructuredData::ObjectSP
MainThreadCheckerRuntime::RetrieveReportData(ExecutionContextRef exe_ctx_ref) {
  ProcessSP process_sp = GetProcessSP();
  if (!process_sp)
    return StructuredData::ObjectSP();

  ThreadSP thread_sp = exe_ctx_ref.GetThreadSP();
  StackFrameSP frame_sp = thread_sp->GetSelectedFrame();
  ModuleSP runtime_module_sp = GetRuntimeModuleSP();
  Target &target = process_sp->GetTarget();

  if (!frame_sp)
    return StructuredData::ObjectSP();

  RegisterContextSP regctx_sp = frame_sp->GetRegisterContext();
  if (!regctx_sp)
    return StructuredData::ObjectSP();

  const RegisterInfo *reginfo = regctx_sp->GetRegisterInfoByName("arg1");
  if (!reginfo)
    return StructuredData::ObjectSP();

  uint64_t apiname_ptr = regctx_sp->ReadRegisterAsUnsigned(reginfo, 0);
  if (!apiname_ptr)
    return StructuredData::ObjectSP();

  std::string apiName = "";
  Status read_error;
  target.ReadCStringFromMemory(apiname_ptr, apiName, read_error);
  if (read_error.Fail())
    return StructuredData::ObjectSP();

  std::string className = "";
  std::string selector = "";
  if (apiName.substr(0, 2) == "-[") {
    size_t spacePos = apiName.find(" ");
    if (spacePos != std::string::npos) {
      className = apiName.substr(2, spacePos - 2);
      selector = apiName.substr(spacePos + 1, apiName.length() - spacePos - 2);
    }
  }

  // Gather the PCs of the user frames in the backtrace.
  StructuredData::Array *trace = new StructuredData::Array();
  auto trace_sp = StructuredData::ObjectSP(trace);
  StackFrameSP responsible_frame;
  for (unsigned I = 0; I < thread_sp->GetStackFrameCount(); ++I) {
    StackFrameSP frame = thread_sp->GetStackFrameAtIndex(I);
    Address addr = frame->GetFrameCodeAddress();
    if (addr.GetModule() == runtime_module_sp) // Skip PCs from the runtime.
      continue;

    // The first non-runtime frame is responsible for the bug.
    if (!responsible_frame)
      responsible_frame = frame;

    // First frame in stacktrace should point to a real PC, not return address.
    if (I != 0 && trace->GetSize() == 0) {
      addr.Slide(-1);
    }

    lldb::addr_t PC = addr.GetLoadAddress(&target);
    trace->AddItem(StructuredData::ObjectSP(new StructuredData::Integer(PC)));
  }

  auto *d = new StructuredData::Dictionary();
  auto dict_sp = StructuredData::ObjectSP(d);
  d->AddStringItem("instrumentation_class", "MainThreadChecker");
  d->AddStringItem("api_name", apiName);
  d->AddStringItem("class_name", className);
  d->AddStringItem("selector", selector);
  d->AddStringItem("description",
                   apiName + " must be used from main thread only");
  d->AddIntegerItem("tid", thread_sp->GetIndexID());
  d->AddItem("trace", trace_sp);
  return dict_sp;
}

bool MainThreadCheckerRuntime::NotifyBreakpointHit(
    void *baton, StoppointCallbackContext *context, user_id_t break_id,
    user_id_t break_loc_id) {
  assert(baton && "null baton");
  if (!baton)
    return false; //< false => resume execution.

  MainThreadCheckerRuntime *const instance =
      static_cast<MainThreadCheckerRuntime *>(baton);

  ProcessSP process_sp = instance->GetProcessSP();
  ThreadSP thread_sp = context->exe_ctx_ref.GetThreadSP();
  if (!process_sp || !thread_sp ||
      process_sp != context->exe_ctx_ref.GetProcessSP())
    return false;

  if (process_sp->GetModIDRef().IsLastResumeForUserExpression())
    return false;

  StructuredData::ObjectSP report =
      instance->RetrieveReportData(context->exe_ctx_ref);

  if (report) {
    std::string description = report->GetAsDictionary()
                                ->GetValueForKey("description")
                                ->GetAsString()
                                ->GetValue();
    thread_sp->SetStopInfo(
        InstrumentationRuntimeStopInfo::CreateStopReasonWithInstrumentationData(
            *thread_sp, description, report));
    return true;
  }

  return false;
}

void MainThreadCheckerRuntime::Activate() {
  if (IsActive())
    return;

  ProcessSP process_sp = GetProcessSP();
  if (!process_sp)
    return;

  ModuleSP runtime_module_sp = GetRuntimeModuleSP();

  ConstString symbol_name("__main_thread_checker_on_report");
  const Symbol *symbol = runtime_module_sp->FindFirstSymbolWithNameAndType(
      symbol_name, eSymbolTypeCode);

  if (symbol == nullptr)
    return;

  if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid())
    return;

  Target &target = process_sp->GetTarget();
  addr_t symbol_address = symbol->GetAddressRef().GetOpcodeLoadAddress(&target);

  if (symbol_address == LLDB_INVALID_ADDRESS)
    return;

  Breakpoint *breakpoint =
      process_sp->GetTarget()
          .CreateBreakpoint(symbol_address, /*internal=*/true,
                            /*hardware=*/false)
          .get();
  breakpoint->SetCallback(MainThreadCheckerRuntime::NotifyBreakpointHit, this,
                          true);
  breakpoint->SetBreakpointKind("main-thread-checker-report");
  SetBreakpointID(breakpoint->GetID());

  SetActive(true);
}

void MainThreadCheckerRuntime::Deactivate() {
  SetActive(false);

  auto BID = GetBreakpointID();
  if (BID == LLDB_INVALID_BREAK_ID)
    return;

  if (ProcessSP process_sp = GetProcessSP()) {
    process_sp->GetTarget().RemoveBreakpointByID(BID);
    SetBreakpointID(LLDB_INVALID_BREAK_ID);
  }
}

lldb::ThreadCollectionSP
MainThreadCheckerRuntime::GetBacktracesFromExtendedStopInfo(
    StructuredData::ObjectSP info) {
  ThreadCollectionSP threads;
  threads.reset(new ThreadCollection());

  ProcessSP process_sp = GetProcessSP();

  if (info->GetObjectForDotSeparatedPath("instrumentation_class")
      ->GetStringValue() != "MainThreadChecker")
    return threads;

  std::vector<lldb::addr_t> PCs;
  auto trace = info->GetObjectForDotSeparatedPath("trace")->GetAsArray();
  trace->ForEach([&PCs](StructuredData::Object *PC) -> bool {
    PCs.push_back(PC->GetAsInteger()->GetValue());
    return true;
  });

  if (PCs.empty())
    return threads;

  StructuredData::ObjectSP thread_id_obj =
      info->GetObjectForDotSeparatedPath("tid");
  tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0;

  uint32_t stop_id = 0;
  bool stop_id_is_valid = false;
  HistoryThread *history_thread =
      new HistoryThread(*process_sp, tid, PCs, stop_id, stop_id_is_valid);
  ThreadSP new_thread_sp(history_thread);

  // Save this in the Process' ExtendedThreadList so a strong pointer retains
  // the object
  process_sp->GetExtendedThreadList().AddThread(new_thread_sp);
  threads->AddThread(new_thread_sp);

  return threads;
}


text:
#include "minunit.h"
#include "stdio.h"
#include "polarssl/x509_crt.h"
#include "polarssl/error.h"
char *test_SSL_verify_cert()
{

    x509_crt crt;
    memset( &crt, 0, sizeof crt );

    x509_crt ca_crt;
    memset( &ca_crt, 0, sizeof ca_crt );

    x509_crl crl;
    memset( &crl, 0, sizeof crl );

    int ret = 0;

    ret =x509_crt_parse_file( &crt, "tests/ca/certs/m2-cert.pem" );

    mu_assert(ret == 0, "failed to parse cert m2-cert.pem");

    ret =x509_crt_parse_file( &ca_crt, "tests/ca/none.pem" );

    mu_assert(ret != 0, "failed to fail on non-existent pem none.pem");

    ret =x509_crt_parse_file( &ca_crt, "tests/ca/cacert.pem" );

    mu_assert(ret == 0, "failed to parse cert cacert.pem");

    ret =x509_crl_parse_file( &crl, "tests/ca/crl.pem" );

    mu_assert(ret == 0, "failed to parse cert crl.pem");

    /*
     * Validate the cert.  Since these certs are only valid within a certain time period, this test
     * will fail when the current time is outside this period.  To avoid false failures (eg. when
     * building/testing this version of the software in the distant future), adjust the expected
     * test outcome accordingly.  However, log the failure to stderr so that the maintainer can
     * detect the expiry of the cert, and generate/commit a new one from time to time.
     */
    int flags = 0;
    ret =x509_crt_verify( &crt, &ca_crt, NULL, NULL, &flags, NULL, NULL);
    if ( ret ) {
	char buf[1024];
	buf[0] = 0;
	polarssl_strerror( ret, buf, sizeof buf );
	fprintf( stderr, "*** x509_crt_verify of m2-cert.pem: %d: %s\n", ret, buf );
    }
    int valid_from = x509_time_expired( &crt.valid_from );
    int valid_to   = x509_time_expired( &crt.valid_to );

    int expected = 0;
    if ( valid_from == BADCERT_EXPIRED && valid_to == BADCERT_EXPIRED ) {
	/*
	 * This cert hasn't yet become active, or has already expired; expect
	 * X509 cert failure (-0x2700)
	 */
	fprintf( stderr, "*** x509_crt_verify WILL FAIL because current data is outside: valid_from '%d/%d/%d %d:%d:%d': %d, valid_to '%d/%d/%d %d:%d:%d': %d\n",
	       crt.valid_from.year, crt.valid_from.mon, crt.valid_from.day, crt.valid_from.hour, crt.valid_from.min, crt.valid_from.sec, valid_from,
	       crt.valid_to  .year, crt.valid_to  .mon, crt.valid_to  .day, crt.valid_to  .hour, crt.valid_to  .min, crt.valid_to  .sec, valid_to );
	fprintf( stderr, "*** If this is the currently supported version, generate and commit a new tests/ca/m2-cert.pem with valid dates\n" );
	expected = POLARSSL_ERR_X509_CERT_VERIFY_FAILED;
    }
    mu_assert(ret == expected, "failed to verify cert m2-cert.pem");

    x509_crt_free( &crt );
    x509_crt_free( &ca_crt );
    x509_crl_free( &crl );

    return NULL;
}

char * all_tests() {
    mu_suite_start();

    mu_run_test(test_SSL_verify_cert);

    return NULL;
}

RUN_TESTS(all_tests);


text:
export = TerserPlugin;
/** @typedef {import("schema-utils/declarations/validate").Schema} Schema */
/** @typedef {import("webpack").Compiler} Compiler */
/** @typedef {import("webpack").Compilation} Compilation */
/** @typedef {import("webpack").WebpackError} WebpackError */
/** @typedef {import("webpack").Asset} Asset */
/** @typedef {import("./utils.js").TerserECMA} TerserECMA */
/** @typedef {import("./utils.js").TerserOptions} TerserOptions */
/** @typedef {import("jest-worker").Worker} JestWorker */
/** @typedef {import("source-map").RawSourceMap} RawSourceMap */
/** @typedef {RegExp | string} Rule */
/** @typedef {Rule[] | Rule} Rules */
/**
 * @callback ExtractCommentsFunction
 * @param {any} astNode
 * @param {{ value: string, type: 'comment1' | 'comment2' | 'comment3' | 'comment4', pos: number, line: number, col: number }} comment
 * @returns {boolean}
 */
/**
 * @typedef {boolean | 'all' | 'some' | RegExp | ExtractCommentsFunction} ExtractCommentsCondition
 */
/**
 * @typedef {string | ((fileData: any) => string)} ExtractCommentsFilename
 */
/**
 * @typedef {boolean | string | ((commentsFile: string) => string)} ExtractCommentsBanner
 */
/**
 * @typedef {Object} ExtractCommentsObject
 * @property {ExtractCommentsCondition} [condition]
 * @property {ExtractCommentsFilename} [filename]
 * @property {ExtractCommentsBanner} [banner]
 */
/**
 * @typedef {ExtractCommentsCondition | ExtractCommentsObject} ExtractCommentsOptions
 */
/**
 * @typedef {Object} MinimizedResult
 * @property {string} code
 * @property {RawSourceMap} [map]
 * @property {Array<Error | string>} [errors]
 * @property {Array<Error | string>} [warnings]
 * @property {Array<string>} [extractedComments]
 */
/**
 * @typedef {{ [file: string]: string }} Input
 */
/**
 * @typedef {{ [key: string]: any }} CustomOptions
 */
/**
 * @template T
 * @typedef {T extends infer U ? U : CustomOptions} InferDefaultType
 */
/**
 * @typedef {Object} PredefinedOptions
 * @property {boolean} [module]
 * @property {TerserECMA} [ecma]
 */
/**
 * @template T
 * @typedef {PredefinedOptions & InferDefaultType<T>} MinimizerOptions
 */
/**
 * @template T
 * @callback BasicMinimizerImplementation
 * @param {Input} input
 * @param {RawSourceMap | undefined} sourceMap
 * @param {MinimizerOptions<T>} minifyOptions
 * @param {ExtractCommentsOptions | undefined} extractComments
 * @returns {Promise<MinimizedResult>}
 */
/**
 * @typedef {object} MinimizeFunctionHelpers
 * @property {() => string | undefined} [getMinimizerVersion]
 */
/**
 * @template T
 * @typedef {BasicMinimizerImplementation<T> & MinimizeFunctionHelpers} MinimizerImplementation
 */
/**
 * @template T
 * @typedef {Object} InternalOptions
 * @property {string} name
 * @property {string} input
 * @property {RawSourceMap | undefined} inputSourceMap
 * @property {ExtractCommentsOptions | undefined} extractComments
 * @property {{ implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> }} minimizer
 */
/**
 * @template T
 * @typedef {JestWorker & { transform: (options: string) => MinimizedResult, minify: (options: InternalOptions<T>) => MinimizedResult }} MinimizerWorker
 */
/**
 * @typedef {undefined | boolean | number} Parallel
 */
/**
 * @typedef {Object} BasePluginOptions
 * @property {Rules} [test]
 * @property {Rules} [include]
 * @property {Rules} [exclude]
 * @property {ExtractCommentsOptions} [extractComments]
 * @property {Parallel} [parallel]
 */
/**
 * @template T
 * @typedef {T extends TerserOptions ? { minify?: MinimizerImplementation<T> | undefined, terserOptions?: MinimizerOptions<T> | undefined } : { minify: MinimizerImplementation<T>, terserOptions?: MinimizerOptions<T> | undefined }} DefinedDefaultMinimizerAndOptions
 */
/**
 * @template T
 * @typedef {BasePluginOptions & { minimizer: { implementation: MinimizerImplementation<T>, options: MinimizerOptions<T> } }} InternalPluginOptions
 */
/**
 * @template [T=TerserOptions]
 */
declare class TerserPlugin<T = import("terser").MinifyOptions> {
  /**
   * @private
   * @param {any} input
   * @returns {boolean}
   */
  private static isSourceMap;
  /**
   * @private
   * @param {unknown} warning
   * @param {string} file
   * @returns {Error}
   */
  private static buildWarning;
  /**
   * @private
   * @param {any} error
   * @param {string} file
   * @param {SourceMapConsumer} [sourceMap]
   * @param {Compilation["requestShortener"]} [requestShortener]
   * @returns {Error}
   */
  private static buildError;
  /**
   * @private
   * @param {Parallel} parallel
   * @returns {number}
   */
  private static getAvailableNumberOfCores;
  /**
   * @private
   * @param {any} environment
   * @returns {TerserECMA}
   */
  private static getEcmaVersion;
  /**
   * @param {BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>} [options]
   */
  constructor(
    options?:
      | (BasePluginOptions & DefinedDefaultMinimizerAndOptions<T>)
      | undefined
  );
  /**
   * @private
   * @type {InternalPluginOptions<T>}
   */
  private options;
  /**
   * @private
   * @param {Compiler} compiler
   * @param {Compilation} compilation
   * @param {Record<string, import("webpack").sources.Source>} assets
   * @param {{availableNumberOfCores: number}} optimizeOptions
   * @returns {Promise<void>}
   */
  private optimize;
  /**
   * @param {Compiler} compiler
   * @returns {void}
   */
  apply(compiler: Compiler): void;
}
declare namespace TerserPlugin {
  export {
    terserMinify,
    uglifyJsMinify,
    swcMinify,
    esbuildMinify,
    Schema,
    Compiler,
    Compilation,
    WebpackError,
    Asset,
    TerserECMA,
    TerserOptions,
    JestWorker,
    RawSourceMap,
    Rule,
    Rules,
    ExtractCommentsFunction,
    ExtractCommentsCondition,
    ExtractCommentsFilename,
    ExtractCommentsBanner,
    ExtractCommentsObject,
    ExtractCommentsOptions,
    MinimizedResult,
    Input,
    CustomOptions,
    InferDefaultType,
    PredefinedOptions,
    MinimizerOptions,
    BasicMinimizerImplementation,
    MinimizeFunctionHelpers,
    MinimizerImplementation,
    InternalOptions,
    MinimizerWorker,
    Parallel,
    BasePluginOptions,
    DefinedDefaultMinimizerAndOptions,
    InternalPluginOptions,
  };
}
type Compiler = import("webpack").Compiler;
type BasePluginOptions = {
  test?: Rules | undefined;
  include?: Rules | undefined;
  exclude?: Rules | undefined;
  extractComments?: ExtractCommentsOptions | undefined;
  parallel?: Parallel;
};
type DefinedDefaultMinimizerAndOptions<T> = T extends TerserOptions
  ? {
      minify?: MinimizerImplementation<T> | undefined;
      terserOptions?: MinimizerOptions<T> | undefined;
    }
  : {
      minify: MinimizerImplementation<T>;
      terserOptions?: MinimizerOptions<T> | undefined;
    };
import { terserMinify } from "./utils";
import { uglifyJsMinify } from "./utils";
import { swcMinify } from "./utils";
import { esbuildMinify } from "./utils";
type Schema = import("schema-utils/declarations/validate").Schema;
type Compilation = import("webpack").Compilation;
type WebpackError = import("webpack").WebpackError;
type Asset = import("webpack").Asset;
type TerserECMA = import("./utils.js").TerserECMA;
type TerserOptions = import("./utils.js").TerserOptions;
type JestWorker = import("jest-worker").Worker;
type RawSourceMap = import("source-map").RawSourceMap;
type Rule = RegExp | string;
type Rules = Rule[] | Rule;
type ExtractCommentsFunction = (
  astNode: any,
  comment: {
    value: string;
    type: "comment1" | "comment2" | "comment3" | "comment4";
    pos: number;
    line: number;
    col: number;
  }
) => boolean;
type ExtractCommentsCondition =
  | boolean
  | "all"
  | "some"
  | RegExp
  | ExtractCommentsFunction;
type ExtractCommentsFilename = string | ((fileData: any) => string);
type ExtractCommentsBanner =
  | string
  | boolean
  | ((commentsFile: string) => string);
type ExtractCommentsObject = {
  condition?: ExtractCommentsCondition | undefined;
  filename?: ExtractCommentsFilename | undefined;
  banner?: ExtractCommentsBanner | undefined;
};
type ExtractCommentsOptions = ExtractCommentsCondition | ExtractCommentsObject;
type MinimizedResult = {
  code: string;
  map?: import("source-map").RawSourceMap | undefined;
  errors?: (string | Error)[] | undefined;
  warnings?: (string | Error)[] | undefined;
  extractedComments?: string[] | undefined;
};
type Input = {
  [file: string]: string;
};
type CustomOptions = {
  [key: string]: any;
};
type InferDefaultType<T> = T extends infer U ? U : CustomOptions;
type PredefinedOptions = {
  module?: boolean | undefined;
  ecma?: import("terser").ECMA | undefined;
};
type MinimizerOptions<T> = PredefinedOptions & InferDefaultType<T>;
type BasicMinimizerImplementation<T> = (
  input: Input,
  sourceMap: RawSourceMap | undefined,
  minifyOptions: MinimizerOptions<T>,
  extractComments: ExtractCommentsOptions | undefined
) => Promise<MinimizedResult>;
type MinimizeFunctionHelpers = {
  getMinimizerVersion?: (() => string | undefined) | undefined;
};
type MinimizerImplementation<T> = BasicMinimizerImplementation<T> &
  MinimizeFunctionHelpers;
type InternalOptions<T> = {
  name: string;
  input: string;
  inputSourceMap: RawSourceMap | undefined;
  extractComments: ExtractCommentsOptions | undefined;
  minimizer: {
    implementation: MinimizerImplementation<T>;
    options: MinimizerOptions<T>;
  };
};
type MinimizerWorker<T> = Worker & {
  transform: (options: string) => MinimizedResult;
  minify: (options: InternalOptions<T>) => MinimizedResult;
};
type Parallel = undefined | boolean | number;
type InternalPluginOptions<T> = BasePluginOptions & {
  minimizer: {
    implementation: MinimizerImplementation<T>;
    options: MinimizerOptions<T>;
  };
};
import { minify } from "./minify";
import { Worker } from "jest-worker";


text:
/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM8L10x_IRTIM_H
#define __STM8L10x_IRTIM_H

/* Includes ------------------------------------------------------------------*/
#include "stm8l10x.h"

/* Exported variables ------------------------------------------------------- */
/* Exported types ------------------------------------------------------------*/
/* Exported constants --------------------------------------------------------*/
/* Exported macros -----------------------------------------------------------*/
/* Private macros ------------------------------------------------------------*/
/* Exported functions --------------------------------------------------------*/
/** @addtogroup IRTIM_Exported_Functions
  * @{
  */

void IRTIM_DeInit(void);
void IRTIM_Cmd(FunctionalState NewState);
FunctionalState IRTIM_GetStatus(void);
void IRTIM_HighSinkODCmd(FunctionalState Newstate);
FunctionalState IRTIM_GetHighSinkODStatus(void);

/**
  * @}
  */
#endif /* __STM8L10x_IRTIM_H */

/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/


text:
package org.metaborg.meta.lang.dynsem.interpreter.nodes.rules;

import org.metaborg.meta.lang.dynsem.interpreter.DynSemLanguage;
import org.metaborg.meta.lang.dynsem.interpreter.nodes.DynSemRootNode;

import com.oracle.truffle.api.frame.FrameDescriptor;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

public abstract class Rule extends DynSemRootNode {

	private final DynSemLanguage lang;

	public Rule(DynSemLanguage lang, SourceSection source, FrameDescriptor fd) {
		super(lang, source, fd);
		this.lang = lang;
	}

	public Rule(DynSemLanguage lang, SourceSection source) {
		this(lang, source, null);
	}

	protected DynSemLanguage language() {
		return lang;
	}

	@Override
	public abstract RuleResult execute(VirtualFrame frame);

}


text:
#include <stdio.h>
#include <stdlib.h>
#include "testbench.h"
#include "calc.h"

int main (int argc, char **argv)
{
	int numberOfWords;
	if(argc == 3)
	{
		calcSetup();
#ifdef BIG_CALC
		bigTableSetup();
#endif
		numberOfWords = atoi(argv[2]);
		runTestbench(numberOfWords, argv[1], 0);
		return 0;
	}
	else
	{
		printf("Usage: input_name output_0_name number_of_bytes\n");
		return -1;
	}
}


text:
package com.bjorktech.cayman.idea.designpattern.behavior.interpret;

/**
 * User: sheshan
 * Date: 05/07/2018
 * content:
 */
public interface Expression {
    int interpret(Context context);
}


text:
typedef struct _GLFWwin_struct _GLFWwin;

struct _GLFWwin_struct {

// ========= PLATFORM INDEPENDENT MANDATORY PART =========================

    // User callback functions
    GLFWwindowsizefun    WindowSizeCallback;
    GLFWwindowclosefun   WindowCloseCallback;
    GLFWwindowrefreshfun WindowRefreshCallback;
    GLFWmousebuttonfun   MouseButtonCallback;
    GLFWmouseposfun      MousePosCallback;
    GLFWmousewheelfun    MouseWheelCallback;
    GLFWkeyfun           KeyCallback;
    GLFWcharfun          CharCallback;

    // User selected window settings
    int       Fullscreen;      // Fullscreen flag
    int       MouseLock;       // Mouse-lock flag
    int       AutoPollEvents;  // Auto polling flag
    int       SysKeysDisabled; // System keys disabled flag

    // Window status & parameters
    int       Opened;          // Flag telling if window is opened or not
    int       Active;          // Application active flag
    int       Iconified;       // Window iconified flag
    int       Width, Height;   // Window width and heigth
    int       Accelerated;     // GL_TRUE if window is HW accelerated
    int       RedBits;
    int       GreenBits;
    int       BlueBits;
    int       AlphaBits;
    int       DepthBits;
    int       StencilBits;
    int       AccumRedBits;
    int       AccumGreenBits;
    int       AccumBlueBits;
    int       AccumAlphaBits;
    int       AuxBuffers;
    int       Stereo;
    int       RefreshRate;     // Vertical monitor refresh rate

    // Extensions & OpenGL version
    int       Has_GL_SGIS_generate_mipmap;
    int       GLVerMajor,GLVerMinor;

// ========= PLATFORM SPECIFIC PART ======================================

    // Platform specific window resources
    DMesaVisual  Visual;
    DMesaContext Context;
    DMesaBuffer  Buffer;

    // Standard output redirection
    char OutName[L_tmpnam];
    char ErrName[L_tmpnam];
    int  hOut,hOutOld,hErr,hErrOld;

    // Platform specific extensions

    // Various platform specific internal variables

};

GLFWGLOBAL _GLFWwin _glfwWin;

//------------------------------------------------------------------------
// User input status (most of this should go in _GLFWwin)
//------------------------------------------------------------------------
GLFWGLOBAL struct {

// ========= PLATFORM INDEPENDENT MANDATORY PART =========================

    // Mouse status
    int  MousePosX, MousePosY;
    int  WheelPos;
    char MouseButton[ GLFW_MOUSE_BUTTON_LAST+1 ];

    // Keyboard status
    char Key[ GLFW_KEY_LAST+1 ];
    int  LastChar;

    // User selected settings
    int  StickyKeys;
    int  StickyMouseButtons;
    int  KeyRepeat;

// ========= PLATFORM SPECIFIC PART ======================================

    // Platform specific internal variables

} _glfwInput;

//------------------------------------------------------------------------
// Timer status
//------------------------------------------------------------------------
GLFWGLOBAL struct {
    double    Period;
    long long t0;
    int       HasRDTSC;
} _glfwTimer;

//------------------------------------------------------------------------
// Thread record (one for each thread)
//------------------------------------------------------------------------
typedef struct _GLFWthread_struct _GLFWthread;

struct _GLFWthread_struct {

// ========= PLATFORM INDEPENDENT MANDATORY PART =========================

    // Pointer to previous and next threads in linked list
    _GLFWthread    *Previous, *Next;

    // GLFW user side thread information
    GLFWthread     ID;

// ========= PLATFORM SPECIFIC PART ======================================

    // System side thread information
    GLFWthreadfun  Function;
    void           *Arg;
};

//------------------------------------------------------------------------
// General thread information
//------------------------------------------------------------------------
GLFWGLOBAL struct {

// ========= PLATFORM INDEPENDENT MANDATORY PART =========================

    // Next thread ID to use (increments for every created thread)
    GLFWthread       NextID;

    // First thread in linked list (always the main thread)
    _GLFWthread      First;

// ========= PLATFORM SPECIFIC PART ======================================

    // Critical section lock

} _glfwThrd;

//------------------------------------------------------------------------
// Joystick information & state
//------------------------------------------------------------------------
GLFWGLOBAL struct {
    int dummy;
} _glfwJoy;

//========================================================================
// Macros for encapsulating critical code sections (i.e. making parts
// of GLFW thread safe)
//========================================================================

// Thread list management
#define ENTER_THREAD_CRITICAL_SECTION \
        ;
#define LEAVE_THREAD_CRITICAL_SECTION \
        ;

//========================================================================
// DOS events
//========================================================================

// Valid event types
#define _GLFW_DOS_KEY_EVENT          1
#define _GLFW_DOS_MOUSE_MOVE_EVENT   2
#define _GLFW_DOS_MOUSE_WHEEL_EVENT  3
#define _GLFW_DOS_MOUSE_BUTTON_EVENT 4

// Keyboard event structure
struct key_event {
    int Type;
    int Key;
    int KeyNoMod;
    int Action;
};

// Mouse move event structure
struct mousemove_event {
    int Type;
    int DeltaX, DeltaY;
};

// Mouse wheel event structure
struct mousewheel_event {
    int Type;
    int WheelDelta;
};

// Mouse button event structure
struct mousebutton_event {
    int Type;
    int Button;
    int Action;
};

// DOS event structure
typedef union {
    int Type;
    struct key_event            Key;
    struct mousemove_event      MouseMove;
    struct mousewheel_event     MouseWheel;
    struct mousebutton_event    MouseButton;
} _GLFWdosevent;

//========================================================================
// Prototypes for platform specific internal functions
//========================================================================

// Time
int  _glfwInitTimer( void );
void _glfwTerminateTimer( void );

// Fullscreen

// Events
int  _glfwInitEvents( void );
void _glfwTerminateEvents( void );
void _glfwWaitNextEvent( void );
int  _glfwGetNextEvent( _GLFWdosevent *event );
void _glfwPostDOSEvent( _GLFWdosevent *event );

// Mouse
int  _glfwInitMouse( void );
void _glfwTerminateMouse( void );

// Keyboard
int  _glfwInitKeyboard( void );
void _glfwTerminateKeyboard( void );

// Joystick
void _glfwInitJoysticks( void );
void _glfwTerminateJoysticks( void );

// Threads
int  _glfwInitThreads( void );
void _glfwTerminateThreads( void );

// Interrupt handling
int _glfwInstallDOSIrq( int i, int (*handler) () );
int _glfwRemoveDOSIrq( int i );

// Interrupt macros
#define ENABLE()  __asm __volatile("sti")
#define DISABLE() __asm __volatile("cli")

// Memory macros (for locking memory)
#define ENDOFUNC(x)    static void x##_end() { }
#define LOCKFUNC(x)    _go32_dpmi_lock_code((void *)x, (long)x##_end - (long)x)
#define LOCKDATA(x)    _go32_dpmi_lock_data((void *)&x, sizeof(x))
#define LOCKBUFF(x, l) _go32_dpmi_lock_data((void *)x, l)

#endif // _platform_h_