original_string: public function get_samples($sampleids) {
          global $DB;
  
          list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
          $users = $DB->get_records_select('user', "id $sql", $params);
  
          $userids = array_keys($users);
          $sampleids = array_combine($userids, $userids);
  
          $users = array_map(function($user) {
              return ['user' => $user, 'context' => \context_user::instance($user->id)];
          }, $users);
  
          // No related data attached.
          return [$sampleids, $users];
      }
code: public function get_samples($sampleids) {
          global $DB;
  
          list($sql, $params) = $DB->get_in_or_equal($sampleids, SQL_PARAMS_NAMED);
          $users = $DB->get_records_select('user', "id $sql", $params);
  
          $userids = array_keys($users);
          $sampleids = array_combine($userids, $userids);
  
          $users = array_map(function($user) {
              return ['user' => $user, 'context' => \context_user::instance($user->id)];
          }, $users);
  
          // No related data attached.
          return [$sampleids, $users];
      }
code_tokens: public function get_samples ( $ sampleids ) { global $ DB ; list ( $ sql , $ params ) = $ DB -> get_in_or_equal ( $ sampleids , SQL_PARAMS_NAMED ) ; $ users = $ DB -> get_records_select ( 'user' , "id $sql" , $ params ) ; $ userids = array_keys ( $ users ) ; $ sampleids = array_combine ( $ userids , $ userids ) ; $ users = array_map ( function ( $ user ) { return [ 'user' => $ user , 'context' => \ context_user :: instance ( $ user -> id ) ] ; } , $ users ) ; // No related data attached. return [ $ sampleids , $ users ] ; }
docstring: Returns samples data from sample ids.
  
  @param int[] $sampleids
  @return array
docstring_tokens: Returns samples data from sample ids .