text:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="./testcase.xsl"?>
<test_definition>
  <suite category="Tizen Web Device APIs" extension="crosswalk" name="tct-secureelement-tizen-tests">
    <set name="SE" type="js">
      <capabilities>
        <capability name="secureelement" />
      </capabilities>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="Channel_notexist" priority="P3" purpose="Check if interface Channel exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/Channel_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="Channel" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="ReaderArraySuccessCallback_notexist" priority="P3" purpose="Check if interface ReaderArraySuccessCallback exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/ReaderArraySuccessCallback_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="ReaderArraySuccessCallback" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="Reader_notexist" priority="P3" purpose="Check if interface Reader exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/Reader_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="Reader" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEChangeListener_notexist" priority="P3" purpose="Check if interface SEChangeListener exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEChangeListener_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="SEChangeListener" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEServiceManagerObject_notexist" priority="P3" purpose="Check if interface SEServiceManagerObject exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEServiceManagerObject_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="SEServiceManagerObject" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_notexist" priority="P3" purpose="Check if interface SEService exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="SEService" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SessionSuccessCallback_notexist" priority="P3" purpose="Check if interface SessionSuccessCallback exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SessionSuccessCallback_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="SessionSuccessCallback" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="Session_notexist" priority="P3" purpose="Check if interface Session exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/Session_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="Session" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="Tizen_seService_exist" priority="P3" purpose="Check if Tizen implements interface SEServiceManagerObject and has attribute seService" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/Tizen_seService_exist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="SEService" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="TransmitSuccessCallback_notexist" priority="P3" purpose="Check if interface TransmitSuccessCallback exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/TransmitSuccessCallback_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="TransmitSuccessCallback" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_extend" priority="P3" purpose="Test whether the SEServiceManager object can have new attribute added" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_extend.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="SEService" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_exist" priority="P1" purpose="Check if getReaders method exists in SEServiceManager" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_exist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_registerSEListener_exist" priority="P1" purpose="Check if registerSEListener method exists in SEServiceManager" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_exist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="registerSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_unregisterSEListener_exist" priority="P1" purpose="Check if unregisterSEListener method exists in SEServiceManager" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_unregisterSEListener_exist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="unregisterSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_shutdown_exist" priority="P1" purpose="Check if shutdown method exists in SEServiceManager" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_shutdown_exist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="shutdown" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders" onload_delay="90" priority="P2" purpose="Check without optional arguments getReaders(getReadersSuccessCallback)" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_registerSEListener" onload_delay="90" priority="P1" purpose="Check with non-optional arguments registerSEListener" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="registerSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_unregisterSEListener" onload_delay="90" priority="P1" purpose="Check with non-optional arguments unregisterSEListener" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_unregisterSEListener.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="unregisterSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_shutdown" priority="P1" purpose="Check if shutdown method works properly" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_shutdown.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="shutdown" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="ReaderArraySuccessCallback_onsuccess" onload_delay="90" priority="P1" purpose="Check if onsuccess method of ReaderArraySuccessCallback works" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/ReaderArraySuccessCallback_onsuccess.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="onsuccess" element_type="method" interface="ReaderArraySuccessCallback" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_missarg" priority="P1" purpose="Check if getReaders method called with missing non-optional argument throws an exception" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_missarg.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_successCallback_TypeMismatch" onload_delay="90" priority="P2" purpose="Check argument successCallback conversions exception" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_TypeMismatch.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_successCallback_invalid_cb" onload_delay="90" priority="P2" purpose="GetReaders - check argument successCallback validation - use {onsuccess: function (){}}" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_successCallback_invalid_cb.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_with_errorCallback" onload_delay="90" priority="P1" purpose="Check method getReaders of SEService with errorCallback" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_with_errorCallback.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_TypeMismatch" onload_delay="90" priority="P2" purpose="Check if registerSEListener of SEService throws exception when argument is incorrect" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_TypeMismatch.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="registerSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_invalid_cb" priority="P2" purpose="Check if registerSEListener of SEService throws exception when listener is invalid" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_invalid_cb.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="registerSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_registerSEListener_missarg" priority="P1" purpose="Check if registerSEListener method of SEService called with missing non-optional argument throws an exception" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_missarg.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="registerSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_shutdown_extra_argument" priority="P1" purpose="Check if SEService.shutdown works with extra argument" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_shutdown_extra_argument.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="shutdown" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="ChannelSuccessCallback_notexist" priority="P3" purpose="Check if interface ChannelSuccessCallback exists, it should not" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/ChannelSuccessCallback_notexist.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" interface="ChannelSuccessCallback" section="Communication" specification="SE" usage="true" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_errorCallback_invalid_cb" onload_delay="90" priority="P2" purpose="GetReaders - check argument errorCallback validation - use {onerror: function (){}}" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_errorCallback_invalid_cb.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_getReaders_errorCallback_TypeMismatch" onload_delay="90" priority="P2" purpose="Check argument errorCallback conversions exception" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_getReaders_errorCallback_TypeMismatch.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="getReaders" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
      <testcase component="Tizen Device APIs/Communication/SE" execution_type="auto" id="SEService_registerSEListener_listener_empty" priority="P1" purpose="Check with empty argument of registerSEListener" status="approved" type="compliance">
        <description>
          <test_script_entry>/opt/tct-secureelement-tizen-tests/secureelement/SEService_registerSEListener_listener_empty.html</test_script_entry>
        </description>
        <specs>
          <spec>
            <spec_assertion category="Tizen Device API Specifications" element_name="registerSEListener" element_type="method" interface="SEService" section="Communication" specification="SE" />
            <spec_url>https://developer.tizen.org/help/topic/org.tizen.web.device.apireference/tizen/se.html</spec_url>
            <spec_statement>TBD</spec_statement>
          </spec>
        </specs>
      </testcase>
    </set>
  </suite>
</test_definition>


text: Small application for exploring boundaries.minnpost.com API

redpajama_set_name: RedPajamaGithub


text:
package edu.mayo.mprc.raw2mgf;

import edu.mayo.mprc.daemon.CachableWorkPacket;
import edu.mayo.mprc.daemon.WorkCache;
import edu.mayo.mprc.daemon.worker.WorkPacket;
import edu.mayo.mprc.daemon.worker.WorkPacketBase;
import edu.mayo.mprc.utilities.progress.ProgressReporter;

import java.io.File;
import java.util.Arrays;
import java.util.List;

/**
 * One task for batch converter.
 * Defines who searches, using what params, what file and where to put outputs.
 * The packet is now in the format used by messaging. Eventually there will be an unified system for both grid engine
 * and daemon messaging in place.
 */
public final class RawToMgfWorkPacket extends WorkPacketBase implements CachableWorkPacket {
	private static final long serialVersionUID = 20071220L;
	private String params;
	private File outputFile;
	private boolean skipIfExists;
	private File inputFile;
	private boolean publicAccess;

	public RawToMgfWorkPacket(final boolean fromScratch) {
		super(fromScratch);
	}

	/**
	 * Request to convert a .RAW file to .mgf file.
	 *  @param outputFile   This is the desired target of the output. The cache can overwrite this to anything it sees fit.
	 *                     If that happens, a {@link RawToMgfResult} class is sent back
	 *                     as progress report.
	 * @param publicAccess If the .mgf caching is enabled, the files will never be visible to the end user.
	 */
	public RawToMgfWorkPacket(final String params,
	                          final File outputFile,
	                          final boolean bSkipIfExists,
	                          final File inputFile,
	                          final boolean fromScratch,
	                          final boolean publicAccess) {
		super(fromScratch);

		assert params != null : "Raw2MGF request cannot be created: parameters are null";
		assert outputFile != null : "Raw2MGF request cannot be created: output file is null";
		assert inputFile != null : "Raw2MGF request cannot be created: input file is null";

		this.params = params;
		this.outputFile = outputFile;
		skipIfExists = bSkipIfExists;
		this.inputFile = inputFile;
		this.publicAccess = publicAccess;
	}

	public String getParams() {
		return params;
	}

	@Override
	public boolean isPublishResultFiles() {
		return isPublicAccess();
	}

	@Override
	public File getOutputFile() {
		return outputFile;
	}

	public boolean isSkipIfExists() {
		return skipIfExists;
	}

	public File getInputFile() {
		return inputFile;
	}

	public boolean isPublicAccess() {
		return publicAccess;
	}

	@Override
	public String getStringDescriptionOfTask() {
		final File sourceFile = getInputFile();
		final String params = getParams();
		return "Input:" + sourceFile.getAbsolutePath() + "\nParams:" + params;
	}

	@Override
	public WorkPacket translateToCachePacket(final File cacheFolder) {
		final String canonicalOutput = WorkCache.getCanonicalOutput(getInputFile(), getOutputFile());
		return new RawToMgfWorkPacket(
				getParams(),
				new File(cacheFolder, canonicalOutput),
				isSkipIfExists(),
				getInputFile(),
				isFromScratch(),
				/*public access*/false);
	}

	@Override
	public List<String> getOutputFiles() {
		return Arrays.asList(getOutputFile().getName());
	}

	@Override
	public boolean cacheIsStale(final File subFolder, final List<String> outputFiles) {
		return getInputFile().lastModified() > new File(subFolder, outputFiles.get(0)).lastModified();
	}

	@Override
	public void reportCachedResult(final ProgressReporter reporter, final File targetFolder, final List<String> outputFiles) {
		final File cachedMgf = new File(targetFolder, outputFiles.get(0));
		reporter.reportProgress(new RawToMgfResult(cachedMgf));
	}
}


text:
<!DOCTYPE html>

    <link rel='stylesheet' type='text/css' href='../css/css.css'/>
	   <meta name="author" content="Kesego,4THID">
    <meta name="description" content="Tiroyaone Letsholathebe, Service Advisor, MotorHoldings Gaborone">
    <meta name="keywords" content="isuzu, opel, service, parts, bakkies, gaborone, botswana,isuzu assist, chevrolet">
    <link rel="canonical" href="https://gdggabs.github.io/isuzu/service/tiro.html">

    <meta property="og:title" content="Tiroyaone Letsholathebe" />
    <meta property="og:site_name" content="Tiroyaone Letsholathebe, Service Advisor, MotorHoldings Gaborone" />
    <meta property="og:type" content="website" />
    <meta property="og:url" content="https://gdggabs.github.io/isuzu/service/tiro.html" />
    <meta property="og:image" content="https://gdggabs.github.io/isuzu/img/profiles/tirol.jpg" />
    <meta property="og:description" content="Tiroyaone Letsholathebe, Service Advisor, MotorHoldings Gaborone" />
<meta property="og:image:type" content="image/jpeg" />
	<meta property="og:image:width" content="130" />
	<meta property="og:image:height" content="170" />
<title>Tiroyaone Letsholathebe</title>

<meta name="viewport" content="width=360px,initial-scale=1,user-scalable=yes"/>
<link rel="stylesheet" href="../css/font-awesome.min.css">

<link href="../../img/logos/isuzu.png" rel="apple-touch-icon"/>
<link href="../../img/logos/isuzu.png" rel="apple-touch-icon" sizes="152x152"/>
<link href="../../img/logos/isuzu.png" rel="apple-touch-icon" sizes="167x167"/>
<link href="../../img/logos/isuzu.png" rel="apple-touch-icon" sizes="180x180"/>
<link href="../../img/logos/isuzu.png" rel="icon" sizes="192x192"/>
<link href="../../img/logos/isuzu.png" rel="icon" sizes="128x128"/>

Motor Holdings Gaborone

Tiroyaone Letsholathebe

Service Advisor

				<button class="conbutt" style="position: absolute;left:20px; border: solid rgba(220,7,29,0.99) 2px;background:linear-gradient( red ,rgba(220,38,29,0.99) ) ;color:white">
				Call Me
				</button>

				<button class="conbutt" style="position: absolute;left:131px; border: solid rgba(220,7,29,0.99) 2px; background:linear-gradient( red ,rgba(220,38,29,0.99) ) ;color:white">
				Save
				</button>

				<button class="conbutt" style="position: absolute;right:20px; border: solid rgba(220,7,29,0.99) 2px; background:linear-gradient( red ,rgba(220,38,29,0.99) ) ;color:white">
				Mail Me
				</button>

		<form action="tel:+267 362 6800">
			<button class="conbsub"style="border: solid rgba(220,7,29,0.99) 2px;background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white">
				Call Isuzu Assist
			</button>
		</form>

			Telephone:

			+267 3626800

			Fax Line:

			+267 3971453

			Mobile:

			E-mail:

			TiroL@motorholdings.co.bw

			Website:

			www.motorholdings.net.bw

					<button style="background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white;border: 2px solid rgba(220,7,29,0.99);" class="buttselect">Specials
					</button>

					<button style="background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white;border: 2px solid rgba(220,7,29,0.99);" class="buttselect">New Showroom
					</button>

					<button style="background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white;border: 2px solid rgba(220,7,29,0.99);" class="buttselect">Used Showroom
					</button>

					<button style="background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white;border: 2px solid rgba(220,7,29,0.99);" class="buttselect">Book a Test Drive
					</button>

					<button style="background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white;border: 2px solid rgba(220,7,29,0.99);" class="buttselect">Finance Application
					</button>

					<button style="background:linear-gradient(red,rgba(220,38,29,0.99)) ;color:white;border: 2px solid rgba(220,7,29,0.99);" class="buttselect">Book a Service
					</button>

 Address:

 Plot 1284, Old Lobatse Road, Gaborone, Botswana

	        Designed by 4TH ID  &copy2017


text:
package io.pravega.cli.admin.config;

import com.google.common.base.Preconditions;
import io.pravega.cli.admin.CommandArgs;

/**
 * Lists the contents of the shared Configuration.
 */
public class ConfigListCommand extends ConfigCommand {
    /**
     * Creates a new instance of the Command class.
     *
     * @param args The arguments for the command.
     */
    public ConfigListCommand(CommandArgs args) {
        super(args);
    }

    @Override
    public void execute() {
        Preconditions.checkArgument(getCommandArgs().getArgs().size() == 0, "Not expecting any arguments.");
        getCommandArgs().getState().getConfigBuilder().build().forEach((name, value) -> output("\t%s=%s", name, value));
    }

    public static CommandDescriptor descriptor() {
        return new CommandDescriptor(COMPONENT, "list", "Lists all configuration set during this session.");
    }
}


text:
class Document
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Pagination
  include Finder

  field :title,             type: String
  field :category,          type: String
  field :published_at,      type: Date
  field :description,       type: String
  field :original_title,    type: String
  field :original_filename, type: String
  field :context_cache,     type: Hash, default: {}
  field :information,       type: Hash
  field :fontspecs,         type: Hash, default: {}
  field :last_analysis_at,  type: Time
  field :processed_text,    type: String
  field :state,             type: Symbol, default: :waiting
  field :public,            type: Boolean, default: true
  field :percentage,        type: Integer, default: 0
  field :file_id,           type: Moped::BSON::ObjectId
  field :thumbnail_file_id, type: Moped::BSON::ObjectId

  belongs_to :user

  has_many :pages
  has_many :fact_registers
  has_many :named_entities
  has_and_belongs_to_many :people, index: true
  has_and_belongs_to_many :project

  validates_presence_of :file_id
  validates_presence_of :original_filename

  before_save   :set_default_title
  after_create  :enqueue_process
  after_destroy :destroy_gridfs_files

  scope :public, -> { where(public: true) }
  scope :private_for, ->(user){ where(:user_id => user.id, :public => false) }
  scope :without, ->(documents){ not_in(_id: documents.map(&:id)) }

  include Tire::Model::Search
  include Tire::Model::Callbacks

  tire do
    mapping do
      indexes :title,          analyzer: "snowball", boost: 100
      indexes :original_title, analyzer: "snowball", boost: 90
      indexes :pages,          analyzer: "snowball"
      indexes :user_id,        index: :not_analyzed
    end
  end

  def to_indexed_json
    fields = {
      title: title,
      original_title: original_title,
      pages: {},
      user_id: user_id,
      project_ids: project_ids,
    }
    pages.each do |page|
      fields[:pages][page.num] = page.text.gsub(/<[^<]+?>/, "")
    end
    fields.to_json
  end

  def file
    if file_id
      Mongoid::GridFS.namespace_for(:documents).get(file_id)
    end
  end

  def file=(file_or_path)
    fs = Mongoid::GridFS.namespace_for(:documents).put(file_or_path)
    self.file_id = fs.id
    fs
  end

  def thumbnail_file
    if thumbnail_file_id
      Mongoid::GridFS.namespace_for(:thumbnails).get(thumbnail_file_id)
    end
  end

  def thumbnail_file=(file_or_path)
    fs = Mongoid::GridFS.namespace_for(:thumbnails).put(file_or_path)
    self.thumbnail_file_id = fs.id
    fs
  end

  def readable?
    true
  end

  def geocoded?
    true
  end

  def exportable?
    true
  end

  def processed?
    true
  end

  def completed?
    percentage == 100
  end

  def failed?
    id and failed_ids.include?(id.to_s)
  end

  # opt[:force] = true
  def context(opt = {})
    if opt[:force] || context_cache == {}
      self.context_cache = context_generator
      save
    end
    self.context_cache
  end

protected

  def context_generator
    ctx = {
      :id => id,
      :title => title,
      :registers => self.fact_registers.map(&:to_hash),
      :people => self.people.map { |person| { id: person.id, name: person.full_name, mentions: person.mentions_in(self) } },
      :dates => self.dates_found.group_by(&:text).map { |k, v| { text: k, mentions: v.size} },
      :organizations => self.organizations_found.group_by(&:text).map { |k, v| { text: k, mentions: v.size} },
      :places => (self.places_found + self.addresses_found).group_by(&:text).map { |k, v| { text: k, mentions: v.size} }
    }

    [:registers, :people, :dates, :organizations, :places].each do |f|
      ctx[:"has_#{f}"] = !ctx[f].empty?
    end

    ctx
  end

  def set_default_title
    if self.title.blank?
      self.title = self.original_filename
    end
  end

  def enqueue_process
    logger.info "Enqueue processing task for document with id #{id}"
    Resque.enqueue(DocumentProcessBootstrapTask, id)
  end

  def destroy_gridfs_files
    file.destroy if file
    thumbnail_file.destroy if thumbnail_file
  end

  def failed_ids(opts={})
    self.failed_jobs(opts).map do |job|
      job['payload']['args'].first
    end.compact
  end

  def failed_jobs(opts={})
    opts.reverse_merge!({
      :offset => 0,
      :limit => Resque::Failure.count
    })
    jobs = [Resque::Failure.all(opts[:offset], opts[:limit])].flatten.compact
  end
end


text:
'use strict';

// jquery extensions
if (!window.$)
{
    var $ = {fn: {}};
}
$.isNull = (value) => (value === undefined) || (value === null);
$.isNotNull = (value) => (value !== undefined) && (value !== null);
$.isEmpty = (value) => $.isNull(value) || (value.length === 0);
$.isNotEmpty = (value) => $.isNotNull(value) && (value.length > 0);
$.isBlank = (value) => $.isEmpty(value) || (value.trim().length === 0);
$.isNotBlank = (value) => $.isNotEmpty(value) && (value.trim().length > 0);
$.fn.isEmpty = (value) => $.isEmpty(this.val());
$.fn.isNotEmpty = (value) => $.isNotEmpty(this.val());
$.fn.isBlank = (value) => $.isBlank(this.val());
$.fn.isNotBlank = (value) => $.isNotBlank(this.val());
$.fn.exists = () => this.length > 0;

//
function xhr(options)
{
    var ret,
        async = 'async' in options ? options.async : true,
        _do = function(resolve, reject) {
            var req = new XMLHttpRequest();
            req.open(options.method || 'GET', options.url, async);
            Object.keys(options.headers || {}).forEach((key) => req.setRequestHeader(key, options.headers[key]));
            req.onreadystatechange = function(event) {
                if (req.readyState !== 4)
                {
                    return;
                }
                if ([200, 304].indexOf(req.status) === -1)
                {
                    var error = new Error('Server responded with a status of ' + HTTP_STATUS_CODES[req.status] + ' (' + req.status + ')');
                    if (async)
                    {
                        reject(error);
                    }
                    else
                    {
                        throw error;
                    }
                }
                else
                {
                    var data;
                    if (options.method !== 'HEAD')
                    {
                        var type = options.type;
                        if (!type)
                        {
                            var contentType = req.getResponseHeader('Content-Type');
                            if (contentType && contentType.length > 0)
                            {
                                type = contentType.split(';')[0];
                            }
                        }
                        switch (type)
                        {
                            case 'xml':
                            case 'application/xml':
                                data = event.target.responseXML;
                                break;
                            case 'json':
                            case 'application/json':
                                data = JSON.parse(event.target.response);
                                break;
                            case 'text':
                            case 'text/plain':
                            default:
                                data = event.target.response;
                                break;
                        }
                    }

                    if (async)
                    {
                        resolve({data: data, req: req});
                    }
                    else
                    {
                        ret = {data: data, req: req};
                    }
                }
            };

            req.send(options.data || void 0);
        };

    if (async)
    {
        ret = new Promise(_do);
    }
    else
    {
        _do();
    }

    return ret;
}

function deepExtend(/*target, obj1, ...*/)
{
    var extendObject = function(target, object) {
        for (let prop in object)
        {
            target[prop] = extend(target[prop], object[prop]);
        }

        return target;
    };
    var extendArray = function(target, array) {
        for (let i=0; i<array.length; i++)
        {
            target[i] = extend(target[i], array[i]);
        }

        return target;
    };
    var extend = function(target, object) {
        if (Array.isArray(object))
        {
            target = extendArray(target || [], object);
        }
        else if (typeof object === 'object')
        {
            target = extendObject(target || {}, object);
        }
        else
        {
            target = object;
        }

        return target;
    };
    var target = arguments[0];
    var objs = Array.slice(arguments, 1);
    objs.forEach(function(obj) {
        extendObject(target, obj);
    });

    return target;
}

function assert(condition, message)
{
    if (!condition)
    {
        throw new Error(message);
    }
}

function assertNotNull(value, message)
{
    assert($.isNotNull(value), message);
}

function get(object, path, defaultValue)
{
    var value = object;
    path.split('.').forEach(function(property) {
        if ((value !== undefined) && (value !== null))
        {
            value = value[property];
        }
        else
        {
            return false;
        }
    });
    if (value == undefined)
    {
        value = defaultValue;
    }

    return value;
}

function getOrNull(object, path)
{
    return get(object, path, null);
}

function toArray(object)
{
    return Array.isArray(object) ? object : [object];
}

function filterOne(array, filter)
{
    var result = toArray(array).filter(filter);
    return result.length > 0 ? result[0] : null;
}

function prettyJson(json)
{
    var html = '
';
    var pretty = function(property, obj) {
        var clazz = null;
        if (obj === true || obj === false)
        {
            clazz = 'boolean';
        }
        else if ($.isNumeric(obj))
        {
            clazz = 'numeric';
        }
        else if (obj instanceof Date)
        {
            clazz = 'date';
        }
        else if (typeof obj === 'string' || obj instanceof String)
        {
            clazz = 'string';
        }

        if (clazz == null)
        {
            if (Array.isArray(obj))
            {
                html += '
';
                if (property != null)
                {
                    html += '' + property + ':';
                }
                html += '[

';
                for (var i=0; i<obj.length; i++)
                {
                    pretty(null, obj[i]);
                }
                html += '

],
';
            }
            else
            {
                html += '
';
                if (property != null)
                {
                    html += '' + property + ':';
                }
                html += '{

';
                for (var subProperty in obj)
                {
                    pretty(subProperty, obj[subProperty]);
                }
                html += '

},
';
            }
        }
        else
        {
            html += '
' + property + ':'
                     + '';
            if (clazz == 'string')
            {
                html += '"';
            }
            html += obj;
            if (clazz == 'string')
            {
                html += '"';
            }
            html += ',
';
        }
    };
    pretty(null, json);
    html += '
';

    return html;
}

var HTTP_STATUS_CODES = {
    '200': 'OK',
    '201': 'Created',
    '202': 'Accepted',
    '203': 'Non-Authoritative Information',
    '204': 'No Content',
    '205': 'Reset Content',
    '206': 'Partial Content',
    '300': 'Multiple Choices',
    '301': 'Moved Permanently',
    '302': 'Found',
    '303': 'See Other',
    '304': 'Not Modified',
    '305': 'Use Proxy',
    '307': 'Temporary Redirect',
    '400': 'Bad Request',
    '401': 'Unauthorized',
    '402': 'Payment Required',
    '403': 'Forbidden',
    '404': 'Not Found',
    '405': 'Method Not Allowed',
    '406': 'Not Acceptable',
    '407': 'Proxy Authentication Required',
    '408': 'Request Timeout',
    '409': 'Conflict',
    '410': 'Gone',
    '411': 'Length Required',
    '412': 'Precondition Failed',
    '413': 'Request Entity Too Large',
    '414': 'Request-URI Too Long',
    '415': 'Unsupported Media Type',
    '416': 'Requested Range Not Satisfiable',
    '417': 'Expectation Failed',
    '500': 'Internal Server Error',
    '501': 'Not Implemented',
    '502': 'Bad Gateway',
    '503': 'Service Unavailable',
    '504': 'Gateway Timeout',
    '505': 'HTTP Version Not Supported'
};

// Polyfill
if (!Promise.cast)
{
    Object.defineProperty(Promise, 'cast', {
        enumerable: false,
        configurable: true,
        writable: true,
        value: function(value) {
            return new Promise((resolve, reject) => resolve(value));
        }
    });
}
else
{
    console.warn('promise.cast found !');
}


text:
#include "paddle/fluid/operators/modified_huber_loss_op.h"

namespace paddle {
namespace operators {

class ModifiedHuberLossOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext* ctx) const override {
    PADDLE_ENFORCE(ctx->HasInput("X"), "X must be initialized.");
    PADDLE_ENFORCE(ctx->HasInput("Y"), "Y must be initialized.");

    auto x_dims = ctx->GetInputDim("X");
    auto y_dims = ctx->GetInputDim("Y");

    PADDLE_ENFORCE_EQ(x_dims.size(), 2, "The tensor rank of X must be 2.");
    if (ctx->IsRuntime() ||
        (framework::product(x_dims) > 0 && framework::product(y_dims) > 0)) {
      PADDLE_ENFORCE_EQ(x_dims, y_dims,
                        "The shape of X and Y must be the same.");
    }

    if (ctx->IsRuntime()) {
      PADDLE_ENFORCE_EQ(x_dims[1], 1, "The 2nd dimension of X must be 1.");
    }

    ctx->SetOutputDim("IntermediateVal", x_dims);
    ctx->SetOutputDim("Out", {x_dims[0], 1});
  }
};

class ModifiedHuberLossOpMaker : public framework::OpProtoAndCheckerMaker {
 public:
  void Make() override {
    AddInput("X",
             "The input tensor of modified huber loss op. "
             "X is 2-D tensor with shape [batch_size, 1].");
    AddInput("Y",
             "The target labels of modified huber loss op. "
             "The shape of Y is the same as X. Values of Y must be 0 or 1.");
    AddOutput("IntermediateVal",
              "Variable to save intermediate result which will be reused in "
              "backward processing.")
        .AsIntermediate();
    AddOutput("Out", "Classification loss for X.");
    AddComment(R"DOC(
Modified Huber Loss Operator.

This operator is used in binary classification problem. The shape of
input X and target Y are both [N, 1] and so is the shape of the output loss.
Since target Y is not differentiable, calculating gradient for Y is illegal.
The formula of modified huber loss is:

$$
L(y, f(x)) =
\begin{cases}
(\max(0, 1 - yf(x)))^2,  \text{if} \  yf(x) >= -1    \\
             -4yf(x),    \quad \text{otherwise}
\end{cases}
$$

Make sure the values of target label Y are in {0, 1} here. This operator will
scale values of Y to {-1, +1} when computing losses and gradients.

)DOC");
  }
};

class ModifiedHuberLossGradOp : public framework::OperatorWithKernel {
 public:
  using framework::OperatorWithKernel::OperatorWithKernel;

  void InferShape(framework::InferShapeContext* ctx) const override {
    PADDLE_ENFORCE(ctx->HasInput("X"), "X must be initialized.");
    PADDLE_ENFORCE(ctx->HasInput("Y"), "Y must be initialized.");
    PADDLE_ENFORCE(ctx->HasInput("IntermediateVal"),
                   "Intermediate value must not be null.");
    PADDLE_ENFORCE(ctx->HasInput(framework::GradVarName("Out")),
                   "Input(Out@Grad) must not be null.");

    auto x_dims = ctx->GetInputDim("X");
    auto intermediate_dims = ctx->GetInputDim("IntermediateVal");
    auto out_grad_dims = ctx->GetInputDim(framework::GradVarName("Out"));

    if (ctx->IsRuntime()) {
      PADDLE_ENFORCE_EQ(
          intermediate_dims, x_dims,
          "The shape of X and intermediate value must be the same.");
      PADDLE_ENFORCE_EQ(out_grad_dims, x_dims,
                        "The shape of Input(Out@Grad) and X must be the same.");
    }

    if (ctx->HasOutput(framework::GradVarName("X"))) {
      ctx->SetOutputDim(framework::GradVarName("X"), x_dims);
    }
  }
};

}  // namespace operators
}  // namespace paddle

namespace ops = paddle::operators;
REGISTER_OPERATOR(modified_huber_loss, ops::ModifiedHuberLossOp,
                  ops::ModifiedHuberLossOpMaker,
                  paddle::framework::DefaultGradOpDescMaker<true>);
REGISTER_OPERATOR(modified_huber_loss_grad, ops::ModifiedHuberLossGradOp);

REGISTER_OP_CPU_KERNEL(
    modified_huber_loss,
    ops::ModifiedHuberLossKernel<paddle::platform::CPUDeviceContext, float>);
REGISTER_OP_CPU_KERNEL(modified_huber_loss_grad,
                       ops::ModifiedHuberLossGradCPUKernel<float>);


text:
import setuptools

setuptools.setup(
  name = 'quipu',
  version = '0.1',
  license = 'BSD',
  description = open('README.txt').read(),
  author = 'Matt Good',
  author_email = 'matt@matt-good.net',
  url = 'https://github.com/mgood/quipu',
  platforms = 'any',

  py_modules = ['quipu'],

  zip_safe = True,
  verbose = False,
)


text:
package com4j.tlbimp.driver;

import com4j.ComException;
import com4j.GUID;
import com4j.tlbimp.BindingException;
import com4j.tlbimp.ErrorListener;
import com4j.tlbimp.FileCodeWriter;
import com4j.tlbimp.Generator;
import com4j.tlbimp.def.IWTypeLib;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;

import java.io.File;
import java.io.IOException;

/**
 * tlbimp implemented as an Ant task.
 *
 * @author Kohsuke Kawaguchi (kk@kohsuke.org)
 */
public class AntTaskImpl extends Task implements ErrorListener {

    private File destDir;
    private File source;

    private GUID libid;
    private String libver;

    private Driver driver = new Driver();

    private boolean hasLib = false;

    public void setDestDir(File destDir) {
        this.destDir = destDir;
    }

    public void setPackage(String packageName) {
        driver.setPackageName(packageName);
    }

    public void setFile(File source) {
        this.source = source;
    }

    public void setLibid(String libid) {
        this.libid = new GUID(libid);
    }

    public void setLibver(String libver) {
        this.libver = libver;
    }

    public void setLocale(String locale) {
        driver.setLocale(locale);
    }

    public void setRenameGetterAndSetters(boolean renameGetterAndSetters) {
        driver.renameGetterAndSetters = renameGetterAndSetters;
    }

    public void setAlwaysUseComEnums(boolean alwaysUseComEnums) {
        driver.alwaysUseComEnums = alwaysUseComEnums;
    }

    public void setGenerateDefaultMethodOverloads(boolean v) {
        driver.generateDefaultMethodOverloads = v;
    }

    public void addConfiguredLib( Lib r ) {
        r.validate();
        driver.addLib(r);
        hasLib = true;
    }

    public void execute() throws BuildException {
        if( destDir==null )
            throw new BuildException("@destDir is missing");

        if(source!=null || libid!=null) {
            Lib lib = new Lib();
            lib.setLibid(libid);
            lib.setLibver(libver);
            lib.setFile(source);
            addConfiguredLib(lib);
        }

        if(!hasLib)
            throw new BuildException("No type library is specified");

        try {
            driver.run( new FileCodeWriter(destDir), this);
        } catch( ComException e ) {
            throw new BuildException(e);
        } catch( IOException e ) {
            throw new BuildException(e);
        } catch( BindingException e ) {
            throw new BuildException(e);
        }
    }

    public void started(IWTypeLib lib) {
        log("Generating definitions from "+lib.getName(),Project.MSG_INFO);
    }

    public void error(BindingException e) {
        log(e.getMessage(),Project.MSG_ERR);
    }

    public void warning(String message) {
        log(message,Project.MSG_WARN);
    }
}


text:
Imports SolidEdgeCommunity.Extensions ' https://github.com/SolidEdgeCommunity/SolidEdge.Community/wiki/Using-Extension-Methods
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Reflection
Imports System.Text

Friend Class Program
    <STAThread> _
    Shared Sub Main(ByVal args() As String)
        Dim application As SolidEdgeFramework.Application = Nothing
        Dim document As SolidEdgeAssembly.AssemblyDocument = Nothing
        Dim configurations As SolidEdgeAssembly.Configurations = Nothing
        Dim configuration As SolidEdgeAssembly.Configuration = Nothing

        Try
            ' Register with OLE to handle concurrency issues on the current thread.
            SolidEdgeCommunity.OleMessageFilter.Register()

            ' Connect to or start Solid Edge.
            application = SolidEdgeCommunity.SolidEdgeUtils.Connect(True, True)

            ' Get a reference to the active assembly document.
            document = application.GetActiveDocument(Of SolidEdgeAssembly.AssemblyDocument)(False)

            If document IsNot Nothing Then
                ' Get a reference to the Configurations collection.
                configurations = document.Configurations

                ' Configuration name has to be unique so for demonstration
                ' purposes, use a random number.
                Dim random As New Random()
                Dim configName As String = String.Format("Configuration {0}", random.Next())

                configuration = configurations.Item(1)

                Dim configList As Object = New String() { configuration.Name }

                Dim missing As Object = System.Reflection.Missing.Value

                ' NOTE: Not sure why but this is causing Solid Edge ST6 to crash.
                ' Add the new configuration.
                configuration = configurations.AddDerivedConfig(1, 0, 0, configList, missing, missing, configName)
            Else
                Throw New System.Exception("No active document")
            End If
        Catch ex As System.Exception
            Console.WriteLine(ex.Message)
        Finally
            SolidEdgeCommunity.OleMessageFilter.Unregister()
        End Try
    End Sub
End Class


text:
package com.viesis.gemstones.common.blocks.slabs;

import java.util.List;
import java.util.Random;

import com.viesis.gemstones.init.InitBlocksVG;

import net.minecraft.block.BlockSlab;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.properties.IProperty;
import net.minecraft.block.properties.PropertyEnum;
import net.minecraft.block.state.BlockStateContainer;
import net.minecraft.block.state.IBlockState;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

public abstract class BlockSlabVG extends BlockSlab {

	public static final PropertyEnum TYPE = PropertyEnum.create("type", BlockSlabVG.EnumType.class);

	public BlockSlabVG(String unlocalname, String registryname)
	{
		super(Material.ROCK);

		setUnlocalizedName(unlocalname);
		setRegistryName(registryname);
		useNeighborBrightness = true;
		setHardness(0.8F);
        setResistance(5.0F);
        setSoundType(SoundType.STONE);

		IBlockState state = this.blockState.getBaseState();
		state.withProperty(TYPE, EnumType.STONE);

		if(!this.isDouble())
		{
			state.withProperty(HALF, EnumBlockHalf.BOTTOM);
		}

		setDefaultState(state);
	}

	@Override
	public String getUnlocalizedName(int meta)
	{
		return this.getUnlocalizedName();
	}

	@Override
	public Comparable<?> getTypeForItem(ItemStack stack)
	{
		return BlockSlabVG.EnumType.byMetadata(stack.getMetadata() & 7);
	}

	@Override
	public IProperty<?> getVariantProperty()
	{
		return TYPE;
	}

	@Override
	public Item getItemDropped(IBlockState state, Random rand, int fortune)
    {
		return this == InitBlocksVG.basic_doubleslab_arcanite ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_arcanite)
				: (this == InitBlocksVG.basic_doubleslab_velious ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_velious)
				: (this == InitBlocksVG.basic_doubleslab_fenryte ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_fenryte)
				: (this == InitBlocksVG.basic_doubleslab_electium ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_electium)
				: (this == InitBlocksVG.basic_doubleslab_igneelis ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_igneelis)
				: (this == InitBlocksVG.basic_doubleslab_necrocite ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_necrocite)
				: (this == InitBlocksVG.basic_doubleslab_zephyrium ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_zephyrium)
				: (this == InitBlocksVG.basic_doubleslab_onyxius ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_onyxius)
				: (this == InitBlocksVG.basic_doubleslab_soularite ? Item.getItemFromBlock(InitBlocksVG.basic_halfslab_soularite)

				//: (this == InitBlocksEA.basic_doubleslab_cryptic_draconium ? Item.getItemFromBlock(InitBlocksEA.cryptic_draconium)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_velious ? Item.getItemFromBlock(InitBlocksEA.cryptic_velious)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_arcanite ? Item.getItemFromBlock(InitBlocksEA.cryptic_arcanite)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_katcheen ? Item.getItemFromBlock(InitBlocksEA.cryptic_katcheen)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_necrocite ? Item.getItemFromBlock(InitBlocksEA.cryptic_necrocite)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_soularite ? Item.getItemFromBlock(InitBlocksEA.cryptic_soularite)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_ebonheart ? Item.getItemFromBlock(InitBlocksEA.cryptic_ebonheart)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_obsidian ? Item.getItemFromBlock(InitBlocksEA.cryptic_obsidian)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_glowstone ? Item.getItemFromBlock(InitBlocksEA.cryptic_glowstone)
				: Item.getItemFromBlock(this)))))))
				//)))))))))
				));
    }

	@Override
	public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player)
	{
		return this == InitBlocksVG.basic_doubleslab_arcanite ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_arcanite), 1)
				: (this == InitBlocksVG.basic_doubleslab_velious ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_velious) , 1)
				: (this == InitBlocksVG.basic_doubleslab_fenryte ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_fenryte) , 1)
				: (this == InitBlocksVG.basic_doubleslab_electium ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_electium) , 1)
				: (this == InitBlocksVG.basic_doubleslab_igneelis ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_igneelis), 1)
				: (this == InitBlocksVG.basic_doubleslab_necrocite ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_necrocite) , 1)
				: (this == InitBlocksVG.basic_doubleslab_zephyrium ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_zephyrium) , 1)
				: (this == InitBlocksVG.basic_doubleslab_onyxius ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_onyxius) , 1)
				: (this == InitBlocksVG.basic_doubleslab_soularite ? new ItemStack(Item.getItemFromBlock(InitBlocksVG.basic_halfslab_soularite) , 1)

				//: (this == InitBlocksEA.basic_doubleslab_cryptic_draconium ? Item.getItemFromBlock(InitBlocksEA.cryptic_draconium)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_velious ? Item.getItemFromBlock(InitBlocksEA.cryptic_velious)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_arcanite ? Item.getItemFromBlock(InitBlocksEA.cryptic_arcanite)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_katcheen ? Item.getItemFromBlock(InitBlocksEA.cryptic_katcheen)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_necrocite ? Item.getItemFromBlock(InitBlocksEA.cryptic_necrocite)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_soularite ? Item.getItemFromBlock(InitBlocksEA.cryptic_soularite)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_ebonheart ? Item.getItemFromBlock(InitBlocksEA.cryptic_ebonheart)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_obsidian ? Item.getItemFromBlock(InitBlocksEA.cryptic_obsidian)
				//: (this == InitBlocksEA.basic_doubleslab_cryptic_glowstone ? Item.getItemFromBlock(InitBlocksEA.cryptic_glowstone)
				: new ItemStack(Item.getItemFromBlock(this))))))))
				//)))))))))
				));
	}

	@Override
	public int quantityDropped(Random random)
    {
        return this.isDouble() ? 2 : 1;
    }

	@Override
	public int damageDropped (IBlockState state)
	{
		return ((BlockSlabVG.EnumType)state.getValue(TYPE)).getID();
	}

	@Override
	public final IBlockState getStateFromMeta (int meta)
	{
		IBlockState blockstate = this.getDefaultState();
		blockstate = blockstate.withProperty(TYPE,BlockSlabVG.EnumType.byMetadata(meta & 7));

		if(!this.isDouble())
		{
			blockstate = blockstate.withProperty(HALF, (meta & 8 ) == 8 ? EnumBlockHalf.BOTTOM : EnumBlockHalf.TOP);
		}

		return blockstate;
	}

	@Override
	public final int getMetaFromState(IBlockState state)
	{
		int meta = ((BlockSlabVG.EnumType) state.getValue(TYPE)).getID();

		if (!this.isDouble() && state.getValue(HALF) == EnumBlockHalf.TOP)
		{
			meta |=8;
		}

		return meta;
	}

	@Override
	protected final BlockStateContainer createBlockState()
	{
		if (this.isDouble())
		{
			return new BlockStateContainer(this, getVariantProperty());
		}
		else
		{
			return new BlockStateContainer(this, getVariantProperty(), HALF);
		}
	}

	@SideOnly(Side.CLIENT)
	public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
	{
		for (EnumType t : EnumType.values())
	    list.add(new ItemStack(itemIn, 1, t.ordinal()));
	}

	public enum EnumType implements IStringSerializable
	{
		STONE(0, "stone")
		//RAW(0, "raw"),
		//SMOOTH(1, "smooth"),
		//BRICKED(2, "bricked")
		;
		private static final BlockSlabVG.EnumType[] META_LOOKUP = new BlockSlabVG.EnumType[values().length];

	    private int ID;
	    private String name;

	    private EnumType(int ID, String name)
	    {
	        this.ID = ID;
	        this.name = name;
	    }

	    @Override
	    public String getName()
	    {
	        return name;
	    }

	    public int getID()
	    {
	        return ID;
	    }

	    @Override
	    public String toString()
	    {
	        return getName();
	    }

	    public static BlockSlabVG.EnumType byMetadata(int meta)
        {
            if (meta < 0 || meta >= META_LOOKUP.length)
            {
                meta = 0;
            }

            return META_LOOKUP[meta];
        }
	    static
        {
            for (BlockSlabVG.EnumType types : values())
            {
                META_LOOKUP[types.getID()] = types;
            }
        }
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--

    Bean Validation TCK

    License: Apache License, Version 2.0
    See the license.txt file in the root directory or <http://www.apache.org/licenses/LICENSE-2.0>.

-->
<arquillian xmlns="http://jboss.org/schema/arquillian" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://jboss.org/schema/arquillian
        http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
    <defaultProtocol type="Servlet 3.0"/>

    <engine>
        <property name="deploymentExportPath">target/artifacts</property>
    </engine>

    <container qualifier="incontainer" default="true">
        <configuration>
            <property name="glassFishHome">@CONTAINER.HOME@</property>
            <property name="adminHost">localhost</property>
            <property name="adminPort">4848</property>
            <property name="debug">true</property>
        </configuration>
    </container>

</arquillian>


text:
package org.robolectric.shadows;

import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.googlecode.catchexception.CatchException;
import org.fest.assertions.api.Assertions;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.robolectric.TestRunners;
import org.robolectric.util.DatabaseConfig;
import org.robolectric.util.SQLiteMap;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;

import static com.googlecode.catchexception.CatchException.*;
import static org.fest.assertions.api.Assertions.assertThat;
import static org.robolectric.Robolectric.shadowOf;

@DatabaseConfig.UsingDatabaseMap(SQLiteMap.class)
@RunWith(TestRunners.WithDefaults.class)
public class SQLiteDatabaseTest extends DatabaseTestBase {

    private static final String ANY_VALID_SQL = "SELECT 1";

    @Test
    public void shouldUseSQLiteDatabaseMap() throws Exception {
        assertThat(DatabaseConfig.getDatabaseMap().getClass().getName()).isEqualTo(SQLiteMap.class.getName());
    }

    @Test
    public void testReplace() throws Exception {
        long id = addChuck();
        assertThat(id).isNotEqualTo(-1L);

        ContentValues values = new ContentValues();
        values.put("id", id);
        values.put("name", "Norris");

        long replaceId = database.replace("table_name", null, values);
        assertThat(replaceId).isEqualTo(id);

        String query = "SELECT name FROM table_name where id = " + id;
        ResultSet resultSet = executeQuery(query);

        assertThat(resultSet.next()).isTrue();
        assertThat(resultSet.getString(1)).isEqualTo("Norris");
    }

    @Test
    public void testReplaceIsReplacing() throws SQLException {
        final String query = "SELECT first_column FROM table_name WHERE id = ";
        String stringValueA = "column_valueA";
        String stringValueB = "column_valueB";
        long id = 1;

        ContentValues valuesA = new ContentValues();
        valuesA.put("id", id);
        valuesA.put("first_column", stringValueA);

        ContentValues valuesB = new ContentValues();
        valuesB.put("id", id);
        valuesB.put("first_column", stringValueB);

        long firstId = database.replaceOrThrow("table_name", null, valuesA);
        ResultSet firstResultSet = executeQuery(query + firstId);
        firstResultSet.next();
        long secondId = database.replaceOrThrow("table_name", null, valuesB);
        ResultSet secondResultSet = executeQuery(query + secondId);
        secondResultSet.next();

        assertThat(firstId).isEqualTo(id);
        assertThat(secondId).isEqualTo(id);
        assertThat(firstResultSet.getString(1)).isEqualTo(stringValueA);
        assertThat(secondResultSet.getString(1)).isEqualTo(stringValueB);
    }

    @Test
    public void shouldKeepTrackOfOpenCursors() throws Exception {
        Cursor cursor = database.query("table_name", new String[]{"second_column", "first_column"}, null, null, null, null, null);

        assertThat(shadowOf(database).hasOpenCursors()).isTrue();
        cursor.close();
        assertThat(shadowOf(database).hasOpenCursors()).isFalse();

    }

    @Test
    public void shouldBeAbleToAnswerQuerySql() throws Exception {
        try {
            database.query("table_name_1", new String[]{"first_column"}, null, null, null, null, null);
        } catch (Exception e) {
            //ignore
        }
        try {
            database.query("table_name_2", new String[]{"second_column"}, null, null, null, null, null);
        } catch (Exception e) {
            //ignore
        }
        List<String> queries = shadowOf(database).getQuerySql();
        assertThat(queries.size()).isEqualTo(2);
        assertThat(queries.get(0)).isEqualTo("SELECT first_column FROM table_name_1");
        assertThat(queries.get(1)).isEqualTo("SELECT second_column FROM table_name_2");
    }

    @Test
    public void shouldCreateDefaultCursorFactoryWhenNullFactoryPassed() throws Exception {
        //given
        SQLiteDatabase.CursorFactory nullCursorFactory = null;

        //when
        catchException(database).rawQueryWithFactory(nullCursorFactory, ANY_VALID_SQL, null, null);

        //then
        Assertions.assertThat(caughtException()).as("Null cursor factory should be overridden by default implementation").isNull();
    }

    private ResultSet executeQuery(String query) throws SQLException {
        Statement statement = shadowOf(database).getConnection().createStatement();
        return statement.executeQuery(query);
    }
}


text:
/**
 */
package es.um.unosql.xtext.skiql.metamodel.skiql;

import org.eclipse.emf.ecore.EObject;

/**
 *
 * A representation of the model object 'Ski QL Model'.
 *
 *
 *

 * The following features are supported:
 *

 *

 *
{@link es.um.unosql.xtext.skiql.metamodel.skiql.SkiQLModel#getQuery Query}

 *

 *
 * @see es.um.unosql.xtext.skiql.metamodel.skiql.SkiqlPackage#getSkiQLModel()
 * @model
 * @generated
 */
public interface SkiQLModel extends EObject {
	/**
	 * Returns the value of the 'Query' containment reference.
	 *
	 *

	 * If the meaning of the 'Query' containment reference isn't clear,
	 * there really should be more of a description here...
	 *

	 *
	 * @return the value of the 'Query' containment reference.
	 * @see #setQuery(Query)
	 * @see es.um.unosql.xtext.skiql.metamodel.skiql.SkiqlPackage#getSkiQLModel_Query()
	 * @model containment="true" required="true"
	 * @generated
	 */
	Query getQuery();

	/**
	 * Sets the value of the '{@link es.um.unosql.xtext.skiql.metamodel.skiql.SkiQLModel#getQuery Query}' containment reference.
	 *
	 *
	 * @param value the new value of the 'Query' containment reference.
	 * @see #getQuery()
	 * @generated
	 */
	void setQuery(Query value);

} // SkiQLModel


text:
package freemarker.ext.dom;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.util.Locale;
import java.util.StringTokenizer;

import freemarker.core.Environment;
import freemarker.template.Configuration;
import freemarker.template.Template;

/**
 * A class that contains a main() method for command-line invocation of a FreeMarker XML transformation.
 *
 * @deprecated Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").
 */
@Deprecated
public class Transform {

    private File inputFile, ftlFile, outputFile;
    private String encoding;
    private Locale locale;
    private Configuration cfg;

    /**
     * @deprecated Will be removed (main method in a library, often classified as CWE-489 "Leftover Debug Code").
     */
    @Deprecated
    static public void main(String[] args) {
        try {
            Transform proc = transformFromArgs(args);
            proc.transform();
        } catch (IllegalArgumentException iae) {
            System.err.println(iae.getMessage());
            usage();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    /**
     * @param inputFile
     *            The file from which to read the XML input
     * @param ftlFile
     *            The file containing the template
     * @param outputFile
     *            The file to which to output. If this is null, we use stdout.
     * @param locale
     *            The locale to use. If this is null, we use the platform default.
     * @param encoding
     *            The character encoding to use for output, if this is null, we use the platform default
     */
    Transform(File inputFile, File ftlFile, File outputFile, Locale locale, String encoding) throws IOException {
        if (encoding == null) {
            encoding = System.getProperty("file.encoding");
        }
        if (locale == null) {
            locale = Locale.getDefault();
        }
        this.encoding = encoding;
        this.locale = locale;
        this.inputFile = inputFile;
        this.ftlFile = ftlFile;
        this.outputFile = outputFile;
        File ftlDirectory = ftlFile.getAbsoluteFile().getParentFile();
        cfg = new Configuration();
        cfg.setDirectoryForTemplateLoading(ftlDirectory);
    }

    /**
     * Performs the transformation.
     */
    void transform() throws Exception {
        String templateName = ftlFile.getName();
        Template template = cfg.getTemplate(templateName, locale);
        NodeModel rootNode = NodeModel.parse(inputFile);
        OutputStream outputStream = System.out;
        if (outputFile != null) {
            outputStream = new FileOutputStream(outputFile);
        }
        Writer outputWriter = new OutputStreamWriter(outputStream, encoding);
        try {
            template.process(null, outputWriter, null, rootNode);
        } finally {
            if (outputFile != null)
                outputWriter.close();
        }
    }

    static Transform transformFromArgs(String[] args) throws IOException {
        int i = 0;
        String input = null, output = null, ftl = null, loc = null, enc = null;
        while (i < args.length) {
            String dashArg = args[i++];
            if (i >= args.length) {
                throw new IllegalArgumentException("");
            }
            String arg = args[i++];
            if (dashArg.equals("-in")) {
                if (input != null) {
                    throw new IllegalArgumentException("The input file should only be specified once");
                }
                input = arg;
            } else if (dashArg.equals("-ftl")) {
                if (ftl != null) {
                    throw new IllegalArgumentException("The ftl file should only be specified once");
                }
                ftl = arg;
            } else if (dashArg.equals("-out")) {
                if (output != null) {
                    throw new IllegalArgumentException("The output file should only be specified once");
                }
                output = arg;
            } else if (dashArg.equals("-locale")) {
                if (loc != null) {
                    throw new IllegalArgumentException("The locale should only be specified once");
                }
                loc = arg;
            } else if (dashArg.equals("-encoding")) {
                if (enc != null) {
                    throw new IllegalArgumentException("The encoding should only be specified once");
                }
                enc = arg;
            } else {
                throw new IllegalArgumentException("Unknown input argument: " + dashArg);
            }
        }
        if (input == null) {
            throw new IllegalArgumentException("No input file specified.");
        }
        if (ftl == null) {
            throw new IllegalArgumentException("No ftl file specified.");
        }
        File inputFile = new File(input).getAbsoluteFile();
        File ftlFile = new File(ftl).getAbsoluteFile();
        if (!inputFile.exists()) {
            throw new IllegalArgumentException("Input file does not exist: " + input);
        }
        if (!ftlFile.exists()) {
            throw new IllegalArgumentException("FTL file does not exist: " + ftl);
        }
        if (!inputFile.isFile() || !inputFile.canRead()) {
            throw new IllegalArgumentException("Input file must be a readable file: " + input);
        }
        if (!ftlFile.isFile() || !ftlFile.canRead()) {
            throw new IllegalArgumentException("FTL file must be a readable file: " + ftl);
        }
        File outputFile = null;
        if (output != null) {
            outputFile = new File(output).getAbsoluteFile();
            File outputDirectory = outputFile.getParentFile();
            if (!outputDirectory.exists() || !outputDirectory.canWrite()) {
                throw new IllegalArgumentException("The output directory must exist and be writable: "
                        + outputDirectory);
            }
        }
        Locale locale = Locale.getDefault();
        if (loc != null) {
            locale = localeFromString(loc);
        }
        return new Transform(inputFile, ftlFile, outputFile, locale, enc);
    }

    static Locale localeFromString(String ls) {
        if (ls == null) ls = "";
        String lang = "", country = "", variant = "";
        StringTokenizer st = new StringTokenizer(ls, "_-,");
        if (st.hasMoreTokens()) {
            lang = st.nextToken();
            if (st.hasMoreTokens()) {
                country = st.nextToken();
                if (st.hasMoreTokens()) {
                    variant = st.nextToken();
                }
            }
            return new Locale(lang, country, variant);
        } else {
            return Locale.getDefault();
        }
    }

    static void usage() {
        System.err
                .println("Usage: java freemarker.ext.dom.Transform -in <xmlfile> -ftl <ftlfile> [-out <outfile>] [-locale <locale>] [-encoding <encoding>]");
        // Security: prevents shutting down the container from a template:
        if (Environment.getCurrentEnvironment() == null) {
            System.exit(-1);
        }
    }
}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>IOSS: Class Members - Enumerations</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>

<link href="navtree.css" rel="stylesheet" type="text/css"/>

<link href="search/search.css" rel="stylesheet" type="text/css"/>

<link href="doxygen.css" rel="stylesheet" type="text/css" />

IOSS
    2.0

BasicType
: Ioss::Field
, Ioss::Property

DuplicationPolicy
: Json::Value::CZString

entity_type
: Iocgns::DatabaseIO
, Iocgns::ParallelDatabaseIO

FinalPressureType
: anonymous_namespace{cth_pressure_map.C}::Globals

Kind
: Json::PathArgument

MinMax
: Ioss::ParallelUtils

OptType
: Ioss::GetLongOption

RoleType
: Ioss::Field

ShellLocation
: Iogn::GeneratedMesh

TokenType
: Json::Reader

TranType
: Iotr::Tensor

var_type
: CatalystParserInterface

Generated by

     1.8.13


text:
<!DOCTYPE html>
<meta charset="UTF-8">
<title>Context Menu</title>

Right Click ME!

<menu type=context id=examplemenu>
    <command label="FOO" onclick="alert('FOO ACTION');">
    <command label="BAR" onclick="alert('BAR ACTION');)">
</menu>


text:
//
//  PESatitApiManager.h
//  SatitCMU
//
//  Created by MRG on 2/10/2557 BE.
//  Copyright (c) 2557 Platwo fusion. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "AFNetworking.h"

@protocol PESatitApiManagerDelegate <NSObject>

#pragma mark - Core Api Protocol
/*
 Core Api Protocol
 */
- (void)PESatitApiManager:(id)sender getCommentObjectIdResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getCommentObjectIdErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender CommentObjectIdResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender CommentObjectIdErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender likeObjectResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender likeObjectErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender unlikeObjectResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender unlikeObjectErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender checkLikeObjectResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender checkLikeObjectErrorResponse:(NSString *)errorResponse;
/*
 End Core Api Protocol
 */

#pragma mark - User Api Protocol
/*
 User Api Protocol
 */

- (void)PESatitApiManager:(id)sender loginWithFacebookResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender loginWithFacebookErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender signupWithUsernameResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender signupWithUsernameErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender loginWithEmailResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender loginWithEmailErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender getUserSettingResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getUserSettingErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender getUserByIdResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getUserByIdErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender getNotifyResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getNotifyErrorResponse:(NSString *)errorResponse;

/*
 End Api Protocol
 */
#pragma mark - Gallery Api Protocol
/*
 Gallery Api Protocol
 */
- (void)PESatitApiManager:(id)sender galleryResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender galleryErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender galleryPictureByIdResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender galleryPictureByIdErrorResponse:(NSString *)errorResponse;

/*
 End Gallery Api Protocol
 */
#pragma mark - Feeds Api Protocol
/*
 Feeds Api
 */

- (void)PESatitApiManager:(id)sender feedResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender feedErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender getNewsByIdResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getNewsByIdErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender getNewsLikeCommentsResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getNewsLikeCommentsErrorResponse:(NSString *)errorResponse;

/*
 End Feeds Api Protocol
 */
#pragma mark - Activity Api Protocol
/*
 Activity Api
 */

- (void)PESatitApiManager:(id)sender activityResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender activityErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender getActivitiesByMResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getActivitiesByMErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender joinActivityResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender joinActivityErrorResponse:(NSString *)errorResponse;
- (void)PESatitApiManager:(id)sender unjoinActivityResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender unjoinActivityErrorResponse:(NSString *)errorResponse;

/*
 End Activity Api Protocol
 */
#pragma mark - Contact Api Protocol
/*
 Contact Api Protocol
 */
- (void)PESatitApiManager:(id)sender getContactResponse:(NSDictionary *)response;
- (void)PESatitApiManager:(id)sender getContactErrorResponse:(NSString *)errorResponse;
/*
 End Contact Api Protocol
 */
@end

@interface PESatitApiManager : NSObject
#pragma mark - Property
/*
 Property
 */

@property AFHTTPRequestOperationManager *manager;
@property NSUserDefaults *userDefaults;
@property (assign, nonatomic) id delegate;

/*
 End Property
 */

#pragma mark - Core Api

/*
 Core Api
 */
- (NSString *)getUserToken;
- (void)getObjectWithObjectId:(NSString *)objectId;
- (void)getCommentObjectId:(NSString *)commentId limit:(NSString *)limit next:(NSString *)next;
- (void)CommentObjectId:(NSString *)objectId msg:(NSString *)msg;
- (NSString *)genTokenForGuest;
- (NSString *)getAuth;
- (NSString *)getTokenGuest;
- (void)setTokenForGuest;
- (void)saveCoreData:(NSString *)data;
- (void)saveToCoreData:(NSDictionary *)data;
- (void)saveUserSettingToCoreDataWithUpdare:(NSString *)update showcase:(NSString *)showcase newsFromSatit:(NSString *)newsFromSatit;
- (void)saveUserProfileUpdate:(NSString *)email phone:(NSString *)phone;
- (NSDictionary *)getUserSettingFromCoreData;
- (NSDictionary *)getCoreData;
- (void)saveGalleryDesc:(NSString *)text;
- (NSDictionary *)getGalleryDesc;

- (void)saveGalleryName:(NSString *)text;
- (NSDictionary *)getGalleryName;

- (void)clearCoreData;
- (void)likeObject:(NSString *)objId;
- (void)unlikeObject:(NSString *)objId;
- (void)checkLikeObject:(NSString *)objId;
/*
 End Core Api
 */
#pragma mark - User Api
/*
 User Api
 */
- (void)loginWithFacebook:(NSString *)email fbid:(NSString *)fbid firstName:(NSString *)firstName lastName:(NSString *)lastName username:(NSString *)username deviceToken:(NSString *)deviceToken;
- (void)signupWithUsername:(NSString *)username email:(NSString *)email password:(NSString *)password gender:(NSString *)gender dateOfBirth:(NSString *)dateOfBirth;
- (void)loginWithEmail:(NSString *)email Password:(NSString *)password deviceToken:(NSString *)deviceToken;
- (void)uploadPicture:(NSData *)imageData;
- (void)getUserSetting;
- (void)setPushNews:(NSString *)type onoff:(NSString *)onoff;
- (void)setPushShowcase:(NSString *)type onoff:(NSString *)onoff;
- (void)setPushActivity:(NSString *)type onoff:(NSString *)onoff;
- (void)setPushFrom:(NSString *)type onoff:(NSString *)onoff;
- (void)updateUserProfileEmail:(NSString *)email phone:(NSString *)phone;
- (void)getUserById:(NSString *)userId;
- (void)getNotify;

/*
 End User Api
 */
#pragma mark - Gallery Api
/*
 Gallery Api
 */

- (void)galleryLimit:(NSString *)limit link:(NSString *)link;
- (void)galleryPictureByid:(NSString *)pictureId;

/*
 End Gallery Api
 */
#pragma mark - Feeds Api
/*
 Feeds Api
 */

- (void)feedLimit:(NSString *)limit link:(NSString *)link;
- (void)getNewsById:(NSString *)idObj;
- (void)getNewsLikeComments:(NSString *)newsId;
- (void)getLikeComment:(NSString *)newsId;
/*
 End Feeds Api
 */
#pragma mark - Activity Api
/*
 Activity Api
 */
- (void)activityLimit:(NSString *)limit link:(NSString *)link;
- (void)getActivitiesByM:(NSString *)m year:(NSString *)year;
- (void)joinActivityById:(NSString *)actId;
- (void)unjoinActivityById:(NSString *)actId;
/*
 End Activity Api
 */
#pragma mark - Contact Api
/*
 Contact Api
 */
- (NSDictionary *)getContact;
/*
 End Contact Api
*/
#pragma mark - Helper Function
/*
 Helper Function
 */
- (NSString *)genRandStringLength:(int)len;
- (NSString *)getUdid;
/*
 End Helper Function
 */
@end


text:
import { CancellationToken, DocumentHighlightProvider, Position, TextDocument, DocumentHighlight, Range } from 'vscode';

export default class PrologDocumentHighlightProvider implements DocumentHighlightProvider {
  public provideDocumentHighlights(doc: TextDocument, position: Position, token: CancellationToken): Thenable<DocumentHighlight[]> | DocumentHighlight[] {
    let docHilite: DocumentHighlight[] = [];
    let wordRange = doc.getWordRangeAtPosition(position);
    if (!wordRange) {
      return;
    }

    let symbol = doc.getText(wordRange);
    let symbolLen = symbol.length;
    let line = 0;
    let re = new RegExp("\\b" + symbol + "\\b", "g");
    while (line < doc.lineCount) {
      let lineTxt = doc.lineAt(line).text;
      let match = re.exec(lineTxt);
      while (match) {
        docHilite.push(new DocumentHighlight(new Range(line, match["index"], line, match["index"] + symbolLen)));
        match = re.exec(lineTxt);
      }
      line++;
    }
    return docHilite;
  }
}


text:
package com.canoo.grails.ulc.server;

import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Enumeration;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Properties;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;

import com.ulcjava.applicationframework.application.Application;
import com.ulcjava.base.shared.CoderRegistry;
import com.ulcjava.base.shared.logging.Level;
import com.ulcjava.base.shared.logging.Logger;

public class ULCApplicationHolder {
    private static final Map<String, String> ALIASES = new LinkedHashMap<String, String>();
    private static final String APPLET_PREFIX = "-applet.ulc";

    private static final Map<String, Application> APPLICATIONS = new LinkedHashMap<String, Application>();
    private static final Map<String, CoderRegistry> CODERS = new LinkedHashMap<String, CoderRegistry>();
    private static final Logger LOG = Logger.getLogger(ULCApplicationHolder.class);

    public static Application getApplication(HttpServletRequest request) {
        return getApplication(getApplicationAlias(request));
    }

    public static Application getApplication(String alias) {
        return alias != null ? APPLICATIONS.get(alias) : null;
    }

    public static String getApplicationAlias(Application application) {
        if (application == null) {
            return null;
        }
        return getApplicationAlias(application.getClass());
    }

    public static String getApplicationAlias(Class<?> clazz) {
        if (clazz == null) {
            return null;
        }
        String alias = clazz.getSimpleName().toLowerCase();
        if (alias.endsWith("application")) {
            alias = alias.substring(0, alias.length() - 11);
        } else if (alias.endsWith("applet")) {
            alias = alias.substring(0, alias.length() - 6);
        }
        return alias;
    }

    public static String getApplicationAlias(HttpServletRequest request) {
        String path = request.getRequestURI();
        String alias = path.substring(path.lastIndexOf('/') + 1);
        if (alias.endsWith(APPLET_PREFIX)) {
            alias = alias.substring(0, alias.length() - 11);
        } else {
            alias = alias.substring(0, alias.length() - 4);
        }

        return alias;
    }

    public static String getApplicationClassName(HttpServletRequest request) {
        return getApplicationClassName(getApplicationAlias(request), isApplet(request));
    }

    public static String getApplicationClassName(String alias) {
        return getApplicationClassName(alias, false);
    }

    public static String getApplicationClassName(String alias, boolean isApplet) {
        String className = ALIASES.get(alias);
        if (className == null) {
            LOG.log(Level.SEVERE, "'" + alias + "' is not configured as an ULC application.");
            throw new RuntimeException("'" + alias + "' is not configured as an ULC application.");
        }

        return className + (isApplet ? "Applet" : "Application");
    }

    public static CoderRegistry getCoderRegistry(Application application) {
        return getCoderRegistry(getApplicationAlias(application));
    }

    public static CoderRegistry getCoderRegistry(HttpServletRequest request) {
        return getCoderRegistry(getApplicationAlias(request));
    }

    public static CoderRegistry getCoderRegistry(String alias) {
        return alias != null ? CODERS.get(alias) : null;
    }

    // Development mode
    public static void init(File basedir) {
        if (!basedir.exists()) {
            LOG.log(Level.SEVERE, "Basedir " + basedir + " does not exist");
            throw new RuntimeException("Basedir " + basedir + " does not exist");
        }

        File ulcApplicationPropertiesFile = new File(basedir, "resources/ulc-applications.properties");
        if (!ulcApplicationPropertiesFile.exists()) {
            LOG.log(Level.SEVERE, "File " + ulcApplicationPropertiesFile + " does not exist");
            throw new RuntimeException("File " + ulcApplicationPropertiesFile + " does not exist");
        }

        try {
            init(ulcApplicationPropertiesFile.toURI().toURL());
        } catch (MalformedURLException e) {
            LOG.log(Level.SEVERE, "File " + ulcApplicationPropertiesFile + " could not be read");
            throw new RuntimeException("File " + ulcApplicationPropertiesFile + " could not be read", e);
        }
    }

    // Production mode
    public static void init(ServletContext servletContext) {
        String propertiesUrlStr = "/WEB-INF/resources/ulc-applications.properties";
        try {
            init(servletContext.getResource(propertiesUrlStr));
        } catch (MalformedURLException e) {
            LOG.log(Level.SEVERE, "Cannot read " + propertiesUrlStr);
            throw new RuntimeException("Cannot read " + propertiesUrlStr);
        }
    }

    public static boolean isApplet(HttpServletRequest request) {
        String path = request.getRequestURI();
        String alias = path.substring(path.lastIndexOf('/') + 1);
        return alias.endsWith(APPLET_PREFIX);
    }

    public static void setApplication(Application application) {
        String alias = getApplicationAlias(application);
        if (APPLICATIONS.get(alias) == null) {
            APPLICATIONS.put(alias, application);
        }
    }

    public static void setCoderRegistry(String alias, CoderRegistry coderRegistry) {
        if (alias == null || coderRegistry == null) {
            return;
        }
        CODERS.put(alias, coderRegistry);
    }

    private static void init(URL url) {
        try {
            Properties props = new Properties();
            props.load(url.openStream());
            Enumeration<Object> keys = props.keys();
            while (keys.hasMoreElements()) {
                Object key = keys.nextElement();
                String value = (String)props.get(key);
                if (value != null) {
                    ALIASES.put((String)key, value);
                }
            }
        } catch (IOException e) {
            LOG.log(Level.SEVERE, "Cannot read " + url);
            throw new RuntimeException("Cannot read " + url);
        }
    }
}


text:
import iteration_utilities
import itertools

def bench_iu_accumulate(iterable, func=iteration_utilities.accumulate):
    iteration_utilities.consume(func(iterable), None)

def bench_itertools_accumulate(iterable, func=itertools.accumulate):
    iteration_utilities.consume(func(iterable), None)

def args_list_length():
    for exponent in range(2, 16):
        size = 2**exponent
        yield size, [1] * size