original_string: public function get_group_list() {
  
          // No groups for system.
          if (empty($this->course)) {
              return array();
          }
  
          $context = context_course::instance($this->course->id);
          $groups = array();
          $groupmode = groups_get_course_groupmode($this->course);
          if (($groupmode == VISIBLEGROUPS) ||
                  ($groupmode == SEPARATEGROUPS and has_capability('moodle/site:accessallgroups', $context))) {
              // Get all groups.
              if ($cgroups = groups_get_all_groups($this->course->id)) {
                  foreach ($cgroups as $cgroup) {
                      $groups[$cgroup->id] = $cgroup->name;
                  }
              }
          }
          return $groups;
      }
code: public function get_group_list() {
  
          // No groups for system.
          if (empty($this->course)) {
              return array();
          }
  
          $context = context_course::instance($this->course->id);
          $groups = array();
          $groupmode = groups_get_course_groupmode($this->course);
          if (($groupmode == VISIBLEGROUPS) ||
                  ($groupmode == SEPARATEGROUPS and has_capability('moodle/site:accessallgroups', $context))) {
              // Get all groups.
              if ($cgroups = groups_get_all_groups($this->course->id)) {
                  foreach ($cgroups as $cgroup) {
                      $groups[$cgroup->id] = $cgroup->name;
                  }
              }
          }
          return $groups;
      }
code_tokens: public function get_group_list ( ) { // No groups for system. if ( empty ( $ this -> course ) ) { return array ( ) ; } $ context = context_course :: instance ( $ this -> course -> id ) ; $ groups = array ( ) ; $ groupmode = groups_get_course_groupmode ( $ this -> course ) ; if ( ( $ groupmode == VISIBLEGROUPS ) || ( $ groupmode == SEPARATEGROUPS and has_capability ( 'moodle/site:accessallgroups' , $ context ) ) ) { // Get all groups. if ( $ cgroups = groups_get_all_groups ( $ this -> course -> id ) ) { foreach ( $ cgroups as $ cgroup ) { $ groups [ $ cgroup -> id ] = $ cgroup -> name ; } } } return $ groups ; }
docstring: Return list of groups.
  
  @return array list of groups.
docstring_tokens: Return list of groups .