nodes: 0, module; 1, function_definition; 2, function_name:_init_steps; 3, parameters; 4, block; 5, identifier:self; 6, expression_statement; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, for_statement; 12, return_statement; 13, comment:"""
          Given the flow config and everything else, create a list of steps to run, sorted by step number.
  
          :return: List[StepSpec]
          """; 14, call; 15, assignment; 16, call; 17, assignment; 18, pattern_list; 19, call; 20, block; 21, call; 22, attribute; 23, argument_list; 24, identifier:config_steps; 25, attribute; 26, attribute; 27, argument_list; 28, identifier:steps; 29, list; 30, identifier:number; 31, identifier:step_config; 32, attribute; 33, argument_list; 34, expression_statement; 35, expression_statement; 36, identifier:sorted; 37, argument_list; 38, identifier:self; 39, identifier:_check_old_yaml_format; 40, attribute; 41, identifier:steps; 42, identifier:self; 43, identifier:_check_infinite_flows; 44, identifier:config_steps; 45, identifier:config_steps; 46, identifier:items; 47, assignment; 48, call; 49, identifier:steps; 50, keyword_argument; 51, identifier:self; 52, identifier:flow_config; 53, identifier:specs; 54, call; 55, attribute; 56, argument_list; 57, identifier:key; 58, call; 59, attribute; 60, argument_list; 61, identifier:steps; 62, identifier:extend; 63, identifier:specs; 64, identifier:attrgetter; 65, argument_list; 66, identifier:self; 67, identifier:_visit_step; 68, identifier:number; 69, identifier:step_config; 70, string:"step_num"
code: def _init_steps(self,):
          """
          Given the flow config and everything else, create a list of steps to run, sorted by step number.
  
          :return: List[StepSpec]
          """
          self._check_old_yaml_format()
          config_steps = self.flow_config.steps
          self._check_infinite_flows(config_steps)
  
          steps = []
  
          for number, step_config in config_steps.items():
              specs = self._visit_step(number, step_config)
              steps.extend(specs)
  
          return sorted(steps, key=attrgetter("step_num"))