Update or add resources from resource dict.
        
        types = a list of resource types to update (None = all)
        names = a list of resource names to update (None = all)
        languages = a list of resource languages to update (None = all)
175549
def update_resources_from_dict(self, res, types=None, names=None, 
                                   languages=None):
        
        UpdateResourcesFromDict(self.filename, res, types, names, 
                                languages)
396700
def add_assigned_resource(self, resource_type: str,
                              value: Union[str, int, float, bool],
                              parameters: dict = None):
        
        if parameters is None:
            parameters = dict()
        resources = DB.get_hash_value(self.key, 'resources_assigned')
        resources = ast.literal_eval(resources)
        resources.append(dict(type=resource_type, value=value,
                              parameters=parameters))
        DB.set_hash_value(self.key, 'resources_assigned', resources)
22826
def file_add_types(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTypes' % object_id, input_params, always_retry=always_retry, **kwargs)
681003
def add_changed_resources(self, resources, change=None):
        
        for resource in resources:
            rc = Resource(resource=resource, change=change)
            self.add(rc)
1372066
def resources(type = nil)
            if type.nil?
                self.extgstates
                    .merge self.colorspaces
                    .merge self.patterns
                    .merge self.shadings
                    .merge self.xobjects
                    .merge self.fonts
                    .merge self.properties
            else
                self.each_resource(type).to_h
            end
        end
468813
def update_resource_fields(self, data, data_to_add):
        
        for key, value in data_to_add.items():
            if not data.get(key):
                data[key] = value

        return data
26826
private void writeResources(List<Resource> resources)
            throws JsonGenerationException, IOException {

        PolicyUtils.validateResourceList(resources);
        List<String> resourceStrings = new ArrayList<String>();

        for (Resource resource : resources) {
            resourceStrings.add(resource.getId());
        }

        // all resources are validated to be of the same type, so it is safe to take the type of the first one
        if (resources.get(0).isNotType()) {
            writeJsonArray(JsonDocumentFields.NOT_RESOURCE, resourceStrings);
        } else {
            writeJsonArray(JsonDocumentFields.RESOURCE, resourceStrings);
        }
    }
491056
def UpdateResources(dstpath, data, type_, names=None, languages=None):
    
    # look for existing resources
    res = GetResources(dstpath, [type_], names, languages)
    # add type_, names and languages not already present in existing resources
    if not type_ in res and type_ != "*":
        res[type_] = {}
    if names:
        for name in names:
            if not name in res[type_] and name != "*":
                res[type_][name] = []
                if languages:
                    for language in languages:
                        if not language in res[type_][name] and language != "*":
                            res[type_][name].append(language)
    # add resource to destination, overwriting existing resources
    hdst = win32api.BeginUpdateResource(dstpath, 0)
    for type_ in res:
        for name in res[type_]:
            for language in res[type_][name]:
                logger.info("Updating resource type %s name %s language %s",
                            type_, name, language)
                win32api.UpdateResource(hdst, type_, name, data, language)
    win32api.EndUpdateResource(hdst, 0)
812946
def record_add_types(object_id, input_params={}, always_retry=True, **kwargs):
    
    return DXHTTPRequest('/%s/addTypes' % object_id, input_params, always_retry=always_retry, **kwargs)
1255245
def add_required_resources(resources):
    
    required = [["variation", "cosmic"], ["variation", "clinvar"], ["variation", "dbsnp"],
                ["variation", "lcr"], ["variation", "polyx"],
                ["variation", "encode_blacklist"], ["variation", "gc_profile"],
                ["variation", "germline_het_pon"],
                ["variation", "train_hapmap"], ["variation", "train_indels"],
                ["variation", "editing"], ["variation", "exac"], ["variation", "esp"],
                ["variation", "gnomad_exome"],
                ["variation", "1000g"], ["aliases", "human"]]
    for key in required:
        if not tz.get_in(key, resources):
            resources = tz.update_in(resources, key, lambda x: None)
    return resources
1264892
public void setResourceTypes(List<String> resourceTypes) {

        if ((resourceTypes != null) && !resourceTypes.isEmpty()) {
            addFilterQuery(CmsSearchField.FIELD_TYPE, resourceTypes, false, false);
        }
    }
445643
def add(self, resource):
        
        if isinstance(resource, collections.Iterable):
            for r in resource:
                self.add_if_changed(r)
        else:
            self.add_if_changed(resource)
1012118
public void add(String[] types, OsgiModelSource<?> source) {
        for (String resourceType : types) {
            this.typeNameToModelSourcesMap.put(resourceType, source);
        }
        clearLookupCaches();
    }
129059
def update_from_dict(self, keywords):
        
        for key, value in list(keywords.items()):
            setattr(self, key, value)
627443
def update(self, other: 'Language') -> 'Language':
        
        return Language.make(
            language=other.language or self.language,
            extlangs=other.extlangs or self.extlangs,
            script=other.script or self.script,
            region=other.region or self.region,
            variants=other.variants or self.variants,
            extensions=other.extensions or self.extensions,
            private=other.private or self.private
        )
1295020
def get_resource_types(self):
        
        resource_types = set()
        for model in self.models():
            for field in self.model_file_fields(model):
                resource_type = field.storage.RESOURCE_TYPE
                resource_types.add(resource_type)
        return resource_types
544747
def get_resources(cls):
        """"""
        my_plurals = resource_helper.build_plural_mappings(
            {}, RESOURCE_ATTRIBUTE_MAP)
        attributes.PLURALS.update(my_plurals)
        attr_map = RESOURCE_ATTRIBUTE_MAP
        resources = resource_helper.build_resource_info(my_plurals,
                                                        attr_map,
                                                        constants.A10_DEVICE_INSTANCE)

        return resources