code: def test_construct_output_features_with_dependencies(
      output_feature_defs,
  ):
      # Add keys to output_feature_defs which would have been derived from data.
      def add_data_derived_keys(output_feature_def):
          if DECODER not in output_feature_def:
              output_feature_def[DECODER] = {}
          if output_feature_def[TYPE] == CATEGORY:
              output_feature_def["num_classes"] = 2
          elif output_feature_def[TYPE] == NUMBER:
              output_feature_def[DECODER][TYPE] = "regressor"
          elif output_feature_def[TYPE] == SEQUENCE:
              output_feature_def[DECODER]["max_sequence_length"] = 5
          return output_feature_def
  
      output_feature_defs = [
          add_data_derived_keys(of) for of in output_feature_defs
      ]
      # Gets name of output feature which has dependencies.
      dep_feature_name = [
          of
          for of in output_feature_defs
          if len(of.get("dependencies", [])) > 0
      ][0]["name"]
      # Creates a dummy input feature and combiner.
      config = {
          "input_features": [number_feature()],
          "output_features": output_feature_defs,
          "combiner": {"type": "concat", "output_size": 1},
      }
      config_obj = ModelConfig.from_dict(config)
      input_features = BaseModel.build_inputs(config_obj.input_features)
      combiner = ConcatCombiner(
          input_features=input_features, config=config_obj.combiner
      )
      output_features = BaseModel.build_outputs(
          config_obj.output_features, combiner
      )
      # Gets the output feature object which has dependencies.
      feature_with_deps = output_features[dep_feature_name]
      n_dependencies = len(feature_with_deps.dependencies)
      assert n_dependencies > 0
      # Each synthetic output feature has output size 1, so total size is 1 + n_dependencies.
      assert feature_with_deps.fc_stack.input_shape == torch.Size(
          [1 + n_dependencies]
      )
  
file_path: ludwig/tests/integration_tests/test_dependencies.py
imports: import logging
  import pytest
  import torch
  from ludwig.combiners.combiners import ConcatCombiner
  from ludwig.constants import CATEGORY, DECODER, NUMBER, SEQUENCE, TYPE
  from ludwig.models.base import BaseModel
  from ludwig.modules.reduction_modules import SequenceReducer
  from ludwig.schema.model_config import ModelConfig
  from ludwig.utils import output_feature_utils
  from tests.integration_tests.utils import generate_output_features_with_dependencies, number_feature
label_desc: Use image node_id 2 for calling a global function with example usage: test_construct_output_features_with_dependencies(output_feature_defs) and returns: output_feature_def