code: def test_get_best_trial_straigth_lineage(self):
      root = build_full_tree(4)
      leafs = root.get_nodes_at_depth(3)
      assert leafs[0].item.id == "id-8"
      assert leafs[0].get_best_trial() == root.item
      assert leafs[1].get_best_trial() == root.item
      leafs[0].item.objective.value = -1
      # Now best trial is leaf on first branch
      assert leafs[0].get_best_trial() == leafs[0].item
      # But still root for second branch
      assert leafs[1].get_best_trial() == root.item
  
      third_row = root.get_nodes_at_depth(2)
      assert third_row[0].item.id == "id-4"
      assert third_row[0].get_best_trial() == root.item
      assert third_row[1].get_best_trial() == root.item
  
      third_row[0].item.objective.value = -2
      # Now best trial is third node on first branch
      assert third_row[0].get_best_trial() == third_row[0].item
      # But still root for second branch
      assert third_row[1].get_best_trial() == root.item
      # And third node on full first and second branches
      assert leafs[0].get_best_trial() == third_row[0].item
      assert leafs[1].get_best_trial() == third_row[0].item
      # But not for third branch
      assert leafs[2].get_best_trial() == root.item
  
      second_row = root.get_nodes_at_depth(1)
      assert second_row[0].item.id == "id-2"
      assert second_row[0].get_best_trial() == root.item
      assert second_row[1].get_best_trial() == root.item
  
      second_row[0].item.objective.value = -3
      # Now best trial is second node on first branch
      assert second_row[0].get_best_trial() == second_row[0].item
      # But still root for second branch
      assert second_row[1].get_best_trial() == root.item
      # And second node on full 4 first branches
      assert leafs[0].get_best_trial() == second_row[0].item
      assert leafs[1].get_best_trial() == second_row[0].item
      assert leafs[2].get_best_trial() == second_row[0].item
      assert leafs[3].get_best_trial() == second_row[0].item
      # But not for fifth branch
      assert leafs[4].get_best_trial() == root.item
  
imports: import os
  import random
  import pytest
  from base import ObjectiveStub, TrialStub, build_full_tree, build_population, compare_generations
  from orion.algo.pbt.pbt import LineageNode, Lineages
label_desc: Use image node_id 10 for calling the TestLineageNode obj's underlying member method code with example usage: obj.test_get_best_trial_straigth_lineage() without return types