When this package is uninstalled, the generated git hooks need to be removed.
557726
public function prePackageUninstall(PackageEvent $event)
    {
        /** @var UninstallOperation $operation */
        $operation = $event->getOperation();
        $package = $operation->getPackage();

        if (!$this->guardIsGrumPhpPackage($package)) {
            return;
        }

        // First remove the hook, before everything is deleted!
        $this->deInitGitHook();
    }
324126
def removed(name):
    '''
    
    '''

    ret = {'name': name,
           'changes': {},
           'pchanges': {},
           'result': None,
           'comment': ''}

    old = __salt__['snap.versions_installed'](name)
    if not old:
        ret['comment'] = 'Package {0} is not installed'.format(name)
        ret['result'] = True
        return ret

    if __opts__['test']:
        ret['comment'] = 'Package {0} would have been removed'.format(name)
        ret['result'] = None
        ret['pchanges']['old'] = old[0]['version']
        ret['pchanges']['new'] = None
        return ret

    remove = __salt__['snap.remove'](name)
    ret['comment'] = 'Package {0} removed'.format(name)
    ret['result'] = True
    ret['changes']['old'] = old[0]['version']
    ret['changes']['new'] = None
    return ret
903969
function() {
    TraceKit.report.uninstall();

    this._detachPromiseRejectionHandler();
    this._unpatchFunctionToString();
    this._restoreBuiltIns();
    this._restoreConsole();

    Error.stackTraceLimit = this._originalErrorStackTraceLimit;
    this._isRavenInstalled = false;

    return this;
  }
980627
public void deleteSystemHook(SystemHook hook) throws GitLabApiException {

        if (hook == null) {
            throw new RuntimeException("hook cannot be null");
        }

        deleteSystemHook(hook.getId());
    }
276816
def clear_masters(self):
        
        packages = []
        for mas in Utils().remove_dbs(self.packages):
            if mas not in self.dependencies:
                packages.append(mas)
        self.packages = packages
970512
async function unlink(args: Array<string>, ctx: ConfigT) {
  const packageName = args[0];

  const {[packageName]: dependency, ...otherDependencies} = ctx.dependencies;

  if (!dependency) {
    throw new CLIError(`
      Failed to unlink "${packageName}". It appears that the project is not linked yet.
    `);
  }

  const dependencies = values(otherDependencies);
  try {
    if (dependency.hooks.preulink) {
      await dependency.hooks.preulink();
    }
    unlinkDependency(
      ctx.platforms,
      ctx.project,
      dependency,
      packageName,
      dependencies,
    );
    if (dependency.hooks.postunlink) {
      await dependency.hooks.postunlink();
    }
  } catch (error) {
    throw new CLIError(
      `Something went wrong while unlinking. Reason ${error.message}`,
      error,
    );
  }

  // @todo move all these to above try/catch
  // @todo it is possible we could be unlinking some project assets in case of duplicate
  const assets = difference(
    dependency.assets,
    flatMap(dependencies, d => d.assets),
  );

  if (assets.length === 0) {
    return;
  }

  Object.keys(ctx.platforms || {}).forEach(platform => {
    const projectConfig = ctx.project[platform];
    const linkConfig =
      ctx.platforms[platform] &&
      ctx.platforms[platform].linkConfig &&
      ctx.platforms[platform].linkConfig();
    if (!linkConfig || !linkConfig.unlinkAssets || !projectConfig) {
      return;
    }

    logger.info(`Unlinking assets from ${platform} project`);
    // $FlowFixMe
    linkConfig.unlinkAssets(assets, projectConfig);
  });

  logger.info(
    `${packageName} assets has been successfully unlinked from your project`,
  );
}
929521
protected void release() {
		stack.getLocalTransactions().remove(Integer.valueOf(localTID));
		stack.getRemoteTxToLocalTxMap().remove(Integer.valueOf(remoteTID));
		cancelTHISTTimerTask();
		cancelLongtranTimer();
		cancelReTransmissionTimer();
		
		if(originalPacket!=null)
			stack.releasePacket(originalPacket);
		
		originalPacket=null;
	}
821423
def removed(name, dir=None, user=None):
    '''
    
    '''
    ret = {'name': name, 'result': None, 'comment': '', 'changes': {}}

    try:
        installed_pkgs = __salt__['npm.list'](dir=dir, depth=0)
    except (CommandExecutionError, CommandNotFoundError) as err:
        ret['result'] = False
        ret['comment'] = 'Error uninstalling \'{0}\': {1}'.format(name, err)
        return ret

    if name not in installed_pkgs:
        ret['result'] = True
        ret['comment'] = 'Package \'{0}\' is not installed'.format(name)
        return ret

    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Package \'{0}\' is set to be removed'.format(name)
        return ret

    if __salt__['npm.uninstall'](pkg=name, dir=dir, runas=user):
        ret['result'] = True
        ret['changes'][name] = 'Removed'
        ret['comment'] = 'Package \'{0}\' was successfully removed'.format(name)
    else:
        ret['result'] = False
        ret['comment'] = 'Error removing package \'{0}\''.format(name)

    return ret
344159
public function uninstall()
    {
        $_POST['selected'] = [];

        foreach ((array) $this->plugin as $plugin) {
            $_POST['selected'][] = $plugin->name;
        }

        $_POST['edit_method'] = 'delete';
        ob_start();
        plugin_multi_edit();
        ob_end_clean();
    }
133047
function (done) {
      var p = clone(pkg);
      delete p.devDependencies;
      var content = JSON.stringify(p, null, 2);
      write_if_not_exists('package.json', content, done);
    }
208354
public void removeSuperfluousArtifacts(Set<String> recentlyCompiled) {
        // Nothing to do, if nothing was recompiled.
        if (recentlyCompiled.size() == 0) return;

        for (String pkg : now.packages().keySet()) {
            // If this package has not been recompiled, skip the check.
            if (!recentlyCompiled.contains(pkg)) continue;
            Collection<File> arts = now.artifacts().values();
            for (File f : fetchPrevArtifacts(pkg).values()) {
                if (!arts.contains(f)) {
                    Log.debug("Removing "+f.getPath()+" since it is now superfluous!");
                    if (f.exists()) f.delete();
                }
            }
        }
    }
1192446
def uninstall(self, package: str) -> None:
        ''''''
        if package not in self.view_packgets_list():
            raise NoSuchPackageException(
                f'There is no such package {package!r}.')
        self._execute('-s', self.device_sn, 'uninstall', package)
354409
def unpurge(*packages):
    '''
    
    '''
    if not packages:
        return {}
    old = __salt__['pkg.list_pkgs'](purge_desired=True)
    ret = {}
    __salt__['cmd.run'](
        ['dpkg', '--set-selections'],
        stdin=r'\n'.join(['{0} install'.format(x) for x in packages]),
        python_shell=False,
        output_loglevel='trace'
    )
    __context__.pop('pkg.list_pkgs', None)
    new = __salt__['pkg.list_pkgs'](purge_desired=True)
    return salt.utils.data.compare_dicts(old, new)
786055
private function cleanup()
	{
		foreach ($this->installationMap as $path => $packages) {
			if ($path == '__CHECKSUMS__') {
				continue;
			}

			if (count($packages)) {
				sort($this->installationMap[$path]);
				continue;
			}

			$installation_path = ltrim($path, '/\\' . DIRECTORY_SEPARATOR);
			$installation_path = getcwd() . DIRECTORY_SEPARATOR . $installation_path;

			if (is_dir($installation_path)) {

				//
				// Here's what to do with a directory
				//

				$children = array_merge(
					glob($installation_path . DIRECTORY_SEPARATOR . '/*'),
					glob($installation_path . DIRECTORY_SEPARATOR . '/.*')
				);

				//
				// Children should be at least two (one entry for current dir and another)
				// for parent dir.  Our install map is sorted by the length of the path
				// so we should only be trying to remove directories which have already had
				// other opus related/created children removed.
				//

				if (count($children) > 2) {
					continue;
				}

				if (!@rmdir($installation_path)) {
					switch ($this->integrity) {
						case 'low':
							break;

						case 'medium':
							$this->io->write(sprintf(
								self::TAB . 'Warning: unable to remove empty directory %s',
								$path
							));
							break;

						case 'high':
							throw new \Exception(sprintf(
								'Error removing empty directory %s',
								$path
							));
					}
				}

			} else {

				//
				// Here's what to do with a file
				//

				if (!@unlink($installation_path)) {
					switch ($this->integrity) {
						case 'low':
							break;

						case 'medium':
							$this->io->write(sprintf(
								self::TAB . 'Warning: unable to remove unused file %s; remove manually',
								$path
							));
							break;

						case 'high':
							throw new \Exception(sprintf(
								'Error removing unused file %s, restore file or check permissions and try again',
								$path
							));
					}
				}
			}

			unset($this->installationMap[$path]);
			unset($this->installationMap['__CHECKSUMS__'][$path]);
		}

		//
		// Sort our paths by length
		//

		uksort($this->installationMap, function($a, $b) {
			if (strlen($a) == strlen($b)) {
				return 0;
			}

			if (strlen($a) > strlen($b)) {
				return -1;
			}

			return 1;
		});
	}
873603
def removeProductFrom(self, userstore):
        
        def uninstall():
            #this is probably highly insufficient, but i don't know the
            #requirements
            i = userstore.findFirst(Installation,
                                    Installation.types == self.types)
            i.uninstall()
            i.deleteFromStore()
        userstore.transact(uninstall)
803067
public static function uninstall() {
		$cptp = CPTP::get_instance();

		foreach ( $cptp->modules as $module ) {
			$module->uninstall_hook();
		}
	}
284891
def pip_uninstall(package, **options):
    """"""
    command = ["uninstall", "-q", "-y"]

    available_options = ('proxy', 'log', )
    for option in parse_options(options, available_options):
        command.append(option)

    if isinstance(package, list):
        command.extend(package)
    else:
        command.append(package)

    log("Uninstalling {} package with options: {}".format(package,
                                                          command))
    pip_execute(command)