original_string: public function get_parent_contexts($includeself = false) {
          if (!$contextids = $this->get_parent_context_ids($includeself)) {
              return array();
          }
  
          // Preload the contexts to reduce DB calls.
          context_helper::preload_contexts_by_id($contextids);
  
          $result = array();
          foreach ($contextids as $contextid) {
              $parent = context::instance_by_id($contextid, MUST_EXIST);
              $result[$parent->id] = $parent;
          }
  
          return $result;
      }
code: public function get_parent_contexts($includeself = false) {
          if (!$contextids = $this->get_parent_context_ids($includeself)) {
              return array();
          }
  
          // Preload the contexts to reduce DB calls.
          context_helper::preload_contexts_by_id($contextids);
  
          $result = array();
          foreach ($contextids as $contextid) {
              $parent = context::instance_by_id($contextid, MUST_EXIST);
              $result[$parent->id] = $parent;
          }
  
          return $result;
      }
code_tokens: public function get_parent_contexts ( $ includeself = false ) { if ( ! $ contextids = $ this -> get_parent_context_ids ( $ includeself ) ) { return array ( ) ; } // Preload the contexts to reduce DB calls. context_helper :: preload_contexts_by_id ( $ contextids ) ; $ result = array ( ) ; foreach ( $ contextids as $ contextid ) { $ parent = context :: instance_by_id ( $ contextid , MUST_EXIST ) ; $ result [ $ parent -> id ] = $ parent ; } return $ result ; }
docstring: Returns parent contexts of this context in reversed order, i.e. parent first,
  then grand parent, etc.
  
  @param bool $includeself true means include self too
  @return array of context instances
docstring_tokens: Returns parent contexts of this context in reversed order i . e . parent first then grand parent etc .