<commit_before>#include <functional>
#include <future>
#include "kernel.h"
#include "raster.h"
#include "symboltable.h"
#include "ilwisoperation.h"
#include "fcoordinate.h"

using namespace Ilwis;
using namespace BaseOperations;

FCoordinate::FCoordinate()
{
}

FCoordinate::FCoordinate(quint64 metaid, const Ilwis::OperationExpression &expr) : OperationImplementation(metaid, expr)
{
}

bool FCoordinate::execute(ExecutionContext *ctx, SymbolTable& symTable)
{
    if (_prepState == sNOTPREPARED)
        if((_prepState = prepare(ctx, symTable)) != sPREPARED)
            return false;
    if ( !_coord.isValid())
        return false;

    QVariant value;
    value.setValue<Voxel>(_coord);
    ctx->addOutput(symTable, value, sUNDEF, itCOORD3D, Resource());

    return true;
}

Ilwis::OperationImplementation *FCoordinate::create(quint64 metaid, const Ilwis::OperationExpression &expr)
{
    return new FCoordinate(metaid, expr);
}

Ilwis::OperationImplementation::State FCoordinate::prepare(ExecutionContext *, const SymbolTable &)
{
    bool ok;
    double sx = _expression.parm(0).value().toDouble(&ok);
    if (!ok){
        ERROR2(ERR_ILLEGAL_VALUE_2,"coordinate","x");
        return sPREPAREFAILED;
    }
    double sy = _expression.parm(0).value().toDouble(&ok);
    if (!ok){
        ERROR2(ERR_ILLEGAL_VALUE_2,"coordinate","y");
        return sPREPAREFAILED;
    }
    double sz = 0;
    if (_expression.parameterCount() == 3) {
        sz = _expression.parm(0).value().toDouble(&ok);
        if (!ok){
            ERROR2(ERR_ILLEGAL_VALUE_2,"coordinate","x");<commit_msg>second parameter was searched at first position<commit_after>#include <functional>
#include <future>
#include "kernel.h"
#include "raster.h"
#include "symboltable.h"
#include "ilwisoperation.h"
#include "fcoordinate.h"

using namespace Ilwis;
using namespace BaseOperations;

FCoordinate::FCoordinate()
{
}

FCoordinate::FCoordinate(quint64 metaid, const Ilwis::OperationExpression &expr) : OperationImplementation(metaid, expr)
{
}

bool FCoordinate::execute(ExecutionContext *ctx, SymbolTable& symTable)
{
    if (_prepState == sNOTPREPARED)
        if((_prepState = prepare(ctx, symTable)) != sPREPARED)
            return false;
    if ( !_coord.isValid())
        return false;

    QVariant value;
    value.setValue<Voxel>(_coord);
    ctx->addOutput(symTable, value, sUNDEF, itCOORD3D, Resource());

    return true;
}

Ilwis::OperationImplementation *FCoordinate::create(quint64 metaid, const Ilwis::OperationExpression &expr)
{
    return new FCoordinate(metaid, expr);
}

Ilwis::OperationImplementation::State FCoordinate::prepare(ExecutionContext *, const SymbolTable &)
{
    bool ok;
    double sx = _expression.parm(0).value().toDouble(&ok);
    if (!ok){
        ERROR2(ERR_ILLEGAL_VALUE_2,"coordinate","x");
        return sPREPAREFAILED;
    }
    double sy = _expression.parm(1).value().toDouble(&ok);
    if (!ok){
        ERROR2(ERR_ILLEGAL_VALUE_2,"coordinate","y");
        return sPREPAREFAILED;
    }
    double sz = 0;
    if (_expression.parameterCount() == 3) {
        sz = _expression.parm(0).value().toDouble(&ok);
        if (!ok){
            ERROR2(ERR_ILLEGAL_VALUE_2,"coordinate","x");
{'fraction_non_alphanumeric': 0.1371571072319202, 'fraction_numerical': 0.00997506234413965, 'mean_word_length': 4.28665568369028, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '4809431', 'n_tokens_mistral': 1087, 'n_tokens_neox': 1054, 'n_words': 203}