drop all fields that aren't found in the attributes array
435392
function cleanup(a) {
      return _.filter(a, function (a) {
        var field = a[0];
        return attr[field];
      });
    }
549311
def select_fields(self, *fields):
        """"""
        if fields:
            if not isinstance(fields[0], basestring): 
                fields = list(fields[0]) + list(fields)[1:]

        for field_name in fields:
            field_name = self._normalize_field_name(field_name)
            self.select_field(field_name)
        return self
1214987
function removeDuplicateAttributes(attrs) {
    var attrsNames = [],
        res = [];

    _.forEach(attrs, function (attr) {
        if (attrsNames.indexOf(attr.name) === -1) {
            res.push(attr);
            attrsNames.push(attr.name);
        }
    });

    return res;
}
594487
private static Field[] removeMetaFields(Field[] fields) {
		Field[] realFields = new Field[fields.length - 1];
		//We'll delete at least one, sometimes more than one field (because there's at least the r$type field).
		int i = 0;
		for (Field field : fields) {
			if (!field.getName().startsWith(Constants.PREFIX)) {
				realFields[i++] = field;
			}
		}
		if (i < realFields.length) {
			realFields = Utils.arrayCopyOf(realFields, i);
		}
		if (GlobalConfiguration.assertsMode) {
			Utils.assertTrue(i == realFields.length, "Bug in removeMetaFields, created array of wrong length");
		}
		return realFields;
	}
596497
def hide_defaults(self):
        """"""
        for k in list(self.fields.keys()):
            if k in self.default_fields:
                if self.default_fields[k] == self.fields[k]:
                    del(self.fields[k])
        self.payload.hide_defaults()
1331585
protected void removeEmptyResourceFields() {

        Set<Component> componentsToRemove = new HashSet<Component>();
        int count = 0;
        Component lastElement = null;

        for (Component c : m_resources) {
            if (c instanceof CmsRemovableFormRow<?>) {
                count++;
                AbstractField<?> field = (AbstractField<?>)((CmsRemovableFormRow)c).getInput();
                String value = (String)(field.getValue());
                if (value.isEmpty()) {
                    componentsToRemove.add(c);
                    lastElement = c;
                }
            }
        }

        //if all fields are empty -> keep one of them to attach validator to
        if (componentsToRemove.size() == count) {
            componentsToRemove.remove(lastElement);
        }

        if (count == 0) {
            addResource("");
        }

        for (Component c : componentsToRemove) {
            m_resources.removeComponent(c);
            m_componentsToValidate.remove(c);
        }
    }
785320
public function removeSystemFields()
    {
        $properties = $this->fields;
        unset(
            $properties['created'],
            $properties['changed'],
            $properties['changer'],
            $properties['changer_id'],
            $properties['creator'],
            $properties['creator_id']
        );

        foreach ($properties as $key => $field) {
            // remove system fields
            if ('__' == substr($key, 0, 2)) {
                continue;
            }

            $this->properties[$key] = $field->getValue();
        }
    }
562947
public function generateRemovedFields()
    {
        foreach ($this->keptModelKeys as $modelName) {
            $oldFieldKeys = $this->oldFieldKeys[$modelName];
            $newFieldKeys = $this->newFieldKeys[$modelName];

            $remFields = array_diff($oldFieldKeys, $newFieldKeys);

            foreach ($remFields as $remField) {
                $this->findRemovedFields($modelName, $remField);
            }
        }
    }
1312813
private static function scrubAttributes($field, $type = null)
    {
        $invalid_keys = [
            'default',
            'description',
            'label',
            'options',
        ];

        if ($type && $type ==='textarea') {
            $invalid_keys[] = 'value';
        }

        foreach ($invalid_keys as $invalid_key) {
            if (array_key_exists($invalid_key, $field)) {
                unset($field[$invalid_key]);
            }
        }
        return $field;
    }
88492
def _delete_fields(self):
        
        for key in self._json_dict.keys():
            if not key.startswith("_"):
                delattr(self, key)
        self._json_dict = {}
        self.id = None
        self.name = None
391986
def removeAttribute(self, attrName):
        '''
            

        '''
        attrName = attrName.lower()

        # Delete provided attribute name ( #attrName ) from attributes map
        try:
            del self._attributes[attrName]
        except KeyError:
            pass
1333575
def drop_field(app_name, model_name, field_name):
    
    app_config = apps.get_app_config(app_name)
    model = app_config.get_model(model_name)
    field = model._meta.get_field(field_name)
    with connection.schema_editor() as schema_editor:
        schema_editor.remove_field(model, field)
94112
function removeAttrsValues(attrs, ignoreAttributes) {
    _.forEach(ignoreAttributes, function (attr) {
        var attrIndexes = _getIndexesInArray(attrs, attr);

        _.forEach(attrIndexes, function (index) {
            attrs[index].value = '';
        });
    });

    return attrs;
}
910318
function cleanAttrs (el, attrs, styles) {  // attrs === false - remove all, attrs === true - allow all
  if (attrs === true) { return; }

  Array.prototype.slice.call(el.attributes)
    .forEach(function (attr) {
      // remove if it is not style nor on attrs  whitelist
      // keeping attributes that are also styles because attributes override
      if (attr.specified) {
        if (attrs === '' || attrs === false || (isUndefined(styles[attr.name]) && attrs.indexOf(attr.name) < 0)) {
          el.removeAttribute(attr.name);
        }
      }
    });
}
694956
def remove_current_specific_fields(obj):
    """"""
    obj = remove_global_dynamo_specific_fields(obj)

    obj.pop("ttl", None)
    obj.pop("eventSource", None)

    return obj
61836
def remove_all_attributes(element, exclude=None):
    
    if exclude is None:
        exclude = []
    for k in element.attrib.keys():
        if k not in exclude:
            element.attrib.pop(k)
332898
function filterOutNullData(fieldValues) {
  return _.filter(fieldValues || [], function(val) {
    return val === false || val === 0 || val;
  });
}