nodes: 0, module; 1, function_definition; 2, function_name:GetStopTimes; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, comment:# In theory problems=None should be safe because data from database has been; 9, comment:# validated. See comment in _LoadStopTimes for why this isn't always true.; 10, expression_statement; 11, expression_statement; 12, expression_statement; 13, expression_statement; 14, if_statement; 15, for_statement; 16, return_statement; 17, identifier:problems; 18, None; 19, comment:"""Return a sorted list of StopTime objects for this trip."""; 20, assignment; 21, call; 22, assignment; 23, assignment; 24, comparison_operator:problems is None; 25, comment:# TODO: delete this branch when StopTime.__init__ doesn't need a; 26, comment:# ProblemReporter; 27, block; 28, identifier:row; 29, call; 30, block; 31, identifier:stop_times; 32, identifier:cursor; 33, call; 34, attribute; 35, argument_list; 36, identifier:stop_times; 37, list; 38, identifier:stoptime_class; 39, attribute; 40, identifier:problems; 41, None; 42, expression_statement; 43, attribute; 44, argument_list; 45, expression_statement; 46, expression_statement; 47, attribute; 48, argument_list; 49, identifier:cursor; 50, identifier:execute; 51, concatenated_string; 52, tuple; 53, call; 54, identifier:StopTime; 55, assignment; 56, identifier:cursor; 57, identifier:fetchall; 58, assignment; 59, call; 60, attribute; 61, identifier:cursor; 62, string; 63, string; 64, string; 65, string; 66, string; 67, attribute; 68, attribute; 69, argument_list; 70, identifier:problems; 71, attribute; 72, identifier:stop; 73, call; 74, attribute; 75, argument_list; 76, attribute; 77, identifier:_connection; 78, string_content:SELECT arrival_secs,departure_secs,stop_headsign,pickup_type,; 79, string_content:drop_off_type,shape_dist_traveled,stop_id,stop_sequence,timepoint; 80, string_content:FROM stop_times; 81, string_content:WHERE trip_id=?; 82, string_content:ORDER BY stop_sequence; 83, identifier:self; 84, identifier:trip_id; 85, identifier:self; 86, identifier:GetGtfsFactory; 87, identifier:problems_module; 88, identifier:default_problem_reporter; 89, attribute; 90, argument_list; 91, identifier:stop_times; 92, identifier:append; 93, call; 94, identifier:self; 95, identifier:_schedule; 96, attribute; 97, identifier:GetStop; 98, subscript; 99, identifier:stoptime_class; 100, argument_list; 101, identifier:self; 102, identifier:_schedule; 103, identifier:row; 104, integer:6; 105, keyword_argument; 106, keyword_argument; 107, keyword_argument; 108, keyword_argument; 109, keyword_argument; 110, keyword_argument; 111, keyword_argument; 112, keyword_argument; 113, keyword_argument; 114, keyword_argument; 115, identifier:problems; 116, identifier:problems; 117, identifier:stop; 118, identifier:stop; 119, identifier:arrival_secs; 120, subscript; 121, identifier:departure_secs; 122, subscript; 123, identifier:stop_headsign; 124, subscript; 125, identifier:pickup_type; 126, subscript; 127, identifier:drop_off_type; 128, subscript; 129, identifier:shape_dist_traveled; 130, subscript; 131, identifier:stop_sequence; 132, subscript; 133, identifier:timepoint; 134, subscript; 135, identifier:row; 136, integer:0; 137, identifier:row; 138, integer:1; 139, identifier:row; 140, integer:2; 141, identifier:row; 142, integer:3; 143, identifier:row; 144, integer:4; 145, identifier:row; 146, integer:5; 147, identifier:row; 148, integer:7; 149, identifier:row; 150, integer:8
code: def GetStopTimes(self, problems=None):
      """Return a sorted list of StopTime objects for this trip."""
      # In theory problems=None should be safe because data from database has been
      # validated. See comment in _LoadStopTimes for why this isn't always true.
      cursor = self._schedule._connection.cursor()
      cursor.execute(
          'SELECT arrival_secs,departure_secs,stop_headsign,pickup_type,'
          'drop_off_type,shape_dist_traveled,stop_id,stop_sequence,timepoint '
          'FROM stop_times '
          'WHERE trip_id=? '
          'ORDER BY stop_sequence', (self.trip_id,))
      stop_times = []
      stoptime_class = self.GetGtfsFactory().StopTime
      if problems is None:
        # TODO: delete this branch when StopTime.__init__ doesn't need a
        # ProblemReporter
        problems = problems_module.default_problem_reporter
      for row in cursor.fetchall():
        stop = self._schedule.GetStop(row[6])
        stop_times.append(stoptime_class(problems=problems,
                                         stop=stop,
                                         arrival_secs=row[0],
                                         departure_secs=row[1],
                                         stop_headsign=row[2],
                                         pickup_type=row[3],
                                         drop_off_type=row[4],
                                         shape_dist_traveled=row[5],
                                         stop_sequence=row[7],
                                         timepoint=row[8]))
      return stop_times