original_string: public static function delete_tempfile_from_draft($draftitemid, $filepath, $filename) {
          global $USER;
          $fs = get_file_storage();
          $user_context = context_user::instance($USER->id);
          if ($file = $fs->get_file($user_context->id, 'user', 'draft', $draftitemid, $filepath, $filename)) {
              $file->delete();
              return true;
          } else {
              return false;
          }
      }
code: public static function delete_tempfile_from_draft($draftitemid, $filepath, $filename) {
          global $USER;
          $fs = get_file_storage();
          $user_context = context_user::instance($USER->id);
          if ($file = $fs->get_file($user_context->id, 'user', 'draft', $draftitemid, $filepath, $filename)) {
              $file->delete();
              return true;
          } else {
              return false;
          }
      }
code_tokens: public static function delete_tempfile_from_draft ( $ draftitemid , $ filepath , $ filename ) { global $ USER ; $ fs = get_file_storage ( ) ; $ user_context = context_user :: instance ( $ USER -> id ) ; if ( $ file = $ fs -> get_file ( $ user_context -> id , 'user' , 'draft' , $ draftitemid , $ filepath , $ filename ) ) { $ file -> delete ( ) ; return true ; } else { return false ; } }
docstring: Delete a temp file from draft area
  
  @param int $draftitemid
  @param string $filepath
  @param string $filename
  @return bool
docstring_tokens: Delete a temp file from draft area