original_string: public function get_samples($sampleids) {
          global $DB;
  
          list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
          $courses = $DB->get_records_select('course', "id $sql", $params);
  
          $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_samples($sampleids) {
          global $DB;
  
          list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
          $courses = $DB->get_records_select('course', "id $sql", $params);
  
          $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_samples ( $ sampleids ) { global $ DB ; list ( $ sql , $ params ) = $ DB -> get_in_or_equal ( $ sampleids , SQL_PARAMS_NAMED ) ; $ courses = $ DB -> get_records_select ( 'course' , "id $sql" , $ params ) ; $ 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: Return all complete samples data from sample ids.
  
  @param int[] $sampleids
  @return array
docstring_tokens: Return all complete samples data from sample ids .