Container whitelist.
775689
def _container_whitelist(self):
        """"""
        if self.__container_whitelist is None:
            self.__container_whitelist = \
                set(self.CLOUD_BROWSER_CONTAINER_WHITELIST or [])
        return self.__container_whitelist
1250491
function prepareWhitelist(whitelist) {
	if (whitelist) {
        logger.info(colors.bold('Applying whitelist filtering for JUnit reports. Take care to keep the whitelist up to date!'));

		// The white-list is either a list or the old format, which is an object with more
		// complex structures.
	    whitelist = JSON.parse(whitelist);

	    // Ensure whitelist is in the expected format
	    whitelist = simplifyWhitelist(whitelist);
	}

  // Read the whitelist from a config file
  if (config.has('whitelist.ignore')) {
    if(!whitelist) {
      whitelist = [];
    }

    var myWhitelist = config.get('whitelist.ignore');
    for (var i = 0; i < myWhitelist.length; i++) {
      whitelist.push({
        "id": myWhitelist[i]
      });
    }
  }

  // Convert the list to a map for easy lookup
  if (whitelist) {
    var whitelistMap = {};
    for (var i = 0; i < whitelist.length; i++) {
      var key = whitelist[i].id;
      whitelistMap[key] = whitelist[i];
    }
    whitelist = whitelistMap;
  }

	return whitelist;
}
1215193
def build_image_list(config, image, imagefile, all_local, include_allanchore, dockerfile=None, exclude_file=None):
    """"""

    if not image and not (imagefile or all_local):
        raise click.BadOptionUsage('No input found for image source. One of <image>, <imagefile>, or <all> must be specified')

    if image and imagefile:
        raise click.BadOptionUsage('Only one of <image> and <imagefile> can be specified')

    filter_images = []
    if exclude_file:
        with open(exclude_file) as f:
            for line in f.readlines():
                filter_images.append(line.strip())

    imagelist = {}
    if image:
        imagelist[image] = {'dockerfile':dockerfile}

    if imagefile:
        filelist = anchore_utils.read_kvfile_tolist(imagefile)
        for i in range(len(filelist)):
            l = filelist[i]
            imageId = l[0]
            try:
                dfile = l[1]
            except:
                dfile = None
            imagelist[imageId] = {'dockerfile':dfile}

    if all_local:
        docker_cli = contexts['docker_cli']
        if docker_cli:
            for f in docker_cli.images(all=True, quiet=True, filters={'dangling': False}):
                if f not in imagelist and f not in filter_images:
                    imagelist[f] = {'dockerfile':None}
        else:
            raise Exception("Could not load any images from local docker host - is docker running?")

    if include_allanchore:
        ret = contexts['anchore_db'].load_all_images().keys()
        if ret and len(ret) > 0:
            for l in list(set(imagelist.keys()) | set(ret)):
                imagelist[l] = {'dockerfile':None}

    # Remove excluded items
    for excluded in filter_images:
        docker_cli = contexts['docker_cli']
        if not docker_cli:
            raise Exception("Could not query docker - is docker running?")
        for img in docker_cli.images(name=excluded, quiet=True):
            imagelist.pop(img, None)

    return imagelist
1058154
def offload_service_containers(self, service):
        
        def anonymous(anonymous_service):
            if not isinstance(anonymous_service, Service):
                raise TypeError("service must be an instance of Service.")

            if anonymous_service.containers:
                logger.info("Deleting service: {0} containers.".format(anonymous_service.name))
                for container_name in list(anonymous_service.containers.keys()):
                    del anonymous_service.containers[container_name]

        self._service_map(service, anonymous, descending=True)
754830
def stop_supporting_containers(get_container_name, extra_containers):
    
    docker.remove_container(get_container_name('postgres'))
    docker.remove_container(get_container_name('solr'))
    for container in extra_containers:
        docker.remove_container(get_container_name(container))
765001
def block(broker):
        """"""
        remove = (".", "ram", "dm-", "loop")
        tmp = "/dev/%s"
        return[(tmp % f) for f in os.listdir("/sys/block") if not f.startswith(remove)]
756731
public function setWhitelist($whitelist)
    {
        if (is_array($whitelist)) {
            $this->whitelist = array_map('strval', $whitelist);
        } elseif ($whitelist instanceof \ArrayObject && true) {
            $this->whitelist = array_map('strval', $whitelist->getArrayCopy());
        } elseif (is_string($whitelist)) {
            $this->whitelist = [];
            for ($i = 0; $i < strlen($whitelist); $i++) {
                $this->whitelist[] = $whitelist[$i];
            }
        } else {
            throw new \Exception('Incorrect whitelist given. Allowed whitelist are: string, array or ArrayObject.');
        }
    }
743430
def container_present(name, profile):
    '''
    
    '''
    containers = __salt__['libcloud_storage.list_containers'](profile)
    match = [z for z in containers if z['name'] == name]
    if match:
        return state_result(True, "Container already exists", name, {})
    else:
        result = __salt__['libcloud_storage.create_container'](name, profile)
        return state_result(True, "Created new container", name, result)
1368420
def get_containers(self):
        """"""
        permitted = lambda c: settings.container_permitted(c.name)
        return [c for c in self._get_containers() if permitted(c)]
1143452
public function whitelist() {
        $args = func_get_args();

        if (isset($args[0]) && is_array($args[0])) {
            $args = $args[0];
        }

        $this->_whitelist += $args;
        $this->_whitelist = array_filter($this->_whitelist);

        return $this;
    }
551401
function (params) {
        var countries = _data;
        var subset = [], i = 0;
        if (params.whitelist) {
            var whitelist = params.whitelist.split(",");
            for (i = 0; i < _data.length; i++) {
                if (whitelist.indexOf(_data[i][1]) !== -1) {
                    subset.push(_data[i]);
                }
            }
            countries = subset;
        } else if (params.blacklist) {
            var blacklist = params.blacklist.split(",");
            for (i = 0; i < _data.length; i++) {
                if (blacklist.indexOf(_data[i][1]) === -1) {
                    subset.push(_data[i]);
                }
            }
            countries = subset;
        }

        if (params.preferred) {
            countries = _applyPreferredCountries(countries, params.preferred, params.preferredDelim);
        }

        _countries = countries;

        // now init the regions
        _initRegions();
    }
1306978
def cleanup():
    """"""
    lib_dir = os.path.join(os.environ['CONTAINER_DIR'], '_lib')
    if os.path.exists(lib_dir):
        shutil.rmtree(lib_dir)
    os.mkdir(lib_dir)
202023
def make_container_public(self, container, ttl=None):
        
        return self._manager.make_public(container, ttl=ttl)
807349
def whitelisted_params
      whitelist = params_for_resource(:sign_up)

      whitelist.inject({}) do |coll, key|
        param = omniauth_params[key.to_s]
        coll[key] = param if param
        coll
      end
    end
378981
def run_container(self, conf, images, **kwargs):
        """"""
        with self._run_container(conf, images, **kwargs):
            pass
449473
def _is_whitelisted(self, email):
        """"""

        return hasattr(settings, "SAFE_EMAIL_WHITELIST") and \
            any(re.match(m, email) for m in settings.SAFE_EMAIL_WHITELIST)
374992
def _get_containers(self):
        """"""
        infos = self.native_conn.list_containers_info()
        return [self.cont_cls(self, i['name'], i['count'], i['bytes'])
                for i in infos]