original_string: protected static function validate_contextlist_contexts(approved_contextlist $contextlist) {
          return array_reduce($contextlist->get_contexts(), function($carry, $context) {
              if ($context->contextlevel == CONTEXT_COURSE) {
                  $carry[] = $context;
              }
              return $carry;
          }, []);
      }
code: protected static function validate_contextlist_contexts(approved_contextlist $contextlist) {
          return array_reduce($contextlist->get_contexts(), function($carry, $context) {
              if ($context->contextlevel == CONTEXT_COURSE) {
                  $carry[] = $context;
              }
              return $carry;
          }, []);
      }
code_tokens: protected static function validate_contextlist_contexts ( approved_contextlist $ contextlist ) { return array_reduce ( $ contextlist -> get_contexts ( ) , function ( $ carry , $ context ) { if ( $ context -> contextlevel == CONTEXT_COURSE ) { $ carry [ ] = $ context ; } return $ carry ; } , [ ] ) ; }
docstring: Simple sanity check on the contextlist contexts, making sure they're of CONTEXT_COURSE contextlevel.
  
  @param approved_contextlist $contextlist
  @return array the array of contexts filtered to only include those of CONTEXT_COURSE contextlevel.
docstring_tokens: Simple sanity check on the contextlist contexts making sure they re of CONTEXT_COURSE contextlevel .