original_string: private function get_mod_instance($cmid) {
          global $DB;
          $rec = $DB->get_record_sql("SELECT md.name
                                 FROM {course_modules} cm,
                                      {modules} md
                                 WHERE cm.id = ? AND
                                       md.id = cm.module", array($cmid));
  
          if ($rec) {
              return get_coursemodule_from_id($rec->name, $cmid);
          } else {
              return null;
          }
      }
code: private function get_mod_instance($cmid) {
          global $DB;
          $rec = $DB->get_record_sql("SELECT md.name
                                 FROM {course_modules} cm,
                                      {modules} md
                                 WHERE cm.id = ? AND
                                       md.id = cm.module", array($cmid));
  
          if ($rec) {
              return get_coursemodule_from_id($rec->name, $cmid);
          } else {
              return null;
          }
      }
code_tokens: private function get_mod_instance ( $ cmid ) { global $ DB ; $ rec = $ DB -> get_record_sql ( "SELECT md.name
                                 FROM {course_modules} cm,
                                      {modules} md
                                 WHERE cm.id = ? AND
                                       md.id = cm.module" , array ( $ cmid ) ) ; if ( $ rec ) { return get_coursemodule_from_id ( $ rec -> name , $ cmid ) ; } else { return null ; } }
docstring: Gets the module instance from the database and returns it.
  If no module instance exists this function returns false.
  
  @return stdClass|bool
docstring_tokens: Gets the module instance from the database and returns it . If no module instance exists this function returns false .