original_string: public function unenrol_user($ue) {
          global $DB;
          list ($instance, $plugin) = $this->get_user_enrolment_components($ue);
          if ($instance && $plugin && $plugin->allow_unenrol_user($instance, $ue) && has_capability("enrol/$instance->enrol:unenrol", $this->context)) {
              $plugin->unenrol_user($instance, $ue->userid);
              return true;
          }
          return false;
      }
code: public function unenrol_user($ue) {
          global $DB;
          list ($instance, $plugin) = $this->get_user_enrolment_components($ue);
          if ($instance && $plugin && $plugin->allow_unenrol_user($instance, $ue) && has_capability("enrol/$instance->enrol:unenrol", $this->context)) {
              $plugin->unenrol_user($instance, $ue->userid);
              return true;
          }
          return false;
      }
code_tokens: public function unenrol_user ( $ ue ) { global $ DB ; list ( $ instance , $ plugin ) = $ this -> get_user_enrolment_components ( $ ue ) ; if ( $ instance && $ plugin && $ plugin -> allow_unenrol_user ( $ instance , $ ue ) && has_capability ( "enrol/$instance->enrol:unenrol" , $ this -> context ) ) { $ plugin -> unenrol_user ( $ instance , $ ue -> userid ) ; return true ; } return false ; }
docstring: Unenrols a user from the course given the users ue entry
  
  @global moodle_database $DB
  @param stdClass $ue
  @return bool
docstring_tokens: Unenrols a user from the course given the users ue entry