nodes: 0, module; 1, function_definition; 2, function_name:estimate; 3, parameters; 4, block; 5, identifier:self; 6, identifier:upgrades; 7, expression_statement; 8, expression_statement; 9, for_statement; 10, return_statement; 11, comment:"""Estimate the time needed to apply upgrades.
  
          If an upgrades does not specify and estimate it is assumed to be
          in the order of 1 second.
  
          :param upgrades: List of upgrades sorted in topological order.
          """; 12, assignment; 13, identifier:u; 14, identifier:upgrades; 15, block; 16, identifier:val; 17, identifier:val; 18, integer:0; 19, expression_statement; 20, augmented_assignment; 21, identifier:val; 22, call; 23, attribute; 24, argument_list; 25, identifier:u; 26, identifier:estimate
code: def estimate(self, upgrades):
          """Estimate the time needed to apply upgrades.
  
          If an upgrades does not specify and estimate it is assumed to be
          in the order of 1 second.
  
          :param upgrades: List of upgrades sorted in topological order.
          """
          val = 0
          for u in upgrades:
              val += u.estimate()
          return val