Remove fields that are found in omit list, and if sparse names
            are passed, remove any fields not found in that list.
197606
def _clean_fields(self, omit_fields, sparse_fields, next_level_omits):
        
        sparse = len(sparse_fields) > 0
        to_remove = []

        if not sparse and len(omit_fields) == 0:
            return

        for field_name in self.fields:
            is_present = self._should_field_exist(
                field_name, omit_fields, sparse_fields, next_level_omits
            )

            if not is_present:
                to_remove.append(field_name)

        for remove_field in to_remove:
            self.fields.pop(remove_field)
1268182
function removeBadFields(attrs){
	var badList = ['scores', 'table', 'headers'];
	for(var k in badList){
		if(attrs[badList[k]])
			delete attrs[badList[k]];
	}
}
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
969865
def clear_list_value(self, value):
        
        # Don't go any further: this value is empty.
        if not value:
            return self.empty_value
        # Clean empty items if wanted
        if self.clean_empty:
            value = [v for v in value if v]
        return value or self.empty_value
970479
public void removeAll()
    {
        if (m_aRecords != null)
        {
            for (int iArrayIndex = 0; iArrayIndex < MAX_RECORD_ARRAY_SIZE; iArrayIndex++)
            {   // Free the objects that are no longer used
                this.freeElement(m_aRecords[iArrayIndex]);
                m_aRecords[iArrayIndex] = null;
            }
            m_aRecords = null;
        }
        m_iRecordListStep = 1;
        m_iRecordListEnd = 0;
        m_iRecordListMax = 0; // Current size of the record list (records scanned) (-1 - unknown)
    }
1020180
def filter_fields(self, fields=[], exclude=[], include_all_if_empty=True):
        
        if not include_all_if_empty and not fields:
            return []
        ret = []
        for f in self.visible_fields():
            if fields and f.name not in fields:
                continue
            if exclude and f.name in exclude:
                continue
            ret.append(f)
        return ret
672885
void clear(int list) {
		int last = getLast(list);
		while (last != nullNode()) {
			int n = last;
			last = getPrev(n);
			freeNode_(n);
		}
		m_lists.setField(list, 0, -1);
		m_lists.setField(list, 1, -1);
		setListSize_(list, 0);
	}
1364760
def _from_rest_ignore(model, props):
    

    fields = model.all_fields

    for prop in props.keys():
        if prop not in fields:
            del props[prop]
1317164
protected void removeUnmappedFields(JdbcIndex<?> index) {
        Iterator<IndexField<?>> iterator = index.getFields().iterator();

        while (iterator.hasNext()) {
            IndexField<?> field = iterator.next();

            if (field.getMappedType() == null) {
                LOG.info("Removing {} from index {} - no mapped type information", field.getName(), index.getName());
                iterator.remove();
            }
        }

    }
387560
private void keepLowestMatches(final List<Match> matches)
    {
        Set<Match> to_remove = new HashSet<>();
        for (Match match : matches)
        {
            for (Match to_compare : matches)
            {
                if (match.getStartIndex() == to_compare.getStartIndex() && match.getEndIndex() == to_compare.getEndIndex())
                {
                    if (match.calculateEntropy() / match.getLength() > to_compare.calculateEntropy() / to_compare.getLength())
                    {
                        to_remove.add(match);
                        break;
                    }
                }
            }
        }
        matches.removeAll(to_remove);
    }
1079111
public <T extends Dict> void removeEqual(T dict, String... withoutNames) {
		HashSet<String> withoutSet = CollectionUtil.newHashSet(withoutNames);
		for (Map.Entry<String, Object> entry : dict.entrySet()) {
			if (withoutSet.contains(entry.getKey())) {
				continue;
			}

			final Object value = this.get(entry.getKey());
			if (null != value && value.equals(entry.getValue())) {
				this.remove(entry.getKey());
			}
		}
	}
1155632
def _remove_none_values(dictionary):
    
    return list(map(dictionary.pop,
                    [i for i in dictionary if dictionary[i] is None]))
664873
def remove(self, val):
        
        _maxes = self._maxes

        if not _maxes:
            raise ValueError('{0} not in list'.format(repr(val)))

        pos = bisect_left(_maxes, val)

        if pos == len(_maxes):
            raise ValueError('{0} not in list'.format(repr(val)))

        _lists = self._lists
        idx = bisect_left(_lists[pos], val)
        if _lists[pos][idx] == val:
            self._delete(pos, idx)
        else:
            raise ValueError('{0} not in list'.format(repr(val)))
107477
public static List<String> removeDuplicates(List<String> list) {
		return list.stream().distinct().collect(Collectors.toList());
	}
359358
def clear(self):
        
        self.__modified_data__ = {}
        self.__deleted_fields__ = [field for field in self.__original_data__.keys()]
101554
function omit(keys, object){
  var ret = {};

  for (var item in object) {
    ret[item] = object[item];
  }

  for (var i = 0; i < keys.length; i++) {
    delete ret[keys[i]];
  }
  return ret;
}
478083
def filter_excluded_fields(fields, Meta, exclude_dump_only):
    
    exclude = list(getattr(Meta, "exclude", []))
    if exclude_dump_only:
        exclude.extend(getattr(Meta, "dump_only", []))

    filtered_fields = OrderedDict(
        (key, value) for key, value in fields.items() if key not in exclude
    )

    return filtered_fields