code: def test_pipeline_builder_with_linear_structure():
      primary_a = PipelineNode("operation_a")
      secondary_f = PipelineNode("operation_f", nodes_from=[primary_a])
  
      # build single node
      assert graphs_same(
          Pipeline(primary_a),
          PipelineBuilder().add_node("operation_a").build(),
      )
      assert graphs_same(
          Pipeline(primary_a),
          PipelineBuilder().add_sequence("operation_a").build(),
      )
      # index overflow is ok
      assert graphs_same(
          Pipeline(primary_a),
          PipelineBuilder()
          .add_node("operation_a", branch_idx=42)
          .build(),
      )
  
      # build linear sequence
      assert graphs_same(
          Pipeline(secondary_f),
          PipelineBuilder(primary_a).add_node("operation_f").build(),
      )
      assert graphs_same(
          Pipeline(secondary_f),
          PipelineBuilder()
          .add_node("operation_a")
          .add_node("operation_f")
          .build(),
      )
      assert graphs_same(
          Pipeline(secondary_f),
          PipelineBuilder()
          .add_sequence("operation_a", "operation_f")
          .build(),
      )
  
      # empty branch should change nothing
      assert graphs_same(
          Pipeline(primary_a),
          PipelineBuilder()
          .add_node("operation_a")
          .add_branch(None, None)
          .build(),
      )
      # following is somewhat an api abuse... but leads to the same sequential pipeline
      assert graphs_same(
          Pipeline(secondary_f),
          PipelineBuilder()
          .add_node("operation_a")
          .add_branch(None, "operation_f")
          .build(),
      )
  
imports: from copy import copy
  from fedot.core.pipelines.pipeline_builder import PipelineBuilder, merge_pipeline_builders
  from fedot.core.pipelines.node import PipelineNode
  from fedot.core.pipelines.pipeline import Pipeline
  from test.unit.dag.test_graph_utils import graphs_same
label_desc: Use image node_id 4 for calling a global function with example usage: test_pipeline_builder_with_linear_structure() without return types