original_string: public function get_assign() {
          if ($this->is_restored()) {
              throw new \coding_exception('get_assign() is intended for event observers only');
          }
          if (!isset($this->assign)) {
              debugging('assign property should be initialised in each event', DEBUG_DEVELOPER);
              global $CFG;
              require_once($CFG->dirroot . '/mod/assign/locallib.php');
              $cm = get_coursemodule_from_id('assign', $this->contextinstanceid, 0, false, MUST_EXIST);
              $course = get_course($cm->course);
              $this->assign = new \assign($this->get_context(), $cm, $course);
          }
          return $this->assign;
      }
code: public function get_assign() {
          if ($this->is_restored()) {
              throw new \coding_exception('get_assign() is intended for event observers only');
          }
          if (!isset($this->assign)) {
              debugging('assign property should be initialised in each event', DEBUG_DEVELOPER);
              global $CFG;
              require_once($CFG->dirroot . '/mod/assign/locallib.php');
              $cm = get_coursemodule_from_id('assign', $this->contextinstanceid, 0, false, MUST_EXIST);
              $course = get_course($cm->course);
              $this->assign = new \assign($this->get_context(), $cm, $course);
          }
          return $this->assign;
      }
code_tokens: public function get_assign ( ) { if ( $ this -> is_restored ( ) ) { throw new \ coding_exception ( 'get_assign() is intended for event observers only' ) ; } if ( ! isset ( $ this -> assign ) ) { debugging ( 'assign property should be initialised in each event' , DEBUG_DEVELOPER ) ; global $ CFG ; require_once ( $ CFG -> dirroot . '/mod/assign/locallib.php' ) ; $ cm = get_coursemodule_from_id ( 'assign' , $ this -> contextinstanceid , 0 , false , MUST_EXIST ) ; $ course = get_course ( $ cm -> course ) ; $ this -> assign = new \ assign ( $ this -> get_context ( ) , $ cm , $ course ) ; } return $ this -> assign ; }
docstring: Get assign instance.
  
  NOTE: to be used from observers only.
  
  @throws \coding_exception
  @return \assign
docstring_tokens: Get assign instance .