{% if 'discard_columns' in pipeline_json %}

{{ pipeline_json['discard_columns']['code'] }}
{% endif %}
{% if 'preprocessing_before_target_separation' in pipeline_json %}
{% for component in pipeline_json["preprocessing_before_target_separation"].values() %}
{% for code in component['code'] %}

# PREPROCESSING-{{ component['id'] + loop.index0 }}
{{ code }}
{% endfor %}
{% endfor %}
{% endif %}
{% if 'target_separation' in pipeline_json %}

{{ pipeline_json['target_separation']['code_validation'] }}
{% endif %}
{% if 'preprocessing_after_target_separation' in pipeline_json %}
{% for component in pipeline_json["preprocessing_after_target_separation"].values() %}
{% for code in component['code'] %}

# PREPROCESSING-{{ component['id'] + loop.index0 }}
{{ code }}
{% endfor %}
{% endfor %}
{% endif %}
{% if 'preprocessing_after_train_test_split' in pipeline_json %}
{% for component in pipeline_json["preprocessing_after_train_test_split"].values() %}
{% for code in component['code'] %}

# PREPROCESSING-{{ component['id'] + loop.index0 }}
{{ code }}
{% endfor %}
{% endfor %}
{% endif %}
{% if flag_hyperparameter_tuning %}

{{ pipeline_json['hyperparameter_optimization']['code'] }}
{% else %}
{% if 'model' in pipeline_json %}
{% if 'preprocess_dataset' in pipeline_json %}
{{ pipeline_json['preprocess_dataset']['code_test'] }}

{% endif %}

# MODEL
{{ pipeline_json['model']['code'] }}
{% endif %}
{% if 'inverse_target' in pipeline_json %}

{{ pipeline_json['inverse_target']['code'] }}
{% endif %}
{% if 'evaluation' in pipeline_json %}

#EVALUATION
{{ pipeline_json['evaluation']['code_validation'] }}
{% endif %}
{% endif %}{# if flag_hyperparameter_tuning #}
