Remove custom repositories
965886
def command_repo_remove(self):
        
        if len(self.args) == 2 and self.args[0] == "repo-remove":
            Repo().remove(self.args[1])
        else:
            usage("")
145095
def remove(user_name, repo_name, reviewer_username, params={})
      update_and_validate_user_repo_params(user_name, repo_name)
      normalize! params
      delete_request("/2.0/repositories/#{user_name}/#{repo_name}/default-reviewers/#{reviewer_username}", params)
    end
269655
public function remove_hooks( $repo_api ) {
		remove_filter( 'extra_theme_headers', [ $this, 'add_headers' ] );
		remove_filter( 'extra_plugin_headers', [ $this, 'add_headers' ] );

		if ( $repo_api instanceof Bitbucket_API ) {
			$this->remove_authentication_hooks();
		}
	}
891939
public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package)
    {
        parent::uninstall($repo, $package);
        $path = $this->getInstallPath($package);
        $ns = static::primaryNamespace($package);
        $this->updateConfig($ns, null);
    }
474513
protected void removeRepositoryLocally(String repositoryName, boolean forceRemove) throws RepositoryCreationException
   {
      try
      {
         // extract list of all datasources
         ManageableRepository repositorty = repositoryService.getRepository(repositoryName);
         Set<String> datasources = extractDataSourceNames(repositorty.getConfiguration(), false);

         // close all opened sessions
         for (String workspaceName : repositorty.getWorkspaceNames())
         {
            WorkspaceContainerFacade wc = repositorty.getWorkspaceContainer(workspaceName);
            SessionRegistry sessionRegistry = (SessionRegistry)wc.getComponent(SessionRegistry.class);

            sessionRegistry.closeSessions(workspaceName);
         }

         // remove repository from configuration
         repositoryService.removeRepository(repositoryName, forceRemove);
         repositoryService.getConfig().retain();
         
         // unbind datasource and close connections
         for (String dsName : datasources)
         {
            try
            {
               // we suppose that lookup() method returns the same instance of datasource by the same name
               DataSource ds = (DataSource)initialContextInitializer.getInitialContext().lookup(dsName);
               initialContextInitializer.getInitialContextBinder().unbind(dsName);

               // close datasource
               if (ds instanceof CloseableDataSource)
               {
                  ((CloseableDataSource)ds).close();
               }
            }
            catch (NamingException e)
            {
               LOG.error("Can't unbind datasource " + dsName, e);
            }
            catch (FileNotFoundException e)
            {
               LOG.error("Can't unbind datasource " + dsName, e);
            }
            catch (XMLStreamException e)
            {
               LOG.error("Can't unbind datasource " + dsName, e);
            }
         }
      }
      catch (RepositoryException e)
      {
         throw new RepositoryCreationException("Can't remove repository", e);
      }
      catch (RepositoryConfigurationException e)
      {
         throw new RepositoryCreationException("Can't remove repository", e);
      }
   }
352344
def remove(self, dist):
        """"""
        while dist.location in self.paths:
            self.paths.remove(dist.location)
            self.dirty = True
        Environment.remove(self, dist)
386452
@Delete("/projects/{projectName}/repos/{repoName}")
    @RequiresRole(roles = ProjectRole.OWNER)
    public CompletableFuture<Void> removeRepository(ServiceRequestContext ctx,
                                                    @Param("repoName") String repoName,
                                                    Repository repository,
                                                    Author author) {
        if (Project.isReservedRepoName(repoName)) {
            return HttpApiUtil.throwResponse(ctx, HttpStatus.FORBIDDEN,
                                             "A reserved repository cannot be removed.");
        }
        return execute(Command.removeRepository(author, repository.parent().name(), repository.name()))
                .thenCompose(unused -> mds.removeRepo(author, repository.parent().name(), repository.name()))
                .handle(HttpApiUtil::throwUnsafelyIfNonNull);
    }
720333
public function removeComposerRepository($repo_url) {
    $composer_json = $this->getComposerJson();
    if (!empty($composer_json['repositories'])) {
      foreach ($composer_json['repositories'] as $key => $repo) {
        $url = $repo['url'];
        if ($repo_url == $url) {
          unset($composer_json['repositories'][$key]);
          $this->writeComposerJson($composer_json);

          return TRUE;
        }
      }
    }
    return FALSE;
  }
1045606
def purge(packages, fatal=False):
    """"""
    cmd = ['yum', '--assumeyes', 'remove']
    if isinstance(packages, six.string_types):
        cmd.append(packages)
    else:
        cmd.extend(packages)
    log("Purging {}".format(packages))
    _run_yum_command(cmd, fatal)
971985
def remove_from_subscriptions(self, subscription):
        
        assert isinstance(subscription, github.Repository.Repository), subscription
        headers, data = self._requester.requestJsonAndCheck(
            "DELETE",
            "/user/subscriptions/" + subscription._identity
        )
185637
public function doUninstall(): void
	{
		$this->uninstallDB();
		$this->uninstallFiles();
		ModuleManager::unRegisterModule($this->MODULE_ID);
	}
395638
def should_use_custom_repo(args, cd_conf, repo_url):
    
    if repo_url:
        # repo_url signals a CLI override, return False immediately
        return False
    if cd_conf:
        if cd_conf.has_repos:
            has_valid_release = args.release in cd_conf.get_repos()
            has_default_repo = cd_conf.get_default_repo()
            if has_valid_release or has_default_repo:
                return True
    return False
1091309
private function ClearInstalledBundles()
    {
        //Clear bundles without code folder
        $bundles = PathUtil::Bundles();
        $sql = new Sql\Builder($this->connection);
        $inList = $sql->InListFromValues($bundles);
        $tbl = InstalledBundle::Schema()->Table();
        
        $where = $sql->NotIn($tbl->Field('Bundle'), $inList);
        InstalledBundle::Schema()->Delete($where);
        //Clear failed bundles
        $failedList = $sql->InListFromValues(array_keys($this->failedBundles));
        if ($failedList)
        {
            InstalledBundle::Schema()->Delete($sql->In($tbl->Field('Bundle'), $failedList));
        }
    }
462568
def _clean_streams(repo, mapped_streams):
    """"""
    for stream_name in ('stdout', 'stderr'):
        stream = mapped_streams.get(stream_name)
        if not stream:
            continue

        path = os.path.relpath(stream, start=repo.working_dir)
        if (path, 0) not in repo.index.entries:
            os.remove(stream)
        else:
            blob = repo.index.entries[(path, 0)].to_blob(repo)
            with open(path, 'wb') as fp:
                fp.write(blob.data_stream.read())
273402
def cleanup_temporary_directories(self):
        """"""
        while self.build_directories:
            shutil.rmtree(self.build_directories.pop())
        for requirement in self.reported_requirements:
            requirement.remove_temporary_source()
        while self.eggs_links:
            symbolic_link = self.eggs_links.pop()
            if os.path.islink(symbolic_link):
                os.unlink(symbolic_link)
261677
def delete(*args)
      arguments(args, required: [:user, :repo, :ref])
      params = arguments.params

      delete_request("/repos/#{arguments.user}/#{arguments.repo}/git/refs/#{arguments.ref}", params)
    end
511801
def uninstall(client):
    """"""
    from git.index.fun import hook_path as get_hook_path

    for hook in HOOKS:
        hook_path = Path(get_hook_path(hook, client.repo.git_dir))
        if hook_path.exists():
            hook_path.unlink()