Remove properties from an instance that aren't in the PropertyList

    inst -- The CIMInstance
    plist -- The property List, or None.  The list items must be all
        lowercase.
166609
def filter_instance(inst, plist):
    

    if plist is not None:
        for pname in inst.properties.keys():
            if pname.lower() not in plist:
                del inst.properties[pname]
1026221
def del_properties(elt, keys=None, ctx=None):
    

    # get the best context
    if ctx is None:
        ctx = find_ctx(elt=elt)

    elt_properties = _ctx_elt_properties(elt=elt, ctx=ctx, create=False)

    # if elt properties exist
    if elt_properties is not None:

        if keys is None:
            keys = list(elt_properties.keys())

        else:
            keys = ensureiterable(keys, iterable=tuple, exclude=str)

        for key in keys:
            if key in elt_properties:
                del elt_properties[key]

        # delete property component if empty
        if not elt_properties:
            # case of dynamic object
            if isinstance(getattr(ctx, '__dict__', None), dict):
                try:
                    if elt in ctx.__dict__[__B3J0F__PROPERTIES__]:
                        del ctx.__dict__[__B3J0F__PROPERTIES__][elt]
                except TypeError:  # if elt is unhashable
                    elt = id(elt)
                    if elt in ctx.__dict__[__B3J0F__PROPERTIES__]:
                        del ctx.__dict__[__B3J0F__PROPERTIES__][elt]
                # if ctx_properties is empty, delete it
                if not ctx.__dict__[__B3J0F__PROPERTIES__]:
                    del ctx.__dict__[__B3J0F__PROPERTIES__]

            # case of static object and hashable
            else:
                if isinstance(ctx, Hashable):
                    cache = __STATIC_ELEMENTS_CACHE__
                else:  # case of static and unhashable object
                    cache = __UNHASHABLE_ELTS_CACHE__
                    ctx = id(ctx)
                    if not isinstance(elt, Hashable):
                        elt = id(elt)

                # in case of static object
                if ctx in cache:
                    del cache[ctx][elt]
                    if not cache[ctx]:
                        del cache[ctx]
419622
public List<RawComponent> removeExperimentalComponents(String name) {
		List<RawComponent> all = getExperimentalComponents();
		List<RawComponent> toRemove = new ArrayList<RawComponent>();
		for (RawComponent property : all) {
			if (property.getName().equalsIgnoreCase(name)) {
				toRemove.add(property);
			}
		}

		all.removeAll(toRemove);
		return Collections.unmodifiableList(toRemove);
	}
446692
public static function ClearList(){
            $oThis = self::CreateInstanceIfNotExists();
            
            if(preg_match('/{list\:(.*?)}/', $oThis->sBuffer, $aMatches) == 1){
                $sListName = $aMatches[1]; 

                $iStart = strpos($oThis->sBuffer, "{list:{$sListName}}");

                if($iStart > 0)
                    $iEnd = strpos($oThis->sBuffer, "{end}", $iStart);

                if($iStart > 0 && $iEnd > 0)
                    $sList = substr($oThis->sBuffer, $iStart, $iEnd-$iStart)."{end}";

                $oThis->sBuffer = str_replace($sList, "", $oThis->sBuffer);
            }
        }
1042712
def _exclude(self, member):
        '''
        
        '''
        if isinstance(member, string_types):
            return None

        for item in self.opts['spm_build_exclude']:
            if member.name.startswith('{0}/{1}'.format(self.formula_conf['name'], item)):
                return None
            elif member.name.startswith('{0}/{1}'.format(self.abspath, item)):
                return None
        return member
934911
def discard(self, value):
        
        _set = self._set
        if value in _set:
            _set.remove(value)
            self._list.discard(value)
353441
def p_instance_bodylist_noname(self, p):
        ''
        p[0] = p[1] + (p[3],)
        p.set_lineno(0, p.lineno(1))
969189
def bust_caches(cls, obj, excludes=()):
        
        for name, _ in cls.get_cached_properties(obj):
            if name in obj.__dict__ and not name in excludes:
                delattr(obj, name)
1283959
def _remove_classorigin(obj):
        
        assert isinstance(obj, (CIMInstance, CIMClass))
        for prop in obj.properties:
            obj.properties[prop].class_origin = None
        if isinstance(obj, CIMClass):
            for method in obj.methods:
                obj.methods[method].class_origin = None
1261950
def _remove(self, obj):
        """"""
        for idx, item in enumerate(self._queue):
            if item == obj:
                del self._queue[idx]
                break
1264154
def remove_properties(self):
        
        if self.features_layer is not None:
            self.features_layer.remove_properties()

        if self.header is not None:
            self.header.remove_lp('features')
985873
def MI_enumInstances(self,
                         env,
                         ns,
                         propertyList,
                         requestedCimClass,
                         cimClass):
        # pylint: disable=invalid-name
        
        logger = env.get_logger()
        logger.log_debug('CIMProvider MI_enumInstances called...')
        keyNames = get_keys_from_class(cimClass)
        plist = None
        if propertyList is not None:
            lkns = [kn.lower() for kn in keyNames]
            props = pywbem.NocaseDict()
            plist = [s.lower() for s in propertyList]
            pklist = plist + lkns
            [props.__setitem__(p.name, p) for p in cimClass.properties.values()
             if p.name.lower() in pklist]
        else:
            props = cimClass.properties
        _strip_quals(props)
        path = pywbem.CIMInstanceName(classname=cimClass.classname,
                                      namespace=ns)
        model = pywbem.CIMInstance(classname=cimClass.classname,
                                   properties=props, path=path)
        gen = self.enum_instances(env=env,
                                  model=model,
                                  cim_class=cimClass,
                                  keys_only=False)
        try:
            iter(gen)
        except TypeError:
            logger.log_debug('CIMProvider MI_enumInstances returning')
            return
        for inst in gen:
            inst.path = build_instance_name(inst, keyNames)
            if self.filter_results and plist is not None:
                inst = inst.copy()
                filter_instance(inst, plist)
            yield inst
        logger.log_debug('CIMProvider MI_enumInstances returning')
84508
def MI_getInstance(self,
                       env,
                       instanceName,
                       propertyList,
                       cimClass):
        # pylint: disable=invalid-name
        

        logger = env.get_logger()
        logger.log_debug('CIMProvider MI_getInstance called...')
        keyNames = get_keys_from_class(cimClass)
        plist = None
        if propertyList is not None:
            lkns = [kn.lower() for kn in keyNames]
            props = pywbem.NocaseDict()
            plist = [s.lower() for s in propertyList]
            pklist = plist + lkns
            [props.__setitem__(p.name, p) for p in cimClass.properties.values()
             if p.name.lower() in pklist]
        else:
            props = cimClass.properties
        _strip_quals(props)
        model = pywbem.CIMInstance(classname=instanceName.classname,
                                   properties=props,
                                   path=instanceName)
        for k, v in instanceName.keybindings.items():
            type_ = cimClass.properties[k].type

            if type_ != 'reference':
                v = val = pywbem.tocimobj(_type, v)
            model.__setitem__(k, pywbem.CIMProperty(name=k, type=type_,
                                                    value=v))

        rval = self.get_instance(env=env,
                                 model=model,
                                 cim_class=cimClass)
        if self.filter_results:
            filter_instance(rval, plist)
        logger.log_debug('CIMProvider MI_getInstance returning')
        if rval is None:
            raise pywbem.CIMError(pywbem.CIM_ERR_NOT_FOUND, "")
        return rval
650131
function removeDupProperties(selector) {
  // Remove duplicated properties from bottom to top ()
  for (let actIndex = selector.nodes.length - 1; actIndex >= 1; actIndex--) {
    for (let befIndex = actIndex - 1; befIndex >= 0; befIndex--) {
      if (selector.nodes[actIndex].prop === selector.nodes[befIndex].prop) {
        selector.nodes[befIndex].remove();
        actIndex--;
      }
    }
  }
}
423068
def delete(cls, resources, background=False, force=False):
        """"""
        if not isinstance(resources, (list, tuple)):
            resources = [resources]

        ifaces = []
        for item in resources:
            try:
                ip_ = cls.info(item)
            except UsageError:
                cls.error("Can't find this ip %s" % item)

            iface = Iface.info(ip_['iface_id'])
            ifaces.append(iface['id'])

        return Iface.delete(ifaces, background)
1291100
def _clean_props(self):
        
        remove = []
        for p in self.properties.keys():
            if not hasattr(self.ic, p) and \
              p not in self.ic.bands and p not in ['parallax','feh','age','mass_B','mass_C'] and \
              not re.search('delta_',p):
                remove.append(p)

        for p in remove:
            del self.properties[p]

        if len(remove) > 0:
            logging.warning('Properties removed from Model because ' +
                            'not present in {}: {}'.format(type(self.ic),remove))

        remove = []
        for p in self.properties.keys():
            try:
                val = self.properties[p][0]
                if not np.isfinite(val):
                    remove.append(p)
            except:
                pass

        for p in remove:
            del self.properties[p]

        if len(remove) > 0:
            logging.warning('Properties removed from Model because ' +
                            'value is nan or inf: {}'.format(remove))
        


        self._props_cleaned = True
1164355
def remove(self, cls, originalMemberNameList, classNamingConvention):
        
        self._memberDelegate.remove(cls = cls,
                                    originalMemberNameList = originalMemberNameList,
                                    memberName = self._memberName,
                                    classNamingConvention = classNamingConvention)