Filters the given variable set based on request parameters
175098
def get_variable_set(self, variable_set, data):
        """"""

        if data.get('dynamic_layers'):
            variable_set = []  # TODO
        elif data.get('layers'):
            op, layer_ids = data['layers'].split(':', 1)
            op = op.lower()
            layer_ids = [int(x) for x in layer_ids.split(',')]

            if op in ('show', 'include'):
                variable_set = [x for x in variable_set if x.index in layer_ids]
            elif op in ('hide', 'exclude'):
                variable_set = [x for x in variable_set if x.index not in layer_ids]
        elif self.service.render_top_layer_only:
            variable_set = [variable_set[0]]

        return variable_set
163882
private static StringMap filterParam(StringMap params) {
        final StringMap ret = new StringMap();
        if (params == null) {
            return ret;
        }
        params.forEach(new StringMap.Consumer() {
            @Override
            public void accept(String key, Object value) {
                if (value == null) {
                    return;
                }
                String val = value.toString();
                if ((key.startsWith("x:") || key.startsWith("x-qn-meta-")) && !val.equals("")) {
                    ret.put(key, val);
                }
            }
        });
        return ret;
    }
558834
def query_string(context, **kwargs):
    """"""
    params = context["request"].GET.copy()

    for key, value in list(kwargs.items()):
        params[key] = value

    return "?" + params.urlencode()
1210454
function filterQuery(query = {}, ...keys) {
  const out = {};
  keys.forEach((key) => {
    if (query[key] !== undefined && query[key] !== null) {
      out[key] = query[key];
    }
  });
  return out;
}
1025691
public void filter(ClientRequestContext request) throws IOException
    {
        if(!request.getHeaders().containsKey("X-Api-Key"))
            request.getHeaders().add("X-Api-Key", this.apikey);
    }
1271125
def filter_url(url, **kwargs):
    """"""

    d = parse_url_to_dict(url)

    d.update(kwargs)

    return unparse_url_dict({k: v for k, v in list(d.items()) if v})
25174
@SuppressWarnings("unchecked")
    public final void filter(AnyValue property, String clazzname, URL url) {
        filter(property, clazzname, true, url);
    }
787036
def filter(params)
      if @filter_params
        filtered_params = {}
        params.each { |k, p| filtered_params[k] = @filter_params.include?(k.to_s) ? FILTERED_PARAM_VALUE : p }
        filtered_params
      end
    end
710072
def filter(self, table, idps, filter_string):
        """"""
        q = filter_string.lower()
        return [idp for idp in idps
                if q in idp.ud.lower()]
20168
def prepare_params(request):
    """"""
    return request.replace(
        params={key: dump_param(val) for key, val in request.params.items()
                if val is not None})
1178968
def _check_params(ignored_variables, ignored_interactions):
    """"""

    if ignored_variables is None:
        ignored_variables = set()
    elif not isinstance(ignored_variables, abc.Container):
        ignored_variables = set(ignored_variables)

    if ignored_interactions is None:
        ignored_interactions = set()
    elif not isinstance(ignored_interactions, abc.Container):
        ignored_interactions = set(ignored_interactions)

    return ignored_variables, ignored_interactions
414434
def filter(self, data, collection, **kwargs):
        """"""
        if not data or self.filters is None:
            return None, collection

        filters = {}
        for f in self.filters:
            if f.name not in data:
                continue
            ops, collection = f.filter(collection, data, **kwargs)
            filters[f.name] = ops

        return filters, collection
1029712
def filter_params(self, value):
        
        if value is None:
            return {}

        val_min = value.get('min', None)
        val_max = value.get('max', None)
        params = {}

        if val_min == val_max:
            return { self.target: val_min }

        key = self.target + "__"
        if val_min is not None:
            params[key+self.lookup_types[0]] = val_min
        if val_max is not None:
            params[key+self.lookup_types[1]] = val_max

        return params
344911
private List<String> resolveVariable(String filter, String text) {
    List<String> ret = new ArrayList<>();
    Matcher m = PATTERN.matcher(text);
    while (m.find()) {
      ParsedStatement statement = ParsedStatement.fromMatcher(m);
      if (statement != null && statement.getVariable().startsWith(filter)) {
        ret.add(statement.getVariable());
      }
    }
    return ret;
  }
675682
def filter(self, resource_manager, **params):
        """"""
        m = self.resolve(resource_manager.resource_type)
        client = local_session(self.session_factory).client(m.service)

        enum_op, path, extra_args = m.enum_spec
        if extra_args:
            params.update(extra_args)

        parent_type, parent_key, annotate_parent = m.parent_spec
        parents = self.manager.get_resource_manager(parent_type)
        parent_ids = [p[parents.resource_type.id] for p in parents.resources()]

        # Bail out with no parent ids...
        existing_param = parent_key in params
        if not existing_param and len(parent_ids) == 0:
            return []

        # Handle a query with parent id
        if existing_param:
            return self._invoke_client_enum(client, enum_op, params, path)

        # Have to query separately for each parent's children.
        results = []
        for parent_id in parent_ids:
            merged_params = self.get_parent_parameters(params, parent_id, parent_key)
            subset = self._invoke_client_enum(
                client, enum_op, merged_params, path, retry=self.manager.retry)
            if annotate_parent:
                for r in subset:
                    r[self.parent_key] = parent_id
            if subset and self.capture_parent_id:
                results.extend([(parent_id, s) for s in subset])
            elif subset:
                results.extend(subset)
        return results
1219282
def _filter(self, objects, **kwargs):
        """"""
        for obj in objects:
            if self.filter(obj, **kwargs) is False:
                return False

        return True
492044
function valueFilteredByFields(fieldName, item, options) {
	if (!inFields(fieldName, options)) return null;
	return item.dataValues[fieldName];
}