Deactivate plugin
Example: When I deactivate the "hello-dolly" plugin

@then /^I deactivate the "(?P<slug>[^"]*)" plugin$/
166814
public function i_deactivate_the_plugin( $slug ) {
		if ( ! $this->is_plugin_installed( $slug ) ) {
			throw new \Exception( sprintf(
				"The %s plugin is not installed.",
				$slug
			) );
		}

		if ( $this->is_plugin_activated( $slug ) ) {
			$this->deactivate_plugin( $slug );
		}

		if ( $this->is_plugin_activated( $slug ) ) {
			throw new \Exception( sprintf(
				"The %s plugin should not be activated, but activated.",
				$slug
			) );
		}
	}
1016693
@SuppressWarnings("unused")
    @Deactivate
    protected void deactivate(ComponentContext context) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Deactivating the HTTP pipeline event handler");
        }
    }
176773
function() {
        if (this.pinchZoom) {
            this.pinchZoom.deactivate();
        }
        this.zoomBox.deactivate();
        this.dragPan.deactivate();
        this.handlers.click.deactivate();
        this.handlers.wheel.deactivate();
        return OpenLayers.Control.prototype.deactivate.apply(this,arguments);
    }
116571
function(pluginName) {
		
		var self = this;
		
		// if the plugin has been activated on this instance
		if (self[pluginName]) {
			
			var plugin = $.tooltipster._plugin(pluginName);
			
			// if there is a constructor for instances
			if (plugin.instance) {
				
				// unbridge
				$.each(plugin.instance, function(methodName, fn) {
					
					// if the method exists (privates methods do not) and comes indeed from
					// this plugin (may be missing or come from a conflicting plugin).
					if (	self[methodName]
						&&	self[methodName].bridged === self[pluginName]
					) {
						delete self[methodName];
					}
				});
			}
			
			// destroy the plugin
			if (self[pluginName].__destroy) {
				self[pluginName].__destroy();
			}
			
			// remove the reference to the plugin instance
			delete self[pluginName];
		}
		
		return self;
	}
1123442
@Override
    public void destroy() {
        shell.unregisterPlugin(this);
        executeAction(PluginAction.UNLOAD, false);
        CommandUtil.dissociateAll(container);

        if (pluginEventListeners1 != null) {
            pluginEventListeners1.clear();
            pluginEventListeners1 = null;
        }

        if (pluginEventListeners2 != null) {
            executeAction(PluginAction.UNSUBSCRIBE, false);
            pluginEventListeners2.clear();
            pluginEventListeners2 = null;
        }

        if (registeredProperties != null) {
            registeredProperties.clear();
            registeredProperties = null;
        }

        if (registeredBeans != null) {
            registeredBeans.clear();
            registeredBeans = null;
        }

        if (registeredComponents != null) {
            for (BaseComponent component : registeredComponents) {
                component.destroy();
            }

            registeredComponents.clear();
            registeredComponents = null;
        }

        super.destroy();
    }
130525
def activate(name):
    
    if name in plugins:
        plugins[name].activate()
    else:
        raise Exception("plugin {} not found".format(name))
1066484
def disable(self):
        

        self.client.api.disable_plugin(self.name)
        self.reload()
1171359
function post_deactivate() {
		check_ajax_referer( (string) __CLASS__, 'nonce' );

		$this->post_deactivate_or_cancel();

		if ( empty( $_POST['id'] ) ) {

			wp_send_json( [] );

			return;
		}
		$this->call_api(
			array(
				'type'    => 'deactivate',
				'id'      => $_POST['id'],
				'comment' => isset( $_POST['msg'] ) ? $_POST['msg'] : '',
			)
		);
		wp_send_json( [] );

	}
716533
def unregister(self, plugin=None, name=None):
        
        if name is None:
            assert plugin is not None, "one of name or plugin needs to be specified"
            name = self.get_name(plugin)

        if plugin is None:
            plugin = self.get_plugin(name)

        # if self._name2plugin[name] == None registration was blocked: ignore
        if self._name2plugin.get(name):
            del self._name2plugin[name]

        for hookcaller in self._plugin2hookcallers.pop(plugin, []):
            hookcaller._remove_plugin(plugin)

        return plugin
283131
def unload_plugin(name)
      p = get_plugin(name)

      p.unload if p.respond_to?(:unload)
      Capistrano.remove_plugin(name)
    end
185312
protected void deactivate(ComponentContext context) {
        final boolean trace = TraceComponent.isAnyTracingEnabled();
        if (trace && tc.isEntryEnabled())
            Tr.entry(this, tc, "deactivate");

        destroyConnectionFactories(true);

        if (trace && tc.isEntryEnabled())
            Tr.exit(this, tc, "deactivate", id + ' ' + context.getProperties().get(JNDI_NAME));
    }
483373
protected void deactivate(ComponentContext compcontext) {
        if (tc.isDebugEnabled()) {
            Tr.debug(tc, "Deactivating " + this.getClass().getName());
        }
        setInstance(null);
        this.beanValidation.deactivate(compcontext);
    }
1117750
def detach(*args)
      listener = args.last
      case listener
      when vm.Listener
        @events.delete(listener)
        listener.detach
      when vm.Filter
        @filters.delete(listener)
        listener.detach
      when Enumerable
        listener.each(&method(:detach))
      else
        raise ArgumentError, "Argument must be Pluggaloid::Listener, Pluggaloid::Filter, Pluggaloid::HandlerTag or Enumerable. But given #{listener.class}."
      end
      self end
63861
public function deactivate($name)
    {
        $name = Container::get('hooks')->fire('model.plugin.deactivate.name', $name);
        $activePlugins = $this->manager->getActivePlugins();

        // Check if plugin is actually activated
        if (($k = array_search($name, $activePlugins)) !== false) {
            $plugin = DB::forTable('plugins')->where('name', $name)->find_one();
            if (!$plugin) {
                $plugin = DB::forTable('plugins')->create()->set('name', $name);
            }
            $plugin->set('active', 0);

            // Allow additionnal deactivate functions
            $this->manager->deactivate($name);

            $plugin = Container::get('hooks')->fireDB('model.plugin.deactivate', $plugin);
            $plugin->save();

            $this->manager->setActivePlugins();

            return $plugin;
        }
        return true;
    }
519607
protected void deactivate(ComponentContext context) {
        destinationRef.deactivate(context);
        bootstrapContextRef.deactivate(context);
        rrsXAResFactorySvcRef.deactivate(context);
    }
669475
function(name){
        for (var i = 0, len = _pluginList.length ; i < len ; i++){
            var plugin = _pluginList[i];
            if (name === plugin.name) {
                _pluginList.splice(i, 1);
                return;
            }
        }
    }
616810
public function deactivate_component( $args, $assoc_args ) {

		if ( ! class_exists( 'PodsInit' ) ) {
			WP_CLI::error( __( 'PodsInit not available', 'pods' ) );

			return;
		}

		$component = $assoc_args['component'];

		$active = PodsInit::$components->is_component_active( $component );

		if ( ! $active ) {
			WP_CLI::error( sprintf( __( 'Component %s is not active.', 'pods' ), $component ) );
		} else {
			PodsInit::$components->deactivate_component( $component );

			WP_CLI::success( __( 'Component deactivated.', 'pods' ) );
		}

	}