text:
from dl_data_validation_toolset.framework import base_unittest
from dl_data_validation_toolset.data_tests.consistency import ConsistencyTests
#from dl_data_validation_toolset.framework.report import FileReport

class Test_Consistency(base_unittest.BaseTestCase):

  def test_basic_consistency(self):
    label_test = ConsistencyTests('somefile.h5')

    def getitem(name):
      if 'label' in name:
        return [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]
      elif 'wire' in name:
        return [[], [], []]
      else:
        return [[], [], []]

    label_test._file.__getitem__.side_effect = getitem
    # TODO: Fix below
    #report = FileReport("myfile")
    #label_test.validate(report)


text:
@interface GiftListCell : UICollectionViewCell

@property (nonatomic, weak) IBOutlet UIImageView *hotImage;

@property (nonatomic, strong) UIImageView *GiftImageView;

@property (nonatomic, weak) IBOutlet UILabel *nameLabel;

@property (nonatomic, weak) IBOutlet UILabel *coinPriceLabel;

//@property (strong, nonatomic)  UILabel *countLabel;

@property (weak, nonatomic) IBOutlet UIImageView *bg;

@property (weak, nonatomic) IBOutlet UIImageView *rightlineImage;

@property (weak, nonatomic) IBOutlet UIImageView *bottomLineImage;

@property (weak, nonatomic) IBOutlet UILabel *countLabel;

- (void)setTitleText:(NSString *)text;
- (void)setCoinPriceText:(NSUInteger)count;
- (void)setGiftImage:(NSString *)urlString;
@end

redpajama_set_name: RedPajamaGithub


text:
class EXPCL_PANDAEXPRESS WindowsRegistry
{
PUBLISHED:
  enum RegLevel {
      rl_machine = 0,
      rl_user = 1
  };

  static bool set_string_value(const string &key, const string &name,
                               const string &value, RegLevel rl = rl_machine);
  static bool set_int_value(const string &key, const string &name, int value, RegLevel rl = rl_machine);

  enum Type {
    T_none,
    T_int,
    T_string,
  };
  static Type get_key_type(const string &key, const string &name, RegLevel rl = rl_machine);
  static string get_string_value(const string &key, const string &name,
                                 const string &default_value, RegLevel rl = rl_machine);
  static int get_int_value(const string &key, const string &name,
                           int default_value, RegLevel rl = rl_machine);

private:
  static bool do_set(const string &key, const string &name,
                     int data_type, const void *data, int data_length, const RegLevel rl);
  static bool do_get(const string &key, const string &name,
                     int &data_type, string &data, const RegLevel rl);
  static string format_message(int error_code);
};

#endif  // WIN32_VC

#endif


text:
"""406. Queue Reconstruction by Height
https://leetcode.com/problems/queue-reconstruction-by-height/

Suppose you have a random list of people standing in a queue.
Each person is described by a pair of integers (h, k),
where h is the height of the person and k is the number of people
in front of this person who have a height greater than or equal to h.
Write an algorithm to reconstruct the queue.

Note:
The number of people is less than 1,100.

Example

Input:
[[7,0], [4,4], [7,1], [5,0], [6,1], [5,2]]

Output:
[[5,0], [7,0], [5,2], [6,1], [4,4], [7,1]]
"""
from typing import List

class Solution:
    def reconstruct_queue(self, people: List[List[int]]) -> List[List[int]]:
        people.sort(key=lambda x: (-x[0], x[1]))
        ans = []
        for p in people:
            ans.insert(p[1], p)
        return ans


text:
"""
Test that an alias can reference other aliases without crashing.
"""

from __future__ import print_function

import os
import time
import re
import lldb
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil

class NestedAliasTestCase(TestBase):

    mydir = TestBase.compute_mydir(__file__)

    def setUp(self):
        # Call super's setUp().
        TestBase.setUp(self)
        # Find the line number to break inside main().
        self.line = line_number('main.cpp', '// break here')

    def test_nested_alias(self):
        """Test that an alias can reference other aliases without crashing."""
        self.build()
        exe = self.getBuildArtifact("a.out")
        self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)

        # Break in main() after the variables are assigned values.
        lldbutil.run_break_set_by_file_and_line(
            self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)

        self.runCmd("run", RUN_SUCCEEDED)

        # The stop reason of the thread should be breakpoint.
        self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
                    substrs=['stopped', 'stop reason = breakpoint'])

        # The breakpoint should have a hit count of 1.
        self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
                    substrs=[' resolved, hit count = 1'])

        # This is the function to remove the custom aliases in order to have a
        # clean slate for the next test case.
        def cleanup():
            self.runCmd('command unalias read', check=False)
            self.runCmd('command unalias rd', check=False)
            self.runCmd('command unalias fo', check=False)
            self.runCmd('command unalias foself', check=False)

        # Execute the cleanup function during test case tear down.
        self.addTearDownHook(cleanup)

        self.runCmd('command alias read memory read -f A')
        self.runCmd('command alias rd read -c 3')

        self.expect(
            'memory read -f A -c 3 `&my_ptr[0]`',
            substrs=[
                'deadbeef',
                'main.cpp:',
                'feedbeef'])
        self.expect(
            'rd `&my_ptr[0]`',
            substrs=[
                'deadbeef',
                'main.cpp:',
                'feedbeef'])

        self.expect(
            'memory read -f A -c 3 `&my_ptr[0]`',
            substrs=['deadfeed'],
            matching=False)
        self.expect('rd `&my_ptr[0]`', substrs=['deadfeed'], matching=False)

        self.runCmd('command alias fo frame variable -O --')
        self.runCmd('command alias foself fo self')

        self.expect(
            'help foself',
            substrs=[
                '--show-all-children',
                '--raw-output'],
            matching=False)
        self.expect(
            'help foself',
            substrs=[
                'Show variables for the current',
                'stack frame.'],
            matching=True)


text:
using Orchard.ContentManagement.MetaData;
using Orchard.Core.Contents.Extensions;
using Orchard.Data.Migration;
using Orchard.Environment.Extensions;
using Orchard.Indexing;

namespace Nwazet.Commerce.Migrations {
    [OrchardFeature("Nwazet.Bundles")]
    public class BundleMigrations : DataMigrationImpl {
        public int Create() {
            SchemaBuilder.CreateTable(
                "BundlePartRecord",
                table => table.ContentPartRecord());

            SchemaBuilder.CreateTable(
                "BundleProductsRecord", table => table
                .Column<int>("Id", column => column.PrimaryKey().Identity())
                .Column<int>("BundlePartRecord_Id")
                .Column<int>("ContentItemRecord_Id"));

            SchemaBuilder.CreateForeignKey(
                "FK_BundleProductsBundle",
                "BundleProductsRecord", new[] { "BundlePartRecord_Id" },
                "BundlePartRecord", new[] {"Id"});

            SchemaBuilder.CreateForeignKey(
                "FK_BundleProductsProduct",
                "BundleProductsRecord", new[] { "ContentItemRecord_Id" },
                "Orchard.Framework", "ContentItemRecord", new[] { "Id" });

            ContentDefinitionManager.AlterPartDefinition(
                "BundlePart",builder => builder
                .Attachable());

            ContentDefinitionManager.AlterTypeDefinition(
                "Bundle", cfg => cfg
                .WithPart("Bundle")
                .WithPart("CommonPart")
                .WithPart("TitlePart")
                .WithPart("AutoroutePart", builder => builder
                    .WithSetting("AutorouteSettings.AllowCustomPattern", "true")
                    .WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
                    .WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-bundle'}]")
                    .WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
                .WithPart("BodyPart")
                .WithPart("ProductPart")
                .WithPart("BundlePart")
                .WithPart("TagsPart")
                .Creatable()
                .Indexed());

            ContentDefinitionManager.AlterPartDefinition("Bundle",
                builder => builder
                    .WithField("ProductImage", fieldBuilder => fieldBuilder.OfType("MediaPickerField").WithDisplayName("Product Image")));

            return 1;
        }

        public int UpdateFrom1() {
            SchemaBuilder.AlterTable(
                "BundleProductsRecord",
                table => table.AddColumn<int>("Quantity", column => column.WithDefault(1)));
            return 2;
        }
    }
}


text:
require 'test/unit'
require 'shoulda'
require 'section'
require 'mocha'

module Raiskeleton
  class SectionTest < Test::Unit::TestCase
    context "name" do
      should "create a section with given name and when name_valid? is true" do
        name = stub
        Raiskeleton::Section.stubs(:name_valid?).with(name).returns(true).once
        section = Raiskeleton::Section.new name
        assert_equal name, section.name
      end

      should "raise a exception when name_valid? is false" do
        name = stub
        Raiskeleton::Section.stubs(:name_valid?).with(name).returns(false).once
        assert_raise(RuntimeError) do
          Raiskeleton::Section.new name
        end
      end
    end

    context "cells" do
      setup do
        name = stub
        Raiskeleton::Section.stubs(:name_valid?).with(name).returns(true)
        @section = Raiskeleton::Section.new name
      end

      should "create an section with no cells" do
        assert @section.cells.empty?
      end
    end

    context "render_cells" do
      setup do
        name = stub
        Raiskeleton::Section.stubs(:name_valid?).with(name).returns(true)
        @section = Raiskeleton::Section.new name
      end

      should "add a cell to be rendered" do
        state_args = [{:arg0 => 0, :arg1=> 1},"second_arg"]
        @section.render_cell :cell, :show, *state_args
        assert_equal :cell, @section.cells[0][:name]
        assert_equal :show, @section.cells[0][:state]
        assert_equal state_args, @section.cells[0][:args]
      end

      context "name" do
        should "raise an exception when name is nil" do
          assert_raise(RuntimeError) do
            @section.render_cell nil, stub, stub
          end
        end

        should "raise an exception when name is empty" do
          assert_raise(RuntimeError) do
            @section.render_cell "", stub, stub
          end
        end
      end

      context "show" do
        should "raise an exception when state is nil" do
          assert_raise(RuntimeError) do
            name = stub(:nil? => false, :empty? => false)
            @section.render_cell name, nil, stub
          end
        end

        should "raise an exception when state is empty" do
          assert_raise(RuntimeError) do
            name = stub(:nil? => false, :empty? => false)
            @section.render_cell name, "", stub
          end
        end
      end
    end

    context "name_valid?" do
      should "return false when name is nil" do
        assert_equal false, Raiskeleton::Section.name_valid?(nil)
      end

      should "return false when name is empty" do
        assert_equal false, Raiskeleton::Section.name_valid?("")
      end

      should "return true when name is not empty and not nil" do
        assert Raiskeleton::Section.name_valid?("section")
      end
    end
  end
end


text:
package com.github.tomakehurst.wiremock.junit;

import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.github.tomakehurst.wiremock.core.Options;
import org.junit.rules.MethodRule;
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;

import static com.github.tomakehurst.wiremock.core.WireMockConfiguration.wireMockConfig;

public class WireMockClassRule extends WireMockServer implements MethodRule, TestRule {

    public WireMockClassRule(Options options) {
        super(options);
    }

    public WireMockClassRule(int port, Integer httpsPort) {
        this(wireMockConfig().port(port).httpsPort(httpsPort));
    }

    public WireMockClassRule(int port) {
        this(wireMockConfig().port(port));
    }

    public WireMockClassRule() {
        this(wireMockConfig());
    }

    @Override
    public Statement apply(final Statement base, FrameworkMethod method, Object target) {
        return apply(base, null);
    }

    @Override
    public Statement apply(final Statement base, Description description) {
        return new Statement() {
            @Override
            public void evaluate() throws Throwable {
                if (isRunning()) {
                    try {
                        before();
                        base.evaluate();
                    } finally {
                        after();
                        client.resetMappings();
                    }
                } else {
                    start();
                    WireMock.configureFor("localhost", port());
                    try {
                        before();
                        base.evaluate();
                    } finally {
                        after();
                        stop();
                    }
                }
            }

        };
    }

    protected void before() {
        // NOOP
    }

    protected void after() {
        // NOOP
    }
}


text:
(function (doc, win) {
  let docEl = doc.documentElement
  let resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize'
  const recalc = function () {
    let clientWidth = docEl.clientWidth
    if (!clientWidth) return
    if (clientWidth > 768) {
      clientWidth = 768
    }
    // docEl.style.fontSize = `${20 * (clientWidth / 320)}px`
    docEl.style.fontSize = `${50 * (clientWidth / 375)}px`
  }
  if (!doc.addEventListener) return
  win.addEventListener(resizeEvt, recalc, false)
  doc.addEventListener('DOMContentLoaded', recalc, false)
}(document, window))


text:
import {Component, OnInit} from '@angular/core';
import {ActivatedRoute} from '@angular/router';
import {AuthService} from '../../../../../../services/auth.service';

@Component({
  selector: 'app-application-email',
  templateUrl: './email.component.html',
  styleUrls: ['./email.component.scss']
})
export class ApplicationEmailComponent implements OnInit {
  private domainId: string;
  private appId: string;
  private rawTemplate: string;
  private template: string;
  createMode: boolean;
  editMode: boolean;
  deleteMode: boolean;

  constructor(private route: ActivatedRoute,
              private authService: AuthService) { }

  ngOnInit() {
    this.domainId = this.route.snapshot.data['domain']?.id;
    this.appId = this.route.snapshot.params['appId'];
    this.rawTemplate = this.route.snapshot.queryParams['template'];
    this.template = this.rawTemplate.toLowerCase().replace(/_/g, ' ');
    this.createMode = this.authService.hasPermissions(['application_email_template_create']);
    this.editMode = this.authService.hasPermissions(['application_email_template_update']);
    this.deleteMode = this.authService.hasPermissions(['application_email_template_delete']);
  }
}


text:
module Pickwick
  module Workers
    VERSION = "0.0.1"
  end
end


text:
package tdg.reranking;
import java.io.*;
import java.util.*;

import pos.IsstPos;
import pos.TanlPos;
import pos.TutPos;
import pos.WsjPos;
import settings.Parameters;
import tdg.DSConnl;
import tdg.TDNode;
import tdg.corpora.DepCorpus;
import tdg.corpora.TanlD;
import tdg.corpora.TutD;
import tdg.corpora.WsjD;
import util.*;
import util.file.FileUtil;

public class Reranker_EisnerCBackoff_left_extended_Tanl extends Reranker_ProbModelBackoff {

	private static boolean countEmptyDaughters = false;
	private static boolean printTables = false;

	public static TanlPos tanlPosAnalyzer;

	// P(dist, term(d), w(d),t(d) | h, s, gh, dir)
	public Reranker_EisnerCBackoff_left_extended_Tanl(File goldFile, File parsedFile, int nBest,
			ArrayList<TDNode> trainingCorpus, int uk_limit,
			int limitTestToFirst, boolean addEOS, boolean markTerminalNodes,
			int[][][] backoffLevels, boolean[] skipEvents, int[][] groupEventLevels) {

		super(goldFile, parsedFile, nBest, trainingCorpus, uk_limit,
				limitTestToFirst, addEOS, countEmptyDaughters, markTerminalNodes, printTables,
				backoffLevels, skipEvents, groupEventLevels);

		updateCondFreqTables();
	}

	public static String[][] fillBackoffTagsTable(TDNode h, TDNode s, TDNode d, String dir, int dist) {
		TDNode gh = h.parent;
		String[][] result = new String[8][];
		//0: distance
		//1: d is terminal
		//2: word(daughter)
		//3: tag(daughter)
		//-----
		//4: parent
		//5: previous sister
		//6: gran parent
		//7: direction
		result[0] = new String[]{Integer.toString(dist), Integer.toString(groupDistance(dist)), ""};
		result[1] = (d==null)? new String[]{EOC, ""} :
					(d.isTerminalNode())? new String[]{"1", ""} : new String[]{"0", ""};
		result[2] = (d==null)? new String[]{EOC, EOC, ""} :
						new String[]{tanlPosAnalyzer.getLex(d), tanlPosAnalyzer.getLemma(d), ""};
		result[3] = (d==null)? new String[]{EOC, EOC, ""} :
						new String[]{tanlPosAnalyzer.getPos(d),tanlPosAnalyzer.getShortPos(d),""};
		//-----
		result[4] = tanlPosAnalyzer.standardReductions(h);
		result[5] = (s==null) ?
					new String[]{nullNode, nullNode, nullNode, nullNode, nullNode, nullNode, ""} :
						tanlPosAnalyzer.standardReductions(s);
		result[6] = (gh==null) ?
					new String[]{nullNode, nullNode, nullNode, nullNode, nullNode, nullNode, ""} :
					tanlPosAnalyzer.standardReductions(gh);
		result[7] = new String[]{dir, ""};
		return result;
	}

	public void updateCondFreqTables(TDNode thisNode) {
		String[][] backoffTagsTable = null;
		TDNode d = null;
		int dist;

		TDNode previousChild = null;
		if (thisNode.leftDaughters!=null) {
			for(TDNode ld : thisNode.leftDaughters) {
				dist = getDistance(thisNode,ld);
				backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, ld, left, dist);
				increaseInTables(backoffTagsTable);
				previousChild = ld;
				updateCondFreqTables(ld);
			}
		}
		d = null;
		dist = thisNode.leftProle()+1;
		backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, d, left, dist);
		increaseInTables(backoffTagsTable);

		previousChild = null;
		if (thisNode.rightDaughters!=null) {
			for (TDNode rd : thisNode.rightDaughters) {
				dist = getDistance(thisNode,rd);
				backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, rd, right, dist);
				increaseInTables(backoffTagsTable);
				previousChild = rd;
				updateCondFreqTables(rd);
			}
		}
		d = null;
		dist = thisNode.rightProle()+1;
		backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, d, right, dist);
		increaseInTables(backoffTagsTable);
	}

	public double getProb(TDNode thisNode) {

		double prob = 1d;

		String[][] backoffTagsTable = null;
		TDNode d = null;
		int dist;

		TDNode previousChild = null;
		if (thisNode.leftDaughters!=null) {
			for(TDNode ld : thisNode.leftDaughters) {
				dist = getDistance(thisNode,ld);
				backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, ld, left, dist);
				prob *= getCondProb(backoffTagsTable) * getProb(ld);
				previousChild = ld;
			}
		}
		d = null;
		dist = thisNode.leftProle()+1;
		backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, d, left, dist);
		prob *= getCondProb(backoffTagsTable);

		previousChild = null;
		if (thisNode.rightDaughters!=null) {
			for (TDNode rd : thisNode.rightDaughters) {
				dist = getDistance(thisNode,rd);
				backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, rd, right, dist);
				prob *= getCondProb(backoffTagsTable) * getProb(rd);
				previousChild = rd;
			}
		}
		d = null;
		dist = thisNode.rightProle()+1;
		backoffTagsTable = fillBackoffTagsTable(thisNode, previousChild, d, right, dist);
		prob *= getCondProb(backoffTagsTable);

		return prob;
	}

	public static int getDistance(TDNode head, TDNode dep) {
		int dis = Math.abs(head.index - dep.index);
		return dis;
	}

	public static int groupDistance(int dis) {
		if (dis==1) return 1;
		if (dis==2) return 2;
		if (dis<7) return 3; // 3,4,5,6
		return 4; // 7,8, 9, 10, ..., inf.
	}

	public void updateKeyCondKeyLog(TDNode thisNode, Vector<String> keyCondKeyLog) {

	}

	/* r: open         | close
	 * ------------------
	 * 0: lexPos       | lexPos
	 * 1: lexShortPos  | lexPos
	 * 2: pos		   | lexPos
	 * 3: shortPos     | lexPos
	 * 4: shortPos     | pos
	 * 5: shortPos     | shortPos
	 * 6: no specified
	 */

	static public int[][][] default_backoffLevels = new int[][][] {
		{//dist | term(d), w(d),t(d), h, s, gh, dir
			{0,        1,    2,   1, 0, 0,  2,   0},

			{0,        1,    2,   1, 2, 2,  4,   0},

			{0,        1,    2,   1, 4, 4,  5,   0},
		},
		{//term(d) | w(d),t(d), h, s, gh, dir
				{0,     2,   1, 0, 0, 3,    1},

			    {0,     2,   1, 2, 2, 4,    1},

			    {0,     2,   1, 4, 4, 5,    1},
		},
		{//w(d) | t(d), h, s, gh, dir
			 {0,     2, 0, 0,  3,   0},

			 {0,     2, 2, 2,  4,   0},

			 {0,     2, 4, 4,  5,   0},
		},
		{//t(d) | h, s, gh, dir
			{0,   0, 0,  2,   0},

			{0,   0, 2,  2,   0},
			{0,   2, 0,  2,   0},

			{0,   4, 4,  5,   0},

			{0,   5, 5,  5,   0}
		}};

	static boolean[] default_skipEvents = new boolean[]{false, false, false, false};
	static int[][] default_groupEventLevels = new int[][]{{1,1,1},{1,1,1},{1,1,1},{1,2,1,1}};

	public static void mainTest(String[] args) { //mainTest
		int uk_limit = -1;
		int nBest = 10;
		boolean mxPos= false;
		int limitTestSetToFirst = 10000;
		boolean includeGoldInNBest = false;
		int order = 2;
		String MSTver = "0.5";
		String corpusName = "Tut_Evalita09";

		String withGold = includeGoldInNBest ? "_withGold" : "";
		String mstVerOrderDir = "MST_" + MSTver + "_" + order + "order";
		String basePath = Parameters.resultsPath + "Reranker/Parsed/" +
							mstVerOrderDir + "/" + ((mxPos) ? "mxPOS/" : "goldPOS/") +
							corpusName + "/";

		Parameters.outputPath = basePath + "Reranker/" + FileUtil.dateTimeString() + "/";
		File outputPathFile = new File(Parameters.outputPath);
		outputPathFile.mkdirs();
		Parameters.logFile = new File(Parameters.outputPath + "Log");

		File trainingFile = new File(TutD.TutTrainSetConnl);
		File testBlindFile = new File(TutD.TutTestSetBlindConnl);
		String testFileName = FileUtil.getFileNameWithoutExtensions(testBlindFile);

		String nBestPath = basePath  + corpusName + "_nBest" + nBest + "/";
		File parsedFile = new File(nBestPath + testFileName + "_nBest" + nBest + withGold);

		ArrayList<TDNode> training = DepCorpus.readTreebankFromFileConll07(trainingFile, 10000);
		ArrayList<TDNode> testLB = DepCorpus.readTreebankFromFileConll07(testBlindFile, 10000);

		File test_LB_ulab = new File(basePath + "TUT-Evalita09-testset10-9-09_nBest1.ulab");
		//DepCorpus.convertConll07ToUlab(test1BestFileConll, test1BestFileUlab);
		DepCorpus.toFileMSTulab(test_LB_ulab, testLB, false);

		if(!parsedFile.exists()) {
			System.out.println("NBest file not found: " + parsedFile);
			Reranker.makeNBestConll(nBest, corpusName,
					trainingFile, testBlindFile, mxPos, order, MSTver);
		}

		File parsedFileUlab = new File(Parameters.outputPath + testFileName + "_nBest" + nBest + withGold + ".ulab");
		DepCorpus.convertConll07ToUlab(parsedFile, parsedFileUlab);

		boolean addEOS = false;
		boolean markTerminalNodes = false;

		if (includeGoldInNBest) nBest++;
		new Reranker_EisnerCBackoff_left_extended_Tanl(test_LB_ulab, parsedFileUlab, nBest,
				training, uk_limit, limitTestSetToFirst, addEOS, markTerminalNodes,
				default_backoffLevels, default_skipEvents, default_groupEventLevels).reranking();

		File rerankedFileConll = new File(Parameters.outputPath+ "reranked.conll");
		DSConnl.selectRerankedFromFile(parsedFile, rerankedFileConll, Reranker.rerankedIndexes);
		File rerankedFileUlabVerify = new File(Parameters.outputPath + "reranked.verify.ulab");
		DepCorpus.convertConll07ToUlab(rerankedFileConll, rerankedFileUlabVerify);
	}

	public static void mainDev(String[] args) {	//mainDev
		int uk_limit = -1;
		int nBest = 50;
		boolean mxPos= false;
		int limitTestSetToFirst = 10000;
		boolean includeGoldInNBest = false;
		int order = 2;
		String MSTver = "0.5";
		String corpusName = "Tanl_Evalita09Develop";

		String withGold = includeGoldInNBest ? "_withGold" : "";
		String mstVerOrderDir = "MST_" + MSTver + "_" + order + "order";
		String basePath = Parameters.resultsPath + "Reranker/Parsed/" +
							mstVerOrderDir + "/" + ((mxPos) ? "mxPOS/" : "goldPOS/") +
							corpusName + "/";

		String outputPath = basePath  + corpusName + "_nBest" + nBest + "/";

		Parameters.outputPath = basePath + "Reranker/" + FileUtil.dateTimeString() + "/";
		File outputPathFile = new File(Parameters.outputPath);
		outputPathFile.mkdirs();
		Parameters.logFile = new File(Parameters.outputPath + "Log");

		File trainingFile = new File(TanlD.TanlD_Train_Connl);
		File testBlindFile = new File(TanlD.TanlD_Dev_Blind_Connl);
		File testGoldFile = new File(TanlD.TanlD_Dev_Connl);
		String testFileName = FileUtil.getFileNameWithoutExtensions(testBlindFile);

		File parsedFile = new File(outputPath + testFileName + "_nBest" + nBest + withGold);

		ArrayList<TDNode> training = DepCorpus.readTreebankFromFileConll07(trainingFile, 10000);
		ArrayList<TDNode> test = DepCorpus.readTreebankFromFileConll07(testGoldFile, 10000);

		int freqConfidence = 4;
		tanlPosAnalyzer = new TanlPos(training, freqConfidence);

		File outputTestGold = new File(Parameters.outputPath + testFileName + ".gold.ulab");

		DepCorpus.toFileMSTulab(outputTestGold, test, false);

		if(!parsedFile.exists()) {
			System.out.println("NBest file not found: " + parsedFile);
			Reranker.makeNBestConll(nBest, corpusName,
					trainingFile, testBlindFile, mxPos, order, MSTver);
		}

		File parsedFileUlab = new File(outputPath + testFileName + "_nBest" + nBest + withGold + ".ulab");
		DepCorpus.convertConll07ToUlab(parsedFile, parsedFileUlab);

		boolean addEOS = false;
		boolean markTerminalNodes = false;

		if (includeGoldInNBest) nBest++;
		new Reranker_EisnerCBackoff_left_extended_Tanl(outputTestGold, parsedFileUlab, nBest,
				training, uk_limit, limitTestSetToFirst, addEOS, markTerminalNodes,
				default_backoffLevels, default_skipEvents, default_groupEventLevels).reranking();
	}

	public static void main(String[] args) {
		mainDev(args);
	}

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
J. Elisha Mitchell Sci. Soc. 80:172. 1964

#### Original name
null

### Remarks
null


text:
<!doctype html>

		<title>Zabuun - Learn Egyptian Arabic for English speakers</title>
		<meta name="description" content="">
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/head.php';?>

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/ie8.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/header.php';?>

			<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/side.php';?>

Essays > Raising the Kids

						Expand All | Collapse All

Raising the Kids

 Neil said not to worry. There was still plenty of time for him to figure out a way for the kids to have fun and still become happy millionaires.

		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/footer.php';?>
		<?php include $_SERVER['DOCUMENT_ROOT'].'/layout/scripts.php';?>


text:
import re
import six
import sys
import unicodedata
from math import radians, sin, cos, acos
from django import VERSION as DJANGO_VERSION
try:
    from django.utils.encoding import force_unicode as force_text
except (NameError, ImportError):
    from django.utils.encoding import force_text
from django.utils.safestring import mark_safe, SafeText

from .conf import CONTINENT_DATA

if sys.version_info < (3, 0):
    unicode_func = unicode  # noqa: F821
else:
    unicode_func = str

# GEO DISTANCE

earth_radius_km = 6371.009

def geo_distance(a, b):
    """Distance between two geo points in km. (p.x = long, p.y = lat)"""
    a_y = radians(a.y)
    b_y = radians(b.y)
    delta_x = radians(a.x - b.x)
    cos_x = (sin(a_y) * sin(b_y) +
             cos(a_y) * cos(b_y) * cos(delta_x))
    return acos(cos_x) * earth_radius_km

# ADD CONTINENTS FUNCTION

def add_continents(continent_model):
    for ccode, cdata in CONTINENT_DATA.items():
        try:
            c = continent_model.objects.get(code=ccode)
        except continent_model.DoesNotExist:
            c = continent_model()
        c.id = cdata[1]
        c.name = cdata[0]
        c.code = ccode
        c.slug = c.name
        c.save()

# SLUGIFY REGEXES

to_und_rgx = re.compile(r"[']", re.UNICODE)
slugify_rgx = re.compile(r'[^-\w._~]', re.UNICODE)
multi_dash_rgx = re.compile(r'-{2,}', re.UNICODE)
dash_und_rgx = re.compile(r'[-_]_', re.UNICODE)
und_dash_rgx = re.compile(r'[-_]-', re.UNICODE)
starting_chars_rgx = re.compile(r'^[-._]*', re.UNICODE)
ending_chars_rgx = re.compile(r'[-._]*$', re.UNICODE)

def default_slugify(obj, value):
    if value is None:
        return None

    value = force_text(unicode_func(value))
    value = unicodedata.normalize('NFKC', value.strip())
    value = re.sub(to_und_rgx, '_', value)
    value = re.sub(slugify_rgx, '-', value)
    value = re.sub(multi_dash_rgx, '-', value)
    value = re.sub(dash_und_rgx, '_', value)
    value = re.sub(und_dash_rgx, '_', value)
    value = re.sub(starting_chars_rgx, '', value)
    value = re.sub(ending_chars_rgx, '', value)
    return mark_safe(value)

if DJANGO_VERSION < (1, 10):
    from django.utils.functional import allow_lazy
    default_slugify = allow_lazy(default_slugify, six.text_type, SafeText)
else:
    from django.utils.functional import keep_lazy
    default_slugify = keep_lazy(six.text_type, SafeText)(default_slugify)

# DJANGO BACKWARDS-COMPATIBLE PATTERNS

def patterns(prefix, *args):
    if DJANGO_VERSION < (1, 9):
        from django.conf.urls import patterns as django_patterns
        return django_patterns(prefix, *args)
    elif prefix != '':
        raise Exception("You need to update your URLConf to be a list of URL "
                        "objects")
    else:
        return list(args)


text:
package main

import "github.com/rafikk/imagick/imagick"

func main() {
	imagick.Initialize()
	defer imagick.Terminate()

	mw := imagick.NewMagickWand()
	defer mw.Destroy()
	mw.ReadImage("logo:")

	// We know that logo: is 640x480 but in the general case
	// we need to get the dimensions of the image
	w := mw.GetImageWidth()
	h := mw.GetImageHeight()

	// +matte is the same as -alpha off
	// This does it the "new" way but if your IM doesn't have this
	// then MagickSetImageMatte(mw,MagickFalse); can be used
	mw.SetImageAlphaChannel(imagick.ALPHA_CHANNEL_DEACTIVATE)
	// clone the input image
	mwr := mw.Clone()
	defer mwr.Destroy()
	// Resize it
	mwr.ResizeImage(w, h/2, imagick.FILTER_LANCZOS, 1)
	// Flip the image over to form the reflection
	mwr.FlipImage()

	// Create the gradient image which will be used as the alpha
	// channel in the reflection image
	mwg := imagick.NewMagickWand()
	defer mwg.Destroy()
	mwg.SetSize(w, h/2)
	mwg.ReadImage("gradient:white-black")

	// Copy the gradient in to the alpha channel of the reflection image
	mwr.CompositeImage(mwg, imagick.COMPOSITE_OP_COPY_OPACITY, 0, 0)

	// Add the reflection image to the wand which holds the original image
	mw.AddImage(mwr)

	// Append the reflection to the bottom (MagickTrue) of the original image
	mwout := mw.AppendImages(true)
	defer mwout.Destroy()

	// and save the result
	mwout.WriteImage("logo_reflect.png")
}


text:
package edu.duke.cabig.c3pr.service;

import static edu.duke.cabig.c3pr.C3PRUseCase.CREATE_ORGANIZATION;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.test.annotation.ExpectedException;

import edu.duke.cabig.c3pr.C3PRUseCases;
import edu.duke.cabig.c3pr.domain.HealthcareSite;
import edu.duke.cabig.c3pr.domain.LocalHealthcareSite;
import edu.duke.cabig.c3pr.exception.C3PRBaseException;
import edu.duke.cabig.c3pr.utils.ContextTools;
import edu.duke.cabig.c3pr.utils.DaoTestCase;

/**
 * Created by IntelliJ IDEA. User: kherm Date: Sep 7, 2007 Time: 2:06:36 PM To change this template
 * use File | Settings | File Templates.
 */

@C3PRUseCases( { CREATE_ORGANIZATION })
public class OrganizationServiceTest extends DaoTestCase {

    private OrganizationService organizationService;

    private HealthcareSite dummySite;

    public static final String HCS_NAME = "Duke";

    public OrganizationServiceTest() {
    	organizationService = (OrganizationService) getApplicationContext()
    	.getBean("organizationService");
        String strValue = "test" + String.valueOf(Math.random());

        dummySite = new LocalHealthcareSite();
        dummySite.setName(HCS_NAME);
        dummySite.setDescriptionText(strValue);
        dummySite.setCtepCode(strValue);
        dummySite.getOrganizationAssignedIdentifiers().get(0).setPrimaryIndicator(true);
    }

    protected void setUp() throws Exception {
        super.setUp();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }

    public void testUPM() throws Exception {
        organizationService.save(dummySite);
        assertEquals(organizationService.getSiteNameByNciIdentifier(dummySite.getCtepCode()),dummySite.getName());
//        assertEquals(1, jdbcTemplate.queryForInt("Select count(*) from csm_group where group_name='edu.duke.cabig.c3pr.domain.HealthcareSite."
//                                                        + dummySite.getNciInstituteCode() + "'"));

    }

    @ExpectedException(C3PRBaseException.class)
    public void testDuplicatesNotAllowed() throws Exception {
        organizationService.save(dummySite);
        try{
        	organizationService.save(dummySite);
        	fail("Should not save duplicate site");
        } catch(Exception e){

        }
    }

//    protected void onTearDownAfterTransaction() throws Exception {
//        jdbcTemplate.execute("Delete from csm_group where group_name='"
//                        + dummySite.getNciInstituteCode() + "'");
//    }

    protected ConfigurableApplicationContext loadContext(Object object) throws Exception {
        return (ConfigurableApplicationContext) ContextTools.createDeployedCoreApplicationContext();
    }

    public OrganizationService getOrganizationService() {
        return organizationService;
    }

    public void setOrganizationService(OrganizationService organizationService) {
        this.organizationService = organizationService;
    }

}


text:
module phosphor.widgets {

import IMessage = core.IMessage;
import IMessageHandler = core.IMessageHandler;
import IMessageFilter = core.IMessageFilter;
import Message = core.Message;
import disconnect = core.disconnect;
import postMessage = core.postMessage;

import IDisposable = utility.IDisposable;
import Size = utility.Size;

/**
 * A singleton 'layout-request' message.
 */
var MSG_LAYOUT_REQUEST = new Message('layout-request');

/**
 * The base class of phosphor layouts.
 *
 * The Layout class does not define an interface for adding widgets to
 * the layout. A subclass should define that API in a manner suitable
 * for its intended use.
 */
export
class Layout implements IMessageFilter, IDisposable {
  /**
   * Construct a new layout.
   */
  constructor() { }

  /**
   * Dispose of the resources held by the layout.
   */
  dispose(): void {
    disconnect(this, null, null, null);
    disconnect(null, null, this, null);
    this._parent = null;
  }

  /**
   * Get the parent widget of the layout.
   */
  get parent(): Widget {
    return this._parent;
  }

  /**
   * Set the parent widget of the layout.
   *
   * The parent widget can only be set once, and is done automatically
   * when the layout is installed on a widget. This should not be set
   * directly by user code.
   */
  set parent(parent: Widget) {
    if (!parent) {
      throw new Error('cannot set parent widget to null');
    }
    if (parent === this._parent) {
      return;
    }
    if (this._parent) {
      throw new Error('layout already installed on a widget');
    }
    this._parent = parent;
    this.reparentChildWidgets();
    this.invalidate();
  }

  /**
   * Get the number of layout items in the layout.
   *
   * This must be implemented by a subclass.
   */
  get count(): number {
    throw new Error('not implemented');
  }

  /**
   * Get the layout item at the given index.
   *
   * This must be implemented by a subclass.
   */
  itemAt(index: number): ILayoutItem {
    throw new Error('not implemented');
  }

  /**
   * Remove and return the layout item at the given index.
   *
   * This must be implemented by a subclass.
   */
  removeAt(index: number): ILayoutItem {
    throw new Error('not implemented');
  }

  /**
   * Compute the size hint for the layout.
   *
   * This must be implemented by a subclass.
   */
  sizeHint(): Size {
    throw new Error('not implemented');
  }

  /**
   * Compute the minimum required size for the layout.
   *
   * This must be implemented by a subclass.
   */
  minSize(): Size {
    throw new Error('not implemented');
  }

  /**
   * Compute the maximum allowed size for the layout.
   *
   * This must be implemented by a subclass.
   */
  maxSize(): Size {
    throw new Error('not implemented');
  }

  /**
   * Get the widget at the given index.
   *
   * Returns `undefined` if there is no widget at the given index.
   */
  widgetAt(index: number): Widget {
    var item = this.itemAt(index);
    return (item && item.widget) || void 0;
  }

  /**
   * Get the index of the given widget or layout item.
   *
   * Returns -1 if the widget or item does not exist in the layout.
   */
  indexOf(value: Widget | ILayoutItem): number {
    for (var i = 0, n = this.count; i < n; ++i) {
      var item = this.itemAt(i);
      if (item === value || item.widget === value) {
        return i;
      }
    }
    return -1;
  }

  /**
   * Remove an item from the layout and return its index.
   *
   * Returns -1 if the item is not in the layout.
   */
  remove(value: Widget | ILayoutItem): number {
    var i = this.indexOf(value);
    if (i !== -1) this.removeAt(i);
    return i;
  }

  /**
   * Get the alignment for the given widget.
   *
   * Returns 0 if the widget is not found in the layout.
   */
  alignment(widget: Widget): Alignment {
    var index = this.indexOf(widget);
    return index === -1 ? 0 : this.itemAt(index).alignment;
  }

  /**
   * Set the alignment for the given widget.
   *
   * Returns true if the alignment was updated, false otherwise.
   */
  setAlignment(widget: Widget, alignment: Alignment): boolean {
    var index = this.indexOf(widget);
    if (index === -1) {
      return false;
    }
    var item = this.itemAt(index);
    if (item.alignment !== alignment) {
      item.alignment = alignment;
      this.invalidate();
    }
    return true;
  }

  /**
   * Invalidate the cached layout data and enqueue an update.
   *
   * This should be reimplemented by a subclass as needed.
   */
  invalidate(): void {
    var parent = this._parent;
    if (parent) {
      postMessage(parent, MSG_LAYOUT_REQUEST);
      parent.updateGeometry();
    }
  }

  /**
   * Refresh the layout for the parent widget immediately.
   *
   * This is typically called automatically at the appropriate times.
   */
  refresh(): void {
    var parent = this._parent;
    if (parent && parent.isVisible) {
      var box = parent.boxSizing;
      var x = box.paddingLeft;
      var y = box.paddingTop;
      var w = parent.width - box.horizontalSum;
      var h = parent.height - box.verticalSum;
      this.layout(x, y, w, h);
    }
  }

  /**
   * Filter a message sent to a message handler.
   *
   * This implements the `IMessageFilter` interface.
   */
  filterMessage(handler: IMessageHandler, msg: IMessage): boolean {
    if (handler === this._parent) {
      this.processParentMessage(msg);
    }
    return false;
  }

  /**
   * Process a message dispatched to the parent widget.
   *
   * Subclasses may reimplement this method as needed.
   */
  protected processParentMessage(msg: IMessage): void {
    switch (msg.type) {
    case 'resize':
    case 'layout-request':
      this.refresh();
      break;
    case 'child-removed':
      this.remove((<ChildMessage>msg).child);
      break;
    case 'before-attach':
      this.invalidate();
      break;
    }
  }

  /**
   * A method invoked when widget layout should be updated.
   *
   * The arguments are the content boundaries for the layout which are
   * already adjusted to account for the parent widget box sizing data.
   *
   * The default implementation of this method is a no-op.
   */
  protected layout(x: number, y: number, width: number, height: number): void { }

  /**
   * Ensure a child widget is parented to the layout's parent.
   *
   * This should be called by a subclass when adding a widget.
   */
  protected ensureParent(widget: Widget): void {
    var parent = this._parent;
    if (parent) widget.parent = parent;
  }

  /**
   * Reparent the child widgets to the layout's parent.
   *
   * This is typically called automatically at the proper times.
   */
  protected reparentChildWidgets(): void {
    var parent = this._parent;
    if (parent) {
      for (var i = 0, n = this.count; i < n; ++i) {
        var widget = this.itemAt(i).widget;
        if (widget) widget.parent = parent;
      }
    }
  }

  private _parent: Widget = null;
}

} // module phosphor.widgets


text:
require 'helper'
require 'erb' #asciidoctor fail to load it randomly

class TestSlimEmbeddedEngines < TestSlim
  def test_render_with_erb
    source = %q{
p
  - text = 'before erb block'
  erb:
    Hello from <%= text.upcase %>!
    Second Line!
    <% if true %><%= true %><% end %>
}

    assert_html "
Hello from BEFORE ERB BLOCK!\nSecond Line!\ntrue
", source
  end

  def test_wip_render_with_asciidoc
    source = %q{
asciidoc:
  == Header
  Hello from #{"AsciiDoc!"}

  #{1+2}

  * one
  * two
}
    output = render(source)
    assert_match 'sect1', output
    assert_match 'Hello from AsciiDoc!', output
  end

  def test_render_with_markdown
    source = %q{
markdown:
  #Header
  Hello from #{"Markdown!"}

  #{1+2}

  * one
  * two
}
    if ::Tilt['md'].name =~ /Redcarpet/
      # redcarpet
      assert_html "
Header
\n\n
Hello from Markdown!
\n\n
3
\n\n
\n
one
\n
two
\n
\n", source
    elsif ::Tilt['md'].name =~ /RDiscount/
      # rdiscount
      assert_html "
Header
\n\n
Hello from Markdown!
\n\n
3
\n\n
\n
one
\n
two
\n
\n\n", source
    else
      # kramdown, :auto_ids by default
      assert_html "
Header
\n
Hello from Markdown!
\n\n
3
\n\n
\n
one
\n
two
\n
\n", source

      Slim::Embedded.with_options(markdown: {auto_ids: false}) do
        assert_html "
Header
\n
Hello from Markdown!
\n\n
3
\n\n
\n
one
\n
two
\n
\n", source
      end

      assert_html "
Header
\n
Hello from Markdown!
\n\n
3
\n\n
\n
one
\n
two
\n
\n", source
    end
  end

  def test_render_with_creole
    source = %q{
creole:
  = head1
  == head2
}
    assert_html "
head1

head2
", source
  end

  def test_render_with_creole_one_line
    source = %q{
creole: Hello **world**,
  we can write one-line embedded markup now!
  = Headline
  Text
.nested: creole: **Strong**
}
    assert_html '
Hello world, we can write one-line embedded markup now!

Headline

Text

Strong

', source
  end

  def test_render_with_org
    # HACK: org-ruby registers itself in Tilt
    require 'org-ruby'

    source = %q{
org:
  * point1
  * point2
}
    assert_html "
point1
\n
point2
\n", source
  end

  def test_render_with_builder
    source = %q{
builder:
  xml.p(id: 'test') {
    xml.text!('Hello')
  }
}
    assert_html "
\nHello
\n", source
  end

  def test_render_with_wiki
    source = %q{
wiki:
  = head1
  == head2
}
    assert_html "
head1

head2
", source
  end

  def test_render_with_javascript
    # Keep the trailing space behind "javascript:   "!
    source = %q{
javascript:
  $(function() {});

  alert('hello')
p Hi
}
    assert_html %{
Hi
}, source
  end

  def test_render_with_opal
    begin
      # HACK: org-ruby registers itself in Tilt
      require 'opal'
    rescue LoadError
      return
    end

    source = %q{
opal:
  puts 'hello from opal'
}
    assert_match '$puts("hello from opal")', render(source)
  end

  def test_render_with_javascript_with_tabs
    source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
    assert_html "
Hi
", source
  end

  def test_render_with_javascript_including_variable
    # Keep the trailing space behind "javascript:   "!
    source = %q{
- func = "alert('hello');"
javascript:
  $(function() { #{func} });
}
    assert_html %q||, source
  end

  def test_render_with_javascript_with_explicit_html_comment
    Slim::Engine.with_options(js_wrapper: :comment) do
      source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
      assert_html "
Hi
", source
    end
  end

  def test_render_with_javascript_with_explicit_cdata_comment
    Slim::Engine.with_options(js_wrapper: :cdata) do
      source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
      assert_html "
Hi
", source
    end
  end

  def test_render_with_javascript_with_format_xhtml_comment
    Slim::Engine.with_options(js_wrapper: :guess, format: :xhtml) do
      source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
      assert_html "
Hi
", source
    end
  end

  def test_render_with_javascript_with_format_html_comment
    Slim::Engine.with_options(js_wrapper: :guess, format: :html) do
      source = "javascript:\n\t$(function() {});\n\talert('hello')\np Hi"
      assert_html "
Hi
", source
    end
  end

  def test_render_with_ruby
    source = %q{
ruby:
  variable = 1 +
  2
= variable
}
    assert_html '3', source
  end

  def test_render_with_scss
    source = %q{
scss:
  $color: #f00;
  body { color: $color; }
}
    assert_html "", source
  end

  def test_disabled_embedded_engine
    source = %{
ruby:
  Embedded Ruby
}
    assert_runtime_error 'Embedded engine ruby is disabled', source, enable_engines: [:javascript]
    assert_runtime_error 'Embedded engine ruby is disabled', source, enable_engines: %w(javascript)

    source = %{
ruby:
  Embedded Ruby
}
    assert_runtime_error 'Embedded engine ruby is disabled', source, enable_engines: [:javascript]
    assert_runtime_error 'Embedded engine ruby is disabled', source, enable_engines: %w(javascript)

    source = %{
ruby:
  Embedded Ruby
}
    assert_runtime_error 'Embedded engine ruby is disabled', source, disable_engines: [:ruby]
    assert_runtime_error 'Embedded engine ruby is disabled', source, disable_engines: %w(ruby)
  end

  def test_enabled_embedded_engine
    source = %q{
javascript:
  $(function() {});
}
    assert_html '', source, disable_engines: [:ruby]
    assert_html '', source, disable_engines: %w(ruby)

    source = %q{
javascript:
  $(function() {});
}
    assert_html '', source, enable_engines: [:javascript]
    assert_html '', source, enable_engines: %w(javascript)
  end
end


text:
package org.saravana.consumer;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

import org.saravana.domain.Download;
import org.saravana.domain.Download.Status;
import org.saravana.domain.DownloadTask;
import org.saravana.monitor.DownloadMonitor;
import org.saravana.queue.DownloadQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class DownloadConsumerImpl implements DownloadConsumer {

	@Value("${max.exec.threads}")
	private int nThreads;

	@Value("${download.location}")
	private String path;

	@Autowired
	private DownloadQueue queue;

	@Autowired
	private DownloadMonitor downloadMonitor;

	private ExecutorService execService;

	@Override
	@PostConstruct
	public void init() {
		execService = Executors.newFixedThreadPool(nThreads <= 0 ? Runtime.getRuntime().availableProcessors() : nThreads);
	}

	private volatile boolean isRunning;

	@Override
	@PostConstruct
	public void download() {
		new Thread(() -> getTask(isRunning)).start();
	}

	protected void getTask(boolean isRunning) {
		while (!isRunning) {
			Download download = queue.take();
			if (download.getStatus() == Status.TERMINATE) {
				isRunning = !isRunning;
				destroy();
				return;
			}
			download.setPath(path);
			this.downloadMonitor.add(download);
			if (download.getStatus() != Status.REJECTED)
				submitTask(download);
		}
	}

	protected void submitTask(Download download) {
		this.execService.submit(new DownloadTask(download));
	}

	@Override
	@PreDestroy
	public void destroy() {
		execService.shutdown();
	}

	public DownloadQueue getQueue() {
		return queue;
	}

	public void setQueue(DownloadQueue queue) {
		this.queue = queue;
	}

	public DownloadMonitor getDownloadMonitor() {
		return downloadMonitor;
	}

	public void setDownloadMonitor(DownloadMonitor downloadMonitor) {
		this.downloadMonitor = downloadMonitor;
	}

}


text:
const { exec } = require('mz/child_process');

module.exports = async (command) => {
    const stdout = await exec(command, {
        cwd: __dirname,
        uid: process.getuid()
    });

    return stdout.toString('utf8');
};


text:
from __future__ import division,print_function,unicode_literals
import os
import bctest
import buildenv

if __name__ == '__main__':
	bctest.bctester(os.environ["srcdir"] + "/test/data",
			"presidentielcoin-util-test.json",buildenv)


text:
#pragma once
#include <aws/dynamodb/DynamoDB_EXPORTS.h>

namespace Aws
{
namespace Utils
{
namespace Json
{
  class JsonValue;
  class JsonView;
} // namespace Json
} // namespace Utils
namespace DynamoDB
{
namespace Model
{

  /**
   *
Replica-specific provisioned throughput settings. If not specified, uses the
   * source table's provisioned throughput settings.

See Also:
   AWS
   * API Reference

   */
  class AWS_DYNAMODB_API ProvisionedThroughputOverride
  {
  public:
    ProvisionedThroughputOverride();
    ProvisionedThroughputOverride(Aws::Utils::Json::JsonView jsonValue);
    ProvisionedThroughputOverride& operator=(Aws::Utils::Json::JsonView jsonValue);
    Aws::Utils::Json::JsonValue Jsonize() const;

    /**
     *
Replica-specific read capacity units. If not specified, uses the source
     * table's read capacity settings.

     */
    inline long long GetReadCapacityUnits() const{ return m_readCapacityUnits; }

    /**
     *
Replica-specific read capacity units. If not specified, uses the source
     * table's read capacity settings.

     */
    inline bool ReadCapacityUnitsHasBeenSet() const { return m_readCapacityUnitsHasBeenSet; }

    /**
     *
Replica-specific read capacity units. If not specified, uses the source
     * table's read capacity settings.

     */
    inline void SetReadCapacityUnits(long long value) { m_readCapacityUnitsHasBeenSet = true; m_readCapacityUnits = value; }

    /**
     *
Replica-specific read capacity units. If not specified, uses the source
     * table's read capacity settings.

     */
    inline ProvisionedThroughputOverride& WithReadCapacityUnits(long long value) { SetReadCapacityUnits(value); return *this;}

  private:

    long long m_readCapacityUnits;
    bool m_readCapacityUnitsHasBeenSet = false;
  };

} // namespace Model
} // namespace DynamoDB
} // namespace Aws


text:
package org.thinkinghub.gateway.oauth.queue;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadFactory;

public class QueueProcessor {

    private String queueName;

    private ExecutorService workerPool;

    public QueueProcessor(String queueName, int workerNum) {
        assert queueName != null && queueName.length() > 0;
        assert workerNum > 0;
        this.queueName = queueName;
        this.workerPool = Executors.newFixedThreadPool(workerNum, new ThreadFactory() {
            @Override
            public Thread newThread(Runnable r) {
                Thread t = new Thread(r);
                t.setName(String.format("queue-worker-thread-for-%s-%d", queueName, t.getId()));
                t.setDaemon(true);
                return t;
            }
        });
    }

    public void put(QueuableTask task) {
        workerPool.submit(task);
    }

    public String getQueueName() {
        return queueName;
    }
}


text:
#ifndef PADDLE_ONLY_CPU
/// This unittest checks GpuSparseMatrix/CpuSparseMatrix get same result,
//  so disable when
/// only cpu version.

#include <gtest/gtest.h>
#include "paddle/math/Matrix.h"
#include "paddle/utils/Util.h"
#include "test_matrixUtil.h"

using namespace paddle;  // NOLINT
using namespace std;     // NOLINT

static inline int uniformRandom(int n) { return n == 0 ? 0 : rand() % n; }

void testSpMatrixAddBias(int M, int N, real rate, real scale) {
  int nnz = M * N * rate;

  MatrixPtr cpuA(new CpuSparseMatrix(M, N, nnz));
  MatrixPtr cpuB = std::make_shared<CpuMatrix>(1, N);

  MatrixPtr gpuA(new GpuSparseMatrix(M, N, nnz));
  MatrixPtr gpuB = std::make_shared<GpuMatrix>(1, N);

  cpuA->randomizeUniform();
  cpuB->randomizeUniform();

  hl_stream_t stream(HPPL_STREAM_1);
  gpuA->copyFrom(*cpuA, stream);
  gpuB->copyFrom(*cpuB, stream);
  hl_stream_synchronize(stream);

  cpuA->addBias(*cpuB, scale);
  gpuA->addBias(*gpuB, scale);

  MatrixPtr outputCheck(new CpuSparseMatrix(M, N, nnz));
  outputCheck->copyFrom(*gpuA, stream);
  hl_stream_synchronize(stream);
  checkSMatrixEqual2(std::dynamic_pointer_cast<CpuSparseMatrix>(cpuA),
                     std::dynamic_pointer_cast<CpuSparseMatrix>(outputCheck));
}

void testSpMatrixAddDense(int M, int N, real rate) {  // add3
  int nnz = M * N * rate;

  MatrixPtr cpuA(new CpuSparseMatrix(M, N, nnz));
  MatrixPtr cpuB = std::make_shared<CpuMatrix>(M, N);

  MatrixPtr gpuA(new GpuSparseMatrix(M, N, nnz));
  MatrixPtr gpuB = std::make_shared<GpuMatrix>(M, N);

  cpuA->randomizeUniform();
  cpuB->randomizeUniform();

  hl_stream_t stream(HPPL_STREAM_3);
  gpuA->copyFrom(*cpuA, stream);
  gpuB->copyFrom(*cpuB, stream);
  hl_stream_synchronize(stream);

  cpuA->add3(cpuB);
  gpuA->add3(gpuB);

  MatrixPtr outputCheck(new CpuSparseMatrix(M, N, nnz));
  outputCheck->copyFrom(*gpuA, stream);
  hl_stream_synchronize(stream);
  checkSMatrixEqual2(std::dynamic_pointer_cast<CpuSparseMatrix>(cpuA),
                     std::dynamic_pointer_cast<CpuSparseMatrix>(outputCheck));
}

void testSpMatrixMul(int M, int N, int K, real rate) {
  int nnz = M * N * rate;

  MatrixPtr cpuA = std::make_shared<CpuMatrix>(M, K);
  MatrixPtr cpuB = std::make_shared<CpuMatrix>(N, K);
  MatrixPtr cpuC(new CpuSparseMatrix(M, N, nnz));

  MatrixPtr gpuA = std::make_shared<GpuMatrix>(M, K);
  MatrixPtr gpuB = std::make_shared<GpuMatrix>(N, K);
  MatrixPtr gpuC(new GpuSparseMatrix(M, N, nnz));

  cpuA->randomizeUniform();
  cpuB->randomizeUniform();
  cpuC->randomizeUniform();

  hl_stream_t stream(HPPL_STREAM_3);
  gpuA->copyFrom(*cpuA, stream);
  gpuB->copyFrom(*cpuB, stream);
  gpuC->copyFrom(*cpuC, stream);
  hl_stream_synchronize(stream);

  cpuC->mul(cpuA, cpuB->getTranspose(), 1, 1);
  gpuC->mul(gpuA, gpuB->getTranspose(), 1, 1);

  MatrixPtr outputCheck(new CpuSparseMatrix(M, N, nnz));
  outputCheck->copyFrom(*gpuC, stream);
  hl_stream_synchronize(stream);
  checkSMatrixErr(std::dynamic_pointer_cast<CpuSparseMatrix>(cpuC),
                  std::dynamic_pointer_cast<CpuSparseMatrix>(outputCheck));
}

void testSpMatrixCollectBias(int M, int N, real rate) {
  int nnz = M * N * rate;
  LOG(INFO) << "nnz=" << nnz;

  MatrixPtr cpuA(new CpuSparseMatrix(M, N, nnz));
  MatrixPtr cpuB = std::make_shared<CpuMatrix>(1, N);

  MatrixPtr gpuA(new GpuSparseMatrix(M, N, nnz));
  MatrixPtr gpuB = std::make_shared<GpuMatrix>(1, N);

  cpuA->randomizeUniform();
  cpuB->randomizeUniform();

  hl_stream_t stream(HPPL_STREAM_3);
  gpuA->copyFrom(*cpuA, stream);
  gpuB->copyFrom(*cpuB, stream);
  hl_stream_synchronize(stream);

  cpuB->collectBias(*cpuA, 1);
  gpuB->collectBias(*gpuA, 1);

  MatrixPtr outputCheck = std::make_shared<CpuMatrix>(1, N);
  outputCheck->copyFrom(*gpuB, stream);
  hl_stream_synchronize(stream);
  checkMatrixErr(*cpuB, *outputCheck);
}

TEST(SMatrix, sMatrixOp) {
  for (auto height : {1, 11, 200}) {
    for (auto width : {200, 2048, 20480}) {
      VLOG(3) << " height=" << height << " width=" << width;
      for (auto rate : {0.02, 0.1}) {
        testSpMatrixAddDense(height, width, rate);
        testSpMatrixAddBias(height, width, rate, 1.0);
      }
    }
  }
}

TEST(SMatrix, sMatrixMul) {
  for (auto M : {1, 40, 128, 200}) {
    for (auto N : {100, 2000, 20480}) {
      for (auto K : {100, 512, 1024}) {
        VLOG(3) << " M=" << M << " N=" << N << " K=" << K;
        testSpMatrixMul(M, N, K, 0.05);
      }
    }
  }
}

TEST(SMatrix, sMatrixCollectBias) {
  for (auto height : {1, 128, 200}) {
    for (auto width : {100, 2048, 20480}) {
      VLOG(3) << " height=" << height << " width=" << width;
      testSpMatrixCollectBias(height, width, 0.1);
    }
  }
}

int main(int argc, char** argv) {
  testing::InitGoogleTest(&argc, argv);
  initMain(argc, argv);
  int ret = RUN_ALL_TESTS();
  return ret;
}

#endif


text:
<TITLE>Review for Ed Wood (1994)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Ed Wood (1994)

reviewed by
Chad Polenz

                                  ED WOOD
                       A film review by Chad Polenz
                        Copyright 1997 Chad Polenz

*** (out of 4 = good)
1994,, R, 124 minutes [2 hours, 4 minutes]
[satire]
starring: Johnny Depp (Ed Wood), Martin Landou (Bela Lugosi), Sarah Jessica
Parker (Delores Wood), written by Scott Alexander, Larry Karaszewski,
produced by Denise Di Novi, Tim Burton, directed by Tim Burton.

Did you ever wonder who made those bad sci-fi/horror movies they show at 2
a.m. that also end up being ridiculed on "Mystery Science Theater 3000"? Well
Edward D. Wood Jr. is the man responsible for starting an entire industry of
bad movies, unfortunately he never really saw it that way, and "Ed Wood" is a
good satirical portrait of his life.

Ed Wood was a man so in love with the filmmaking process itself he didn't
care if things went wrong, the script was terrible, or the props were fake.
To him, it's not about scrutiny, it's about the joy of the movies and as long
as people are having fun nothing else matters. Johnny Depp is excellent as
the quite neurotic, obsessive, cross-dressing Ed Wood. He starts his
showbusiness career by taking on projects no one else will touch, with
stories so terrible it's a wonder they're even thought up. He writes his own
scripts, does all the casting, and even manages to raise the money to make
the movies himself.

But Ed has a heart, he knows who the respected people in the business are
like Orson Wells, and feels the need to succeed as his role models have done.
One day, he stumbles upon Bela Lugosi (Landou), a symbolic character in films
of these types. He's a morphine addict, and thinks he's still a huge star but
can't accept the fact he's a wash-up. Lugosi is going broke, but much like
Ed, he is so in love with film he'll take any job just to work. It's obvious
we are meant to feel for the pathetic old man, but the attitude of the film
isn't some type of sappy melodrama, it is a satire through and through.

Even Ed's home life is portrayed in a very satirical and funny manner, as a
parody of 50s sit-coms. The dialogue is so over-the-top it's hard to tell
what's scripted and what's improvised.

There is a fair amount of events and actions going on in this movie, yet
there is no specific plot, just the adventures of Ed Wood. We see him pitch
his ideas and not understand how anyone couldn't like anything shown to them
on a screen. He actually believes the audience is scared by his monsters and
aliens, and he is going to win an Oscar for his work. Ed and his crew aren't
even discouraged when they are attacked by an angry mob of frustrated
movie-goers!

Finally Ed embarks on the infamous "Plan 9 From Outer Space," a film so bad
and so stupid it's almost brilliant. One of the final scenes depicts the
opening night of "Plan 9" and we can see the excitement bristling in Ed's
eyes. His face is so lit up with joy he is in ecstasy just watching the
picture... it's both pathetic and funny.

I liked "Ed Wood" even though there wasn't much to it. It has a great sense
of mood and is very clever overall. Why did he make all those bad movies
anyway? The good thing about this film is that it doesn't try to answer that
question (6/4/96) (1/18/97) (6/11/97) [see also: "Barton Fink," also by
Burton: "Batman"]

please visit Chad'z Movie Page @ http://members.aol.com/ChadPolenz/index.html

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
package hu.petabyte.redflags.engine.test;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import org.junit.Test;

import hu.petabyte.redflags.engine.util.ArgsUtils;

/**
 * @author Zsolt Jurányi
 */
@Deprecated
public class ArgsCheckerTest {

	@Test
	public void argMissing() {
		assertTrue(ArgsUtils.isAnyArgMissing( //
				new String[] { "--scope=auto" }, //
				new String[] { "--scope=.+", "--cache=.+" } //
		));
		assertTrue(ArgsUtils.isAnyArgMissing( //
				new String[] { "--scope=auto" }, //
				new String[] { "--cache=.+", "--scope=.+" } //
		));
		assertTrue(ArgsUtils.isAnyArgMissing( //
				new String[] { "--cache=tenders" }, //
				new String[] { "--scope=.+", "--cache=.+" } //
		));
	}

	@Test
	public void noArgsMissing() {
		assertFalse(ArgsUtils.isAnyArgMissing( //
				new String[] { "--scope=auto" }, //
				new String[] { "--scope=.+" } //
		));
		assertFalse(ArgsUtils.isAnyArgMissing( //
				new String[] { "--scope=auto", "--cache=tenders" }, //
				new String[] { "--scope=.+", "--cache=.+" } //
		));
	}

}


text:
FROM centos:centos7
MAINTAINER Przemyslaw Ozgo linux@ozgo.info, Marcin Ryzycki marcin@m12.io

RUN \
    yum update -y && \
    yum install -y epel-release && \
    yum install -y atop htop nmap iftop iotop mc net-tools xfsprogs mariadb mtr && \
    yum clean all

ADD htoprc /root/.config/htop/htoprc


text:
function problem6() {
    var discriminant,
        outputString,
        outputField = document.getElementById('problem-6-output'),
        coefficientA = document.getElementById('problem-6-first').value | 0,
        coefficientB = document.getElementById('problem-6-second').value | 0,
        coefficientC = document.getElementById('problem-6-third').value | 0;

    discriminant = (coefficientB * coefficientB) - 4 * coefficientA * coefficientC;
    console.log('discriminant is ' + discriminant);
    if (discriminant === 0) {
        var root = (coefficientB * -1) / (2 * coefficientA);
        outputString = 'Root is ' + root;
    } else if (discriminant > 0) {
        var rootOne = ((coefficientB * -1) + Math.sqrt(discriminant)) / (coefficientA * 2);
        var rootTwo = ((coefficientB * -1) - Math.sqrt(discriminant)) / (coefficientA * 2);
        outputString = 'Roots are ' + rootOne + ', ' + rootTwo;
    } else {
        outputString = 'No real roots.';
    }

    console.log('Problem 6');
    console.log(outputString);
    console.log('\n');

    outputField.innerHTML = outputString;
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;

namespace GestureSample.Views
{
	public class DisposeInHandlerContentView : ContentView
	{
		public DisposeInHandlerContentView()
		{
			BackgroundColor = Color.Blue;

			SetContent();
		}

		public void SetContent()
		{
			var syncLbl = new MR.Gestures.Label { Text = "Clear synchronously", HorizontalOptions = LayoutOptions.Start, BackgroundColor = Color.Silver };
#pragma warning disable CS4014
			syncLbl.Tapping += (s, e) => { DisposeInHandlerPage.Log.Text = "Sync clear from inside"; ClearContent(); };
#pragma warning restore CS4014
			var asyncLbl = new MR.Gestures.Label { Text = "Clear asynchronously", HorizontalOptions = LayoutOptions.EndAndExpand, BackgroundColor = Color.Silver };
			asyncLbl.Tapping += async (s, e) => { DisposeInHandlerPage.Log.Text = "Async clear from inside"; await ClearContent(); };

			Content = new StackLayout
			{
				Orientation = StackOrientation.Horizontal,
				Padding = 20,
				Children =
				{
					syncLbl,
					asyncLbl,
				}
			};
		}

#pragma warning disable CS1998
		public async Task ClearContent()
		{
			Content = null;
		}
#pragma warning restore CS1998
	}
}


text:
/** \brief Short description of this file
 **
 ** Long description of this file
 **
 **/

/** \addtogroup CIAA_Firmware CIAA Firmware
 ** @{ */
/** \addtogroup Template Template to start a new module
 ** @{ */

/*
 * Initials     Name
 * ---------------------------
 *
 */

/*
 * modification history (new versions first)
 * -----------------------------------------------------------
 * yyyymmdd v0.0.1 initials initial version
 */

/*==================[inclusions]=============================================*/

/*==================[macros and definitions]=================================*/

/*==================[internal data declaration]==============================*/

/*==================[internal functions declaration]=========================*/

/*==================[internal data definition]===============================*/

/*==================[external data definition]===============================*/

/*==================[internal functions definition]==========================*/

/*==================[external functions definition]==========================*/

/** @} doxygen end group definition */
/** @} doxygen end group definition */
/*==================[end of file]============================================*/


text:
package org.mycore.xml.alto.v4;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElements;
import javax.xml.bind.annotation.XmlID;
import javax.xml.bind.annotation.XmlIDREF;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;

/**
 * A block of text.
 *
 *
Java class for TextBlockType complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="TextBlockType">
 *   <complexContent>
 *     <extension base="{http://www.loc.gov/standards/alto/ns-v4#}BlockType">
 *       <sequence minOccurs="0">
 *         <element name="TextLine" maxOccurs="unbounded">
 *           <complexType>
 *             <complexContent>
 *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                 <sequence>
 *                   <sequence>
 *                     <element name="Shape" type="{http://www.loc.gov/standards/alto/ns-v4#}ShapeType" minOccurs="0"/>
 *                   </sequence>
 *                   <sequence maxOccurs="unbounded">
 *                     <element name="String" type="{http://www.loc.gov/standards/alto/ns-v4#}StringType"/>
 *                     <element name="SP" type="{http://www.loc.gov/standards/alto/ns-v4#}SPType" minOccurs="0"/>
 *                   </sequence>
 *                   <element name="HYP" minOccurs="0">
 *                     <complexType>
 *                       <complexContent>
 *                         <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *                           <attribute name="HEIGHT" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                           <attribute name="WIDTH" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                           <attribute name="HPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                           <attribute name="VPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                           <attribute name="CONTENT" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
 *                         </restriction>
 *                       </complexContent>
 *                     </complexType>
 *                   </element>
 *                 </sequence>
 *                 <attribute name="ID" type="{http://www.loc.gov/standards/alto/ns-v4#}TextLineID" />
 *                 <attribute name="STYLEREFS" type="{http://www.w3.org/2001/XMLSchema}IDREFS" />
 *                 <attribute name="TAGREFS" type="{http://www.w3.org/2001/XMLSchema}IDREFS" />
 *                 <attribute name="PROCESSINGREFS" type="{http://www.w3.org/2001/XMLSchema}IDREFS" />
 *                 <attribute name="HEIGHT" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                 <attribute name="WIDTH" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                 <attribute name="HPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                 <attribute name="VPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                 <attribute name="BASELINE" type="{http://www.w3.org/2001/XMLSchema}float" />
 *                 <attribute name="LANG" type="{http://www.w3.org/2001/XMLSchema}language" />
 *                 <attribute name="CS" type="{http://www.w3.org/2001/XMLSchema}boolean" />
 *               </restriction>
 *             </complexContent>
 *           </complexType>
 *         </element>
 *       </sequence>
 *       <attribute name="language" type="{http://www.w3.org/2001/XMLSchema}language" />
 *       <attribute name="LANG" type="{http://www.w3.org/2001/XMLSchema}language" />
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "TextBlockType", propOrder = {
    "textLine"
})
public class TextBlockType
    extends BlockType
{

    @XmlElement(name = "TextLine")
    protected List<TextBlockType.TextLine> textLine;
    @XmlAttribute(name = "language")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlSchemaType(name = "language")
    protected String language;
    @XmlAttribute(name = "LANG")
    @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
    @XmlSchemaType(name = "language")
    protected String lang;

    /**
     * Gets the value of the textLine property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the textLine property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getTextLine().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link TextBlockType.TextLine }
     *
     *
     */
    public List<TextBlockType.TextLine> getTextLine() {
        if (textLine == null) {
            textLine = new ArrayList<TextBlockType.TextLine>();
        }
        return this.textLine;
    }

    /**
     * Gets the value of the language property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLanguage() {
        return language;
    }

    /**
     * Sets the value of the language property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLanguage(String value) {
        this.language = value;
    }

    /**
     * Gets the value of the lang property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLANG() {
        return lang;
    }

    /**
     * Sets the value of the lang property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLANG(String value) {
        this.lang = value;
    }

    /**
     *
Java class for anonymous complex type.
     *
     *
The following schema fragment specifies the expected content contained within this class.
     *
     *

     * <complexType>
     *   <complexContent>
     *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *       <sequence>
     *         <sequence>
     *           <element name="Shape" type="{http://www.loc.gov/standards/alto/ns-v4#}ShapeType" minOccurs="0"/>
     *         </sequence>
     *         <sequence maxOccurs="unbounded">
     *           <element name="String" type="{http://www.loc.gov/standards/alto/ns-v4#}StringType"/>
     *           <element name="SP" type="{http://www.loc.gov/standards/alto/ns-v4#}SPType" minOccurs="0"/>
     *         </sequence>
     *         <element name="HYP" minOccurs="0">
     *           <complexType>
     *             <complexContent>
     *               <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
     *                 <attribute name="HEIGHT" type="{http://www.w3.org/2001/XMLSchema}float" />
     *                 <attribute name="WIDTH" type="{http://www.w3.org/2001/XMLSchema}float" />
     *                 <attribute name="HPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
     *                 <attribute name="VPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
     *                 <attribute name="CONTENT" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
     *               </restriction>
     *             </complexContent>
     *           </complexType>
     *         </element>
     *       </sequence>
     *       <attribute name="ID" type="{http://www.loc.gov/standards/alto/ns-v4#}TextLineID" />
     *       <attribute name="STYLEREFS" type="{http://www.w3.org/2001/XMLSchema}IDREFS" />
     *       <attribute name="TAGREFS" type="{http://www.w3.org/2001/XMLSchema}IDREFS" />
     *       <attribute name="PROCESSINGREFS" type="{http://www.w3.org/2001/XMLSchema}IDREFS" />
     *       <attribute name="HEIGHT" type="{http://www.w3.org/2001/XMLSchema}float" />
     *       <attribute name="WIDTH" type="{http://www.w3.org/2001/XMLSchema}float" />
     *       <attribute name="HPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
     *       <attribute name="VPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
     *       <attribute name="BASELINE" type="{http://www.w3.org/2001/XMLSchema}float" />
     *       <attribute name="LANG" type="{http://www.w3.org/2001/XMLSchema}language" />
     *       <attribute name="CS" type="{http://www.w3.org/2001/XMLSchema}boolean" />
     *     </restriction>
     *   </complexContent>
     * </complexType>
     *

     *
     *
     */
    @XmlAccessorType(XmlAccessType.FIELD)
    @XmlType(name = "", propOrder = {
        "shape",
        "stringAndSP",
        "hyp"
    })
    public static class TextLine {

        @XmlElement(name = "Shape")
        protected ShapeType shape;
        @XmlElements({
            @XmlElement(name = "String", required = true, type = StringType.class),
            @XmlElement(name = "SP", required = true, type = SPType.class)
        })
        protected List<Object> stringAndSP;
        @XmlElement(name = "HYP")
        protected TextBlockType.TextLine.HYP hyp;
        @XmlAttribute(name = "ID")
        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
        @XmlID
        protected String id;
        @XmlAttribute(name = "STYLEREFS")
        @XmlIDREF
        @XmlSchemaType(name = "IDREFS")
        protected List<Object> stylerefs;
        @XmlAttribute(name = "TAGREFS")
        @XmlIDREF
        @XmlSchemaType(name = "IDREFS")
        protected List<Object> tagrefs;
        @XmlAttribute(name = "PROCESSINGREFS")
        @XmlIDREF
        @XmlSchemaType(name = "IDREFS")
        protected List<Object> processingrefs;
        @XmlAttribute(name = "HEIGHT")
        protected Float height;
        @XmlAttribute(name = "WIDTH")
        protected Float width;
        @XmlAttribute(name = "HPOS")
        protected Float hpos;
        @XmlAttribute(name = "VPOS")
        protected Float vpos;
        @XmlAttribute(name = "BASELINE")
        protected Float baseline;
        @XmlAttribute(name = "LANG")
        @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
        @XmlSchemaType(name = "language")
        protected String lang;
        @XmlAttribute(name = "CS")
        protected Boolean cs;

        /**
         * Gets the value of the shape property.
         *
         * @return
         *     possible object is
         *     {@link ShapeType }
         *
         */
        public ShapeType getShape() {
            return shape;
        }

        /**
         * Sets the value of the shape property.
         *
         * @param value
         *     allowed object is
         *     {@link ShapeType }
         *
         */
        public void setShape(ShapeType value) {
            this.shape = value;
        }

        /**
         * Gets the value of the stringAndSP property.
         *
         *

         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a set method for the stringAndSP property.
         *
         *

         * For example, to add a new item, do as follows:
         *

         *    getStringAndSP().add(newItem);
         *

         *
         *
         *

         * Objects of the following type(s) are allowed in the list
         * {@link StringType }
         * {@link SPType }
         *
         *
         */
        public List<Object> getStringAndSP() {
            if (stringAndSP == null) {
                stringAndSP = new ArrayList<Object>();
            }
            return this.stringAndSP;
        }

        /**
         * Gets the value of the hyp property.
         *
         * @return
         *     possible object is
         *     {@link TextBlockType.TextLine.HYP }
         *
         */
        public TextBlockType.TextLine.HYP getHYP() {
            return hyp;
        }

        /**
         * Sets the value of the hyp property.
         *
         * @param value
         *     allowed object is
         *     {@link TextBlockType.TextLine.HYP }
         *
         */
        public void setHYP(TextBlockType.TextLine.HYP value) {
            this.hyp = value;
        }

        /**
         * Gets the value of the id property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        public String getID() {
            return id;
        }

        /**
         * Sets the value of the id property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        public void setID(String value) {
            this.id = value;
        }

        /**
         * Gets the value of the stylerefs property.
         *
         *

         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a set method for the stylerefs property.
         *
         *

         * For example, to add a new item, do as follows:
         *

         *    getSTYLEREFS().add(newItem);
         *

         *
         *
         *

         * Objects of the following type(s) are allowed in the list
         * {@link Object }
         *
         *
         */
        public List<Object> getSTYLEREFS() {
            if (stylerefs == null) {
                stylerefs = new ArrayList<Object>();
            }
            return this.stylerefs;
        }

        /**
         * Gets the value of the tagrefs property.
         *
         *

         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a set method for the tagrefs property.
         *
         *

         * For example, to add a new item, do as follows:
         *

         *    getTAGREFS().add(newItem);
         *

         *
         *
         *

         * Objects of the following type(s) are allowed in the list
         * {@link Object }
         *
         *
         */
        public List<Object> getTAGREFS() {
            if (tagrefs == null) {
                tagrefs = new ArrayList<Object>();
            }
            return this.tagrefs;
        }

        /**
         * Gets the value of the processingrefs property.
         *
         *

         * This accessor method returns a reference to the live list,
         * not a snapshot. Therefore any modification you make to the
         * returned list will be present inside the JAXB object.
         * This is why there is not a set method for the processingrefs property.
         *
         *

         * For example, to add a new item, do as follows:
         *

         *    getPROCESSINGREFS().add(newItem);
         *

         *
         *
         *

         * Objects of the following type(s) are allowed in the list
         * {@link Object }
         *
         *
         */
        public List<Object> getPROCESSINGREFS() {
            if (processingrefs == null) {
                processingrefs = new ArrayList<Object>();
            }
            return this.processingrefs;
        }

        /**
         * Gets the value of the height property.
         *
         * @return
         *     possible object is
         *     {@link Float }
         *
         */
        public Float getHEIGHT() {
            return height;
        }

        /**
         * Sets the value of the height property.
         *
         * @param value
         *     allowed object is
         *     {@link Float }
         *
         */
        public void setHEIGHT(Float value) {
            this.height = value;
        }

        /**
         * Gets the value of the width property.
         *
         * @return
         *     possible object is
         *     {@link Float }
         *
         */
        public Float getWIDTH() {
            return width;
        }

        /**
         * Sets the value of the width property.
         *
         * @param value
         *     allowed object is
         *     {@link Float }
         *
         */
        public void setWIDTH(Float value) {
            this.width = value;
        }

        /**
         * Gets the value of the hpos property.
         *
         * @return
         *     possible object is
         *     {@link Float }
         *
         */
        public Float getHPOS() {
            return hpos;
        }

        /**
         * Sets the value of the hpos property.
         *
         * @param value
         *     allowed object is
         *     {@link Float }
         *
         */
        public void setHPOS(Float value) {
            this.hpos = value;
        }

        /**
         * Gets the value of the vpos property.
         *
         * @return
         *     possible object is
         *     {@link Float }
         *
         */
        public Float getVPOS() {
            return vpos;
        }

        /**
         * Sets the value of the vpos property.
         *
         * @param value
         *     allowed object is
         *     {@link Float }
         *
         */
        public void setVPOS(Float value) {
            this.vpos = value;
        }

        /**
         * Gets the value of the baseline property.
         *
         * @return
         *     possible object is
         *     {@link Float }
         *
         */
        public Float getBASELINE() {
            return baseline;
        }

        /**
         * Sets the value of the baseline property.
         *
         * @param value
         *     allowed object is
         *     {@link Float }
         *
         */
        public void setBASELINE(Float value) {
            this.baseline = value;
        }

        /**
         * Gets the value of the lang property.
         *
         * @return
         *     possible object is
         *     {@link String }
         *
         */
        public String getLANG() {
            return lang;
        }

        /**
         * Sets the value of the lang property.
         *
         * @param value
         *     allowed object is
         *     {@link String }
         *
         */
        public void setLANG(String value) {
            this.lang = value;
        }

        /**
         * Gets the value of the cs property.
         *
         * @return
         *     possible object is
         *     {@link Boolean }
         *
         */
        public Boolean isCS() {
            return cs;
        }

        /**
         * Sets the value of the cs property.
         *
         * @param value
         *     allowed object is
         *     {@link Boolean }
         *
         */
        public void setCS(Boolean value) {
            this.cs = value;
        }

        /**
         *
Java class for anonymous complex type.
         *
         *
The following schema fragment specifies the expected content contained within this class.
         *
         *

         * <complexType>
         *   <complexContent>
         *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
         *       <attribute name="HEIGHT" type="{http://www.w3.org/2001/XMLSchema}float" />
         *       <attribute name="WIDTH" type="{http://www.w3.org/2001/XMLSchema}float" />
         *       <attribute name="HPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
         *       <attribute name="VPOS" type="{http://www.w3.org/2001/XMLSchema}float" />
         *       <attribute name="CONTENT" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
         *     </restriction>
         *   </complexContent>
         * </complexType>
         *

         *
         *
         */
        @XmlAccessorType(XmlAccessType.FIELD)
        @XmlType(name = "")
        public static class HYP {

            @XmlAttribute(name = "HEIGHT")
            protected Float height;
            @XmlAttribute(name = "WIDTH")
            protected Float width;
            @XmlAttribute(name = "HPOS")
            protected Float hpos;
            @XmlAttribute(name = "VPOS")
            protected Float vpos;
            @XmlAttribute(name = "CONTENT", required = true)
            protected String content;

            /**
             * Gets the value of the height property.
             *
             * @return
             *     possible object is
             *     {@link Float }
             *
             */
            public Float getHEIGHT() {
                return height;
            }

            /**
             * Sets the value of the height property.
             *
             * @param value
             *     allowed object is
             *     {@link Float }
             *
             */
            public void setHEIGHT(Float value) {
                this.height = value;
            }

            /**
             * Gets the value of the width property.
             *
             * @return
             *     possible object is
             *     {@link Float }
             *
             */
            public Float getWIDTH() {
                return width;
            }

            /**
             * Sets the value of the width property.
             *
             * @param value
             *     allowed object is
             *     {@link Float }
             *
             */
            public void setWIDTH(Float value) {
                this.width = value;
            }

            /**
             * Gets the value of the hpos property.
             *
             * @return
             *     possible object is
             *     {@link Float }
             *
             */
            public Float getHPOS() {
                return hpos;
            }

            /**
             * Sets the value of the hpos property.
             *
             * @param value
             *     allowed object is
             *     {@link Float }
             *
             */
            public void setHPOS(Float value) {
                this.hpos = value;
            }

            /**
             * Gets the value of the vpos property.
             *
             * @return
             *     possible object is
             *     {@link Float }
             *
             */
            public Float getVPOS() {
                return vpos;
            }

            /**
             * Sets the value of the vpos property.
             *
             * @param value
             *     allowed object is
             *     {@link Float }
             *
             */
            public void setVPOS(Float value) {
                this.vpos = value;
            }

            /**
             * Gets the value of the content property.
             *
             * @return
             *     possible object is
             *     {@link String }
             *
             */
            public String getCONTENT() {
                return content;
            }

            /**
             * Sets the value of the content property.
             *
             * @param value
             *     allowed object is
             *     {@link String }
             *
             */
            public void setCONTENT(String value) {
                this.content = value;
            }

        }

    }

}