Create a filter in the ethereum node.
341592
def new_filter(
            self,
            contract_address: Address,
            topics: List[str] = None,
            from_block: BlockSpecification = 0,
            to_block: BlockSpecification = 'latest',
    ) -> StatelessFilter:
        
        logs_blocks_sanity_check(from_block, to_block)
        return StatelessFilter(
            self.web3,
            {
                'fromBlock': from_block,
                'toBlock': to_block,
                'address': to_checksum_address(contract_address),
                'topics': topics,
            },
        )
1314321
def filter(self, *args):
    """"""
    if not args:
      return self
    preds = []
    f = self.filters
    if f:
      preds.append(f)
    for arg in args:
      if not isinstance(arg, Node):
        raise TypeError('Cannot filter a non-Node argument; received %r' % arg)
      preds.append(arg)
    if not preds:
      pred = None
    elif len(preds) == 1:
      pred = preds[0]
    else:
      pred = ConjunctionNode(*preds)
    return self.__class__(kind=self.kind, ancestor=self.ancestor,
                          filters=pred, orders=self.orders,
                          app=self.app, namespace=self.namespace,
                          default_options=self.default_options,
                          projection=self.projection, group_by=self.group_by)
874077
def filterStack(self, filters):
        
        visited, removes, orphans = filter_stack(self.graph, self, filters)

        for last_good, tail in orphans:
            self.graph.add_edge(last_good, tail, edge_data='orphan')

        for node in removes:
            self.graph.hide_node(node)

        return len(visited)-1, len(removes), len(orphans)
1249031
def _build_filters(_filters):
    
    root = utils.NestedDict({})
    for _filter in _filters:
        operation = None
        for operation, token in SPLIT_TOKENS:
            # split "some.key=value" into ["some.key", "value"]
            top_parts = _filter.split(token, 1)
            if len(top_parts) == 2:
                break
        else:
            raise exceptions.CLIAbort('Failed to find valid operation for: %s'
                                      % _filter)

        key, value = top_parts
        current = root
        # split "some.key" into ["some", "key"]
        parts = [part.strip() for part in key.split('.')]

        # Actually drill down and add the filter
        for part in parts[:-1]:
            current = current[part]

        if operation == 'eq':
            current[parts[-1]] = utils.query_filter(value.strip())
        elif operation == 'in':
            current[parts[-1]] = {
                'operation': 'in',
                'options': [{
                    'name': 'data',
                    'value': [p.strip() for p in value.split(',')],
                }],
            }

    return root.to_dict()
1268581
protected Filter createFilter(final T configuration) {
        ShiroConfiguration shiroConfig = narrow(configuration);
        final IniWebEnvironment shiroEnv = new IniWebEnvironment();
        shiroEnv.setConfigLocations(shiroConfig.iniConfigs());
        shiroEnv.init();

        AbstractShiroFilter shiroFilter = new AbstractShiroFilter() {
            @Override
            public void init() throws Exception {
                Collection<Realm> realms = createRealms(configuration);
                WebSecurityManager securityManager = realms.isEmpty()
                        ? shiroEnv.getWebSecurityManager()
                        : new DefaultWebSecurityManager(realms);
                setSecurityManager(securityManager);
                setFilterChainResolver(shiroEnv.getFilterChainResolver());
            }
        };
        return shiroFilter;
    }
1073441
function(filters) {
      filters = _.clone(filters || {});
      var endpoint = api;

      if (config.parent && !filters[config.parent.key]) {
        throw new Error("fetchAll: must supply the parent.key as a filter to fetch all entities");
      }

      if (config.parent) {
        endpoint.one(config.parent.entity, filters[config.parent.key]);
        // since the filtering is happening in the endpoint url we dont need filters
        delete filters[config.parent.key];
      }

      return endpoint
        .all(config.entity)
        .filter(filters)
        .get()
        .then(function(results) {
          return results.map(this.create);
        // }.bind(this), console.error);
        }.bind(this), function(err) {console.log(err); throw new Error(err);});
    }
840526
@Override
	public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) {
		return chain.filter(exchange) //
				.subscriberContext(Context.of(SERVER_WEB_EXCHANGE, exchange));
	}
647179
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }
204040
function filter( node ) {
	var isNullable;
	var isOptional;
	var type;
	var desc;
	var val;

	if ( node.type ) {
		if ( node.type.names.length === 1 ) {
			type = node.type.names[ 0 ];
		} else {
			type = node.type.names;
		}
	} else {
		type = '';
	}
	desc = node.description || '';
	if ( hasOwn.call( node, 'defaultvalue' ) ) {
		val = node.defaultvalue;
	} else {
		val = '';
	}
	if ( typeof node.optional === 'boolean' ) {
		isOptional = node.optional;
	} else {
		isOptional = '';
	}
	if ( typeof node.nullable === 'boolean' ) {
		isNullable = node.nullable;
	} else {
		isNullable = '';
	}
	return {
		'name': node.name,
		'type': type,
		'description': desc,
		'default': val,
		'optional': isOptional,
		'nullable': isNullable
	};
}
322877
def filter(self, filter):
        
        new_query_set = self.clone()
        new_query_set.query.add_filter(filter)
        
        return new_query_set
898081
def add_filter_by_client(self, query, out_params):
        
        current_client = logged_in_client(self.context)
        if current_client:
            query['getClientUID'] = api.get_uid(current_client)
        elif self.request.form.get("ClientUID", ""):
            query['getClientUID'] = self.request.form['ClientUID']
            client = api.get_object_by_uid(query['getClientUID'])
            out_params.append({'title': _('Client'),
                               'value': client.Title(),
                               'type': 'text'})
639407
def make_event_filter(self, filter_key, filter_value):
        """"""
        event_filter = EventFilter(
            self.event_name,
            self.event,
            {filter_key: filter_value},
            from_block=self.from_block,
            to_block=self.to_block
        )
        event_filter.set_poll_interval(0.5)
        return event_filter
857182
function filter(/*DOM*/ elem) {

		// execute and remove jbst:oninit method
		var method = popMethod(elem, INIT);
		if ('function' === typeof method) {
			// execute in context of element
			method.call(elem);
		}

		// execute and remove jbst:onload method
		method = popMethod(elem, LOAD);
		if ('function' === typeof method) {
			// queue up to execute after insertion into parentNode
			setTimeout(function() {
				// execute in context of element
				method.call(elem);
				method = elem = null;
			}, 0);
		}

		if (JsonML.BST.filter) {
			return JsonML.BST.filter(elem);
		}

		return elem;
	}
576249
private FilterDescriptor createFilter(FilterType filterType, Map<String, FilterDescriptor> filters, ScannerContext context) {
        Store store = context.getStore();
        FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterType.getFilterName().getValue(), filters, store);
        setAsyncSupported(filterDescriptor, filterType.getAsyncSupported());
        for (DescriptionType descriptionType : filterType.getDescription()) {
            filterDescriptor.getDescriptions().add(XmlDescriptorHelper.createDescription(descriptionType, store));
        }
        for (DisplayNameType displayNameType : filterType.getDisplayName()) {
            filterDescriptor.getDisplayNames().add(XmlDescriptorHelper.createDisplayName(displayNameType, store));
        }
        FullyQualifiedClassType filterClass = filterType.getFilterClass();
        if (filterClass != null) {
            TypeResolver typeResolver = context.peek(TypeResolver.class);
            TypeCache.CachedType<TypeDescriptor> filterClassDescriptor = typeResolver.resolve(filterClass.getValue(), context);
            filterDescriptor.setType(filterClassDescriptor.getTypeDescriptor());
        }
        for (IconType iconType : filterType.getIcon()) {
            IconDescriptor iconDescriptor = XmlDescriptorHelper.createIcon(iconType, store);
            filterDescriptor.getIcons().add(iconDescriptor);
        }
        for (ParamValueType paramValueType : filterType.getInitParam()) {
            ParamValueDescriptor paramValueDescriptor = createParamValue(paramValueType, store);
            filterDescriptor.getInitParams().add(paramValueDescriptor);
        }
        return filterDescriptor;
    }
639803
function FilterLoadPacket(filter) {
  if (!(this instanceof FilterLoadPacket))
    return new FilterLoadPacket(filter);

  Packet.call(this);

  this.filter = filter || new Bloom();
}
1258933
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
		
		HttpServletResponse res = (HttpServletResponse)response;
		HttpServletRequest req = (HttpServletRequest)request;
		
		String et = req.getParameter("e");
		String h = req.getParameter("h");
		
		if(null == et || null == h) {
			badRequest(res);
			LOG.warn("et & h attributes are null; Bad request from IP: " + req.getRemoteAddr());
			return;
		}
			
		String baseUrl = req.getRequestURI();
		String passKey = secureUriMapper.getPassKey(baseUrl);		
		
		String salt = passKey + baseUrl + "?e=" + et;
		String hash = SpringExtensionsUtil.getMD5(salt);		
		if(!hash.trim().equals(h)) {
			badRequest(res);
			LOG.warn("Hash Value doesn't match; Bad request from IP: " + req.getRemoteAddr());
			return;
		}
		
		long expiryTime = Long.parseLong(et);		
		if(expiryTime > 0 && !(new Date().getTime() <= expiryTime)) {
			badRequest(res);
			LOG.warn("Secure Link expried, link accessed from IP: " + req.getRemoteAddr());
			return;
		}		
		
		/** making chain call for following filters*/
		chain.doFilter(request, response);
	}
1228084
def setup_filter(self, root_path, path_list):
        """"""
        self.root_path = osp.normpath(to_text_string(root_path))
        self.path_list = [osp.normpath(to_text_string(p)) for p in path_list]
        self.invalidateFilter()