Reload blacklist data
350453
public function reloadBlacklist()
    {
        $this->cache->flush($this->getCacheKey());

        $this->blackListRegex = null;

        $this->loadBlacklist();
    }
435974
def read_blacklist (self):
        
        with codecs.open(self.filename, 'r', self.output_encoding,
                         self.codec_errors) as fd:
            for line in fd:
                line = line.rstrip()
                if line.startswith('#') or not line:
                    continue
                value, key = line.split(None, 1)
                self.blacklist[key] = int(value)
533920
def do_blacklist(config, config_dir):
    
    if not os.path.exists(config_dir):
        print "Configuration '{}' does not exist.".format(config)
        exit(1)    

    editor = os.environ["EDITOR"]

    config_blacklist = os.path.join(config_dir, 'blacklist')
    call([editor, config_blacklist])
    print "Blacklist configuration has been updated."
639919
def refresh():
    """"""
    override_files = []
    for stack in traceback.extract_stack():
        f = os.path.join(os.path.dirname(stack[0]), OVERRIDE_FILE)
        if f not in override_files:
            override_files.insert(0, f)
    if OVERRIDE_FILE in override_files:
        del override_files[override_files.index(OVERRIDE_FILE)]
    override_files.append(OVERRIDE_FILE)

    def import_path(path):
        if sys.version_info < (3, 5, 0):
            from importlib.machinery import SourceFileLoader
            return SourceFileLoader(__name__, path).load_module()
        import importlib.util
        spec = importlib.util.spec_from_file_location(__name__, path)
        module = importlib.util.module_from_spec(spec)
        spec.loader.exec_module(module)
        return module

    for override_file in override_files:
        if not os.path.isfile(override_file):
            continue
        mod = import_path(override_file)
        globals().update({n: getattr(mod, n) for n in dir(mod) if not n.startswith("__")})
59462
def greylisting(data):
    
    input_bam = data.get("work_bam_input", None)
    if not input_bam:
        logger.info("No input BAM file detected, skipping greylisting.")
        return None
    try:
        greylister = config_utils.get_program("chipseq-greylist", data)
    except config_utils.CmdNotFound:
        logger.info("No greylister found, skipping greylisting.")
        return None
    greylistdir = os.path.join(os.path.dirname(input_bam), "greylist")
    if os.path.exists(greylistdir):
        return greylistdir
    cmd = "{greylister} --outdir {txgreylistdir} {input_bam}"
    message = "Running greylisting on %s." % input_bam
    with file_transaction(greylistdir) as txgreylistdir:
        utils.safe_makedir(txgreylistdir)
        try:
            do.run(cmd.format(**locals()), message)
        except subprocess.CalledProcessError as msg:
            if str(msg).find("Cannot take a larger sample than population when 'replace=False'") >= 0:
                logger.info("Skipping chipseq greylisting because of small sample size: %s"
                            % dd.get_sample_name(data))
                return None
    return greylistdir
1351538
def reload(self, env=None, silent=None):  # pragma: no cover
        """"""
        self.clean()
        self.execute_loaders(env, silent)
863036
def reload(self):
        
        r = self.api._req_directory(self.cid)
        self.pid = r['pid']
        self.name = r['name']
        self._count = r['count']
269103
function() {
        var assetKey, newEntry, oldEntry;

        // Reuse existing metadata.
        for ( assetKey in oldAvailableLists ) {
            oldEntry = oldAvailableLists[assetKey];
            newEntry = newAvailableLists[assetKey];
            // List no longer exists. If a stock list, try to convert to
            // imported list if it was selected.
            if ( newEntry === undefined ) {
                µb.removeFilterList(assetKey);
                if ( assetKey.indexOf('://') === -1 ) {
                    customListFromStockList(assetKey);
                }
                continue;
            }
            if ( oldEntry.entryCount !== undefined ) {
                newEntry.entryCount = oldEntry.entryCount;
            }
            if ( oldEntry.entryUsedCount !== undefined ) {
                newEntry.entryUsedCount = oldEntry.entryUsedCount;
            }
            // This may happen if the list name was pulled from the list
            // content.
            // https://github.com/chrisaljoudi/uBlock/issues/982
            // There is no guarantee the title was successfully extracted from
            // the list content.
            if (
                newEntry.title === '' &&
                typeof oldEntry.title === 'string' &&
                oldEntry.title !== ''
            ) {
                newEntry.title = oldEntry.title;
            }
        }

        // Remove unreferenced imported filter lists.
        var dict = new Set(importedListKeys);
        for ( assetKey in newAvailableLists ) {
            newEntry = newAvailableLists[assetKey];
            if ( newEntry.submitter !== 'user' ) { continue; }
            if ( dict.has(assetKey) ) { continue; }
            delete newAvailableLists[assetKey];
            µb.assets.unregisterAssetSource(assetKey);
            µb.removeFilterList(assetKey);
        }
    }
143946
private void blacklist(String nodeName, ResourceType type) {
    List<ResourceType> blacklistedResourceTypes =
      blacklistedNodes.get(nodeName);
    if (blacklistedResourceTypes == null) {
      blacklistedResourceTypes = new ArrayList<ResourceType>();
      blacklistedNodes.put(nodeName, blacklistedResourceTypes);
    }
    synchronized (blacklistedResourceTypes) {
      if (!blacklistedResourceTypes.contains(type)) {
        blacklistedResourceTypes.add(type);
      }
    }
  }
210568
def _whitelist_blacklist(self, os_name):
        '''
        
        '''
        return napalm_logs.ext.check_whitelist_blacklist(os_name,
                                                         whitelist=self.device_whitelist,
                                                         blacklist=self.device_blacklist)
586096
def deny(self, ip):
        
        self.blacklist.append(ip)
        self.whitelist.clear()
344956
private void blacklist(KestrelClientInfo info, Throwable t)
    {
        logger.warn("Failed to read from Kestrel at " + info.host + ":" + info.port, t);

        //this case can happen when it fails to connect to Kestrel (and so never stores the connection)
        info.closeClient();
        info.blacklistTillTimeMs = System.currentTimeMillis() + DEFAULT_BLACKLIST_TIME_MS;

        int index = this.clientInfoList.indexOf(info);

        // we just closed the connection, so all open reliable reads will be aborted. empty buffers.
        for (Iterator<EmitItem> i = this.emitBuffer.iterator(); i.hasNext();)
        {
            EmitItem item = i.next();
            if (item.getSourceId().getIndex() == index)
            {
                i.remove();
            }
        }
    }
270649
public void addToBlacklists(final Blacklist blacklist) {
		if (null == getBlacklists()) {
			setBlacklists(new java.util.TreeSet<Blacklist>());
		}
		getBlacklists().add(blacklist);
	}
668921
def blacklistNode(self, nodeName: str, reason: str = None, code: int = None):
        
        msg = "{} blacklisting node {}".format(self, nodeName)
        if reason:
            msg += " for reason {}".format(reason)
        if code:
            msg += " for code {}".format(code)
        logger.display(msg)
        self.nodeBlacklister.blacklist(nodeName)
1093898
def _container_blacklist(self):
        """"""
        if self.__container_blacklist is None:
            self.__container_blacklist = \
                set(self.CLOUD_BROWSER_CONTAINER_BLACKLIST or [])
        return self.__container_blacklist
310709
def filter_factory(global_conf, **local_conf):
    """"""
    conf = global_conf.copy()
    conf.update(local_conf)

    def blacklist(app):
        return BlacklistFilter(app, conf)
    return blacklist
41246
private function bootWithBlacklist()
    {
        $this->serverInstance = new IpBlackList($this->serverInstance);

        foreach (config('ratchet.blackList') as $host) {
            $this->serverInstance->blockAddress($host);
        }
    }