original_string: public function populate_slots_with_sections() {
          $sections = array_values($this->sections);
          foreach ($sections as $i => $section) {
              if (isset($sections[$i + 1])) {
                  $section->lastslot = $sections[$i + 1]->firstslot - 1;
              } else {
                  $section->lastslot = count($this->slotsinorder);
              }
              for ($slot = $section->firstslot; $slot <= $section->lastslot; $slot += 1) {
                  $this->slotsinorder[$slot]->section = $section;
              }
          }
      }
code: public function populate_slots_with_sections() {
          $sections = array_values($this->sections);
          foreach ($sections as $i => $section) {
              if (isset($sections[$i + 1])) {
                  $section->lastslot = $sections[$i + 1]->firstslot - 1;
              } else {
                  $section->lastslot = count($this->slotsinorder);
              }
              for ($slot = $section->firstslot; $slot <= $section->lastslot; $slot += 1) {
                  $this->slotsinorder[$slot]->section = $section;
              }
          }
      }
code_tokens: public function populate_slots_with_sections ( ) { $ sections = array_values ( $ this -> sections ) ; foreach ( $ sections as $ i => $ section ) { if ( isset ( $ sections [ $ i + 1 ] ) ) { $ section -> lastslot = $ sections [ $ i + 1 ] -> firstslot - 1 ; } else { $ section -> lastslot = count ( $ this -> slotsinorder ) ; } for ( $ slot = $ section -> firstslot ; $ slot <= $ section -> lastslot ; $ slot += 1 ) { $ this -> slotsinorder [ $ slot ] -> section = $ section ; } } }
docstring: Fill in the section ids for each slot.
docstring_tokens: Fill in the section ids for each slot .