<commit_before>#!/bin/bash
# ------------------------------------------------------------------------
#
# Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
#
# 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
#
# ------------------------------------------------------------------------

# run script sets the configurable parameters for the cartridge agent in agent.conf and
# starts the cartridge agent process.


source /root/.bashrc

export STRATOS_VERSION="4.1.0"
export PCA_HOME="/opt/apache-stratos-python-cartridge-agent-${STRATOS_VERSION}"

set -o posix ; set | sed -e ':a;N;$!ba;s/\n/,/g' > ${PCA_HOME}/payload/launch-params

echo "PCA_HOME=${PCA_HOME}" >> /etc/environment

#mandatory parameters
sed -i "s/MB-IP/${MB_IP}/g" ${PCA_HOME}/agent.conf
sed -i "s/MB-PORT/${MB_PORT}/g" ${PCA_HOME}/agent.conf


#parameters that can be empty
#default values have to be set

if [ -z "${LISTEN_ADDR}" ]; then
	sed -i "s/LISTEN_ADDR/localhost/g" ${PCA_HOME}/agent.conf
else
	sed -i "s/LISTEN_ADDR/${LISTEN_ADDR}/g" ${PCA_HOME}/agent.conf<commit_msg>Setting CARBON_HOME as APPLICATION_PATH in start-agent.sh<commit_after>#!/bin/bash
# ------------------------------------------------------------------------
#
# Copyright 2005-2015 WSO2, Inc. (http://wso2.com)
#
# 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
#
# ------------------------------------------------------------------------

# run script sets the configurable parameters for the cartridge agent in agent.conf and
# starts the cartridge agent process.


source /root/.bashrc

export STRATOS_VERSION="4.1.0"
export PCA_HOME="/opt/apache-stratos-python-cartridge-agent-${STRATOS_VERSION}"

set -o posix ; set | sed -e ':a;N;$!ba;s/\n/,/g' > ${PCA_HOME}/payload/launch-params
# set PCA_HOME
echo "PCA_HOME=${PCA_HOME}" >> /etc/environment

# set CARBON_HOME as APPLICATION_PATH
export APPLICATION_PATH="${CARBON_HOME}"
echo "APPLICATION_PATH=${APPLICATION_PATH}" >> /etc/environment

# mandatory parameters
sed -i "s/MB-IP/${MB_IP}/g" ${PCA_HOME}/agent.conf
sed -i "s/MB-PORT/${MB_PORT}/g" ${PCA_HOME}/agent.conf

# parameters that can be empty
# default values have to be set

if [ -z "${LISTEN_ADDR}" ]; then
	sed -i "s/LISTEN_ADDR/localhost/g" ${PCA_HOME}/agent.conf
else
	sed -i "s/LISTEN_ADDR/${LISTEN_ADDR}/g" ${PCA_HOME}/agent.conf
{'fraction_non_alphanumeric': 0.20525351252290777, 'fraction_numerical': 0.010384850335980453, 'mean_word_length': 2.9174641148325358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2762086', 'n_tokens_mistral': 1023, 'n_tokens_neox': 981, 'n_words': 321}