Deletes cached branch_info file
163668
def delete_cached_branch_info(self):
        '''
            
        '''
        if os.path.isfile(constants.cached_branch_info):
            logger.debug('Deleting cached branch_info file...')
            os.remove(constants.cached_branch_info)
        else:
            logger.debug('Cached branch_info file does not exist.')
1352261
def clear(self):
        
        self.log(u"Clearing cache...")
        for file_handler, file_info in self.cache.values():
            self.log([u"  Removing file '%s'", file_info])
            gf.delete_file(file_handler, file_info)
        self._initialize_cache()
        self.log(u"Clearing cache... done")
1039385
def clean_python(ctx, dry_run=False):
    """"""
    # MAYBE NOT: "**/__pycache__"
    cleanup_dirs(["build", "dist", "*.egg-info", "**/__pycache__"],
                 dry_run=dry_run)
    if not dry_run:
        ctx.run("py.cleanup")
    cleanup_files(["**/*.pyc", "**/*.pyo", "**/*$py.class"], dry_run=dry_run)
406610
def cache_clear(self):
        
        # Delete content of local cache directory
        for f in os.listdir(self.directory):
            f = os.path.join(self.directory, f)
            if os.path.isfile(f):
                os.remove(f)
            elif os.path.isdir(f):
                shutil.rmtree(f)
        # Empty cache index
        self.cache = {}
52376
def clear_cache():
        """"""
        del Cache._keys
        for k in list(Cache._cache.keys()):
            it = Cache._cache.pop(k)
            del it
        del Cache._cache
        Cache._keys = []
        Cache._cache = {}
        gc.collect()
1060223
def clear_cache(self, back=None):
        '''
        
        '''
        back = self.backends(back)
        cleared = []
        errors = []
        for fsb in back:
            fstr = '{0}.clear_cache'.format(fsb)
            if fstr in self.servers:
                log.debug('Clearing %s fileserver cache', fsb)
                failed = self.servers[fstr]()
                if failed:
                    errors.extend(failed)
                else:
                    cleared.append(
                        'The {0} fileserver cache was successfully cleared'
                        .format(fsb)
                    )
        return cleared, errors
1115605
def delete():
    """"""
    path = cache.local_path(
        filename=ALLELE_XML_FILENAME,
        url=ALLELE_XML_URL,
        decompress=ALLELE_XML_DECOMPRESS)
    os.remove(path)
873902
async function deleteBranch(branchName, abandonAssociatedPr = false) {
  await config.storage.deleteBranch(branchName);
  // istanbul ignore if
  if (abandonAssociatedPr) {
    const pr = await getBranchPr(branchName);
    await abandonPr(pr.number);
  }
}
499310
public void deleteBranch(Serializable projectId, String branchName) throws IOException {
        String tailUrl = GitlabProject.URL + "/" + sanitizeProjectId(projectId) + GitlabBranch.URL + '/' + sanitizePath(branchName);
        retrieve().method(DELETE).to(tailUrl, Void.class);
    }
1199656
def destroy_branch(base_branch, sha)
        if base_branch == "maximus_#{sha}"
          @g.branch('master').checkout
        else
          @g.branch(base_branch).checkout
        end
        @g.branch("maximus_#{sha}").delete
      end
360618
def cleanup():
        """"""
        for install_dir in linters.INSTALL_DIRS:
            try:
                shutil.rmtree(install_dir, ignore_errors=True)
            except Exception:
                print(
                    "{0}\nFailed to delete {1}".format(
                        traceback.format_exc(), install_dir
                    )
                )
                sys.stdout.flush()
456314
def clear_file_cache(filename=None):
    """"""
    global file_cache, file2file_remap, file2file_remap_lines
    if filename is not None:
        if filename in file_cache:
            del file_cache[filename]
            pass
    else:
        file_cache = {}
        file2file_remap = {}
        file2file_remap_lines = {}
        pass
    return
1288359
def delete_commit_branches(self, enrich_backend):
        
        fltr = """
            "filter": [
                {
                    "term": {
                        "origin": "%s"
                    }
                }
            ]
        """ % self.perceval_backend.origin

        # reset references in enrich index
        es_query = """
            {
              "script": {
                "source": "ctx._source.branches = new HashSet();",
                "lang": "painless"
              },
              "query": {
                "bool": {
                    %s
                }
              }
            }
            """ % fltr

        index = enrich_backend.elastic.index_url
        r = self.requests.post(index + "/_update_by_query?refresh", data=es_query, headers=HEADER_JSON, verify=False)
        try:
            r.raise_for_status()
        except requests.exceptions.HTTPError:
            logger.error("Error while deleting branches on %s",
                         self.elastic.anonymize_url(index))
            logger.error(r.text)
            return

        logger.debug("Delete branches %s, index %s", r.text, self.elastic.anonymize_url(index))
1129170
def _cleanup(self):  # pragma: no cover
        
        need_to_delete = []  # can't delete from a dict while iterating
        with self.attr_lock:
            now_time = time()
            for path in self.cache:
                if now_time - self.attr[path][TIMESTAMP_KEY] >= MAX_CACHE_TIME:
                    need_to_delete.append(path)
            for path in need_to_delete:
                del self.attr[path]
                del self.cache[path]
382570
def delete_branch(self, repo, branch, prefix):
        
        # extra safeguard to make sure we are handling a bot branch here
        assert branch.startswith(prefix)
        ref = repo.get_git_ref("/".join(["heads", branch]))
        ref.delete()
296367
def cleanup_pycache():
    
    try:
        for file in glob.glob('setup.py[co]'):
            os.remove(file)
        if isdir('__pycache__'):
            for file in glob.glob(join('__pycache__', 'setup.*.py[co]')):
                os.remove(file)
            if not glob.glob(join('__pycache__', '*')):
                os.rmdir('__pycache__')
    except (IOError, OSError):
        pass
530236
def clear_caches(self):
        
        for element_name in dir(self.components):
            element = getattr(self.components, element_name)
            if hasattr(element, 'cache_val'):
                delattr(element, 'cache_val')