Retuns a deep copy of the properties filtered by an allowed keywords list
169405
function clonePugOpts(opts, filename) {
    return PUGPROPS.reduce((o, p) => {
        if (p in opts) {
            o[p] = clone(opts[p]);
        }
        return o;
    }, { filename });
}
222365
def copy(input, **params):
    
    PARAM_FIELDS = 'fields'

    def filter_fields(obj, fields):
        return {k:v for k,v in obj.items() if k in fields}

    if PARAM_FIELDS in params:
        fields = params.get(PARAM_FIELDS)
        if isinstance(input, list):
            res = []
            for row in input:
                res.append(filter_fields(row, fields))
            return res
        elif isinstance(input, dict):
            return filter_fields(input, fields)
        else:
            raise NotImplementedError('{} is not supported'.format(type(input)))
    else:
        return input
582570
def filter_params(params):
    
    if params is not None:
        new_params = copy.deepcopy(params)
        new_params = dict((k, v) for k, v in new_params.items() if v is not None)
        for key, value in new_params.items():
            if isinstance(value, bool):
                new_params[key] = "true" if value else "false"
        return new_params
163682
function applyFilter(data, restrictedFields, allowedFields) {
    var filterFunc;

    // if string, something like a sort where each word should be a value
    var isString = _.isString(data);
    if (isString) { data = data.split(' '); }

    if (restrictedFields) {
        filterFunc = _.isArray(data) ? removeItemsFromList : removeFieldsFromObj;
        data = filterFunc(data, restrictedFields);
    }
    else if (allowedFields) {
        filterFunc = _.isArray(data) ? getItemsFromList : getFieldsFromObj;
        data = filterFunc(data, allowedFields);
    }

    return isString ? data[0] : data;
}
152117
def filter_properties(self, model, context=None):
        
        if model is None:
            return

        for property_name in self.properties:
            prop = self.properties[property_name]
            value = self.get(model, property_name)
            if value is None:
                continue

            filtered_value = prop.filter(
                value=value,
                model=model,
                context=context
            )
            if value != filtered_value:  # unless changed!
                self.set(model, property_name, filtered_value)
339342
function copyNonHalProperties(unparsed, resource) {
  Object.keys(unparsed).forEach(function(key) {
    if (key !== '_links' && key !== '_embedded') {
      resource[key] = unparsed[key];
    }
  });
}
841515
def filtered_entries(self):
        """"""
        return [
            e for e in self.entries if not any(fnmatch.fnmatch(e.name.lower(), p.lower()) for p in self.exclude_list)
        ]
1122181
def filtered_keys
      values.keys.reject { |k| k == :title || !attr_def[k] || (attr_def[k][:behaviour] == :namevar && @namevars.size == 1) }
    end
979682
function deepCopy(destination, source) {
    Object.keys(source).forEach(function (property) {
        if (destination[property] && isObject(destination[property])) {
            deepCopy(destination[property], source[property]);
        } else {
            destination[property] = source[property];
        }
    });
}
182095
def filter_query(filter_dict, required_keys):
    """"""
    if not isinstance(filter_dict, dict):
        raise TypeError("dict_list is not a list. Please try again")

    if not isinstance(required_keys, list):
        raise TypeError("dict_list is not a list. Please try again")

    available = []
    for k,v in filter_dict.items():
        # print(k, v)
        if k in required_keys:
            available.append(k)
    return available
388622
def _remove_keywords(d):
    
    return { k:v for k, v in iteritems(d) if k not in RESERVED }
295650
function filterForKeyword(extensionList, word) {
            var filteredList = [];
            extensionList.forEach(function (id) {
                var entry = self._getEntry(id);
                if (entry && self._entryMatchesQuery(entry, word)) {
                    filteredList.push(id);
                }
            });
            return filteredList;
        }
1100151
function getKeywords(keywords) {
  let arrs = [];

  utils._each(keywords, (v, k) => {
    if (utils.isArray(v)) {
      let values = [];
      utils._each(v, (val) => {
        val = utils.getValueString('keywords.' + k, val);
        if (val) { values.push(val); }
      });
      v = values;
    } else {
      v = utils.getValueString('keywords.' + k, v);
      if (utils.isStr(v)) {
        v = [v];
      } else {
        return;
      } // unsuported types - don't send a key
    }
    arrs.push({key: k, value: v});
  });

  return arrs;
}
997610
def _generate_filtered_properties(self, props, filters):
        
        # by default no properties are returned
        if props and filters:
            return (props
                    if '*' in filters
                    else dict(((k, v) for k, v in props.items() if k in filters)))
120099
def re(self, event_property, value):
        
        c = self.copy()
        c.filters.append(filters.RE(event_property, value))
        return c
418993
def filter_protected(f):
    
    def new_f(self, *args, **kwargs):
        for obj in f(self, *args, **kwargs):
            if self.protected == False:
                if 'user' in obj and obj['user']['protected']:
                    continue
                elif 'protected' in obj and obj['protected']:
                    continue
            yield obj

    return new_f
175718
private List<Column> filterKeyColumn(CqlRow row) {
    if ( suppressKeyInColumns && row.isSetColumns() && row.columns.size() > 0) {
      Iterator<Column> columnsIterator = row.getColumnsIterator();
      Column column = columnsIterator.next();
      if ( column.name.duplicate().equals(KEY_BB) ) {
        columnsIterator.remove();  
      }      
    }
    return row.getColumns();
  }