original_string: protected function filter_out_prediction_samples_and_ranges(array &$sampleids, array &$ranges,
              \core_analytics\local\time_splitting\base $timesplitting) {
  
          if (count($ranges) > 1) {
              throw new \coding_exception('$ranges argument should only contain one range');
          }
  
          $rangeindex = key($ranges);
          $predictedrange = $this->get_predict_samples_record($timesplitting, $rangeindex);
  
          if (!$predictedrange) {
              // Nothing to filter out.
              return null;
          }
  
          $predictedrange->sampleids = json_decode($predictedrange->sampleids, true);
          $missingsamples = array_diff_key($sampleids, $predictedrange->sampleids);
          if (count($missingsamples) === 0) {
              // All samples already calculated.
              unset($ranges[$rangeindex]);
              return null;
          }
  
          // Replace the list of samples by the one excluding samples that already got predictions at this range.
          $sampleids = $missingsamples;
  
          return $predictedrange;
      }
code: protected function filter_out_prediction_samples_and_ranges(array &$sampleids, array &$ranges,
              \core_analytics\local\time_splitting\base $timesplitting) {
  
          if (count($ranges) > 1) {
              throw new \coding_exception('$ranges argument should only contain one range');
          }
  
          $rangeindex = key($ranges);
          $predictedrange = $this->get_predict_samples_record($timesplitting, $rangeindex);
  
          if (!$predictedrange) {
              // Nothing to filter out.
              return null;
          }
  
          $predictedrange->sampleids = json_decode($predictedrange->sampleids, true);
          $missingsamples = array_diff_key($sampleids, $predictedrange->sampleids);
          if (count($missingsamples) === 0) {
              // All samples already calculated.
              unset($ranges[$rangeindex]);
              return null;
          }
  
          // Replace the list of samples by the one excluding samples that already got predictions at this range.
          $sampleids = $missingsamples;
  
          return $predictedrange;
      }
code_tokens: protected function filter_out_prediction_samples_and_ranges ( array & $ sampleids , array & $ ranges , \ core_analytics \ local \ time_splitting \ base $ timesplitting ) { if ( count ( $ ranges ) > 1 ) { throw new \ coding_exception ( '$ranges argument should only contain one range' ) ; } $ rangeindex = key ( $ ranges ) ; $ predictedrange = $ this -> get_predict_samples_record ( $ timesplitting , $ rangeindex ) ; if ( ! $ predictedrange ) { // Nothing to filter out. return null ; } $ predictedrange -> sampleids = json_decode ( $ predictedrange -> sampleids , true ) ; $ missingsamples = array_diff_key ( $ sampleids , $ predictedrange -> sampleids ) ; if ( count ( $ missingsamples ) === 0 ) { // All samples already calculated. unset ( $ ranges [ $ rangeindex ] ) ; return null ; } // Replace the list of samples by the one excluding samples that already got predictions at this range. $ sampleids = $ missingsamples ; return $ predictedrange ; }
docstring: Filters out samples that have already been used for prediction.
  
  @param int[] $sampleids
  @param array $ranges
  @param \core_analytics\local\time_splitting\base $timesplitting
  @return  \stdClass|null The analytics_predict_samples record or null
docstring_tokens: Filters out samples that have already been used for prediction .