text:
package org.apache.sysml.runtime.instructions.cp;

import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
import org.apache.sysml.runtime.matrix.operators.BinaryOperator;
import org.apache.sysml.runtime.matrix.operators.Operator;

public class ScalarScalarRelationalCPInstruction extends RelationalBinaryCPInstruction
{

	public ScalarScalarRelationalCPInstruction(Operator op,
											   CPOperand in1,
											   CPOperand in2,
											   CPOperand out,
											   String opcode,
											   String istr){
		super(op, in1, in2, out, opcode, istr);
	}

	@Override
	public void processInstruction(ExecutionContext ec)
		throws DMLRuntimeException
	{
		ScalarObject so1 = ec.getScalarInput(input1.getName(), input1.getValueType(), input1.isLiteral());
		ScalarObject so2 = ec.getScalarInput(input2.getName(), input2.getValueType(), input2.isLiteral() );
		ScalarObject sores = null;

		BinaryOperator dop = (BinaryOperator) _optr;

		if ( so1 instanceof IntObject && so2 instanceof IntObject ) {
			boolean rval = dop.fn.compare ( so1.getLongValue(), so2.getLongValue() );
			sores = (ScalarObject) new BooleanObject(rval);
		}
		else if ( so1 instanceof DoubleObject && so2 instanceof DoubleObject ) {
			boolean rval = dop.fn.compare ( so1.getDoubleValue(), so2.getDoubleValue() );
			sores = (ScalarObject) new BooleanObject(rval);
		}
		else if ( so1 instanceof IntObject && so2 instanceof DoubleObject) {
			boolean rval = dop.fn.compare ( so1.getLongValue(), so2.getDoubleValue() );
			sores = (ScalarObject) new BooleanObject(rval);
		}
		else if ( so1 instanceof DoubleObject && so2 instanceof IntObject ) {
			boolean rval = dop.fn.compare ( so1.getDoubleValue(), so2.getLongValue() );
			sores = (ScalarObject) new BooleanObject(rval);
		}
		else if ( so1 instanceof BooleanObject && so2 instanceof BooleanObject ) {
			boolean rval = dop.fn.compare ( so1.getBooleanValue(), so2.getBooleanValue() );
			sores = (ScalarObject) new BooleanObject(rval);
		}
		else if ( so1 instanceof StringObject && so2 instanceof StringObject ) {
			boolean rval = dop.fn.compare ( so1.getStringValue(), so2.getStringValue() );
			sores = (ScalarObject) new BooleanObject(rval);
		}
		else throw new DMLRuntimeException("compare(): Invalid combination of value types.");

		ec.setScalarOutput(output.getName(), sores);
	}
}

redpajama_set_name: RedPajamaGithub


text:
package com.xero.api.client;

import static org.junit.Assert.assertTrue;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.*;

import static org.hamcrest.MatcherAssert.*;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
import static org.hamcrest.core.Every.everyItem;

import com.xero.api.ApiClient;
import com.xero.api.client.*;
import com.xero.models.accounting.*;

import java.io.File;
import java.net.URL;

import com.google.api.client.auth.oauth2.BearerToken;
import com.google.api.client.auth.oauth2.Credential;
import com.google.api.client.http.HttpRequestFactory;
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;

import org.threeten.bp.*;
import java.io.IOException;
import com.fasterxml.jackson.core.type.TypeReference;

import java.util.Calendar;
import java.util.Map;
import java.util.UUID;

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

import org.apache.commons.io.IOUtils;

public class AccountingApiAccountsTest {

	ApiClient defaultClient;
	AccountingApi accountingApi;
	String accessToken;
    String xeroTenantId;

	private static boolean setUpIsDone = false;

	@Before
	public void setUp() {

		// Set Access Token and Tenant Id
        accessToken = "123";
        xeroTenantId = "xyz";

		// Init AccountingApi client
		// NEW Sandbox for API Mocking
		defaultClient = new ApiClient("https://xero-accounting.getsandbox.com:443/api.xro/2.0",null,null,null,null);

		accountingApi = AccountingApi.getInstance(defaultClient);

		// ADDED TO MANAGE RATE LIMITS while using SwaggerHub to mock APIs
		if (setUpIsDone) {
        	return;
    	}

    	try {
    		System.out.println("Sleep for 60 seconds");
	    	Thread.sleep(60);
    	} catch(InterruptedException e) {
    		System.out.println(e);
    	}
    	// do the setup
    	setUpIsDone = true;
	}

	public void tearDown() {
		accountingApi = null;
		defaultClient = null;
	}

	@Test
	public void testGetAccounts() throws Exception {
		System.out.println("@Test - getAccounts");

		OffsetDateTime ifModifiedSince = null;
		String where = null;
		String order = null;
		Accounts accounts = accountingApi.getAccounts(accessToken,xeroTenantId,ifModifiedSince, where, order);
		assert(accounts.getAccounts().size() == 2);
		assertThat(accounts.getAccounts().get(0).getCode(), is(equalTo("091")));
		assertThat(accounts.getAccounts().get(0).getName(), is(equalTo("Business Savings Account")));
		assertThat(accounts.getAccounts().get(0).getAccountID().toString(), is(equalTo("ebd06280-af70-4bed-97c6-7451a454ad85")));
		assertThat(accounts.getAccounts().get(0).getType(), is(equalTo(com.xero.models.accounting.AccountType.BANK)));
		assertThat(accounts.getAccounts().get(0).getBankAccountNumber(), is(equalTo("0209087654321050")));
		assertThat(accounts.getAccounts().get(0).getBankAccountType(), is(equalTo(com.xero.models.accounting.Account.BankAccountTypeEnum.BANK)));
		assertThat(accounts.getAccounts().get(0).getCurrencyCode(), is(equalTo(com.xero.models.accounting.CurrencyCode.NZD)));
		assertThat(accounts.getAccounts().get(0).getTaxType(), is(equalTo("NONE")));
	}

	@Test
	public void testGetAccount() throws Exception {
		System.out.println("@Test - getAccount");

		UUID accountID = UUID.fromString("297c2dc5-cc47-4afd-8ec8-74990b8761e9");

		Accounts oneAccount = accountingApi.getAccount(accessToken,xeroTenantId,accountID);
		assertThat(oneAccount.getAccounts().get(0).getName(), is(equalTo("FooBar")));
		assertThat(oneAccount.getAccounts().get(0).getCode(), is(equalTo("123456")));
	}

	@Test
	public void testCreateAccount() throws Exception {
		System.out.println("@Test - createAccount");
		Account acct = new Account();
		Accounts newAccount = accountingApi.createAccount(accessToken,xeroTenantId,acct);
		assertThat(newAccount.getAccounts().get(0).getName(), is(equalTo("Foobar")));
	}

	@Test
	public void testUpdateAccount() throws Exception {
		System.out.println("@Test - updateAccount");
		UUID accountID = UUID.fromString("297c2dc5-cc47-4afd-8ec8-74990b8761e9");
		Accounts accts = new Accounts();
		Accounts updatedAccount = accountingApi.updateAccount(accessToken,xeroTenantId,accountID, accts);
		assertThat(updatedAccount.getAccounts().get(0).getName(), is(equalTo("BarFoo")));
	}

	@Test
	public void testDeleteAccount() throws Exception {
		System.out.println("@Test - deleteAccount");
		UUID accountID = UUID.fromString("297c2dc5-cc47-4afd-8ec8-74990b8761e9");
		Accounts deleteAccount = accountingApi.deleteAccount(accessToken,xeroTenantId,accountID);
		assertThat(deleteAccount.getAccounts().get(0).getStatus().toString(), is(equalTo("DELETED")));
	}

	@Test
	public void testGetAccountAttachments() throws Exception {
		System.out.println("@Test - getAccountAttachments");
		UUID accountID = UUID.fromString("297c2dc5-cc47-4afd-8ec8-74990b8761e9");
		Attachments accountsAttachments = accountingApi.getAccountAttachments(accessToken,xeroTenantId,accountID);
		assertThat(accountsAttachments.getAttachments().get(0).getAttachmentID().toString(), is(equalTo("52a643be-cd5c-489f-9778-53a9fd337756")));
		assertThat(accountsAttachments.getAttachments().get(0).getFileName().toString(), is(equalTo("sample5.jpg")));
		assertThat(accountsAttachments.getAttachments().get(0).getMimeType().toString(), is(equalTo("image/jpg")));
		assertThat(accountsAttachments.getAttachments().get(0).getUrl().toString(), is(equalTo("https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg")));

	}

	@Test
	public void testCreateAccountAttachmentByFileName() throws Exception {

		System.out.println("@Test - createAccountAttachmentByFileName");
		UUID accountID = UUID.fromString("297c2dc5-cc47-4afd-8ec8-74990b8761e9");

		ClassLoader classLoader = getClass().getClassLoader();
		File bytes = new File(classLoader.getResource("helo-heros.jpg").getFile());

		String newFileName = "sample5.jpg";
		Attachments createAccountsAttachments = accountingApi.createAccountAttachmentByFileName(accessToken,xeroTenantId,accountID, newFileName, bytes);

		assertThat(createAccountsAttachments.getAttachments().get(0).getAttachmentID().toString(), is(equalTo("ab95b276-9dce-4925-9077-439818ba270f")));
		assertThat(createAccountsAttachments.getAttachments().get(0).getFileName().toString(), is(equalTo("sample5.jpg")));
		assertThat(createAccountsAttachments.getAttachments().get(0).getMimeType().toString(), is(equalTo("image/jpg")));
		assertThat(createAccountsAttachments.getAttachments().get(0).getUrl().toString(), is(equalTo("https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg")));

	}
/*
	@Test
	public void testUpdateAccountAttachmentByFileName() throws Exception {
		System.out.println("@Test - updateAccountAttachmentByFileName");

		UUID accountID = UUID.fromString("297c2dc5-cc47-4afd-8ec8-74990b8761e9");
		ClassLoader classLoader = getClass().getClassLoader();
		File bytes = new File(classLoader.getResource("helo-heros.jpg").getFile());

    	String newFileName = "sample.jpg";
		Attachments createAccountsAttachments = accountingApi.updateAccountAttachmentByFileName(accountID, newFileName, bytes);
		assertThat(createAccountsAttachments.getAttachments().get(0).getAttachmentID().toString(), is(equalTo("3fa85f64-5717-4562-b3fc-2c963f66afa6")));
		assertThat(createAccountsAttachments.getAttachments().get(0).getFileName().toString(), is(equalTo("sample5.jpg")));
		assertThat(createAccountsAttachments.getAttachments().get(0).getMimeType().toString(), is(equalTo("image/jpg")));
		assertThat(createAccountsAttachments.getAttachments().get(0).getUrl().toString(), is(equalTo("https://api.xero.com/api.xro/2.0/Accounts/da962997-a8bd-4dff-9616-01cdc199283f/Attachments/sample5.jpg")));
	}
	*/
}


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/html; charset=UTF-8" />
		<title>PMD Matlab 5.5.1 Reference</title>
		<link rel="stylesheet" type="text/css" href="stylesheet.css" title="style" />

			All Classes

Packages

				net.sourceforge.pmd

				net.sourceforge.pmd.cpd


text:
import sys
from typing import Any, Callable, Dict, IO, Optional, TypeVar, Union, overload

from azure.core.exceptions import (
    ClientAuthenticationError,
    HttpResponseError,
    ResourceExistsError,
    ResourceNotFoundError,
    ResourceNotModifiedError,
    map_error,
)
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import HttpResponse
from azure.core.rest import HttpRequest
from azure.core.tracing.decorator import distributed_trace
from azure.core.utils import case_insensitive_dict
from azure.mgmt.core.exceptions import ARMErrorFormat

from .. import models as _models
from .._serialization import Serializer
from .._vendor import _convert_request, _format_url_section

if sys.version_info >= (3, 8):
    from typing import Literal  # pylint: disable=no-name-in-module, ungrouped-imports
else:
    from typing_extensions import Literal  # type: ignore  # pylint: disable=ungrouped-imports
T = TypeVar("T")
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]

_SERIALIZER = Serializer()
_SERIALIZER.client_side_validation = False

def build_get_request(
    resource_group_name: str,
    workspace_name: str,
    integration_runtime_name: str,
    node_name: str,
    subscription_id: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version: Literal["2021-06-01-preview"] = kwargs.pop(
        "api_version", _params.pop("api-version", "2021-06-01-preview")
    )
    accept = _headers.pop("Accept", "application/json")

    # Construct URL
    _url = kwargs.pop(
        "template_url",
        "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}",
    )  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
        "resourceGroupName": _SERIALIZER.url(
            "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
        ),
        "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
        "integrationRuntimeName": _SERIALIZER.url("integration_runtime_name", integration_runtime_name, "str"),
        "nodeName": _SERIALIZER.url("node_name", node_name, "str"),
    }

    _url: str = _format_url_section(_url, **path_format_arguments)  # type: ignore

    # Construct parameters
    _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")

    # Construct headers
    _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

    return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs)

def build_update_request(
    resource_group_name: str,
    workspace_name: str,
    integration_runtime_name: str,
    node_name: str,
    subscription_id: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version: Literal["2021-06-01-preview"] = kwargs.pop(
        "api_version", _params.pop("api-version", "2021-06-01-preview")
    )
    content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
    accept = _headers.pop("Accept", "application/json")

    # Construct URL
    _url = kwargs.pop(
        "template_url",
        "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}",
    )  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
        "resourceGroupName": _SERIALIZER.url(
            "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
        ),
        "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
        "integrationRuntimeName": _SERIALIZER.url("integration_runtime_name", integration_runtime_name, "str"),
        "nodeName": _SERIALIZER.url("node_name", node_name, "str"),
    }

    _url: str = _format_url_section(_url, **path_format_arguments)  # type: ignore

    # Construct parameters
    _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")

    # Construct headers
    if content_type is not None:
        _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str")
    _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

    return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs)

def build_delete_request(
    resource_group_name: str,
    workspace_name: str,
    integration_runtime_name: str,
    node_name: str,
    subscription_id: str,
    **kwargs: Any
) -> HttpRequest:
    _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
    _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

    api_version: Literal["2021-06-01-preview"] = kwargs.pop(
        "api_version", _params.pop("api-version", "2021-06-01-preview")
    )
    accept = _headers.pop("Accept", "application/json")

    # Construct URL
    _url = kwargs.pop(
        "template_url",
        "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}",
    )  # pylint: disable=line-too-long
    path_format_arguments = {
        "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1),
        "resourceGroupName": _SERIALIZER.url(
            "resource_group_name", resource_group_name, "str", max_length=90, min_length=1
        ),
        "workspaceName": _SERIALIZER.url("workspace_name", workspace_name, "str"),
        "integrationRuntimeName": _SERIALIZER.url("integration_runtime_name", integration_runtime_name, "str"),
        "nodeName": _SERIALIZER.url("node_name", node_name, "str"),
    }

    _url: str = _format_url_section(_url, **path_format_arguments)  # type: ignore

    # Construct parameters
    _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str")

    # Construct headers
    _headers["Accept"] = _SERIALIZER.header("accept", accept, "str")

    return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs)

class IntegrationRuntimeNodesOperations:
    """
    .. warning::
        **DO NOT** instantiate this class directly.

        Instead, you should access the following operations through
        :class:`~azure.mgmt.synapse.SynapseManagementClient`'s
        :attr:`integration_runtime_nodes` attribute.
    """

    models = _models

    def __init__(self, *args, **kwargs):
        input_args = list(args)
        self._client = input_args.pop(0) if input_args else kwargs.pop("client")
        self._config = input_args.pop(0) if input_args else kwargs.pop("config")
        self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer")
        self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer")

    @distributed_trace
    def get(
        self,
        resource_group_name: str,
        workspace_name: str,
        integration_runtime_name: str,
        node_name: str,
        **kwargs: Any
    ) -> _models.SelfHostedIntegrationRuntimeNode:
        """Get integration runtime node.

        Get an integration runtime node.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace. Required.
        :type workspace_name: str
        :param integration_runtime_name: Integration runtime name. Required.
        :type integration_runtime_name: str
        :param node_name: Integration runtime node name. Required.
        :type node_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SelfHostedIntegrationRuntimeNode or the result of cls(response)
        :rtype: ~azure.mgmt.synapse.models.SelfHostedIntegrationRuntimeNode
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version: Literal["2021-06-01-preview"] = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-06-01-preview")
        )
        cls: ClsType[_models.SelfHostedIntegrationRuntimeNode] = kwargs.pop("cls", None)

        request = build_get_request(
            resource_group_name=resource_group_name,
            workspace_name=workspace_name,
            integration_runtime_name=integration_runtime_name,
            node_name=node_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            template_url=self.get.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize("SelfHostedIntegrationRuntimeNode", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    get.metadata = {
        "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}"
    }

    @overload
    def update(
        self,
        resource_group_name: str,
        workspace_name: str,
        integration_runtime_name: str,
        node_name: str,
        update_integration_runtime_node_request: _models.UpdateIntegrationRuntimeNodeRequest,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> _models.SelfHostedIntegrationRuntimeNode:
        """Create integration runtime node.

        Create an integration runtime node.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace. Required.
        :type workspace_name: str
        :param integration_runtime_name: Integration runtime name. Required.
        :type integration_runtime_name: str
        :param node_name: Integration runtime node name. Required.
        :type node_name: str
        :param update_integration_runtime_node_request: The parameters for updating an integration
         runtime node. Required.
        :type update_integration_runtime_node_request:
         ~azure.mgmt.synapse.models.UpdateIntegrationRuntimeNodeRequest
        :keyword content_type: Body Parameter content-type. Content type parameter for JSON body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SelfHostedIntegrationRuntimeNode or the result of cls(response)
        :rtype: ~azure.mgmt.synapse.models.SelfHostedIntegrationRuntimeNode
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @overload
    def update(
        self,
        resource_group_name: str,
        workspace_name: str,
        integration_runtime_name: str,
        node_name: str,
        update_integration_runtime_node_request: IO,
        *,
        content_type: str = "application/json",
        **kwargs: Any
    ) -> _models.SelfHostedIntegrationRuntimeNode:
        """Create integration runtime node.

        Create an integration runtime node.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace. Required.
        :type workspace_name: str
        :param integration_runtime_name: Integration runtime name. Required.
        :type integration_runtime_name: str
        :param node_name: Integration runtime node name. Required.
        :type node_name: str
        :param update_integration_runtime_node_request: The parameters for updating an integration
         runtime node. Required.
        :type update_integration_runtime_node_request: IO
        :keyword content_type: Body Parameter content-type. Content type parameter for binary body.
         Default value is "application/json".
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SelfHostedIntegrationRuntimeNode or the result of cls(response)
        :rtype: ~azure.mgmt.synapse.models.SelfHostedIntegrationRuntimeNode
        :raises ~azure.core.exceptions.HttpResponseError:
        """

    @distributed_trace
    def update(
        self,
        resource_group_name: str,
        workspace_name: str,
        integration_runtime_name: str,
        node_name: str,
        update_integration_runtime_node_request: Union[_models.UpdateIntegrationRuntimeNodeRequest, IO],
        **kwargs: Any
    ) -> _models.SelfHostedIntegrationRuntimeNode:
        """Create integration runtime node.

        Create an integration runtime node.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace. Required.
        :type workspace_name: str
        :param integration_runtime_name: Integration runtime name. Required.
        :type integration_runtime_name: str
        :param node_name: Integration runtime node name. Required.
        :type node_name: str
        :param update_integration_runtime_node_request: The parameters for updating an integration
         runtime node. Is either a model type or a IO type. Required.
        :type update_integration_runtime_node_request:
         ~azure.mgmt.synapse.models.UpdateIntegrationRuntimeNodeRequest or IO
        :keyword content_type: Body Parameter content-type. Known values are: 'application/json'.
         Default value is None.
        :paramtype content_type: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: SelfHostedIntegrationRuntimeNode or the result of cls(response)
        :rtype: ~azure.mgmt.synapse.models.SelfHostedIntegrationRuntimeNode
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {})
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version: Literal["2021-06-01-preview"] = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-06-01-preview")
        )
        content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None))
        cls: ClsType[_models.SelfHostedIntegrationRuntimeNode] = kwargs.pop("cls", None)

        content_type = content_type or "application/json"
        _json = None
        _content = None
        if isinstance(update_integration_runtime_node_request, (IO, bytes)):
            _content = update_integration_runtime_node_request
        else:
            _json = self._serialize.body(update_integration_runtime_node_request, "UpdateIntegrationRuntimeNodeRequest")

        request = build_update_request(
            resource_group_name=resource_group_name,
            workspace_name=workspace_name,
            integration_runtime_name=integration_runtime_name,
            node_name=node_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            content_type=content_type,
            json=_json,
            content=_content,
            template_url=self.update.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        deserialized = self._deserialize("SelfHostedIntegrationRuntimeNode", pipeline_response)

        if cls:
            return cls(pipeline_response, deserialized, {})

        return deserialized

    update.metadata = {
        "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}"
    }

    @distributed_trace
    def delete(  # pylint: disable=inconsistent-return-statements
        self,
        resource_group_name: str,
        workspace_name: str,
        integration_runtime_name: str,
        node_name: str,
        **kwargs: Any
    ) -> None:
        """Delete integration runtime node.

        Delete an integration runtime node.

        :param resource_group_name: The name of the resource group. The name is case insensitive.
         Required.
        :type resource_group_name: str
        :param workspace_name: The name of the workspace. Required.
        :type workspace_name: str
        :param integration_runtime_name: Integration runtime name. Required.
        :type integration_runtime_name: str
        :param node_name: Integration runtime node name. Required.
        :type node_name: str
        :keyword callable cls: A custom type or function that will be passed the direct response
        :return: None or the result of cls(response)
        :rtype: None
        :raises ~azure.core.exceptions.HttpResponseError:
        """
        error_map = {
            401: ClientAuthenticationError,
            404: ResourceNotFoundError,
            409: ResourceExistsError,
            304: ResourceNotModifiedError,
        }
        error_map.update(kwargs.pop("error_map", {}) or {})

        _headers = kwargs.pop("headers", {}) or {}
        _params = case_insensitive_dict(kwargs.pop("params", {}) or {})

        api_version: Literal["2021-06-01-preview"] = kwargs.pop(
            "api_version", _params.pop("api-version", "2021-06-01-preview")
        )
        cls: ClsType[None] = kwargs.pop("cls", None)

        request = build_delete_request(
            resource_group_name=resource_group_name,
            workspace_name=workspace_name,
            integration_runtime_name=integration_runtime_name,
            node_name=node_name,
            subscription_id=self._config.subscription_id,
            api_version=api_version,
            template_url=self.delete.metadata["url"],
            headers=_headers,
            params=_params,
        )
        request = _convert_request(request)
        request.url = self._client.format_url(request.url)

        pipeline_response: PipelineResponse = self._client._pipeline.run(  # pylint: disable=protected-access
            request, stream=False, **kwargs
        )

        response = pipeline_response.http_response

        if response.status_code not in [200, 204]:
            map_error(status_code=response.status_code, response=response, error_map=error_map)
            error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, pipeline_response)
            raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

        if cls:
            return cls(pipeline_response, None, {})

    delete.metadata = {
        "url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Synapse/workspaces/{workspaceName}/integrationRuntimes/{integrationRuntimeName}/nodes/{nodeName}"
    }


text:
require_relative '../../support/feature_helper'

describe "Maven Dependencies" do
  # As a Java developer
  # I want to be able to manage Maven dependencies

  let(:java_developer) { LicenseFinder::TestingDSL::User.new }

  specify "are shown in reports" do
    LicenseFinder::TestingDSL::MavenProject.create
    java_developer.run_license_finder
    expect(java_developer).to be_seeing_line 'junit, 4.11, "Common Public License Version 1.0"'
  end

  context 'when using --maven_include_groups flag' do

    it 'shows the groupid' do
      LicenseFinder::TestingDSL::MavenProject.create
      java_developer.run_license_finder nil, '--maven_include_groups'
      expect(java_developer).to be_seeing_line 'junit:junit, 4.11, "Common Public License Version 1.0"'
    end
  end
end


text:
package com.alibaba.nacos.auth;

import com.alibaba.nacos.api.config.remote.request.ConfigPublishRequest;
import com.alibaba.nacos.api.naming.remote.request.AbstractNamingRequest;
import com.alibaba.nacos.auth.annotation.Secured;
import com.alibaba.nacos.plugin.auth.api.IdentityContext;
import com.alibaba.nacos.plugin.auth.api.Permission;
import com.alibaba.nacos.plugin.auth.api.Resource;
import com.alibaba.nacos.auth.config.AuthConfigs;
import com.alibaba.nacos.plugin.auth.constant.SignType;
import com.alibaba.nacos.plugin.auth.exception.AccessException;
import com.alibaba.nacos.auth.mock.MockAuthPluginService;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

import java.lang.reflect.Method;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;

@RunWith(MockitoJUnitRunner.class)
public class GrpcProtocolAuthServiceTest {

    @Mock
    private AuthConfigs authConfigs;

    private ConfigPublishRequest configRequest;

    private AbstractNamingRequest namingRequest;

    private GrpcProtocolAuthService protocolAuthService;

    @Before
    public void setUp() throws Exception {
        protocolAuthService = new GrpcProtocolAuthService(authConfigs);
        protocolAuthService.initialize();
        mockConfigRequest();
        mockNamingRequest();
    }

    private void mockConfigRequest() {
        configRequest = new ConfigPublishRequest();
        configRequest.setTenant("testCNs");
        configRequest.setGroup("testCG");
        configRequest.setDataId("testD");
    }

    private void mockNamingRequest() {
        namingRequest = new AbstractNamingRequest() {
        };
        namingRequest.setNamespace("testNNs");
        namingRequest.setGroupName("testNG");
        namingRequest.setServiceName("testS");
    }

    @Test
    @Secured(resource = "testResource")
    public void testParseResourceWithSpecifiedResource() throws NoSuchMethodException {
        Secured secured = getMethodSecure("testParseResourceWithSpecifiedResource");
        Resource actual = protocolAuthService.parseResource(namingRequest, secured);
        assertEquals("testResource", actual.getName());
        assertEquals(SignType.SPECIFIED, actual.getType());
        assertNull(actual.getNamespaceId());
        assertNull(actual.getGroup());
        assertNull(actual.getProperties());
    }

    @Test
    @Secured(signType = "non-exist")
    public void testParseResourceWithNonExistType() throws NoSuchMethodException {
        Secured secured = getMethodSecure("testParseResourceWithNonExistType");
        Resource actual = protocolAuthService.parseResource(namingRequest, secured);
        assertEquals(Resource.EMPTY_RESOURCE, actual);
    }

    @Test
    @Secured()
    public void testParseResourceWithNamingType() throws NoSuchMethodException {
        Secured secured = getMethodSecure("testParseResourceWithNamingType");
        Resource actual = protocolAuthService.parseResource(namingRequest, secured);
        assertEquals(SignType.NAMING, actual.getType());
        assertEquals("testS", actual.getName());
        assertEquals("testNNs", actual.getNamespaceId());
        assertEquals("testNG", actual.getGroup());
        assertNotNull(actual.getProperties());
    }

    @Test
    @Secured(signType = SignType.CONFIG)
    public void testParseResourceWithConfigType() throws NoSuchMethodException {
        Secured secured = getMethodSecure("testParseResourceWithConfigType");
        Resource actual = protocolAuthService.parseResource(configRequest, secured);
        assertEquals(SignType.CONFIG, actual.getType());
        assertEquals("testD", actual.getName());
        assertEquals("testCNs", actual.getNamespaceId());
        assertEquals("testCG", actual.getGroup());
        assertNotNull(actual.getProperties());
    }

    @Test
    public void testParseIdentity() {
        IdentityContext actual = protocolAuthService.parseIdentity(namingRequest);
        assertNotNull(actual);
    }

    @Test
    public void testValidateIdentityWithoutPlugin() throws AccessException {
        IdentityContext identityContext = new IdentityContext();
        assertTrue(protocolAuthService.validateIdentity(identityContext, Resource.EMPTY_RESOURCE));
    }

    @Test
    public void testValidateIdentityWithPlugin() throws AccessException {
        Mockito.when(authConfigs.getNacosAuthSystemType()).thenReturn(MockAuthPluginService.TEST_PLUGIN);
        IdentityContext identityContext = new IdentityContext();
        assertFalse(protocolAuthService.validateIdentity(identityContext, Resource.EMPTY_RESOURCE));
    }

    @Test
    public void testValidateAuthorityWithoutPlugin() throws AccessException {
        assertTrue(protocolAuthService
                .validateAuthority(new IdentityContext(), new Permission(Resource.EMPTY_RESOURCE, "")));
    }

    @Test
    public void testValidateAuthorityWithPlugin() throws AccessException {
        Mockito.when(authConfigs.getNacosAuthSystemType()).thenReturn(MockAuthPluginService.TEST_PLUGIN);
        assertFalse(protocolAuthService
                .validateAuthority(new IdentityContext(), new Permission(Resource.EMPTY_RESOURCE, "")));
    }

    private Secured getMethodSecure(String methodName) throws NoSuchMethodException {
        Method method = GrpcProtocolAuthServiceTest.class.getMethod(methodName);
        return method.getAnnotation(Secured.class);
    }
}


text:
package io.socket.emitter;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;

import java.util.ArrayList;
import java.util.List;

import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;

@RunWith(JUnit4.class)
public class EmitterTest {

    @Test
    public void on() {
        Emitter emitter = new Emitter();
        final List<Object> calls = new ArrayList<Object>();

        emitter.on("foo", new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("one");
                calls.add(args[0]);
            }
        });

        emitter.on("foo", new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("two");
                calls.add(args[0]);
            }
        });

        emitter.emit("foo", 1);
        emitter.emit("bar", 1);
        emitter.emit("foo", 2);

        assertThat(calls.toArray(), is(new Object[] {"one", 1, "two", 1, "one", 2, "two", 2}));
    }

    @Test
    public void once() {
        Emitter emitter = new Emitter();
        final List<Object> calls = new ArrayList<Object>();

        emitter.once("foo", new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("one");
                calls.add(args[0]);
            }
        });

        emitter.emit("foo", 1);
        emitter.emit("foo", 2);
        emitter.emit("foo", 3);
        emitter.emit("bar", 1);

        assertThat(calls.toArray(), is(new Object[] {"one", 1}));
    }

    @Test
    public void off() {
        Emitter emitter = new Emitter();
        final List<Object> calls = new ArrayList<Object>();

        Emitter.Listener one = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("one");
            }
        };
        Emitter.Listener two = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("two");
            }
        };

        emitter.on("foo", one);
        emitter.on("foo", two);
        emitter.off("foo", two);

        emitter.emit("foo");

        assertThat(calls.toArray(), is(new Object[] {"one"}));
    }

    @Test
    public void offWithOnce() {
        Emitter emitter = new Emitter();
        final List<Object> calls = new ArrayList<Object>();

        Emitter.Listener one = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("one");
            }
        };

        emitter.once("foo", one);
        emitter.off("foo", one);

        emitter.emit("foo");

        assertThat(calls.toArray(), is(new Object[] {}));
    }

    @Test
    public void offWhenCalledfromEvent() {
        final Emitter emitter = new Emitter();
        final boolean[] called = new boolean[] {false};
        final Emitter.Listener b = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                called[0] = true;
            }
        };
        emitter.on("tobi", new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                emitter.off("tobi", b);
            }
        });
        emitter.once("tobi", b);
        emitter.emit("tobi");
        assertThat(called[0], is(true));
        called[0] = false;
        emitter.emit("tobi");
        assertThat(called[0], is(false));
    }

    @Test
    public void offEvent() {
        Emitter emitter = new Emitter();
        final List<Object> calls = new ArrayList<Object>();

        Emitter.Listener one = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("one");
            }
        };
        Emitter.Listener two = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("two");
            }
        };

        emitter.on("foo", one);
        emitter.on("foo", two);
        emitter.off("foo");

        emitter.emit("foo");
        emitter.emit("foo");

        assertThat(calls.toArray(), is(new Object[] {}));
    }

    @Test
    public void offAll() {
        Emitter emitter = new Emitter();
        final List<Object> calls = new ArrayList<Object>();

        Emitter.Listener one = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("one");
            }
        };
        Emitter.Listener two = new Emitter.Listener() {
            @Override
            public void call(Object... args) {
                calls.add("two");
            }
        };

        emitter.on("foo", one);
        emitter.on("bar", two);

        emitter.emit("foo");
        emitter.emit("bar");

        emitter.off();

        emitter.emit("foo");
        emitter.emit("bar");

        assertThat(calls.toArray(), is(new Object[]{"one", "two"}));
    }

    @Test
    public void listeners() {
        Emitter emitter = new Emitter();
        Emitter.Listener foo = new Emitter.Listener() {
            @Override
            public void call(Object... args) {}
        };
        emitter.on("foo", foo);
        assertThat(emitter.listeners("foo").toArray(), is(new Object[] {foo}));
    }

    @Test
    public void listenersWithoutHandlers() {
        Emitter emitter = new Emitter();
        assertThat(emitter.listeners("foo").toArray(), is(new Object[] {}));
    }

    @Test
    public void hasListeners() {
        Emitter emitter = new Emitter();
        emitter.on("foo", new Emitter.Listener() {
            @Override
            public void call(Object... args) {}
        });
        assertThat(emitter.hasListeners("foo"), is(true));
    }

    @Test
    public void hasListenersWithoutHandlers() {
        Emitter emitter = new Emitter();
        assertThat(emitter.hasListeners("foo"), is(false));
    }
}


text:
using base::Time;
using base::TimeTicks;
using base::TimeDelta;

namespace {

// Events for UMA. Do not reorder or change!
enum SSLInterstitialCause {
  CLOCK_PAST,
  CLOCK_FUTURE,
  WWW_SUBDOMAIN_MATCH,
  SUBDOMAIN_MATCH,
  SUBDOMAIN_INVERSE_MATCH,
  SUBDOMAIN_OUTSIDE_WILDCARD,
  HOST_NAME_NOT_KNOWN_TLD,
  LIKELY_MULTI_TENANT_HOSTING,
  UNUSED_INTERSTITIAL_CAUSE_ENTRY,
};

// Events for UMA. Do not reorder or change!
enum SSLInterstitialCauseCaptivePortal {
  CAPTIVE_PORTAL_DETECTION_ENABLED,
  CAPTIVE_PORTAL_DETECTION_ENABLED_OVERRIDABLE,
  CAPTIVE_PORTAL_PROBE_COMPLETED,
  CAPTIVE_PORTAL_PROBE_COMPLETED_OVERRIDABLE,
  CAPTIVE_PORTAL_NO_RESPONSE,
  CAPTIVE_PORTAL_NO_RESPONSE_OVERRIDABLE,
  CAPTIVE_PORTAL_DETECTED,
  CAPTIVE_PORTAL_DETECTED_OVERRIDABLE,
  UNUSED_CAPTIVE_PORTAL_EVENT,
};

void RecordSSLInterstitialSeverityScore(float ssl_severity_score,
                                        int cert_error) {
  if (SSLErrorInfo::NetErrorToErrorType(cert_error) ==
      SSLErrorInfo::CERT_DATE_INVALID) {
    UMA_HISTOGRAM_COUNTS_100("interstitial.ssl.severity_score.date_invalid",
                             static_cast<int>(ssl_severity_score * 100));
  } else if (SSLErrorInfo::NetErrorToErrorType(cert_error) ==
      SSLErrorInfo::CERT_COMMON_NAME_INVALID) {
    UMA_HISTOGRAM_COUNTS_100(
        "interstitial.ssl.severity_score.common_name_invalid",
        static_cast<int>(ssl_severity_score * 100));
  }
}

// Scores/weights which will be constant through all the SSL error types.
static const float kServerWeight = 0.5f;
static const float kClientWeight = 0.5f;

void RecordSSLInterstitialCause(bool overridable, SSLInterstitialCause event) {
  if (overridable) {
    UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.cause.overridable", event,
                              UNUSED_INTERSTITIAL_CAUSE_ENTRY);
  } else {
    UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.cause.nonoverridable", event,
                              UNUSED_INTERSTITIAL_CAUSE_ENTRY);
  }
}

#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
void RecordCaptivePortalEventStats(SSLInterstitialCauseCaptivePortal event) {
  UMA_HISTOGRAM_ENUMERATION("interstitial.ssl.captive_portal",
                            event,
                            UNUSED_CAPTIVE_PORTAL_EVENT);
}
#endif

int GetLevensteinDistance(const std::string& str1,
                          const std::string& str2) {
  if (str1 == str2)
    return 0;
  if (str1.size() == 0)
    return str2.size();
  if (str2.size() == 0)
    return str1.size();
  std::vector<int> kFirstRow(str2.size() + 1, 0);
  std::vector<int> kSecondRow(str2.size() + 1, 0);

  for (size_t i = 0; i < kFirstRow.size(); ++i)
    kFirstRow[i] = i;
  for (size_t i = 0; i < str1.size(); ++i) {
    kSecondRow[0] = i + 1;
    for (size_t j = 0; j < str2.size(); ++j) {
      int cost = str1[i] == str2[j] ? 0 : 1;
      kSecondRow[j+1] = std::min(std::min(
          kSecondRow[j] + 1, kFirstRow[j + 1] + 1), kFirstRow[j] + cost);
    }
    for (size_t j = 0; j < kFirstRow.size(); j++)
      kFirstRow[j] = kSecondRow[j];
  }
  return kSecondRow[str2.size()];
}

} // namespace

SSLErrorClassification::SSLErrorClassification(
    content::WebContents* web_contents,
    const base::Time& current_time,
    const GURL& url,
    int cert_error,
    const net::X509Certificate& cert)
  : web_contents_(web_contents),
    current_time_(current_time),
    request_url_(url),
    cert_error_(cert_error),
    cert_(cert),
    captive_portal_detection_enabled_(false),
    captive_portal_probe_completed_(false),
    captive_portal_no_response_(false),
    captive_portal_detected_(false) {
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
  Profile* profile = Profile::FromBrowserContext(
      web_contents_->GetBrowserContext());
  CaptivePortalService* captive_portal_service =
      CaptivePortalServiceFactory::GetForProfile(profile);
  captive_portal_detection_enabled_ = captive_portal_service->enabled();
  captive_portal_service->DetectCaptivePortal();
  registrar_.Add(this,
                 chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT,
                 content::Source<Profile>(profile));
#endif
}

SSLErrorClassification::~SSLErrorClassification() { }

void SSLErrorClassification::RecordCaptivePortalUMAStatistics(
    bool overridable) const {
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
  if (captive_portal_detection_enabled_)
    RecordCaptivePortalEventStats(
        overridable ?
        CAPTIVE_PORTAL_DETECTION_ENABLED_OVERRIDABLE :
        CAPTIVE_PORTAL_DETECTION_ENABLED);
  if (captive_portal_probe_completed_)
    RecordCaptivePortalEventStats(
        overridable ?
        CAPTIVE_PORTAL_PROBE_COMPLETED_OVERRIDABLE :
        CAPTIVE_PORTAL_PROBE_COMPLETED);
  // Log only one of portal detected and no response results.
  if (captive_portal_detected_)
    RecordCaptivePortalEventStats(
        overridable ?
        CAPTIVE_PORTAL_DETECTED_OVERRIDABLE :
        CAPTIVE_PORTAL_DETECTED);
  else if (captive_portal_no_response_)
    RecordCaptivePortalEventStats(
        overridable ?
        CAPTIVE_PORTAL_NO_RESPONSE_OVERRIDABLE :
        CAPTIVE_PORTAL_NO_RESPONSE);
#endif
}

void SSLErrorClassification::InvalidDateSeverityScore() {
  SSLErrorInfo::ErrorType type =
      SSLErrorInfo::NetErrorToErrorType(cert_error_);
  DCHECK(type == SSLErrorInfo::CERT_DATE_INVALID);

  // Client-side characteristics. Check whether or not the system's clock is
  // wrong and whether or not the user has encountered this error before.
  float severity_date_score = 0.0f;

  static const float kCertificateExpiredWeight = 0.3f;
  static const float kNotYetValidWeight = 0.2f;

  static const float kSystemClockWeight = 0.75f;
  static const float kSystemClockWrongWeight = 0.1f;
  static const float kSystemClockRightWeight = 1.0f;

  if (IsUserClockInThePast(current_time_)  ||
      IsUserClockInTheFuture(current_time_)) {
    severity_date_score += kClientWeight * kSystemClockWeight *
        kSystemClockWrongWeight;
  } else {
    severity_date_score += kClientWeight * kSystemClockWeight *
        kSystemClockRightWeight;
  }
  // TODO(felt): (crbug.com/393262) Check website settings.

  // Server-side characteristics. Check whether the certificate has expired or
  // is not yet valid. If the certificate has expired then factor the time which
  // has passed since expiry.
  if (cert_.HasExpired()) {
    severity_date_score += kServerWeight * kCertificateExpiredWeight *
        CalculateScoreTimePassedSinceExpiry();
  }
  if (current_time_ < cert_.valid_start())
    severity_date_score += kServerWeight * kNotYetValidWeight;

  RecordSSLInterstitialSeverityScore(severity_date_score, cert_error_);
}

void SSLErrorClassification::InvalidCommonNameSeverityScore() {
  SSLErrorInfo::ErrorType type =
      SSLErrorInfo::NetErrorToErrorType(cert_error_);
  DCHECK(type == SSLErrorInfo::CERT_COMMON_NAME_INVALID);
  float severity_name_score = 0.0f;

  static const float kWWWDifferenceWeight = 0.3f;
  static const float kNameUnderAnyNamesWeight = 0.2f;
  static const float kAnyNamesUnderNameWeight = 1.0f;
  static const float kLikelyMultiTenantHostingWeight = 0.1f;

  std::string host_name = request_url_.host();
  if (IsHostNameKnownTLD(host_name)) {
    Tokens host_name_tokens = Tokenize(host_name);
    if (IsWWWSubDomainMatch())
      severity_name_score += kServerWeight * kWWWDifferenceWeight;
    if (IsSubDomainOutsideWildcard(host_name_tokens))
      severity_name_score += kServerWeight * kWWWDifferenceWeight;

    std::vector<std::string> dns_names;
    cert_.GetDNSNames(&dns_names);
    std::vector<Tokens> dns_name_tokens = GetTokenizedDNSNames(dns_names);
    if (NameUnderAnyNames(host_name_tokens, dns_name_tokens))
      severity_name_score += kServerWeight * kNameUnderAnyNamesWeight;
    // Inverse case is more likely to be a MITM attack.
    if (AnyNamesUnderName(dns_name_tokens, host_name_tokens))
      severity_name_score += kServerWeight * kAnyNamesUnderNameWeight;
    if (IsCertLikelyFromMultiTenantHosting())
      severity_name_score += kServerWeight * kLikelyMultiTenantHostingWeight;
  }

  static const float kEnvironmentWeight = 0.25f;

  severity_name_score += kClientWeight * kEnvironmentWeight *
      CalculateScoreEnvironments();

  RecordSSLInterstitialSeverityScore(severity_name_score, cert_error_);
}

void SSLErrorClassification::RecordUMAStatistics(
    bool overridable) const {
  SSLErrorInfo::ErrorType type =
      SSLErrorInfo::NetErrorToErrorType(cert_error_);
  switch (type) {
    case SSLErrorInfo::CERT_DATE_INVALID: {
      if (IsUserClockInThePast(base::Time::NowFromSystemTime()))
        RecordSSLInterstitialCause(overridable, CLOCK_PAST);
      if (IsUserClockInTheFuture(base::Time::NowFromSystemTime()))
        RecordSSLInterstitialCause(overridable, CLOCK_FUTURE);
      break;
    }
    case SSLErrorInfo::CERT_COMMON_NAME_INVALID: {
      std::string host_name = request_url_.host();
      if (IsHostNameKnownTLD(host_name)) {
        Tokens host_name_tokens = Tokenize(host_name);
        if (IsWWWSubDomainMatch())
          RecordSSLInterstitialCause(overridable, WWW_SUBDOMAIN_MATCH);
        if (IsSubDomainOutsideWildcard(host_name_tokens))
          RecordSSLInterstitialCause(overridable, SUBDOMAIN_OUTSIDE_WILDCARD);
        std::vector<std::string> dns_names;
        cert_.GetDNSNames(&dns_names);
        std::vector<Tokens> dns_name_tokens = GetTokenizedDNSNames(dns_names);
        if (NameUnderAnyNames(host_name_tokens, dns_name_tokens))
          RecordSSLInterstitialCause(overridable, SUBDOMAIN_MATCH);
        if (AnyNamesUnderName(dns_name_tokens, host_name_tokens))
          RecordSSLInterstitialCause(overridable, SUBDOMAIN_INVERSE_MATCH);
        if (IsCertLikelyFromMultiTenantHosting())
          RecordSSLInterstitialCause(overridable, LIKELY_MULTI_TENANT_HOSTING);
      } else {
         RecordSSLInterstitialCause(overridable, HOST_NAME_NOT_KNOWN_TLD);
      }
      break;
    }
    default: {
      break;
    }
  }
}

base::TimeDelta SSLErrorClassification::TimePassedSinceExpiry() const {
  base::TimeDelta delta = current_time_ - cert_.valid_expiry();
  return delta;
}

float SSLErrorClassification::CalculateScoreTimePassedSinceExpiry() const {
  base::TimeDelta delta = TimePassedSinceExpiry();
  int64 time_passed = delta.InDays();
  const int64 kHighThreshold = 7;
  const int64 kLowThreshold = 4;
  static const float kHighThresholdWeight = 0.4f;
  static const float kMediumThresholdWeight = 0.3f;
  static const float kLowThresholdWeight = 0.2f;
  if (time_passed >= kHighThreshold)
    return kHighThresholdWeight;
  else if (time_passed >= kLowThreshold)
    return kMediumThresholdWeight;
  else
    return kLowThresholdWeight;
}

float SSLErrorClassification::CalculateScoreEnvironments() const {
  static const float kWifiWeight = 0.7f;
  static const float kCellularWeight = 0.7f;
  static const float kEthernetWeight = 0.7f;
  static const float kOtherWeight = 0.7f;
  net::NetworkChangeNotifier::ConnectionType type =
      net::NetworkChangeNotifier::GetConnectionType();
  if (type == net::NetworkChangeNotifier::CONNECTION_WIFI)
    return kWifiWeight;
  if (type == net::NetworkChangeNotifier::CONNECTION_2G ||
      type == net::NetworkChangeNotifier::CONNECTION_3G ||
      type == net::NetworkChangeNotifier::CONNECTION_4G ) {
    return kCellularWeight;
  }
  if (type == net::NetworkChangeNotifier::CONNECTION_ETHERNET)
    return kEthernetWeight;
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
  // Assume if captive portals are detected then the user is connected using a
  // hot spot.
  static const float kHotspotWeight = 0.2f;
  if (captive_portal_probe_completed_ && captive_portal_detected_)
      return kHotspotWeight;
#endif
  return kOtherWeight;
}

bool SSLErrorClassification::IsUserClockInThePast(const base::Time& time_now) {
  base::Time build_time = base::GetBuildTime();
  if (time_now < build_time - base::TimeDelta::FromDays(2))
    return true;
  return false;
}

bool SSLErrorClassification::IsUserClockInTheFuture(
    const base::Time& time_now) {
  base::Time build_time = base::GetBuildTime();
  if (time_now > build_time + base::TimeDelta::FromDays(365))
    return true;
  return false;
}

bool SSLErrorClassification::MaybeWindowsLacksSHA256Support() {
#if defined(OS_WIN)
  return !base::win::MaybeHasSHA256Support();
#else
  return false;
#endif
}

bool SSLErrorClassification::IsHostNameKnownTLD(const std::string& host_name) {
  size_t tld_length =
      net::registry_controlled_domains::GetRegistryLength(
          host_name,
          net::registry_controlled_domains::EXCLUDE_UNKNOWN_REGISTRIES,
          net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
  if (tld_length == 0 || tld_length == std::string::npos)
    return false;
  return true;
}

std::vector<SSLErrorClassification::Tokens> SSLErrorClassification::
GetTokenizedDNSNames(const std::vector<std::string>& dns_names) {
  std::vector<std::vector<std::string>> dns_name_tokens;
  for (size_t i = 0; i < dns_names.size(); ++i) {
    std::vector<std::string> dns_name_token_single;
    if (dns_names[i].empty() || dns_names[i].find('\0') != std::string::npos
        || !(IsHostNameKnownTLD(dns_names[i]))) {
      dns_name_token_single.push_back(std::string());
    } else {
      dns_name_token_single = Tokenize(dns_names[i]);
    }
    dns_name_tokens.push_back(dns_name_token_single);
  }
  return dns_name_tokens;
}

size_t SSLErrorClassification::FindSubDomainDifference(
    const Tokens& potential_subdomain, const Tokens& parent) const {
  // A check to ensure that the number of tokens in the tokenized_parent is
  // less than the tokenized_potential_subdomain.
  if (parent.size() >= potential_subdomain.size())
    return 0;

  size_t tokens_match = 0;
  size_t diff_size = potential_subdomain.size() - parent.size();
  for (size_t i = 0; i < parent.size(); ++i) {
    if (parent[i] == potential_subdomain[i + diff_size])
      tokens_match++;
  }
  if (tokens_match == parent.size())
    return diff_size;
  return 0;
}

SSLErrorClassification::Tokens SSLErrorClassification::
Tokenize(const std::string& name) {
  Tokens name_tokens;
  base::SplitStringDontTrim(name, '.', &name_tokens);
  return name_tokens;
}

// We accept the inverse case for www for historical reasons.
bool SSLErrorClassification::IsWWWSubDomainMatch() const {
  std::string host_name = request_url_.host();
  if (IsHostNameKnownTLD(host_name)) {
    std::vector<std::string> dns_names;
    cert_.GetDNSNames(&dns_names);
    bool result = false;
    // Need to account for all possible domains given in the SSL certificate.
    for (size_t i = 0; i < dns_names.size(); ++i) {
      if (dns_names[i].empty() || dns_names[i].find('\0') != std::string::npos
          || dns_names[i].length() == host_name.length()
          || !(IsHostNameKnownTLD(dns_names[i]))) {
        result = result || false;
      } else if (dns_names[i].length() > host_name.length()) {
        result = result ||
            net::StripWWW(base::ASCIIToUTF16(dns_names[i])) ==
            base::ASCIIToUTF16(host_name);
      } else {
        result = result ||
            net::StripWWW(base::ASCIIToUTF16(host_name)) ==
            base::ASCIIToUTF16(dns_names[i]);
      }
    }
    return result;
  }
  return false;
}

bool SSLErrorClassification::NameUnderAnyNames(
    const Tokens& child,
    const std::vector<Tokens>& potential_parents) const {
  bool result = false;
  // Need to account for all the possible domains given in the SSL certificate.
  for (size_t i = 0; i < potential_parents.size(); ++i) {
    if (potential_parents[i].empty() ||
        potential_parents[i].size() >= child.size()) {
      result = result || false;
    } else {
      size_t domain_diff = FindSubDomainDifference(child,
                                                   potential_parents[i]);
      if (domain_diff == 1 &&  child[0] != "www")
        result = result || true;
    }
  }
  return result;
}

bool SSLErrorClassification::AnyNamesUnderName(
    const std::vector<Tokens>& potential_children,
    const Tokens& parent) const {
  bool result = false;
  // Need to account for all the possible domains given in the SSL certificate.
  for (size_t i = 0; i < potential_children.size(); ++i) {
    if (potential_children[i].empty() ||
        potential_children[i].size() <= parent.size()) {
      result = result || false;
    } else {
      size_t domain_diff = FindSubDomainDifference(potential_children[i],
                                                   parent);
      if (domain_diff == 1 &&  potential_children[i][0] != "www")
        result = result || true;
    }
  }
  return result;
}

bool SSLErrorClassification::IsSubDomainOutsideWildcard(
    const Tokens& host_name_tokens) const {
  std::string host_name = request_url_.host();
  std::vector<std::string> dns_names;
  cert_.GetDNSNames(&dns_names);
  bool result = false;

  // This method requires that the host name be longer than the dns name on
  // the certificate.
  for (size_t i = 0; i < dns_names.size(); ++i) {
    const std::string& name = dns_names[i];
    if (name.length() < 2 || name.length() >= host_name.length() ||
        name.find('\0') != std::string::npos ||
        !IsHostNameKnownTLD(name)
        || name[0] != '*' || name[1] != '.') {
      continue;
    }

    // Move past the "*.".
    std::string extracted_dns_name = name.substr(2);
    if (FindSubDomainDifference(
        host_name_tokens, Tokenize(extracted_dns_name)) == 2) {
      return true;
    }
  }
  return result;
}

bool SSLErrorClassification::IsCertLikelyFromMultiTenantHosting() const {
  std::string host_name = request_url_.host();
  std::vector<std::string> dns_names;
  std::vector<std::string> dns_names_domain;
  cert_.GetDNSNames(&dns_names);
  size_t dns_names_size = dns_names.size();

  // If there is only 1 DNS name then it is definitely not a shared certificate.
  if (dns_names_size == 0 || dns_names_size == 1)
    return false;

  // Check to see if all the domains in the SAN field in the SSL certificate are
  // the same or not.
  for (size_t i = 0; i < dns_names_size; ++i) {
    dns_names_domain.push_back(
        net::registry_controlled_domains::
        GetDomainAndRegistry(
            dns_names[i],
            net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES));
  }
  for (size_t i = 1; i < dns_names_domain.size(); ++i) {
    if (dns_names_domain[i] != dns_names_domain[0])
      return false;
  }

  // If the number of DNS names is more than 5 then assume that it is a shared
  // certificate.
  static const int kDistinctNameThreshold = 5;
  if (dns_names_size > kDistinctNameThreshold)
    return true;

  // Heuristic - The edit distance between all the strings should be at least 5
  // for it to be counted as a shared SSLCertificate. If even one pair of
  // strings edit distance is below 5 then the certificate is no longer
  // considered as a shared certificate. Include the host name in the URL also
  // while comparing.
  dns_names.push_back(host_name);
  static const int kMinimumEditDsitance = 5;
  for (size_t i = 0; i < dns_names_size; ++i) {
    for (size_t j = i + 1; j < dns_names_size; ++j) {
      int edit_distance = GetLevensteinDistance(dns_names[i], dns_names[j]);
      if (edit_distance < kMinimumEditDsitance)
        return false;
    }
  }
  return true;
}

void SSLErrorClassification::Observe(
    int type,
    const content::NotificationSource& source,
    const content::NotificationDetails& details) {
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
  // When detection is disabled, captive portal service always sends
  // RESULT_INTERNET_CONNECTED. Ignore any probe results in that case.
  if (!captive_portal_detection_enabled_)
    return;
  if (type == chrome::NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT) {
    captive_portal_probe_completed_ = true;
    CaptivePortalService::Results* results =
        content::Details<CaptivePortalService::Results>(
            details).ptr();
    // If a captive portal was detected at any point when the interstitial was
    // displayed, assume that the interstitial was caused by a captive portal.
    // Example scenario:
    // 1- Interstitial displayed and captive portal detected, setting the flag.
    // 2- Captive portal detection automatically opens portal login page.
    // 3- User logs in on the portal login page.
    // A notification will be received here for RESULT_INTERNET_CONNECTED. Make
    // sure we don't clear the captive protal flag, since the interstitial was
    // potentially caused by the captive portal.
    captive_portal_detected_ = captive_portal_detected_ ||
        (results->result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL);
    // Also keep track of non-HTTP portals and error cases.
    captive_portal_no_response_ = captive_portal_no_response_ ||
        (results->result == captive_portal::RESULT_NO_RESPONSE);
  }
#endif
}


text:
Phine\Test

Property
========

Manages access to a protected or private class property.

Signature
---------

- It is a(n) **class**.

Methods
-------

The class defines the following methods:

- [`find()`](#find) — Finds a property for the given class.
- [`get()`](#get) — Returns the current value of a property.
- [`set()`](#set) — Sets the new value of a property.

### `find()`

Finds a property for the given class.

#### Signature

- It is a **public static** method.
- It accepts the following parameter(s):
    - `$class` (`object`|`string`) — The class instance or name.
    - `$name` (`string`) — The name of a property.
    - `$access` (`boolean`) — Make the property accessible?
- _Returns:_ The property.
    - [`ReflectionProperty`](http://php.net/class.ReflectionProperty)
- It throws one of the following exceptions:
    - `PropertyException` — If the property does not exist.

### `get()`

Returns the current value of a property.

#### Signature

- It is a **public static** method.
- It accepts the following parameter(s):
    - `$class` (`object`|`string`) — The class instance or name.
    - `$name` (`string`) — The name of a property.
- _Returns:_ The current value of the property.
    - `mixed`

### `set()`

Sets the new value of a property.

#### Signature

- It is a **public static** method.
- It accepts the following parameter(s):
    - `$class` (`object`|`string`) — The class instance or name.
    - `$name` (`string`) — The name of a property.
    - `$value` (`mixed`) — The new value.
- It does not return anything.


text:
package org.guvnor.ala.exceptions;

/**
 * BuildException to be used in different Builders implementations.
 */
public class BuildException extends RuntimeException {

    public BuildException( String message ) {
        super( message );
    }

    public BuildException( String message,
            Throwable cause ) {
        super( message, cause );
    }

}


text:
package org.project.openbaton.nubomedia.paas.model.openshift;

/**
 * Created by maa on 07.02.16.
 */
public interface HPASpecMetrics {}


text:
Getting Started
===============

Prerequisites
-------------

Akka requires that you have `Java 1.6 <http://www.oracle.com/technetwork/java/javase/downloads/index.html>`_ or
later installed on you machine.

Getting Started Guides and Template Projects
--------------------------------------------

The best way to start learning Akka is to download `Typesafe Activator <http://www.typesafe.com/platform/getstarted>`_
and try out one of Akka Template Projects.

Download
--------

There are several ways to download Akka. You can download it as part of the Typesafe Platform
(as described above). You can download the full distribution with microkernel, which includes
all modules. Or you can use a build tool like Maven or SBT to download dependencies from the
Akka Maven repository.

Modules
-------

Akka is very modular and consists of several JARs containing different features.

- ``akka-actor`` – Classic Actors, Typed Actors, IO Actor etc.

- ``akka-agent`` – Agents, integrated with Scala STM

- ``akka-camel`` – Apache Camel integration

- ``akka-cluster`` – Cluster membership management, elastic routers.

- ``akka-kernel`` – Akka microkernel for running a bare-bones mini application
  server

- ``akka-osgi`` – base bundle for using Akka in OSGi containers, containing the
  ``akka-actor`` classes

- ``akka-osgi-aries`` – Aries blueprint for provisioning actor systems

- ``akka-remote`` – Remote Actors

- ``akka-slf4j`` – SLF4J Logger (event bus listener)

- ``akka-testkit`` – Toolkit for testing Actor systems

- ``akka-zeromq`` – ZeroMQ integration

In addition to these stable modules there are several which are on their way
into the stable core but are still marked "experimental" at this point. This
does not mean that they do not function as intended, it primarily means that
their API has not yet solidified enough in order to be considered frozen. You
can help accelerating this process by giving feedback on these modules on our
mailing list.

- ``akka-contrib`` – an assortment of contributions which may or may not be
  moved into core modules, see :ref:`akka-contrib` for more details.

The filename of the actual JAR is for example ``@jarName@`` (and analog for
the other modules).

How to see the JARs dependencies of each Akka module is described in the
:ref:`dependencies` section.

Using a release distribution
----------------------------

Download the release you need from http://akka.io/downloads and unzip it.

Using a snapshot version
------------------------

The Akka nightly snapshots are published to http://repo.akka.io/snapshots/ and are
versioned with both ``SNAPSHOT`` and timestamps. You can choose a timestamped
version to work with and can decide when to update to a newer version. The Akka
snapshots repository is also proxied through http://repo.typesafe.com/typesafe/snapshots/
which includes proxies for several other repositories that Akka modules depend on.

.. warning::

  The use of Akka SNAPSHOTs, nightlies and milestone releases is discouraged unless you know what you are doing.

Microkernel
-----------

The Akka distribution includes the microkernel. To run the microkernel put your
application jar in the ``deploy`` directory and use the scripts in the ``bin``
directory.

More information is available in the documentation of the
:ref:`Microkernel (Scala) <microkernel-scala>` / :ref:`Microkernel (Java) <microkernel-java>`.

.. _build-tool:

Using a build tool
------------------

Akka can be used with build tools that support Maven repositories.

Maven repositories
------------------

For Akka version 2.1-M2 and onwards:

`Maven Central <http://repo1.maven.org/maven2/>`_

For previous Akka versions:

`Akka Repo <http://repo.akka.io/releases/>`_
`Typesafe Repo <http://repo.typesafe.com/typesafe/releases/>`_

Using Akka with Maven
---------------------

The simplest way to get started with Akka and Maven is to check out the
`Typesafe Activator <http://www.typesafe.com/platform/getstarted>`_
tutorial named `Akka Main in Java <http://www.typesafe.com/activator/template/akka-sample-main-java>`_.

Since Akka is published to Maven Central (for versions since 2.1-M2), it is
enough to add the Akka dependencies to the POM. For example, here is the
dependency for akka-actor:

.. code-block:: xml

  <dependency>
    <groupId>com.typesafe.akka</groupId>
    <artifactId>akka-actor_@binVersion@</artifactId>
    <version>@version@</version>
  </dependency>

For snapshot versions, the snapshot repository needs to be added as well:

.. code-block:: xml

    <repositories>
      <repository>
        <id>akka-snapshots</id>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        <url>http://repo.akka.io/snapshots/</url>
      </repository>
    </repositories>

**Note**: for snapshot versions both ``SNAPSHOT`` and timestamped versions are published.

Using Akka with SBT
-------------------

The simplest way to get started with Akka and SBT is to check out the
`Akka/SBT template <http://www.typesafe.com/resources/getting-started/typesafe-stack/downloading-installing.html#template-projects-for-scala-akka-and-play>`_
project.

Summary of the essential parts for using Akka with SBT:

SBT installation instructions on `https://github.com/harrah/xsbt/wiki/Setup <https://github.com/harrah/xsbt/wiki/Setup>`_

``build.sbt`` file:

.. parsed-literal::

    name := "My Project"

    version := "1.0"

    scalaVersion := "@scalaVersion@"

    libraryDependencies +=
      "com.typesafe.akka" %% "akka-actor" % "@version@" @crossString@

**Note**: the libraryDependencies setting above is specific to SBT v0.12.x and higher.  If you are using an older version of SBT, the libraryDependencies should look like this:

.. parsed-literal::

    libraryDependencies +=
      "com.typesafe.akka" % "akka-actor_@binVersion@" % "@version@"

For snapshot versions, the snapshot repository needs to be added as well:

.. parsed-literal::

    resolvers += "Akka Snapshot Repository" at "http://repo.akka.io/snapshots/"

Using Akka with Gradle
----------------------

Requires at least `Gradle <http://gradle.org>`_ 1.4
Uses the `Scala plugin <http://gradle.org/docs/current/userguide/scala_plugin.html>`_

.. parsed-literal::

    apply plugin: 'scala'

    repositories {
      mavenCentral()
    }

    dependencies {
      compile 'org.scala-lang:scala-library:@scalaVersion@'
    }

    tasks.withType(ScalaCompile) {
      scalaCompileOptions.useAnt = false
    }

    dependencies {
      compile group: 'com.typesafe.akka', name: 'akka-actor_@binVersion@', version: '@version@'
      compile group: 'org.scala-lang', name: 'scala-library', version: '@scalaVersion@'
    }

For snapshot versions, the snapshot repository needs to be added as well:

.. parsed-literal::

    repositories {
      mavenCentral()
      maven {
        url "http://repo.akka.io/snapshots/"
      }
    }

Using Akka with Eclipse
-----------------------

Setup SBT project and then use `sbteclipse <https://github.com/typesafehub/sbteclipse>`_ to generate a Eclipse project.

Using Akka with IntelliJ IDEA
-----------------------------

Setup SBT project and then use `sbt-idea <https://github.com/mpeltonen/sbt-idea>`_ to generate a IntelliJ IDEA project.

Using Akka with NetBeans
------------------------

Setup SBT project and then use `nbsbt <https://github.com/dcaoyuan/nbsbt>`_ to generate a NetBeans project.

You should also use `nbscala <https://github.com/dcaoyuan/nbscala>`_ for general scala support in the IDE.

Do not use -optimize Scala compiler flag
----------------------------------------

.. warning::

  Akka has not been compiled or tested with -optimize Scala compiler flag.
  Strange behavior has been reported by users that have tried it.

Build from sources
------------------

Akka uses Git and is hosted at `Github <http://github.com>`_.

* Akka: clone the Akka repository from `<http://github.com/akka/akka>`_

Continue reading the page on :ref:`building-akka`

Need help?
----------

If you have questions you can get help on the `Akka Mailing List <http://groups.google.com/group/akka-user>`_.

You can also ask for `commercial support <http://www.typesafe.com>`_.

Thanks for being a part of the Akka community.


text:
from __future__ import annotations

from typing import Union

from airflow.models.abstractoperator import AbstractOperator
from airflow.models.baseoperator import BaseOperator
from airflow.models.mappedoperator import MappedOperator
from airflow.typing_compat import TypeGuard

Operator = Union[BaseOperator, MappedOperator]

def needs_expansion(task: AbstractOperator) -> TypeGuard[Operator]:
    """Whether a task needs expansion at runtime.

    A task needs expansion if it either

    * Is a mapped operator, or
    * Is in a mapped task group.

    This is implemented as a free function (instead of a property) so we can
    make it a type guard.
    """
    if isinstance(task, MappedOperator):
        return True
    if task.get_closest_mapped_task_group() is not None:
        return True
    return False

__all__ = ["Operator", "needs_expansion"]


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

import com.facebook.presto.spi.Page;
import com.facebook.presto.spi.plan.PlanNodeId;

import static java.util.Objects.requireNonNull;

public class DevNullOperator
        implements Operator
{
    public static class DevNullOperatorFactory
            implements OperatorFactory
    {
        private final int operatorId;
        private final PlanNodeId planNodeId;

        public DevNullOperatorFactory(int operatorId, PlanNodeId planNodeId)
        {
            this.operatorId = operatorId;
            this.planNodeId = requireNonNull(planNodeId, "planNodeId is null");
        }

        @Override
        public Operator createOperator(DriverContext driverContext)
        {
            return new DevNullOperator(driverContext.addOperatorContext(operatorId, planNodeId, DevNullOperator.class.getSimpleName()));
        }

        @Override
        public void noMoreOperators()
        {
        }

        @Override
        public OperatorFactory duplicate()
        {
            return new DevNullOperatorFactory(operatorId, planNodeId);
        }
    }

    private final OperatorContext context;
    private boolean finished;

    public DevNullOperator(OperatorContext context)
    {
        this.context = requireNonNull(context, "context is null");
    }

    @Override
    public OperatorContext getOperatorContext()
    {
        return context;
    }

    @Override
    public boolean needsInput()
    {
        return !finished;
    }

    @Override
    public void addInput(Page page)
    {
    }

    @Override
    public Page getOutput()
    {
        return null;
    }

    @Override
    public void finish()
    {
        finished = true;
    }

    @Override
    public boolean isFinished()
    {
        return finished;
    }
}


text:
package at.tugraz.sss.servs.recomm.impl;

import at.kc.tugraz.ss.recomm.datatypes.*;
import at.tugraz.sss.serv.db.api.SSDBSQLI;
import at.tugraz.sss.serv.util.SSSQLVarNames;
import at.tugraz.sss.serv.reg.SSServErrReg;
import at.tugraz.sss.serv.datatype.*;
import at.tugraz.sss.serv.datatype.par.*;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import at.tugraz.sss.serv.db.api.SSCoreSQL;

public class SSRecommSQL extends SSCoreSQL{

  public SSRecommSQL(
    final SSDBSQLI dbSQL) {

    super(dbSQL);
  }

  public Map<String, List<String>> getUserRealms(
    final SSServPar servPar) throws SSErr{

    ResultSet resultSet = null;

    try{
      final Map<String, List<String>> userRealms = new HashMap<>();
      final List<String>              columns    = new ArrayList<>();
      final Map<String, String>       wheres     = new HashMap<>();

      column(columns, SSSQLVarNames.userId);
      column(columns, SSSQLVarNames.realm);

      resultSet = dbSQL.select(servPar, SSRecommSQLTableE.recommuserrealms, columns, wheres, null, null, null);

      while(resultSet.next()){

        if(!userRealms.containsKey(bindingStr(resultSet, SSSQLVarNames.userId))){
          userRealms.put(bindingStr(resultSet, SSSQLVarNames.userId), new ArrayList());
        }else{

          if(userRealms.get(bindingStr(resultSet, SSSQLVarNames.userId)).contains(bindingStr(resultSet, SSSQLVarNames.realm))){
            continue;
          }
        }

        userRealms.get(bindingStr(resultSet, SSSQLVarNames.userId)).add(bindingStr(resultSet, SSSQLVarNames.realm));
      }

      return userRealms;

    }catch(Exception error){
      SSServErrReg.regErrThrow(error);
      return null;
    }finally{
      dbSQL.closeStmt(resultSet);
    }
  }

  public void addUserRealm(
    final SSServPar servPar,
    final SSUri     user,
    final String    realm) throws SSErr{

    try{
      final Map<String, String> inserts =  new HashMap<>();

      insert(inserts, SSSQLVarNames.userId,   user);
      insert(inserts, SSSQLVarNames.realm,    realm);

      dbSQL.insert(servPar, SSRecommSQLTableE.recommuserrealms, inserts);

    }catch(Exception error){
      SSServErrReg.regErrThrow(error);
    }
  }
}


text:
package org.jcrom.callback;

import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.nodetype.NodeType;

import org.jcrom.JcrMappingException;
import org.jcrom.Jcrom;
import org.jcrom.annotations.JcrNode;

/**
 * The default implementation of the interface {@link JcromCallback}.

 * It is recommended to extend this class in order to only override the methods to modify.

 * For example:

 *

 * jcrom.addNode(rootNode, parent, null, new DefaultJcromCallback(jcrom) {
 *     {@literal @Override}
 *     public Node doAddNode(Node parentNode, String nodeName, JcrNode jcrNode, Object entity) throws RepositoryException {
 *         if (!(parentNode instanceof NodeImpl) && !(entity instanceof Parent)) {
 *             return super.doAddNode(parentNode, nodeName, jcrNode, entity);
 *         }
 *         NodeImpl parentNodeImpl = (NodeImpl) parentNode;
 *         Parent parentEntity = (Parent) entity;
 *         return parentNodeImpl.addNodeWithUuid(nodeName, parentEntity.getUuid());
 *     }
 * });
 *

 * @see JcromCallback
 * @author Nicolax Dos Santos
 */
public class DefaultJcromCallback implements JcromCallback {

    private final Jcrom jcrom;

    public DefaultJcromCallback(Jcrom jcrom) {
        this.jcrom = jcrom;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public Node doAddNode(Node parentNode, String nodeName, JcrNode jcrNode, Object entity) throws JcrMappingException, RepositoryException {
        Node node;
        // check if we should use a specific node type
        if (jcrNode == null || (jcrNode.nodeType().equals("nt:unstructured") || jcrNode.nodeType().equals(NodeType.NT_UNSTRUCTURED))) {
            node = parentNode.addNode(nodeName);
        } else {
            node = parentNode.addNode(nodeName, jcrNode.nodeType());
        }
        return node;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void doAddMixinTypes(Node node, String[] mixinTypes, JcrNode jcrNode, Object entity) throws JcrMappingException, RepositoryException {
        // add the mixin types
        if (mixinTypes != null) {
            for (String mixinType : mixinTypes) {
                if (node.canAddMixin(mixinType)) {
                    node.addMixin(mixinType);
                }
            }
        }
        // add annotated mixin types
        if (jcrNode != null && jcrNode.mixinTypes() != null) {
            for (String mixinType : jcrNode.mixinTypes()) {
                if (node.canAddMixin(mixinType)) {
                    node.addMixin(mixinType);
                }
            }
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void doComplete(Object entity, Node node) throws JcrMappingException, RepositoryException {
        // DO NOTHING
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void doAddClassNameToProperty(Node node, JcrNode jcrNode, Object entity) throws JcrMappingException, RepositoryException {
        // map the class name to a property
        node.setProperty(jcrNode.classNameProperty(), entity.getClass().getCanonicalName());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void doUpdateClassNameToProperty(Node node, JcrNode jcrNode, Object entity) throws JcrMappingException, RepositoryException {
        // map the class name to a property
        node.setProperty(jcrNode.classNameProperty(), entity.getClass().getCanonicalName());
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public void doMoveNode(Node parentNode, Node node, String nodeName, JcrNode jcrNode, Object entity) throws JcrMappingException, RepositoryException {
        if (parentNode.getPath().equals("/")) {
            // special case: moving a root node
            node.getSession().move(node.getPath(), parentNode.getPath() + nodeName);
        } else {
            node.getSession().move(node.getPath(), parentNode.getPath() + "/" + nodeName);
        }
    }
}


text:
public class StandartProvider : Provider
{
    private const double DurabilityConst = 1000d;

    public StandartProvider(int id, double energyOutput)
        : base(id, DurabilityConst, energyOutput)
    {
    }
}


text:
namespace views {
namespace test {

CaptureTrackingView::CaptureTrackingView() = default;

CaptureTrackingView::~CaptureTrackingView() = default;

bool CaptureTrackingView::OnMousePressed(const ui::MouseEvent& event) {
  got_press_ = true;
  return true;
}

void CaptureTrackingView::OnMouseCaptureLost() {
  got_capture_lost_ = true;
}

}  // namespace test
}  // namespace views


text:
package com.googlecode.flickrjandroid.photos;

import java.util.Date;

/**
 * @author Anthony Eden
 */
public class Photocount {
    public static final long serialVersionUID = 12L;

    private int count;
    private Date fromDate;
    private Date toDate;

    public Photocount() {

    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public void setCount(String count) {
        if (count != null) setCount(Integer.parseInt(count));
    }

    public Date getFromDate() {
        return fromDate;
    }

    public void setFromDate(Date fromDate) {
        this.fromDate = fromDate;
    }

    public void setFromDate(long fromDate) {
        setFromDate(new Date(fromDate));
    }

    public void setFromDate(String fromDate) {
        if (fromDate != null) setFromDate(Long.parseLong(fromDate));
    }

    public Date getToDate() {
        return toDate;
    }

    public void setToDate(Date toDate) {
        this.toDate = toDate;
    }

    public void setToDate(long toDate) {
        setToDate(new Date(toDate));
    }

    public void setToDate(String toDate) {
        if (toDate != null) setToDate(Long.parseLong(toDate));
    }

}


text:
All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).

## 7.0.6 - 2020-12-02

<details>
<summary> Update ext2fs from 3.0.4 to 3.0.5 [Alexis Svinartchouk] </summary>

> ### node-ext2fs-3.0.5 - 2020-12-02
>
> * Fix reading and discarding with offsets > 32 bits [Alexis Svinartchouk]
>
</details>

## 7.0.5 - 2020-11-27

<details>
<summary> Update file-disk from 8.0.0 to 8.0.1 [Alexis Svinartchouk] </summary>

> ### file-disk-8.0.1 - 2020-11-26
>
> * Add versionbot changelog [Alexis Svinartchouk]
>
</details>

<details>
<summary> Update ext2fs from 3.0.3 to 3.0.4 [Alexis Svinartchouk] </summary>

> ### node-ext2fs-3.0.4 - 2020-11-26
>
> * Add versionbot changelog [Alexis Svinartchouk]
>
</details>

<details>
<summary> Update partitioninfo from 6.0.1 to 6.0.2 [Alexis Svinartchouk] </summary>

> ### partitioninfo-6.0.2 - 2020-11-27
>
>
> <details>
> <summary> Update file-disk from 8.0.0 to 8.0.1 [Alexis Svinartchouk] </summary>
>
>> #### file-disk-8.0.1 - 2020-11-26
>>
>> * Add versionbot changelog [Alexis Svinartchouk]
>>
> </details>
>
> * Add versionbot changelog [Alexis Svinartchouk]
>
</details>

* Add versionbot changelog [Alexis Svinartchouk]

# v7.0.4
## (2020-11-05)

* Update ext2fs to ^3.0.3 [Alexis Svinartchouk]

# v7.0.3
## (2020-10-27)

* Try fat before ext in interact [Alexis Svinartchouk]

# v7.0.2
## (2020-09-03)

* Fix wrong error being thrown for fat partition errors [Alexis Svinartchouk]

# v7.0.1
## (2020-08-04)

* Add .versionbot/CHANGELOG.yml for nested changelogs [Pagan Gazzard]

# v7.0.0
## (2020-07-30)

* Replace wary with mocha [Alexis Svinartchouk]
* Rename resin -> balena [Alexis Svinartchouk]
* lint on pre-commit [Alexis Svinartchouk]
* Convert to typescript [Alexis Svinartchouk]
* Simplify, only leave the interact function [Alexis Svinartchouk]
* Stop using lodash [Alexis Svinartchouk]

# v6.0.0
## (2020-07-24)

* Update file-disk to ^7 [Alexis Svinartchouk]

## 5.0.9 - 2020-03-02

* Update dev dependencies [Pagan Gazzard]

## 5.0.8 - 2019-05-06

* Add bump node-ext2fs ^1.0.28 and and support/CI testing for Node 12/10 [Gergely Imreh]

## 5.0.7 - 2019-04-04

* Update file-disk to ^6.0.0 [Alexis Svinartchouk]
* Update jsdoc-to-markdown [Alexis Svinartchouk]

## 5.0.6 - 2019-01-14

* Update partitioninfo to ^5.2.0 [Alexis Svinartchouk]

## 5.0.5 - 2018-11-29

* Update file-disk to 5.0.0 [Alexis Svinartchouk]

## v5.0.4 - 2018-05-01

* Don't require chalk in utils.coffee #41 [Alexis Svinartchouk]

## v5.0.3 - 2018-04-30

* Only require `fatfs` when it's needed. #39 [Pagan Gazzard]

## v5.0.2 - 2018-04-25

* Change the way we try to identify filesystems #38 [Theodor Gherzan]

## v5.0.1 - 2018-04-25

* Update ext2fs to 1.0.4 #37 [Theodor Gherzan]

## v5.0.0 - 2018-03-30

* Update file-disk, partitioninfo and node-ext2fs #36 [Alexis Svinartchouk]
* Don't version built files #36 [Alexis Svinartchouk]
* Update lodash to v4 #36 [Alexis Svinartchouk]

## v4.1.2 - 2018-01-25

* Throw an error when partition == 0, fix docs. #34 [Alexis Svinartchouk]

## v4.1.1 - 2017-12-11

* Refactor read stream logic to improve clarity & error handling #32 [Tim Perry]
* Update Bluebird to v3 #32 [Tim Perry]

## v4.1.0 - 2017-11-21

* Upgrade partitioninfo so we can read GPT partition tables too #31 [Tim Perry]
* Upgrade to new ext2fs with prebuilt packages available #31 [Tim Perry]

## v4.0.2 - 2017-10-18

### Fixed

- Make errors on read streams safe, by delaying read until someone is attached

## v4.0.1 - 2017-06-23

### Fixed

- Fixed creating files in ext partitions with paths that do not start with '/'.

## v4.0.0 - 2017-06-19

### Changed

- All methods that take a partition as a parameter now expect the partition number instead of {primary: X, logical: Y}.

## v3.0.0 - 2017-06-16

### Added

- Support for ext2, ext3 and ext4 filesystems.
- `imagefs.interact(disk, partition)` returns a disposer of a node fs like interface. Sync methods are not supported.

### Changed

- `imagefs.listDirectory()` lists all files, including those that start with a dot.
- `imagefs.write`, `imagefs.copy` and `imagefs.replace` now return a `Promise` instead of a `Promise<WriteStream>`.
- `imagefs.read` now returns a `disposer<ReadStream>` instead of a `Promise<ReadStream>`.
- All methods now accept `filedisk.Disk` instances as well as image paths.

### Fixed

- Logical partitions are now correctly handled.

## v2.3.0 - 2016-10-05

### Added

- Implement `imagefs.listDirectory()`.

## v2.2.0 - 2016-10-03

### Added

- Implement `imagefs.readFile()`.
- Implement `imagefs.writeFile()`.

## v2.1.2 - 2015-12-04

### Changed

- Reduce package size by omitting tests in NPM.

## v2.1.1 - 2015-10-13

### Changed

- Close drive file descriptor after any operation.

## v2.1.0 - 2015-07-28

### Added

- Implement `imagefs.replace()` function.

## v2.0.1 - 2015-07-27

### Changed

- Fix documentation issues.

### Removed

- FAT file touch workaround before write.

## v2.0.0 - 2015-07-23

### Changed

- Use object path definitions instead of `image:(partition):/path` device paths.

### Removed

- Local file read/write support.


text:
var DDPLogic = function(){
    var self = this;
    self.version = "pre1";

    self.parse = function(message){
        try{
                var msg = JSON.parse(message);
        }catch (e){
                return null;
        }

        if(msg === null || typeof msg !== 'object'){
                return null;
        }

        if (_.has(msg, 'cleared')) {
                if (!_.has(msg, 'fields')){
                         msg.fields = {};
                }
                _.each(msg.cleared, function (clearKey) {
                        msg.fields[clearKey] = undefined;
                });
        }

        /*_.each(['fields', 'params', 'result'], function (field) {
                if(msg[field] !== 'undefined'){
                        console.log(msg[field]);
                }
        });*/

        return msg;
    }

    self.stringify = function(obj){
        var copy = self._clone(obj);
        if (_.has(obj, 'fields')) {
                var cleared = [];
            _.each(obj.fields, function (value, key) {
              if (value === undefined) {
                cleared.push(key);
                delete copy.fields[key];
              }
            });
            if (!_.isEmpty(cleared))
                copy.cleared = cleared;
        if (_.isEmpty(copy.fields))
                delete copy.fields;
        }

        return JSON.stringify(obj);
    }

    self._clone = function(obj){
        if(typeof obj !== "object"){
                return obj;
        }
        if(obj === null){
                return null;
        }

        if(obj instanceof Date){
                return new Date(obj.getTime());
        }

        var clonedobj;
        if (obj instanceof Array) {
                clonedobj = [];
                for (var i = 0; i < obj.length; i++) {
        clonedobj[i] = self._clone(obj[i]);
        }
        }

        if(typeof obj.clone === 'function'){
                return obj.clone();
        }

        clonedobj = {};
        _.each(obj, function(value, key){
                clonedobj[key]=self._clone(value);
        });

        return clonedobj;
    }

}

DDP = new DDPLogic();


text:
ACCEPTED

#### According to
International Plant Names Index

#### Published in
Phytologia 20:446. 1970

#### Original name
null

### Remarks
null