original_string: public function get_all_samples(\core_analytics\analysable $site) {
          global $DB;
  
          // Getting courses from DB instead of from the site as these samples
          // will be stored in memory and we just want the id.
          $select = 'id != 1';
          $courses = get_courses('all', 'c.sortorder ASC');
          unset($courses[SITEID]);
  
          $courseids = array_keys($courses);
          $sampleids = array_combine($courseids, $courseids);
  
          $courses = array_map(function($course) {
              return array('course' => $course, 'context' => \context_course::instance($course->id));
          }, $courses);
  
          // No related data attached.
          return array($sampleids, $courses);
      }
code: public function get_all_samples(\core_analytics\analysable $site) {
          global $DB;
  
          // Getting courses from DB instead of from the site as these samples
          // will be stored in memory and we just want the id.
          $select = 'id != 1';
          $courses = get_courses('all', 'c.sortorder ASC');
          unset($courses[SITEID]);
  
          $courseids = array_keys($courses);
          $sampleids = array_combine($courseids, $courseids);
  
          $courses = array_map(function($course) {
              return array('course' => $course, 'context' => \context_course::instance($course->id));
          }, $courses);
  
          // No related data attached.
          return array($sampleids, $courses);
      }
code_tokens: public function get_all_samples ( \ core_analytics \ analysable $ site ) { global $ DB ; // Getting courses from DB instead of from the site as these samples // will be stored in memory and we just want the id. $ select = 'id != 1' ; $ courses = get_courses ( 'all' , 'c.sortorder ASC' ) ; unset ( $ courses [ SITEID ] ) ; $ courseids = array_keys ( $ courses ) ; $ sampleids = array_combine ( $ courseids , $ courseids ) ; $ courses = array_map ( function ( $ course ) { return array ( 'course' => $ course , 'context' => \ context_course :: instance ( $ course -> id ) ) ; } , $ courses ) ; // No related data attached. return array ( $ sampleids , $ courses ) ; }
docstring: Returns all site courses.
  
  @param \core_analytics\analysable $site
  @return array
docstring_tokens: Returns all site courses .