original_string: public static function delete_instance($contextlevel, $instanceid) {
          global $DB;
  
          // double check the context still exists
          if ($record = $DB->get_record('context', array('contextlevel'=>$contextlevel, 'instanceid'=>$instanceid))) {
              $context = context::create_instance_from_record($record);
              $context->delete();
          } else {
              // we should try to purge the cache anyway
          }
      }
code: public static function delete_instance($contextlevel, $instanceid) {
          global $DB;
  
          // double check the context still exists
          if ($record = $DB->get_record('context', array('contextlevel'=>$contextlevel, 'instanceid'=>$instanceid))) {
              $context = context::create_instance_from_record($record);
              $context->delete();
          } else {
              // we should try to purge the cache anyway
          }
      }
code_tokens: public static function delete_instance ( $ contextlevel , $ instanceid ) { global $ DB ; // double check the context still exists if ( $ record = $ DB -> get_record ( 'context' , array ( 'contextlevel' => $ contextlevel , 'instanceid' => $ instanceid ) ) ) { $ context = context :: create_instance_from_record ( $ record ) ; $ context -> delete ( ) ; } else { // we should try to purge the cache anyway } }
docstring: Delete context instance
  
  @static
  @param int $contextlevel
  @param int $instanceid
  @return void
docstring_tokens: Delete context instance