<commit_before>#include "shaderlab/Node.h"
#include "shaderlab/PinType.h"
#include "shaderlab/ShaderAdapter.h"

#include <blueprint/Pin.h>
#include <blueprint/BackendAdapter.h>
#include <blueprint/PropDescImpl.h>

#include <shadergraph/VarType.h>
#include <shadergraph/Variant.h>
#include <shadergraph/ValueImpl.h>
#include <shadergraph/Block.h>

namespace
{

auto back2front = [](const dag::Node<shadergraph::Variant>::Port& back) -> bp::PinDesc
{
    bp::PinDesc front;

    front.type = shaderlab::ShaderAdapter::TypeBackToFront(back.var.type.type, 1);
    const_cast<shadergraph::Block::Port&>(back).var.full_name = back.var.type.name;
    front.name = back.var.full_name;

    return front;
};

}

namespace shaderlab
{

Node::Node(const std::string& title)
    : bp::Node(title)
{
}

void Node::Init(const shadergraph::Block& block)
{
    Clear();

    // pins
    bp::BackendAdapter<shadergraph::Variant>
        trans("shadergraph", back2front);
    trans.InitNodePins(*this, block);

    // props
    InitProps(block.GetUniforms());
}

void Node::Init(const std::string& name)
{
    Clear();

    // pins
    bp::BackendAdapter<shadergraph::Variant><commit_msg>[FIXED] no need clear<commit_after>#include "shaderlab/Node.h"
#include "shaderlab/PinType.h"
#include "shaderlab/ShaderAdapter.h"

#include <blueprint/Pin.h>
#include <blueprint/BackendAdapter.h>
#include <blueprint/PropDescImpl.h>

#include <shadergraph/VarType.h>
#include <shadergraph/Variant.h>
#include <shadergraph/ValueImpl.h>
#include <shadergraph/Block.h>

namespace
{

auto back2front = [](const dag::Node<shadergraph::Variant>::Port& back) -> bp::PinDesc
{
    bp::PinDesc front;

    front.type = shaderlab::ShaderAdapter::TypeBackToFront(back.var.type.type, 1);
    const_cast<shadergraph::Block::Port&>(back).var.full_name = back.var.type.name;
    front.name = back.var.full_name;

    return front;
};

}

namespace shaderlab
{

Node::Node(const std::string& title)
    : bp::Node(title)
{
}

void Node::Init(const shadergraph::Block& block)
{
    // pins
    bp::BackendAdapter<shadergraph::Variant>
        trans("shadergraph", back2front);
    trans.InitNodePins(*this, block);

    // props
    InitProps(block.GetUniforms());
}

void Node::Init(const std::string& name)
{
    // pins
    bp::BackendAdapter<shadergraph::Variant>
{'fraction_non_alphanumeric': 0.16034482758620688, 'fraction_numerical': 0.002586206896551724, 'mean_word_length': 4.77363184079602, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 27, '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': '1303936', 'n_tokens_mistral': 822, 'n_tokens_neox': 842, 'n_words': 128}