original_string: public function can_cancel_plugin_installation(\core\plugininfo\base $plugin) {
          global $CFG;
  
          if (!empty($CFG->disableupdateautodeploy)) {
              return false;
          }
  
          if (empty($plugin) or $plugin->is_standard() or $plugin->is_subplugin()
                  or !$this->is_plugin_folder_removable($plugin->component)) {
              return false;
          }
  
          if ($plugin->get_status() === self::PLUGIN_STATUS_NEW) {
              return true;
          }
  
          return false;
      }
code: public function can_cancel_plugin_installation(\core\plugininfo\base $plugin) {
          global $CFG;
  
          if (!empty($CFG->disableupdateautodeploy)) {
              return false;
          }
  
          if (empty($plugin) or $plugin->is_standard() or $plugin->is_subplugin()
                  or !$this->is_plugin_folder_removable($plugin->component)) {
              return false;
          }
  
          if ($plugin->get_status() === self::PLUGIN_STATUS_NEW) {
              return true;
          }
  
          return false;
      }
code_tokens: public function can_cancel_plugin_installation ( \ core \ plugininfo \ base $ plugin ) { global $ CFG ; if ( ! empty ( $ CFG -> disableupdateautodeploy ) ) { return false ; } if ( empty ( $ plugin ) or $ plugin -> is_standard ( ) or $ plugin -> is_subplugin ( ) or ! $ this -> is_plugin_folder_removable ( $ plugin -> component ) ) { return false ; } if ( $ plugin -> get_status ( ) === self :: PLUGIN_STATUS_NEW ) { return true ; } return false ; }
docstring: Can the installation of the new plugin be cancelled?
  
  Subplugins can be cancelled only via their parent plugin, not separately
  (they are considered as implicit requirements if distributed together
  with the main package).
  
  @param \core\plugininfo\base $plugin
  @return bool
docstring_tokens: Can the installation of the new plugin be cancelled?