text:
function books (bookName) {
    var allBooks = {
        'JavaScript Remoto': {
            pages: 267,
            author: 'Ben Vinegar Anton Kovalyov',
            publisher: 'Novatec'
        },
        'JavaScript: O guia definitivo': {
            pages: 1062,
            author: 'David Flanagan',
            publisher: 'Novatec'
        },
        'Segredos do Ninja JavaScript': {
            pages: 233,
            author: ' John Resig & Bear Bibeault',
            publisher: 'Novatec'
        }
    };
    return !bookName ? allBooks : allBooks[bookName];
}

var book = books('JavaScript: O guia definitivo');

console.log('O livro [JavaScript: O guia definitivo] tem ' + book.pages + ' páginas!');
console.log('O autor do livro [JavaScript: O guia definitivo] é ' + book.author + '!');
console.log('O livro [JavaScript: O guia definitivo] foi publicado pela editora ' + book.publisher + '.');

redpajama_set_name: RedPajamaGithub


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

define([
  'dojo/_base/declare',
  'dojo/_base/html',
  'dojo/query',
  'dojo/_base/array',
  'jimu/utils'
], function(declare, html, query, array, jimuUtils) {
  return declare('jimu-bind-label-props-mixin', null, {
    isRenderIdForAttrs: false,//if add attrs for screen readers.
    /*
      //Two templates:
      *Before rendering*
      span string
      label string
      <input data-a11y-label-by="a" value="myValue" />
      <input data-a11y-label-by="a b" value="myValue" />
      *After rendering*
      span string
      label string 1
      <input aira-labelledby="uuid_a" value="myValue" />
      <input aira-labelledby="uuid_a uuid_b" value="myValue" />

      *Before rendering*
      label string
      <input data-label-id="c" value="myValue" />
      *After rendering*
      label string
      <input id="uuid_c" value="myValue" />
    */

    buildRendering: function(){
      this.inherited(arguments);
      if(!this.isRenderIdForAttrs){
        return;
      }
      var a11yLabelId = 'data-a11y-label-id', a11yLabelBy = 'data-a11y-label-by';
      var labelFor = 'data-label-for', labelId = 'data-label-id';
      var labelledDoms = query("[" + a11yLabelId + "],[" + a11yLabelBy + "], [" + labelFor +
       "], [" + labelId + "]", this.domNode);

      if(html.getAttr(this.domNode, a11yLabelId) || html.getAttr(this.domNode, a11yLabelBy) ||
        html.getAttr(this.domNode, labelFor) || html.getAttr(this.domNode, labelId)){
        labelledDoms.unshift(this.domNode);
      }

      var idByDict = {idsDict: {}, bysDict: []}; //idsDict:{'id1':id1_Dom, 'id2':id2_Dom}

      var idForDict = {};//{'groupName':{idDom: operateDom, forDom: labelDom}}
      //Init dict
      var uid, index = 0;
      var uniqId = 'jimuUniqName_' + jimuUtils.getUUID();
      array.forEach(labelledDoms, function(labelledDom) {
        var _a11yLabelId = html.getAttr(labelledDom, a11yLabelId);
        var _a11yLabelBy = html.getAttr(labelledDom, a11yLabelBy);
        var _labelFor = html.getAttr(labelledDom, labelFor);
        var _labelId = html.getAttr(labelledDom, labelId);

        //Id & labelledby
        if(_a11yLabelId){
          html.removeAttr(labelledDom, a11yLabelId);
          uid = uniqId + '_' + index;
          html.setAttr(labelledDom, 'id', uid);
          idByDict.idsDict[_a11yLabelId] = uid;
          index ++;
        }else if(_a11yLabelBy){
          idByDict.bysDict.push(labelledDom);
        }
        //For & id
        else if(_labelFor){
          if(!idForDict.hasOwnProperty(_labelFor)){
            idForDict[_labelFor] = {};
          }
          idForDict[_labelFor].forDom = labelledDom;
        }else{
          if(!idForDict.hasOwnProperty(_labelId)){
            idForDict[_labelId] = {};
          }
          idForDict[_labelId].idDom = labelledDom;
        }
      });

      //set ids rendered for bysDict from idsDict
      for(var idx1 in idByDict.bysDict){//ids & aria-labelledby
        var byDom = idByDict.bysDict[idx1];
        var ids = html.getAttr(byDom, a11yLabelBy).split(' ');
        var idsArray = [];
        array.forEach(ids, function(id) {
          idsArray.push(idByDict.idsDict[id]);
        });
        html.removeAttr(byDom, a11yLabelBy);
        html.setAttr(byDom, 'aria-labelledby', idsArray.join(' '));
      }

      for(var idx2 in idForDict){//for & id
        uid = uniqId + '_' + index;
        var forDom = idForDict[idx2].forDom;
        var idDom = idForDict[idx2].idDom;
        if(forDom){
          html.removeAttr(forDom, labelFor);
          html.setAttr(forDom, 'for', uid);
        }
        if(idDom){
          html.removeAttr(idDom, labelId);
          html.setAttr(idDom, 'id', uid);
        }
        index ++;
      }
    }
  });
});


text:
/** zn and zf are the (both negative) near and far planes
    used for the projection matrix that renders the scene.

    From the Graphics Codex entry for "Unproject Depth".
*/
vec3 computeClipInfo(float zn, float zf) {
    if (zf == -INF) {
        return vec3(zn, -1.0f, +1.0f);
    } else {
        return vec3(zn  * zf, zn - zf, zf);
    }
}


text:
package org.jboss.jbossts.qa.junit.testgroup;

import org.jboss.jbossts.qa.junit.*;
import org.junit.*;

// Automatically generated by XML2JUnit
public class TestGroup_rawresources02_2b extends TestGroupBase
{
	public String getTestGroupName()
	{
		return "rawresources02_2b";
	}

	protected Task server0 = null;

	@Before public void setUp()
	{
		super.setUp();
		server0 = createTask("server0", com.arjuna.ats.arjuna.recovery.RecoveryManager.class, Task.TaskType.EXPECT_READY, 480);
		server0.start("-test");
	}

	@After public void tearDown()
	{
		try {
			server0.terminate();
            removeServerIORStore("task0", "$(1)", "$(2)");
		} finally {
			super.tearDown();
		}
	}

    private void runOneServerOneClient(Class clientClass) {

        Task server1 = createTask("server1", org.jboss.jbossts.qa.RawResources02Servers.Server02.class, Task.TaskType.EXPECT_READY, 480);
		server1.start("$(1)", "$(2)");
		Task client0 = createTask("client0", clientClass, Task.TaskType.EXPECT_PASS_FAIL, 480);
		client0.start("$(1)", "$(2)");
		client0.waitFor();
		server1.terminate();
    }

	@Test public void RawResources02_2b_Test001()
	{
		setTestName("Test001");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client001.class);
	}

    @Test public void RawResources02_2b_Test002()
	{
		setTestName("Test002");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client002.class);
	}

	@Test public void RawResources02_2b_Test003()
	{
		setTestName("Test003");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client003.class);
	}

	@Test public void RawResources02_2b_Test004()
	{
		setTestName("Test004");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client004.class);
	}

	@Test public void RawResources02_2b_Test005()
	{
		setTestName("Test005");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client005.class);
	}

	@Test public void RawResources02_2b_Test006()
	{
		setTestName("Test006");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client006.class);
	}

	@Test public void RawResources02_2b_Test007()
	{
		setTestName("Test007");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client007.class);
	}

	@Test public void RawResources02_2b_Test008()
	{
		setTestName("Test008");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client008.class);
	}

	@Test public void RawResources02_2b_Test009()
	{
		setTestName("Test009");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client009.class);
	}

	@Test public void RawResources02_2b_Test010()
	{
		setTestName("Test010");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client010.class);
	}

	@Test public void RawResources02_2b_Test011()
	{
		setTestName("Test011");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client011.class);
	}

	@Test public void RawResources02_2b_Test012()
	{
		setTestName("Test012");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client012.class);
	}

	@Test public void RawResources02_2b_Test013()
	{
		setTestName("Test013");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client013.class);
	}

	@Test public void RawResources02_2b_Test014()
	{
		setTestName("Test014");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client014.class);
	}

	@Test public void RawResources02_2b_Test015()
	{
		setTestName("Test015");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client015.class);
	}

	@Test public void RawResources02_2b_Test016()
	{
		setTestName("Test016");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client016.class);
	}

	@Test public void RawResources02_2b_Test017()
	{
		setTestName("Test017");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client017.class);
	}

	@Test public void RawResources02_2b_Test018()
	{
		setTestName("Test018");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client018.class);
	}

	@Test public void RawResources02_2b_Test019()
	{
		setTestName("Test019");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client019.class);
	}

	@Test public void RawResources02_2b_Test020()
	{
		setTestName("Test020");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client020.class);
	}

	@Test public void RawResources02_2b_Test021()
	{
		setTestName("Test021");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client021.class);
	}

	@Test public void RawResources02_2b_Test022()
	{
		setTestName("Test022");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client022.class);
	}

	@Test public void RawResources02_2b_Test023()
	{
		setTestName("Test023");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client023.class);
	}

	@Test public void RawResources02_2b_Test024()
	{
		setTestName("Test024");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client024.class);
	}

	@Test public void RawResources02_2b_Test025()
	{
		setTestName("Test025");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client025.class);
	}

	@Test public void RawResources02_2b_Test026()
	{
		setTestName("Test026");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client026.class);
	}

	@Test public void RawResources02_2b_Test027()
	{
		setTestName("Test027");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client027.class);
	}

	@Test public void RawResources02_2b_Test028()
	{
		setTestName("Test028");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client028.class);
	}

	@Test public void RawResources02_2b_Test029()
	{
		setTestName("Test029");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client029.class);
	}

	@Test public void RawResources02_2b_Test030()
	{
		setTestName("Test030");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client030.class);
	}

	@Test public void RawResources02_2b_Test031()
	{
		setTestName("Test031");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client031.class);
	}

	@Test public void RawResources02_2b_Test032()
	{
		setTestName("Test032");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client032.class);
	}

	@Test public void RawResources02_2b_Test033()
	{
		setTestName("Test033");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client033.class);
	}

	@Test public void RawResources02_2b_Test034()
	{
		setTestName("Test034");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client034.class);
	}

	@Test public void RawResources02_2b_Test035()
	{
		setTestName("Test035");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client035.class);
	}

	@Test public void RawResources02_2b_Test036()
	{
		setTestName("Test036");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client036.class);
	}

	@Test public void RawResources02_2b_Test037()
	{
		setTestName("Test037");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client037.class);
	}

	@Test public void RawResources02_2b_Test038()
	{
		setTestName("Test038");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client038.class);
	}

	@Test public void RawResources02_2b_Test039()
	{
		setTestName("Test039");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client039.class);
	}

	@Test public void RawResources02_2b_Test040()
	{
		setTestName("Test040");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client040.class);
	}

	@Test public void RawResources02_2b_Test041()
	{
		setTestName("Test041");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client041.class);
	}

	@Test public void RawResources02_2b_Test042()
	{
		setTestName("Test042");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client042.class);
	}

	@Test public void RawResources02_2b_Test043()
	{
		setTestName("Test043");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client043.class);
	}

	@Test public void RawResources02_2b_Test044()
	{
		setTestName("Test044");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client044.class);
	}

	@Test public void RawResources02_2b_Test045()
	{
		setTestName("Test045");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client045.class);
	}

	@Test public void RawResources02_2b_Test046()
	{
		setTestName("Test046");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client046.class);
	}

	@Test public void RawResources02_2b_Test047()
	{
		setTestName("Test047");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client047.class);
	}

	@Test public void RawResources02_2b_Test048()
	{
		setTestName("Test048");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client048.class);
	}

	@Test public void RawResources02_2b_Test049()
	{
		setTestName("Test049");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client049.class);
	}

	@Test public void RawResources02_2b_Test050()
	{
		setTestName("Test050");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client050.class);
	}

	@Test public void RawResources02_2b_Test051()
	{
		setTestName("Test051");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client051.class);
	}

	@Test public void RawResources02_2b_Test052()
	{
		setTestName("Test052");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client052.class);
	}

	@Test public void RawResources02_2b_Test053()
	{
		setTestName("Test053");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client053.class);
	}

	@Test public void RawResources02_2b_Test054()
	{
		setTestName("Test054");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client054.class);
	}

	@Test public void RawResources02_2b_Test055()
	{
		setTestName("Test055");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client055.class);
	}

	@Test public void RawResources02_2b_Test056()
	{
		setTestName("Test056");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client056.class);
	}

	@Test public void RawResources02_2b_Test057()
	{
		setTestName("Test057");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client057.class);
	}

	@Test public void RawResources02_2b_Test058()
	{
		setTestName("Test058");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client058.class);
	}

	@Test public void RawResources02_2b_Test059()
	{
		setTestName("Test059");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client059.class);
	}

	@Test public void RawResources02_2b_Test060()
	{
		setTestName("Test060");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client060.class);
	}

	@Test public void RawResources02_2b_Test061()
	{
		setTestName("Test061");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client061.class);
	}

	@Test public void RawResources02_2b_Test062()
	{
		setTestName("Test062");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client062.class);
	}

	@Test public void RawResources02_2b_Test063()
	{
		setTestName("Test063");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client063.class);
	}

	@Test public void RawResources02_2b_Test064()
	{
		setTestName("Test064");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client064.class);
	}

	@Test public void RawResources02_2b_Test065()
	{
		setTestName("Test065");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client065.class);
	}

	@Test public void RawResources02_2b_Test066()
	{
		setTestName("Test066");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client066.class);
	}

	@Test public void RawResources02_2b_Test067()
	{
		setTestName("Test067");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client067.class);
	}

	@Test public void RawResources02_2b_Test068()
	{
		setTestName("Test068");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client068.class);
	}

	@Test public void RawResources02_2b_Test069()
	{
		setTestName("Test069");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client069.class);
	}

	@Test public void RawResources02_2b_Test070()
	{
		setTestName("Test070");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client070.class);
	}

	@Test public void RawResources02_2b_Test071()
	{
		setTestName("Test071");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client071.class);
	}

	@Test public void RawResources02_2b_Test072()
	{
		setTestName("Test072");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client072.class);
	}

	@Test public void RawResources02_2b_Test073()
	{
		setTestName("Test073");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client073.class);
	}

	@Test public void RawResources02_2b_Test074()
	{
		setTestName("Test074");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client074.class);
	}

	@Test public void RawResources02_2b_Test075()
	{
		setTestName("Test075");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client075.class);
	}

	@Test public void RawResources02_2b_Test076()
	{
		setTestName("Test076");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client076.class);
	}

	@Test public void RawResources02_2b_Test077()
	{
		setTestName("Test077");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client077.class);
	}

	@Test public void RawResources02_2b_Test078()
	{
		setTestName("Test078");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client078.class);
	}

	@Test public void RawResources02_2b_Test079()
	{
		setTestName("Test079");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client079.class);
	}

	@Test public void RawResources02_2b_Test080()
	{
		setTestName("Test080");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client080.class);
	}

	@Test public void RawResources02_2b_Test081()
	{
		setTestName("Test081");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client081.class);
	}

	@Test public void RawResources02_2b_Test082()
	{
		setTestName("Test082");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client082.class);
	}

	@Test public void RawResources02_2b_Test083()
	{
		setTestName("Test083");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client083.class);
	}

	@Test public void RawResources02_2b_Test084()
	{
		setTestName("Test084");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client084.class);
	}

	@Test public void RawResources02_2b_Test085()
	{
		setTestName("Test085");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client085.class);
	}

	@Test public void RawResources02_2b_Test086()
	{
		setTestName("Test086");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client086.class);
	}

	@Test public void RawResources02_2b_Test087()
	{
		setTestName("Test087");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client087.class);
	}

	@Test public void RawResources02_2b_Test088()
	{
		setTestName("Test088");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client088.class);
	}

	@Test public void RawResources02_2b_Test089()
	{
		setTestName("Test089");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client089.class);
	}

	@Test public void RawResources02_2b_Test090()
	{
		setTestName("Test090");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client090.class);
	}

	@Test public void RawResources02_2b_Test091()
	{
		setTestName("Test091");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client091.class);
	}

	@Test public void RawResources02_2b_Test092()
	{
		setTestName("Test092");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client092.class);
	}

	@Test public void RawResources02_2b_Test093()
	{
		setTestName("Test093");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client093.class);
	}

	@Test public void RawResources02_2b_Test094()
	{
		setTestName("Test094");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client094.class);
	}

	@Test public void RawResources02_2b_Test095()
	{
		setTestName("Test095");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client095.class);
	}

	@Test public void RawResources02_2b_Test096()
	{
		setTestName("Test096");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client096.class);
	}

	@Test public void RawResources02_2b_Test097()
	{
		setTestName("Test097");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client097.class);
	}

	@Test public void RawResources02_2b_Test098()
	{
		setTestName("Test098");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client098.class);
	}

	@Test public void RawResources02_2b_Test099()
	{
		setTestName("Test099");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client099.class);
	}

	@Test public void RawResources02_2b_Test100()
	{
		setTestName("Test100");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client100.class);
	}

	@Test public void RawResources02_2b_Test101()
	{
		setTestName("Test101");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client101.class);
	}

	@Test public void RawResources02_2b_Test102()
	{
		setTestName("Test102");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client102.class);
	}

	@Test public void RawResources02_2b_Test103()
	{
		setTestName("Test103");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client103.class);
	}

	@Test public void RawResources02_2b_Test104()
	{
		setTestName("Test104");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client104.class);
	}

	@Test public void RawResources02_2b_Test105()
	{
		setTestName("Test105");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client105.class);
	}

	@Test public void RawResources02_2b_Test106()
	{
		setTestName("Test106");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client106.class);
	}

	@Test public void RawResources02_2b_Test107()
	{
		setTestName("Test107");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client107.class);
	}

	@Test public void RawResources02_2b_Test108()
	{
		setTestName("Test108");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client108.class);
	}

	@Test public void RawResources02_2b_Test109()
	{
		setTestName("Test109");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client109.class);
	}

	@Test public void RawResources02_2b_Test110()
	{
		setTestName("Test110");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client110.class);
	}

	@Test public void RawResources02_2b_Test111()
	{
		setTestName("Test111");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client111.class);
	}

	@Test public void RawResources02_2b_Test112()
	{
		setTestName("Test112");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client112.class);
	}

	@Test public void RawResources02_2b_Test113()
	{
		setTestName("Test113");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client113.class);
	}

	@Test public void RawResources02_2b_Test114()
	{
		setTestName("Test114");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client114.class);
	}

	@Test public void RawResources02_2b_Test115()
	{
		setTestName("Test115");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client115.class);
	}

	@Test public void RawResources02_2b_Test116()
	{
		setTestName("Test116");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client116.class);
	}

	@Test public void RawResources02_2b_Test117()
	{
		setTestName("Test117");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client117.class);
	}

	@Test public void RawResources02_2b_Test118()
	{
		setTestName("Test118");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client118.class);
	}

	@Test public void RawResources02_2b_Test119()
	{
		setTestName("Test119");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client119.class);
	}

	@Test public void RawResources02_2b_Test120()
	{
		setTestName("Test120");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client120.class);
	}

	@Test public void RawResources02_2b_Test121()
	{
		setTestName("Test121");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client121.class);
	}

	@Test public void RawResources02_2b_Test122()
	{
		setTestName("Test122");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client122.class);
	}

	@Test public void RawResources02_2b_Test123()
	{
		setTestName("Test123");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client123.class);
	}

	@Test public void RawResources02_2b_Test124()
	{
		setTestName("Test124");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client124.class);
	}

	@Test public void RawResources02_2b_Test125()
	{
		setTestName("Test125");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client125.class);
	}

	@Test public void RawResources02_2b_Test126()
	{
		setTestName("Test126");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client126.class);
	}

	@Test public void RawResources02_2b_Test127()
	{
		setTestName("Test127");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client127.class);
	}

	@Test public void RawResources02_2b_Test128()
	{
		setTestName("Test128");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client128.class);
	}

	@Test public void RawResources02_2b_Test129()
	{
		setTestName("Test129");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client129.class);
	}

	@Test public void RawResources02_2b_Test130()
	{
		setTestName("Test130");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client130.class);
	}

	@Test public void RawResources02_2b_Test131()
	{
		setTestName("Test131");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client131.class);
	}

	@Test public void RawResources02_2b_Test132()
	{
		setTestName("Test132");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client132.class);
	}

	@Test public void RawResources02_2b_Test133()
	{
		setTestName("Test133");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client133.class);
	}

	@Test public void RawResources02_2b_Test134()
	{
		setTestName("Test134");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client134.class);
	}

	@Test public void RawResources02_2b_Test135()
	{
		setTestName("Test135");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client135.class);
	}

	@Test public void RawResources02_2b_Test136()
	{
		setTestName("Test136");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client136.class);
	}

	@Test public void RawResources02_2b_Test137()
	{
		setTestName("Test137");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client137.class);
	}

	@Test public void RawResources02_2b_Test138()
	{
		setTestName("Test138");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client138.class);
	}

	@Test public void RawResources02_2b_Test139()
	{
		setTestName("Test139");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client139.class);
	}

	@Test public void RawResources02_2b_Test140()
	{
		setTestName("Test140");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client140.class);
	}

	@Test public void RawResources02_2b_Test141()
	{
		setTestName("Test141");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client141.class);
	}

	@Test public void RawResources02_2b_Test142()
	{
		setTestName("Test142");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client142.class);
	}

	@Test public void RawResources02_2b_Test143()
	{
		setTestName("Test143");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client143.class);
	}

	@Test public void RawResources02_2b_Test144()
	{
		setTestName("Test144");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client144.class);
	}

	@Test public void RawResources02_2b_Test145()
	{
		setTestName("Test145");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client145.class);
	}

	@Test public void RawResources02_2b_Test146()
	{
		setTestName("Test146");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client146.class);
	}

	@Test public void RawResources02_2b_Test147()
	{
		setTestName("Test147");
        runOneServerOneClient(org.jboss.jbossts.qa.RawResources02Clients2.Client147.class);
	}
}


text:
SYNONYM

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

#### Published in
J. Mycol. 14: 5 (1908)

#### Original name
Physalospora kellermanii Rehm, 1908

### Remarks
null


text:
"""

   Copyright 2014-2019 OpenEEmeter contributors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

"""
from collections import namedtuple

import numpy as np
import pandas as pd
from patsy import dmatrix

__all__ = (
    "iterate_segmented_dataset",
    "segment_time_series",
    "CalTRACKSegmentModel",
    "SegmentedModel",
    "HourlyModelPrediction",
)

HourlyModelPrediction = namedtuple("HourlyModelPrediction", ["result"])

class CalTRACKSegmentModel(object):
    """An object that captures the model fit for one segment.

    Attributes
    ----------
    segment_name : :any:`str`
        The name of the segment of data this model was fit to.
    model : :any:`object`
        The fitted model object.
    formula : :any:`str`
        The formula of the model regression.
    model_param : :any:`dict`
        A dictionary of parameters
    warnings : :any:`list`
        A list of eemeter warnings.
    """

    def __init__(self, segment_name, model, formula, model_params, warnings=None):
        self.segment_name = segment_name
        self.model = model
        self.formula = formula
        self.model_params = model_params

        if warnings is None:
            warnings = []
        self.warnings = warnings

    def predict(self, data):
        """A function which takes input data and predicts for this segment model."""
        if self.formula is None:
            var_str = ""
        else:
            var_str = self.formula.split("~", 1)[1]

        design_matrix_granular = dmatrix(var_str, data, return_type="dataframe")
        parameters = pd.Series(self.model_params)

        # Step 1, slice
        col_type = "C(hour_of_week)"
        hour_of_week_cols = [
            c
            for c in design_matrix_granular.columns
            if col_type in c and c in parameters.keys()
        ]

        # Step 2, cut out all 0s
        design_matrix_granular = design_matrix_granular[
            (design_matrix_granular[hour_of_week_cols] != 0).any(axis=1)
        ]

        cols_to_predict = list(
            set(parameters.keys()).intersection(set(design_matrix_granular.keys()))
        )
        design_matrix_granular = design_matrix_granular[cols_to_predict]
        parameters = parameters[cols_to_predict]

        # Step 3, predict
        prediction = design_matrix_granular.dot(parameters).rename("predicted_usage")

        # Step 4, put nans back in
        prediction = prediction.reindex(data.index)

        return prediction

    def json(self):
        """Return a JSON-serializable representation of this result.

        The output of this function can be converted to a serialized string
        with :any:`json.dumps`.
        """

        data = {
            "segment_name": self.segment_name,
            "formula": self.formula,
            "warnings": [w.json() for w in self.warnings],
            "model_params": self.model_params,
        }
        return data

    @classmethod
    def from_json(cls, data):
        """Loads a JSON-serializable representation into the model state.

        The input of this function is a dict which can be the result
        of :any:`json.loads`.
        """

        c = cls(
            data.get("segment_name"),
            None,
            data.get("formula"),
            data.get("model_params"),
            warnings=data.get("warnings"),
        )

        return c

class SegmentedModel(object):
    """Represent a model which has been broken into multiple model segments (for
    CalTRACK Hourly, these are month-by-month segments, each of which is associated
    with a different model.

    Parameters
    ----------
    segment_models : :any:`dict` of :any:`eemeter.CalTRACKSegmentModel`
        Dictionary of segment models, keyed by segment name.
    prediction_segment_type : :any:`str`
        Any segment_type that can be passed to :any:`eemeter.segment_time_series`,
        currently "single", "one_month", "three_month", or "three_month_weighted".
    prediction_segment_name_mapping : :any:`dict` of :any:`str`
        A dictionary mapping the segment names for the segment type used for predicting to the
        segment names for the segment type used for fitting,
        e.g., `{"<predict_segment_name>": "<fit_segment_name>"}`.
    prediction_feature_processor : :any:`function`
        A function that transforms raw inputs (temperatures) into features for each
        segment.
    prediction_feature_processor_kwargs : :any:`dict`
        A dict of keyword arguments to be passed as `**kwargs` to the
        `prediction_feature_processor` function.
    """

    def __init__(
        self,
        segment_models,
        prediction_segment_type,
        prediction_segment_name_mapping=None,
        prediction_feature_processor=None,
        prediction_feature_processor_kwargs=None,
    ):
        self.segment_models = segment_models

        fitted_model_lookup = {
            segment_model.segment_name: segment_model
            for segment_model in segment_models
        }
        if prediction_segment_name_mapping is None:
            self.model_lookup = fitted_model_lookup
        else:
            self.model_lookup = {
                pred_name: fitted_model_lookup.get(fit_name)
                for pred_name, fit_name in prediction_segment_name_mapping.items()
            }
        self.prediction_segment_type = prediction_segment_type
        self.prediction_segment_name_mapping = prediction_segment_name_mapping
        self.prediction_feature_processor = prediction_feature_processor
        self.prediction_feature_processor_kwargs = prediction_feature_processor_kwargs

    def predict(
        self, prediction_index, temperature, **kwargs
    ):  # ignore extra args with kwargs
        """Predict over a prediction index by combining results from all models.

        Parameters
        ----------
        prediction_index : :any:`pandas.DatetimeIndex`
            The index over which to predict.
        temperature : :any:`pandas.Series`
            Hourly temperatures.
        **kwargs
            Extra argmuents will be ignored
        """
        prediction_segmentation = segment_time_series(
            temperature.index,
            self.prediction_segment_type,
            drop_zero_weight_segments=True,
        )

        iterator = iterate_segmented_dataset(
            temperature.to_frame("temperature_mean"),
            segmentation=prediction_segmentation,
            feature_processor=self.prediction_feature_processor,
            feature_processor_kwargs=self.prediction_feature_processor_kwargs,
            feature_processor_segment_name_mapping=self.prediction_segment_name_mapping,
        )

        predictions = {}
        for segment_name, segmented_data in iterator:
            segment_model = self.model_lookup.get(segment_name)
            if segment_model is None:
                continue
            prediction = segment_model.predict(segmented_data) * segmented_data.weight
            # NaN the zero weights and reindex
            prediction = prediction[segmented_data.weight > 0].reindex(prediction_index)
            predictions[segment_name] = prediction

        predictions = pd.DataFrame(predictions)
        result = pd.DataFrame({"predicted_usage": predictions.sum(axis=1, min_count=1)})
        return HourlyModelPrediction(result=result)

    def json(self):
        """Return a JSON-serializable representation of this result.

        The output of this function can be converted to a serialized string
        with :any:`json.dumps`.
        """

        def _json_or_none(obj):
            return None if obj is None else obj.json()

        data = {
            "segment_models": [_json_or_none(m) for m in self.segment_models],
            "model_lookup": {
                key: _json_or_none(val) for key, val in self.model_lookup.items()
            },
            "prediction_segment_type": self.prediction_segment_type,
            "prediction_segment_name_mapping": self.prediction_segment_name_mapping,
            "prediction_feature_processor": self.prediction_feature_processor.__name__,
        }
        return data

def filter_zero_weights_feature_processor(segment_name, segment_data):
    """A default segment processor to use if none is provided."""
    return segment_data[segment_data.weight > 0]

def iterate_segmented_dataset(
    data,
    segmentation=None,
    feature_processor=None,
    feature_processor_kwargs=None,
    feature_processor_segment_name_mapping=None,
):
    """A utility for iterating over segments which allows providing a function for
    processing outputs into features.

    Parameters
    ----------
    data : :any:`pandas.DataFrame`, required
        Data to segment,
    segmentation : :any:`pandas.DataFrame`, default None
        A segmentation of the input dataframe expressed as a dataframe which shares
        the timeseries index of the data and has named columns of weights, which
        are iterated over to create the outputs (or inputs to the feature processor,
        which then creates the actual outputs).
    feature_processor : :any:`function`, default None
        A function that transforms raw inputs (temperatures) into features for each
        segment.
    feature_processor_kwargs : :any:`dict`, default None
        A dict of keyword arguments to be passed as `**kwargs` to the
        `feature_processor` function.
    feature_processor_segment_name_mapping : :any:`dict`, default None
        A mapping from the default segmentation segment names to alternate names. This
        is useful when prediction uses a different segment type than fitting.
    """
    if feature_processor is None:
        feature_processor = filter_zero_weights_feature_processor

    if feature_processor_kwargs is None:
        feature_processor_kwargs = {}

    if feature_processor_segment_name_mapping is None:
        feature_processor_segment_name_mapping = {}

    def _apply_feature_processor(segment_name, segment_data):
        feature_processor_segment_name = feature_processor_segment_name_mapping.get(
            segment_name, segment_name
        )

        if feature_processor is not None:
            segment_data = feature_processor(
                feature_processor_segment_name, segment_data, **feature_processor_kwargs
            )
        return segment_data

    def _add_weights(data, weights):
        return pd.merge(data, weights, left_index=True, right_index=True)

    if segmentation is None:
        # spoof segment name and weights column
        segment_name = None
        weights = pd.DataFrame({"weight": 1}, index=data.index)
        segment_data = _add_weights(data, weights)

        segment_data = _apply_feature_processor(segment_name, segment_data)
        yield segment_name, segment_data
    else:
        for segment_name, segment_weights in segmentation.iteritems():
            weights = segment_weights.to_frame("weight")
            segment_data = _add_weights(data, weights)
            segment_data = _apply_feature_processor(segment_name, segment_data)
            yield segment_name, segment_data

def _get_calendar_year_coverage_warning(index):
    pass

def _get_hourly_coverage_warning(index, min_fraction_daily_coverage=0.9):
    pass

def _segment_weights_single(index):
    return pd.DataFrame({"all": 1.0}, index=index)

def _segment_weights_one_month(index):
    return pd.DataFrame(
        {
            month_name: (index.month == month_number).astype(float)
            for month_name, month_number in [
                ("jan", 1),
                ("feb", 2),
                ("mar", 3),
                ("apr", 4),
                ("may", 5),
                ("jun", 6),
                ("jul", 7),
                ("aug", 8),
                ("sep", 9),
                ("oct", 10),
                ("nov", 11),
                ("dec", 12),
            ]
        },
        index=index,
        columns=[
            "jan",
            "feb",
            "mar",
            "apr",
            "may",
            "jun",
            "jul",
            "aug",
            "sep",
            "oct",
            "nov",
            "dec",
        ],  # guarantee order
    )

def _segment_weights_three_month(index):
    return pd.DataFrame(
        {
            month_names: (index.month.map(lambda i: i in month_numbers)).astype(float)
            for month_names, month_numbers in [
                ("dec-jan-feb", (12, 1, 2)),
                ("jan-feb-mar", (1, 2, 3)),
                ("feb-mar-apr", (2, 3, 4)),
                ("mar-apr-may", (3, 4, 5)),
                ("apr-may-jun", (4, 5, 6)),
                ("may-jun-jul", (5, 6, 7)),
                ("jun-jul-aug", (6, 7, 8)),
                ("jul-aug-sep", (7, 8, 9)),
                ("aug-sep-oct", (8, 9, 10)),
                ("sep-oct-nov", (9, 10, 11)),
                ("oct-nov-dec", (10, 11, 12)),
                ("nov-dec-jan", (11, 12, 1)),
            ]
        },
        index=index,
        columns=[
            "dec-jan-feb",
            "jan-feb-mar",
            "feb-mar-apr",
            "mar-apr-may",
            "apr-may-jun",
            "may-jun-jul",
            "jun-jul-aug",
            "jul-aug-sep",
            "aug-sep-oct",
            "sep-oct-nov",
            "oct-nov-dec",
            "nov-dec-jan",
        ],  # guarantee order
    )

def _segment_weights_three_month_weighted(index):
    return pd.DataFrame(
        {
            month_names: index.month.map(
                lambda i: month_weights.get(str(i), 0.0)
            ).astype(float)
            for month_names, month_weights in [
                ("dec-jan-feb-weighted", {"12": 0.5, "1": 1, "2": 0.5}),
                ("jan-feb-mar-weighted", {"1": 0.5, "2": 1, "3": 0.5}),
                ("feb-mar-apr-weighted", {"2": 0.5, "3": 1, "4": 0.5}),
                ("mar-apr-may-weighted", {"3": 0.5, "4": 1, "5": 0.5}),
                ("apr-may-jun-weighted", {"4": 0.5, "5": 1, "6": 0.5}),
                ("may-jun-jul-weighted", {"5": 0.5, "6": 1, "7": 0.5}),
                ("jun-jul-aug-weighted", {"6": 0.5, "7": 1, "8": 0.5}),
                ("jul-aug-sep-weighted", {"7": 0.5, "8": 1, "9": 0.5}),
                ("aug-sep-oct-weighted", {"8": 0.5, "9": 1, "10": 0.5}),
                ("sep-oct-nov-weighted", {"9": 0.5, "10": 1, "11": 0.5}),
                ("oct-nov-dec-weighted", {"10": 0.5, "11": 1, "12": 0.5}),
                ("nov-dec-jan-weighted", {"11": 0.5, "12": 1, "1": 0.5}),
            ]
        },
        index=index,
        columns=[
            "dec-jan-feb-weighted",
            "jan-feb-mar-weighted",
            "feb-mar-apr-weighted",
            "mar-apr-may-weighted",
            "apr-may-jun-weighted",
            "may-jun-jul-weighted",
            "jun-jul-aug-weighted",
            "jul-aug-sep-weighted",
            "aug-sep-oct-weighted",
            "sep-oct-nov-weighted",
            "oct-nov-dec-weighted",
            "nov-dec-jan-weighted",
        ],  # guarantee order
    )

def segment_time_series(index, segment_type="single", drop_zero_weight_segments=False):
    """Split a time series index into segments by applying weights.

    Parameters
    ----------
    index : :any:`pandas.DatetimeIndex`
        A time series index which gets split into segments.
    segment_type : :any:`str`
        The method to use when creating segments.

         - "single": creates one big segment with the name "all".
         - "one_month": creates up to twelve segments, each of which contains a single
           month. Segment names are "jan", "feb", ... "dec".
         - "three_month": creates up to twelve overlapping segments, each of which
           contains three calendar months of data. Segment names are "dec-jan-feb",
           "jan-feb-mar", ... "nov-dec-jan"
         - "three_month_weighted": creates up to twelve overlapping segments, each of
           contains three calendar months of data with first and third month in each
           segment having weights of one half. Segment names are
           "dec-jan-feb-weighted", "jan-feb-mar-weighted", ... "nov-dec-jan-weighted".

    Returns
    -------
    segmentation : `pandas.DataFrame`
        A segmentation of the input index expressed as a dataframe which shares
        the input index and has named columns of weights.
    """
    segment_weight_func = {
        "single": _segment_weights_single,
        "one_month": _segment_weights_one_month,
        "three_month": _segment_weights_three_month,
        "three_month_weighted": _segment_weights_three_month_weighted,
    }.get(segment_type, None)

    if segment_weight_func is None:
        raise ValueError("Invalid segment type: %s" % (segment_type))

    segment_weights = segment_weight_func(index)

    if drop_zero_weight_segments:
        # keep only columns with non-zero weights
        total_weights = segment_weights.sum()
        columns_to_keep = total_weights[total_weights > 0].index.tolist()
        segment_weights = segment_weights[columns_to_keep]

    # TODO: Do something with these
    _get_hourly_coverage_warning(segment_weights)  # each model
    _get_calendar_year_coverage_warning(index)  # whole index

    return segment_weights

def fit_model_segments(segmented_dataset_dict, fit_segment):
    """A function which fits a model to each item in a dataset.

    Parameters
    ----------
    segmented_dataset_dict : :any:`dict` of :any:`pandas.DataFrame`
        A dict with keys as segment names and values as dataframes of model input.
    fit_segment : :any:`function`
        A function which fits a model to a dataset in the `segmented_dataset_dict`.

    Returns
    -------
    segment_models : :any:`list` of :any:`object`
        List of fitted model objects - the return values of the fit_segment function.
    """
    segment_models = [
        fit_segment(segment_name, segment_data)
        for segment_name, segment_data in segmented_dataset_dict.items()
    ]
    return segment_models


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

<title>KMap</title>
<meta name="date" content="2019-11-17">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

org.deidentifier.arx.criteria

Class KMap

java.lang.Object

org.deidentifier.arx.criteria.PrivacyCriterion

org.deidentifier.arx.criteria.ImplicitPrivacyCriterion

org.deidentifier.arx.criteria.KMap

All Implemented Interfaces:

java.io.Serializable

public class KMap
extends ImplicitPrivacyCriterion

This class implements the k-map privacy model as proposed by Latanya Sweeney.

 As an alternative to explicitly providing data about the underlying population, cell sizes can be can be estimated with
 the D3 (Poisson) and D4 (zero-truncated Poisson) estimators proposed in:

 K. El Emam and F. Dankar, "Protecting privacy using k-anonymity" JAMIA, vol. 15, no. 5, pp. 627-637, 2008.

 The estimator D3 was first published in:

 J. Pannekoek, "Statistical methods for some simple disclosure limitation rules," Statistica Neerlandica, vol. 53, no. 1, pp. 55-67, 1999.

Author:

Fabian Prasser, Florian Kohlmayer

See Also:

Serialized Form

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static class
KMap.CellSizeEstimator

Estimators for cell sizes in the population.

Constructor Summary

Constructors

Constructor and Description

KMap(int k,
    DataSubset subset)

Creates a new instance of the k-map criterion as proposed by Latanya Sweeney

KMap(int k,
    double significanceLevel,
    ARXPopulationModel populationModel)

Creates a new instance of the criterion using thr Poisson estimator proposed by Pannekoek.

KMap(int k,
    double significanceLevel,
    ARXPopulationModel populationModel,
    KMap.CellSizeEstimator estimator)

Creates a new instance of the criterion using the Poisson estimator proposed by Pannekoek or by El Emam.

Method Summary

All Methods Instance Methods Concrete Methods

Modifier and Type
Method and Description

KMap
clone()

Clone

PrivacyCriterion
clone(DataSubset subset)

Clone for local recoding

DataSubset
getDataSubset()

If a privacy model uses a data subset, it must overwrite this method

int
getDerivedK()

Returns the derived parameter k.

KMap.CellSizeEstimator
getEstimator()

Returns the specified estimator.

int
getK()

Returns k.

int
getMinimalClassSize()

If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations

ARXPopulationModel
getPopulationModel()

Returns the associated population model, null if there is none.

int
getRequirements()

Returns the criterion's requirements.

double
getRiskThresholdJournalist()

Return journalist risk threshold, 1 if there is none

double
getRiskThresholdMarketer()

Return marketer risk threshold, 1 if there is none

double
getRiskThresholdProsecutor()

Return journalist risk threshold, 1 if there is none

double
getSignificanceLevel()

Returns the specified significance level.

double
getType1Error()

Returns the calculated type I error.

void
initialize(DataManager manager,
          ARXConfiguration config)

Override this to initialize the criterion.

boolean
isAccurate()

Return true if the population has been modeled explicitly.

boolean
isAnonymous(Transformation<?> node,
           HashGroupifyEntry entry)

Implement this, to enforce the criterion.

boolean
isLocalRecodingSupported()

Returns whether the criterion supports local recoding.

boolean
isMinimalClassSizeAvailable()

If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations

boolean
isSubsetAvailable()

If a privacy model uses a data subset, it must overwrite this method

ElementData
render()

Renders the privacy model

java.lang.String
toString()

Returns a string representation.

Methods inherited from class org.deidentifier.arx.criteria.PrivacyCriterion

getSubset, isHeuristicSearchSupported, isHeuristicSearchWithTimeLimitSupported, isMonotonicWithGeneralization, isMonotonicWithSuppression, isOptimalSearchSupported, isSampleBased

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail

KMap

public KMap(int k,
            DataSubset subset)

Creates a new instance of the k-map criterion as proposed by Latanya Sweeney

Parameters:

k -

subset - Research subset

KMap

public KMap(int k,
            double significanceLevel,
            ARXPopulationModel populationModel)

Creates a new instance of the criterion using thr Poisson estimator proposed by Pannekoek.

KMap

public KMap(int k,
            double significanceLevel,
            ARXPopulationModel populationModel,
            KMap.CellSizeEstimator estimator)

Creates a new instance of the criterion using the Poisson estimator proposed by Pannekoek or by El Emam.

Method Detail

clone

public KMap clone()

Description copied from class: PrivacyCriterion

Clone

Specified by:

clone in class PrivacyCriterion

clone

public PrivacyCriterion clone(DataSubset subset)

Description copied from class: PrivacyCriterion

Clone for local recoding

Overrides:

clone in class PrivacyCriterion

getDataSubset

public DataSubset getDataSubset()

Description copied from class: PrivacyCriterion

If a privacy model uses a data subset, it must overwrite this method

Overrides:

getDataSubset in class PrivacyCriterion

Returns:

getDerivedK

public int getDerivedK()

Returns the derived parameter k.

Returns:

getEstimator

public KMap.CellSizeEstimator getEstimator()

Returns the specified estimator.

Returns:

getK

public int getK()

Returns k.

Returns:

getMinimalClassSize

public int getMinimalClassSize()

Description copied from class: PrivacyCriterion

If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations

Overrides:

getMinimalClassSize in class PrivacyCriterion

Returns:

getPopulationModel

public ARXPopulationModel getPopulationModel()

Description copied from class: PrivacyCriterion

Returns the associated population model, null if there is none.

Overrides:

getPopulationModel in class PrivacyCriterion

Returns:

the populationModel

getRequirements

public int getRequirements()

Description copied from class: PrivacyCriterion

Returns the criterion's requirements.

Specified by:

getRequirements in class PrivacyCriterion

Returns:

getRiskThresholdJournalist

public double getRiskThresholdJournalist()

Return journalist risk threshold, 1 if there is none

Overrides:

getRiskThresholdJournalist in class PrivacyCriterion

Returns:

getRiskThresholdMarketer

public double getRiskThresholdMarketer()

Return marketer risk threshold, 1 if there is none

Overrides:

getRiskThresholdMarketer in class PrivacyCriterion

Returns:

getRiskThresholdProsecutor

public double getRiskThresholdProsecutor()

Return journalist risk threshold, 1 if there is none

Overrides:

getRiskThresholdProsecutor in class PrivacyCriterion

Returns:

getSignificanceLevel

public double getSignificanceLevel()

Returns the specified significance level.

Returns:

getType1Error

public double getType1Error()

Returns the calculated type I error.

Returns:

initialize

public void initialize(DataManager manager,
                       ARXConfiguration config)

Description copied from class: PrivacyCriterion

Override this to initialize the criterion.

Overrides:

initialize in class PrivacyCriterion

config - TODO

isAccurate

public boolean isAccurate()

Return true if the population has been modeled explicitly.
 This implies that no approximation is performed.

Returns:

isAnonymous

public boolean isAnonymous(Transformation<?> node,
                           HashGroupifyEntry entry)

Description copied from class: PrivacyCriterion

Implement this, to enforce the criterion.

Specified by:

isAnonymous in class PrivacyCriterion

Parameters:

node - TODO

Returns:

isLocalRecodingSupported

public boolean isLocalRecodingSupported()

Description copied from class: PrivacyCriterion

Returns whether the criterion supports local recoding.

Specified by:

isLocalRecodingSupported in class PrivacyCriterion

Returns:

isMinimalClassSizeAvailable

public boolean isMinimalClassSizeAvailable()

Description copied from class: PrivacyCriterion

If a privacy model provides a prosecutor risk threshold, it should override this method to enable optimizations

Overrides:

isMinimalClassSizeAvailable in class PrivacyCriterion

Returns:

isSubsetAvailable

public boolean isSubsetAvailable()

Description copied from class: PrivacyCriterion

If a privacy model uses a data subset, it must overwrite this method

Overrides:

isSubsetAvailable in class PrivacyCriterion

Returns:

render

public ElementData render()

Description copied from class: PrivacyCriterion

Renders the privacy model

Specified by:

render in class PrivacyCriterion

Returns:

toString

public java.lang.String toString()

Description copied from class: PrivacyCriterion

Returns a string representation.

Specified by:

toString in class PrivacyCriterion

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
SYNONYM

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

#### Published in
Edwards's Bot. Reg. 20: t. 1693. 1834

#### Original name
null

### Remarks
null


text:
package de.altimos.util.res;

/**
 * A ResourceManager handles ResourceLocators and can be used to locate
 * resources.
 *
 * @author Jan Graichen
 */
public interface ResourceManager {

	/**
	 * Tries to find a resource with given name.
	 *
	 * @param name
	 * 			The name or identifier of the resource that should be loaded.
	 * @return The ResourceInfo for requested resource object or NULL if the
	 * 			resource was not found.
	 */
	public ResourceInfo getResource(String name);

	/**
	 * Tries to find a resource for given ResourceKey.
	 *
	 * @param key
				The ResourceKey used to identifier a resource.
	 * @return The ResourceInfo for requested resource object or NULL if the
	 * 			resource was not found.
	 */
	public ResourceInfo getResource(ResourceKey key);

}


text:
namespace Ui {
class RelationDialog;
}

class RelationDialog : public QDialog {
    Q_OBJECT

public:
    explicit RelationDialog(WebApi * currApi, QWidget *parent = 0);
    ~RelationDialog();

    int getId() const;
    QString getName();

private slots:
    void on_cancelButton_clicked();

    void on_friendsList_activated(const QModelIndex &index);

    void on_groupsList_activated(const QModelIndex &index);

private:
    Ui::RelationDialog *ui;
    int uid;
    QString name;
    QStringListModel * friendModel, *groupModel;
    WebApi * api;
};

#endif // RELATIONDIALOG_H


text:
require 'tc_helper.rb'

class TestScatterSeries < Test::Unit::TestCase

  def setup
    p = Axlsx::Package.new
    @ws = p.workbook.add_worksheet :name=>"hmmm"
    @chart = @ws.drawing.add_chart Axlsx::ScatterChart, :title => "Scatter Chart"
    @series = @chart.add_series :xData=>[1,2,4], :yData=>[1,3,9], :title=>"exponents", :color => 'FF0000'
  end

  def test_initialize
    assert_equal(@series.title.text, "exponents", "series title has been applied")
  end

  def test_to_xml_string
    doc = Nokogiri::XML(@chart.to_xml_string)
    assert_equal(doc.xpath("//a:srgbClr[@val='#{@series.color}']").size,4)
  end

end


text:
package com.acs.clemson.ordering.graph;

import com.acs.clemson.ordering.util.Constants;

/**
 *
 * @author Emmanuel John
 */
public class Edge {
    private boolean deleted=false;
    private int u;
    private int v;
    private double weight;
    private double pij;
    private double algebraicDist = (1/Constants.EPSILON);

    public Edge(int u, int v, double weight) {
        this.u = u;
        this.v = v;
        this.weight = weight;
    }

    public Edge() {
    }

    public int getU() {
        return u;
    }

    public void setU(int u) {
        this.u = u;
    }

    public int getV() {
        return v;
    }

    public void setV(int v) {
        this.v = v;
    }

    public int getEndpoint(int from){
        if(from == v){
            return u;
        }

        return v;
    }

    public double getPij() {
        return pij;
    }

    public void setPij(double pij) {
        this.pij = pij;
    }

    public double getAlgebraicDist() {
        return algebraicDist;
    }

    public void setAlgebraicDist(double algebraicDist) {
        this.algebraicDist = algebraicDist;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    @Override
    public String toString() {
        return "Edge[u:"+u+", v:"+v+"]";
    }
}


text:
layout: contribute
title: Bazel Code Coverage Roadmap
---

# Bazel Code Coverage Roadmap 2018

*Last verified: 2018-08-08* ([update history](https://github.com/bazelbuild/bazel-website/commits/master/roadmaps/coverage.md))

## Fast Bazel C++ coverage ([tracking issue](https://github.com/bazelbuild/bazel/issues/5882)) (P0)

Currently C++ coverage is 2x slower than just running the corresponding tests.
The goal is to have similar times for running bazel test and bazel coverage on
the same targets.

Objectives:

* C++ coverage with clang uses profdata and outputs lcov ([tracking issue](https://github.com/bazelbuild/bazel/issues/5881))
 IN PROGRESS
* C++ coverage with gcc uses gcov and outputs lcov ([tracking issue](https://github.com/bazelbuild/bazel/issues/5880))
   DONE

## Have a reliable Bazel coverage report (P1)

Objectives:

* [C++] Fix symlinks following in the coverage report.
  IN PROGRESS
* [sh] Improve sh\_test coverage ([tracking issue](https://github.com/bazelbuild/bazel/issues/5331))
  DONE
* [Java] Improve Java coverage ([tracking issue](https://github.com/bazelbuild/bazel/issues/5426))
  IN PROGRESS

## Improve adding coverage support for Skylark rules (P2)

Objectives:

* Have a design for coverage\_toolchain. (see [Bazel coverage design
  doc](https://docs.google.com/document/d/1-ZWHF-Q-qCKf19ik-t33ie58BkNurrYYzKR4OLtcilY/edit?usp=sharing))
  NOT STARTED

## Github hotlist
At any time you can check out the [updated hotlist of all prioritized coverage issues](https://github.com/bazelbuild/bazel/issues?q=is%3Aopen+is%3Aissue+label%3Acoverage).


text: export { default } from './reconfigure-adapter';


text:
package edgectl

import (
	"fmt"

	"github.com/gookit/color"
)

// First message when beginning the AES Installation process
func (i *Installer) ShowFirstInstalling() {
	i.show.Println()
	i.show.Println(color.Bold.Sprintf("Installing the Ambassador Edge Stack"))
}

func (i *Installer) ShowFirstUpgrading() {
	i.show.Println()
	i.show.Println(color.Bold.Sprintf("Upgrading the Ambassador API Gateway to Ambassador Edge Stack"))
}

func (i *Installer) ShowScoutDisabled() {
	i.show.Printf("INFO: phone-home is disabled by environment variable")
}

func (i *Installer) ShowRequestEmail() {
	i.show.Println()
	i.ShowWrapped("Please enter an email address for us to notify you before your TLS certificate and domain name expire. In order to acquire the TLS certificate, we share this email with Let's Encrypt.")
}

func (i *Installer) ShowACMEFailed(reason string) {
	i.show.Println()
	i.show.Println(color.Bold.Sprintf("Acquiring TLS certificate via ACME has failed: %s", reason))
}

func (i *Installer) ShowBeginAESInstallation() {
	i.show.Println()
	i.show.Println("========================================================================")
	i.show.Println("Beginning Ambassador Edge Stack Installation")
}

func (i *Installer) ShowBeginAOSSUpgrade() {
	i.show.Println()
	i.show.Println("========================================================================")
	i.show.Println("Beginning Ambassador API Gateway upgrade")
}

func (i *Installer) ShowFailedWhenLookingForExistingVersion() {
	i.show.Println("-> Failed when looking for an existing installation")
}

func (i *Installer) ShowAESVersionBeingInstalled() {
	i.show.Println(fmt.Sprintf("-> Installing the Ambassador Edge Stack %s.", i.version))
}

func (i *Installer) ShowAESExistingVersion(versionName string, method string) {
	i.show.Println(fmt.Sprintf("-> Ambassador Edge Stack %s was already installed using %s", versionName, method))
}

func (i *Installer) ShowAOSSExistingVersion(versionName string, method string) {
	i.show.Println(fmt.Sprintf("-> Ambassador API Gateway %s was already installed using %s", versionName, method))
}

func (i *Installer) FindingRepositoriesAndVersions() {
	i.show.Println("-> Finding repositories and chart versions")
}

func (i *Installer) ShowOverridingChartVersion(aesChartVersion string, version string) {
	i.show.Println(fmt.Sprintf("   Overriding chart version rule using %s = %s", aesChartVersion, version))
}

func (i *Installer) ShowOverridingImageRepo(aesImageRepo string, repo string) {
	i.show.Println(fmt.Sprintf("   Overriding image repo using %s = %s", aesImageRepo, repo))
}

func (i *Installer) ShowOverridingImageTag(aesImageTag string, tag string) {
	i.show.Println(fmt.Sprintf("   Overriding image tag using %s = %s", aesImageTag, tag))
}

func (i *Installer) ShowOverridingInstallOption(optionTag string, tagValue string) {
	i.show.Println(fmt.Sprintf("   Overriding install option using %s = %s", optionTag, tagValue))
}

func (i *Installer) ShowOverridingHelmRepo(aesHelmRepo string, repo string) {
	i.show.Println(fmt.Sprintf("   Overriding Helm repo using %s = %s", aesHelmRepo, repo))
}

func (i *Installer) ShowAESCRDsButNoAESInstallation() {
	i.show.Println("-> Found Ambassador CRDs in your cluster, but no Edge Stack installation.")
}

func (i *Installer) ShowDownloadingImages() {
	i.show.Println("-> Downloading latest version")
}

func (i *Installer) ShowInstalling(version string) {
	i.show.Println(fmt.Sprintf("-> Installing Ambassador Edge Stack %s", version))
}

func (i *Installer) ShowUpgrading(version string) {
	i.show.Println(fmt.Sprintf("-> Upgrading Ambassador API Gateway to Ambassador Edge Stack %s", version))
}

func (i *Installer) ShowCheckingAESPodDeployment() {
	i.show.Println("-> Checking the AES pod deployment")
}

func (i *Installer) ShowLocalClusterDetected() {
	i.show.Println("-> Local cluster detected. Not configuring automatic TLS.")
}

func (i *Installer) ShowProvisioningLoadBalancer() {
	i.show.Println("-> Provisioning a cloud load balancer")
}

func (i *Installer) ShowAESInstallAddress(address string) {
	i.show.Println("-> Your Ambassador Edge Stack installation's address is", color.Bold.Sprintf(address))
}

func (i *Installer) ShowAESRespondingToACME() {
	i.show.Println("-> Checking that Ambassador Edge Stack is responding to ACME challenge")
}

func (i *Installer) ShowWaiting(what string) {
	i.show.Printf("   Still waiting for %s. (This may take a minute.)", what)
}

func (i *Installer) ShowTimedOut(what string) {
	i.show.Printf("   Timed out waiting for %s (or interrupted)", what)
}

func (i *Installer) ShowLookingForExistingHost() {
	i.show.Printf("-> Looking for a Host resource in the existing installation")
}

func (i *Installer) ShowExistingHostFound(name, namespace string) {
	i.show.Printf("   Found %s in the %s namespace", name, namespace)
}

func (i *Installer) ShowAESConfiguringTLS() {
	i.show.Println("-> Automatically configuring TLS")
}

func (i *Installer) ShowFailedToCreateDNSName(message string) {
	i.show.Println("   Failed to create a DNS name:", message)
}

func (i *Installer) ShowAcquiringDNSName(hostname string) {
	i.show.Println("-> Acquiring DNS name", color.Bold.Sprintf(hostname))
}

func (i *Installer) ShowObtainingTLSCertificate() {
	i.show.Println("-> Obtaining a TLS certificate from Let's Encrypt")
}

func (i *Installer) ShowTLSConfiguredSuccessfully() {
	i.show.Println("-> TLS configured successfully")
}

// AES installation partially complete -- other instructions follow.
func (i *Installer) ShowAESInstallationPartiallyComplete() {
	i.show.Println()
	i.show.Println("Ambassador Edge Stack Installation Complete!")
	i.show.Println("========================================================================")
}

// AES installation complete, but no DNS.
func (i *Installer) ShowAESInstallationCompleteNoDNS() {
	i.show.Println()
	i.show.Println("Ambassador Edge Stack Installation Complete!")
	i.show.Println("========================================================================")

	// Show congratulations message
	i.show.Println()
	message := "<bold>Congratulations! You've successfully installed the Ambassador Edge Stack in your Kubernetes cluster. However, we cannot connect to your cluster from the Internet, so we could not configure TLS automatically. "
	message += "If the IP address is reachable from your computer, you can access your installation without a DNS name.</>\n"
	i.ShowTemplated(message)
	i.show.Println()
}

// AES installation complete!
func (i *Installer) ShowAESInstallationComplete() {
	i.show.Println()
	i.show.Println("Ambassador Edge Stack Installation Complete!")
	i.show.Println("========================================================================")

	// Show congratulations message
	i.show.Println()
	message := color.Bold.Sprintf("Congratulations! You've successfully installed the Ambassador Edge Stack in your Kubernetes cluster. You can find it at your custom URL: https://{{.hostname}}/")
	i.ShowTemplated(message)
	i.show.Println()
}

// AES already installed
func (i *Installer) ShowAESAlreadyInstalled() {
	i.show.Println()
	i.show.Println("Ambassador Edge Stack Already Installed")
	i.show.Println("========================================================================")

	// Show congratulations message
	i.show.Println()
	message := color.Bold.Sprintf("Congratulations! The Ambassador Edge Stack is already installed in your Kubernetes cluster. You can find it at your custom URL: https://{{.hostname}}/")
	i.ShowTemplated(message)
}


text:
package org.drools.benchmarks.common.util;

public final class Constants {

    public static final String PROP_KEY_SMOKE_TESTS = "smoke.tests";
    public static final String PROP_KEY_DUMP_RETE = "dump.rete";
    public static final String PROP_KEY_DUMP_DRL = "dump.drl";
    public static final String PROP_KEY_DEBUG = "debug";

    public enum AccumulateFunction {
        AVERAGE {
            @Override
            public String toString() {
                return "average";
            }
        },
        MIN {
            @Override
            public String toString() {
                return "min";
            }
        },
        MAX {
            @Override
            public String toString() {
                return "max";
            }
        },
        COUNT {
            @Override
            public String toString() {
                return "count";
            }
        },
        SUM {
            @Override
            public String toString() {
                return "sum";
            }
        },
        COLLECT_LIST {
            @Override
            public String toString() {
                return "collectList";
            }
        },
        COLLECT_SET {
            @Override
            public String toString() {
                return "collectSet";
            }
        }
    }

    private Constants() {
        // Intentionally private - it should be not possible to instantiate util classes.
    }
}


text:
+++
Talk_date = ""
Talk_start_time = ""
Talk_end_time = ""
Title = "Shiba - Serverless Slack ChatOps"
Type = "talk"
Speakers = ["frankie-ji"]
youtube = ""
slideshare = ""
slides = ""
+++

Chat bots/integrations have been around since the IRC days. Now more known as ChatOps, these integrations have found a place in the DevOps world. Many organizations of all sizes have integrated chat integrations to aid in everyday tasks, such as deployments. With today's trend of migrating applications to cloud and serverless, why should our chat bots and integrations be left behind?

Malwarebytes began to raise Shiba during the mid 2018's to address growing pains and feature requests to a legacy chat integration. Shiba has since introduced a much more reliable integration as well as saving the organization loads in operation costs.

This talk will go over the following points:

Benefits of ChatOps
Pains of traditional chat integration implementations
How Shiba solves these pains
Challenges/Limitations with serverless bots
Shiba's serverless architecture
Featured functionality
Maintaining and Developing for Shiba


text:
#region Using Statements
using System;
using System.Collections.Generic;
#endregion

namespace Sardes
{
    class Character
    {
        #region Properties

        /// <summary>
        /// Gets or sets the name of the account the character belongs to.
        /// </summary>
        public string Account { get; set; }

        /// <summary>
        /// Gets or sets the name of the character.
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// Gets or sets the class of the character.
        /// </summary>
        public short Class { get; set; }

        /// <summary>
        /// Gets or sets the stage level of the character.
        /// </summary>
        public short StageLevel { get; set; }

        /// <summary>
        /// Gets or sets the stage experience of the character.
        /// </summary>
        public int StageExperience { get; set; }

        /// <summary>
        /// Gets or sets the PVP level of the character.
        /// </summary>
        public short PvpLevel { get; set; }

        /// <summary>
        /// Gets or sets the pvp experience of the character.
        /// </summary>
        public int PvpExperience { get; set; }

        /// <summary>
        /// Gets or sets the war level of the character.
        /// </summary>
        public short WarLevel { get; set; }

        /// <summary>
        /// Gets or sets the war experience of the character.
        /// </summary>
        public int WarExperience { get; set; }

        /// <summary>
        /// Gets or sets the date on which the character was created.
        /// </summary>
        public DateTime CreatedOn { get; set; }

        /// <summary>
        /// Gets or sets the date on which the character last logged in.
        /// </summary>
        public DateTime LastLoggedOn { get; set; }

        /// <summary>
        /// Gets or sets the number of unspend skillpoints the character has left.
        /// </summary>
        public short SkillPoints { get; set; }

        /// <summary>
        /// Gets or sets the amount of bags the character has.
        /// </summary>
        public short BagCount { get; set; }

        /// <summary>
        /// Gets or sets the amount of money the character has in its bag.
        /// </summary>
        public int BagMoney { get; set; }

        /// <summary>
        /// Gets or sets the amount of bag slots the character has in the bank.
        /// </summary>
        public short BankBagCount { get; set; }

        /// <summary>
        /// Gets or sets the amount of money the character has stored in the bank.
        /// </summary>
        public int BankMoney { get; set; }

        /// <summary>
        /// Gets or sets the rebirth level of the character.
        /// </summary>
        public short RebirthLevel { get; set; }

        /// <summary>
        /// Gets or sets the number of times the character has been reborn.
        /// </summary>
        public short RebirthCount { get; set; }

        /// <summary>
        /// Gets or sets the list of equipment the character is wearing.
        /// </summary>
        public List<Item> Equipment { get; set; }

        #endregion
    }
}


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

<title>server.rest.responses Class Hierarchy</title>
<meta name="date" content="2017-11-29">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package server.rest.responses

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

server.rest.responses.Response

server.rest.responses.ContractorsResponse

server.rest.responses.CostCentersResponse

server.rest.responses.FXRatesResponse

server.rest.responses.HiringManagerResponse

server.rest.responses.HiringManagersResponse

server.rest.responses.HRAddEditPayGradeResponse

server.rest.responses.HRPayGradeResponse

server.rest.responses.HRPositionRoleResponse

server.rest.responses.HRRolesResponse

server.rest.responses.LoginResponse

server.rest.responses.LogoutResponse

server.rest.responses.RefreshResponse

server.rest.responses.ReportResponse

server.rest.responses.SkillsAddResponse

server.rest.responses.SkillsEditResponse

server.rest.responses.SkillsResponse

server.rest.responses.UsersAddResponse

server.rest.responses.UsersEditResponse

server.rest.responses.UsersResponse

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
<?php
header("Access-Control-Allow-Origin: *");
ini_set('display_errors', 1);

require("config/connect.php");
require("functions.php");
if(!empty($_REQUEST['userid'])){
$_SESSION['userid'] = $_REQUEST['userid'];

}
include("$BASE_DIR/include/$template/ajax_auctions.php");
exit;


text:
//%2005////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation, The Open Group.
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; VERITAS Software Corporation; The Open Group.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
//
// Author:
//         Bapu Patil, Hewlett-Packard Company (bapu_patil@hp.com)
//
//%/////////////////////////////////////////////////////////////////////////////

package org.opengroup.pegasus.servlet;

/**
 * Exception for Authentication Failure.
 */

public class AuthenticationFailedException extends Exception
{

  /**
   * Create that kind of exception
   * @param msg The associated error message
   */
  private static final String failedMsg = "AuthenticationFailed: ";

  public AuthenticationFailedException(String msg)
  {
        super( failedMsg + msg) ;
  }

}


text:
use std::io::Write;

use rustc_serialize::json::as_json;

use rls_data::config::Config;
use rls_data::{self, Analysis, CompilationOptions, CratePreludeData, Def, DefKind, Impl, Import,
               MacroRef, Ref, RefKind, Relation};
use rls_span::{Column, Row};

#[derive(Debug)]
pub struct Access {
    pub reachable: bool,
    pub public: bool,
}

pub struct JsonDumper<O: DumpOutput> {
    result: Analysis,
    config: Config,
    output: O,
}

pub trait DumpOutput {
    fn dump(&mut self, result: &Analysis);
}

pub struct WriteOutput<'b, W: Write + 'b> {
    output: &'b mut W,
}

impl<'b, W: Write> DumpOutput for WriteOutput<'b, W> {
    fn dump(&mut self, result: &Analysis) {
        if write!(self.output, "{}", as_json(&result)).is_err() {
            error!("Error writing output");
        }
    }
}

pub struct CallbackOutput<'b> {
    callback: &'b mut dyn FnMut(&Analysis),
}

impl<'b> DumpOutput for CallbackOutput<'b> {
    fn dump(&mut self, result: &Analysis) {
        (self.callback)(result)
    }
}

impl<'b, W: Write> JsonDumper<WriteOutput<'b, W>> {
    pub fn new(writer: &'b mut W, config: Config) -> JsonDumper<WriteOutput<'b, W>> {
        JsonDumper {
            output: WriteOutput { output: writer },
            config: config.clone(),
            result: Analysis::new(config),
        }
    }
}

impl<'b> JsonDumper<CallbackOutput<'b>> {
    pub fn with_callback(
        callback: &'b mut dyn FnMut(&Analysis),
        config: Config,
    ) -> JsonDumper<CallbackOutput<'b>> {
        JsonDumper {
            output: CallbackOutput { callback },
            config: config.clone(),
            result: Analysis::new(config),
        }
    }
}

impl<O: DumpOutput> Drop for JsonDumper<O> {
    fn drop(&mut self) {
        self.output.dump(&self.result);
    }
}

impl<'b, O: DumpOutput + 'b> JsonDumper<O> {
    pub fn crate_prelude(&mut self, data: CratePreludeData) {
        self.result.prelude = Some(data)
    }

    pub fn compilation_opts(&mut self, data: CompilationOptions) {
        self.result.compilation = Some(data);
    }

    pub fn _macro_use(&mut self, data: MacroRef) {
        if self.config.pub_only || self.config.reachable_only {
            return;
        }
        self.result.macro_refs.push(data);
    }

    pub fn import(&mut self, access: &Access, import: Import) {
        if !access.public && self.config.pub_only
            || !access.reachable && self.config.reachable_only {
            return;
        }
        self.result.imports.push(import);
    }

    pub fn dump_ref(&mut self, data: Ref) {
        if self.config.pub_only || self.config.reachable_only {
            return;
        }
        self.result.refs.push(data);
    }

    pub fn dump_def(&mut self, access: &Access, mut data: Def) {
        if !access.public && self.config.pub_only
            || !access.reachable && self.config.reachable_only {
            return;
        }
        if data.kind == DefKind::Mod && data.span.file_name.to_str().unwrap() != data.value {
            // If the module is an out-of-line definition, then we'll make the
            // definition the first character in the module's file and turn
            // the declaration into a reference to it.
            let rf = Ref {
                kind: RefKind::Mod,
                span: data.span,
                ref_id: data.id,
            };
            self.result.refs.push(rf);
            data.span = rls_data::SpanData {
                file_name: data.value.clone().into(),
                byte_start: 0,
                byte_end: 0,
                line_start: Row::new_one_indexed(1),
                line_end: Row::new_one_indexed(1),
                column_start: Column::new_one_indexed(1),
                column_end: Column::new_one_indexed(1),
            }
        }
        self.result.defs.push(data);
    }

    pub fn dump_relation(&mut self, data: Relation) {
        self.result.relations.push(data);
    }

    pub fn dump_impl(&mut self, data: Impl) {
        self.result.impls.push(data);
    }
}


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Threading;
using System.Windows;
using System.Windows.Input;

namespace Ragnarok.Presentation.Utility
{
    /// <summary>
    /// キー操作を疑似的に行います。
    /// </summary>
    public static class PseudoKeyboard
    {
        #region
        const int KEYEVENTF_EXTENDEDKEY = 0x1;
        const int KEYEVENTF_KEYUP = 0x2;

        [DllImport("user32.dll")]
        static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
        #endregion

        /// <summary>
        /// 指定された時間[ms]、指定のキーを押します。
        /// </summary>
        public static void PressKeyWait(Key key, int elapsed)
        {
            PressKeyWait(key, TimeSpan.FromMilliseconds(elapsed));
        }

        /// <summary>
        /// 指定された時間、指定のキーを押します。
        /// </summary>
        public static void PressKeyWait(Key key, TimeSpan elapsed)
        {
            var vk = (byte)KeyInterop.VirtualKeyFromKey(key);

            keybd_event(vk, 0, KEYEVENTF_EXTENDEDKEY, 0);
            Thread.Sleep(elapsed);
            keybd_event(vk, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
        }
    }
}


text:
title: Building a Simple TreeView
page_title: Building a Simple TreeView - RadTreeView
description: Check our Web Forms article about Building a Simple TreeView.
slug: treeview/getting-started/building-a-simple-treeview
tags: building,a,simple,treeview
published: True
position: 0
---

# Building a Simple TreeView

##

The following tutorial will demonstrate how to create a simple TreeView using the designer and shows how to:

* Create root level nodes.

* Create child nodes.

* Apply a pre-defined style to the TreeView.

* Display checkboxes next to nodes.

>caption

![RadTreeView Getting Started](images/treeview_gettingstarted08.png)

1. In a new AJAX Enabled Web Application, drop a **RadTreeView** to the default form.

1. Open the [Smart Tag]({%slug treeview/design-time/smart-tag%}) and set the **Skin** to **Vista** from the drop down list. Then select the **Build RadTreeView** link. *This step will display the RadTreeView Item Builder Dialog.*
>caption
![RadTreeView Getting Started](images/treeview_gettingstarted09.png)

1. In the **RadTreeView** Item Builder dialog click the Add Root Node button to add three nodes.
>caption
![RadTreeView Getting Started](images/treeview_gettingstarted10.png)

1. Click the first node and set the **Text** property to "Condos". Set the **Checkable** property to False.

1. Click the second node and set the **Text** property to "Townhomes". Set the **Checkable** property to False.

1. Click the third node and set the **Text** property to "Houses". Set the **Checkable** property to False.
>caption
![RadTreeView Getting Started](images/treeview_gettingstarted11.png)

1. While the third node, "Houses", is still selected, click the Add Child Item button twice.
>caption
![RadTreeView Getting Started](images/treeview_gettingstarted12.png)

1. Select the first child item and set the **Text** property to "3 Bedroom, 2.5 Baths".

1. Select the second child item and set the **Text** property to "5 Bedroom, 3 Baths".
>caption
![RadTreeView Getting Started](images/treeview_gettingstarted13.png)

1. Click **OK** to close the **RadTreeView** Item Builder dialog.

1. In the Properties Window, set the **RadTreeView** **CheckBoxes** property to **true**.

1. Press **F5** to run the application.


text:
=======================
Rule ``octal_notation``
=======================

Literal octal must be in ``0o`` notation.

Examples
--------

Example #1
~~~~~~~~~~

.. code-block:: diff

   --- Original
   +++ New
   -<?php $foo = 0123;
   +<?php $foo = 0o123;

Rule sets
---------

The rule is part of the following rule sets:

@PHP81Migration
  Using the `@PHP81Migration <./../../ruleSets/PHP81Migration.rst>`_ rule set will enable the ``octal_notation`` rule.

@PHP82Migration
  Using the `@PHP82Migration <./../../ruleSets/PHP82Migration.rst>`_ rule set will enable the ``octal_notation`` rule.


text:
package org.elasticsearch.search.slice;

import org.apache.lucene.search.Query;

import java.util.Objects;

/**
 * An abstract {@link Query} that defines an hash function to partition the documents in multiple slices.
 */
public abstract class SliceQuery extends Query {
    private final String field;
    private final int id;
    private final int max;

    /**
     * @param field The name of the field
     * @param id    The id of the slice
     * @param max   The maximum number of slices
     */
    public SliceQuery(String field, int id, int max) {
        this.field = field;
        this.id = id;
        this.max = max;
    }

    // Returns true if the value matches the predicate
    protected final boolean contains(long value) {
        return Math.floorMod(value, max) == id;
    }

    public String getField() {
        return field;
    }

    public int getId() {
        return id;
    }

    public int getMax() {
        return max;
    }

    @Override
    public boolean equals(Object o) {
        if (super.equals(o) == false) {
            return false;
        }
        SliceQuery that = (SliceQuery) o;
        return field.equals(that.field) && id == that.id && max == that.max;
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), field, id, max);
    }

    @Override
    public String toString(String f) {
        return getClass().getSimpleName() + "[field=" + field + ", id=" + id + ", max=" + max + "]";
    }

}


text:
// //-----------------------------------------------------------------------
// // <copyright file="ClassOriginStory.cs" company="Short Leg Studio, LLC">
// //     Copyright (c) Short Leg Studio, LLC. All rights reserved.
// // </copyright>
// //-----------------------------------------------------------------------

namespace SilverNeedle.Characters.Background
{
    using System;
    using System.Collections.Generic;

    public class ClassOrigin
    {
        public ClassOrigin()
        {
            Traits = new List<string>();
            Storylines = new List<string>();
        }

        public string Name { get; set; }
        public string Class { get; set; }
        public int Weighting { get; set; }
        public IList<string> Traits { get; set; }
        public IList<string> Storylines { get; set; }
    }
}


text:
<%inherit file="base.html"/>
<%def name="head()">

<link rel="stylesheet" href="/static/js/datepicker.css">

</%def>
<%def name="body()">

 ${form.title}返回

            % if msg:

${msg}

            % endif
            <form class="form-horizontal" role="form" action="${form.action}" method="post">
            ${form.render_css()}
        </form>

</%def>


text: java -jar /aws-apigateway-importer.jar "$@"


text:
package lore.compiler.types

import lore.compiler.core.CompilationException

import scala.util.hashing.MurmurHash3

case class SumType private (parts: Set[Type]) extends Type {
  if (parts.isEmpty) {
    throw CompilationException("You may not construct a sum type with an empty set of parts.")
  }

  override val hashCode: Int = MurmurHash3.unorderedHash(parts, 0x85f5fe35)
}

object SumType {
  /**
    * Constructs the sum type from the given types and flattens it if necessary. If the resulting sum type
    * has only one part, this type is returned instead. Some types such as tuples and lists are combined if they occur
    * multiple times.
    *
    * We also apply the following simplification: In a sum type A | B | ..., if B < A, then B can be dropped.
    * That is, A already "clears the way" for values of type B to be part of the sum type. This also leads to the
    * identity for empty sum types: Nothing.
    *
    * The resulting flattened normal form is a requirement for subtyping to work correctly.
    */
  def construct(parts: Vector[Type]): Type = {
    if (parts.isEmpty) {
      return BasicType.Nothing
    }
    Simplification.construct(Kind.Sum, parts)
  }

  def construct(parts: Set[Type]): Type = construct(parts.toVector)
  def construct(parts: Type*): Type = construct(parts.toVector)
}