original_string: private static function get_assignment_from_param($assignment) {
          global $CFG;
  
          require_once($CFG->dirroot . '/mod/assign/locallib.php');
  
          if (!is_object($assignment)) {
              $cm = get_coursemodule_from_instance('assign', $assignment, 0, false, MUST_EXIST);
              $context = \context_module::instance($cm->id);
  
              $assignment = new \assign($context, null, null);
          }
          return $assignment;
      }
code: private static function get_assignment_from_param($assignment) {
          global $CFG;
  
          require_once($CFG->dirroot . '/mod/assign/locallib.php');
  
          if (!is_object($assignment)) {
              $cm = get_coursemodule_from_instance('assign', $assignment, 0, false, MUST_EXIST);
              $context = \context_module::instance($cm->id);
  
              $assignment = new \assign($context, null, null);
          }
          return $assignment;
      }
code_tokens: private static function get_assignment_from_param ( $ assignment ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/mod/assign/locallib.php' ) ; if ( ! is_object ( $ assignment ) ) { $ cm = get_coursemodule_from_instance ( 'assign' , $ assignment , 0 , false , MUST_EXIST ) ; $ context = \ context_module :: instance ( $ cm -> id ) ; $ assignment = new \ assign ( $ context , null , null ) ; } return $ assignment ; }
docstring: This function will take an int or an assignment instance and
  return an assignment instance. It is just for convenience.
  @param int|\assign $assignment
  @return assign
docstring_tokens: This function will take an int or an assignment instance and return an assignment instance . It is just for convenience .