Downloads (and compiles) osmfilter tool from web and
    calls that osmfilter to only filter out only the road elements.
770002
def filter_osm_file():
    

    print_info('Filtering OSM file...')
    start_time = time.time()

    if check_osmfilter():
        # params = '--keep="highway=motorway =motorway_link =trunk =trunk_link =primary =primary_link =secondary' \
        # 		 ' =secondary_link =tertiary =tertiary_link =unclassified =unclassified_link =residential =residential_link' \
        # 		 ' =living_street" --drop="access=no"'
        params = config.osm_filter_params

        command = './osmfilter' if platform.system() == 'Linux' else 'osmfilter.exe'

        if platform.system() == 'Linux':
            filter_command = '%s "%s" %s | pv > "%s"' % (command, config.osm_map_filename, params,
                                                         config.filtered_osm_filename)
        else:
            filter_command = '%s "%s" %s > "%s"' % (
            command, config.osm_map_filename, params, config.filtered_osm_filename)
        os.system(filter_command)
    else:
        print_info('Osmfilter not available. Exiting.')
        exit(1)

    print_info('Filtering finished. (%.2f secs)' % (time.time() - start_time))
1223355
function filterStats(result, track, outbound) {
  var streamStatsType = outbound ? 'outbound-rtp' : 'inbound-rtp';
  var filteredResult = new Map();
  if (track === null) {
    return filteredResult;
  }
  var trackStats = [];
  result.forEach(function(value) {
    if (value.type === 'track' &&
        value.trackIdentifier === track.id) {
      trackStats.push(value);
    }
  });
  trackStats.forEach(function(trackStat) {
    result.forEach(function(stats) {
      if (stats.type === streamStatsType && stats.trackId === trackStat.id) {
        walkStats(result, stats, filteredResult);
      }
    });
  });
  return filteredResult;
}
230599
private void loadFilteredPath(String filter) {
        if (filter == null) return;
        filter = getSlashyPath(filter);
        int starIndex = filter.indexOf(WILDCARD);
        if (starIndex == -1) {
            addFile(new File(filter));
            return;
        }
        boolean recursive = filter.contains(ALL_WILDCARD);

        if (filter.lastIndexOf('/') < starIndex) {
            starIndex = filter.lastIndexOf('/') + 1;
        }
        String startDir = filter.substring(0, starIndex - 1);
        File root = new File(startDir);

        filter = Pattern.quote(filter);
        filter = filter.replaceAll("\\" + WILDCARD + "\\" + WILDCARD, MATCH_ALL);
        filter = filter.replaceAll("\\" + WILDCARD, MATCH_FILE_NAME);
        Pattern pattern = Pattern.compile(filter);

        final File[] files = root.listFiles();
        if (files != null) {
            findMatchingFiles(files, pattern, recursive);
        }
    }
1111349
private Set<URL> filterURLs(final Set<URL> urls) {
		final Set<URL> results = new HashSet<URL>(urls.size());
		for (final URL url : urls) {
			String cleanURL = url.toString();
			// Fix JBoss URLs
			if (url.getProtocol().startsWith("vfszip:")) {
				cleanURL = cleanURL.replaceFirst("vfszip:", "file:");
			} else if (url.getProtocol().startsWith("vfsfile:")) {
				cleanURL = cleanURL.replaceFirst("vfsfile:", "file:");
			}
			cleanURL = cleanURL.replaceFirst("\\.jar/", ".jar!/");
			try {
				results.add(new URL(cleanURL));
			} catch (final MalformedURLException ex) {
				// Shouldn't happen, but we can't do more to fix this URL.
			}
		}
		return results;
	}
442419
private ZapMenuItem getMenuToolsFilter() {
		if (menuToolsFilter == null) {
			menuToolsFilter = new ZapMenuItem("menu.tools.filter");
			menuToolsFilter.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    

					FilterDialog dialog = new FilterDialog(getView().getMainFrame());
				    dialog.setAllFilters(filterFactory.getAllFilter());
				    dialog.showDialog(false);

					boolean startThread = false;
					for (Filter filter : filterFactory.getAllFilter()) {
						if (filter.isEnabled()) {
							startThread = true;
							break;
						}
					}

					if (startThread) {
						if (timerFilterThread == null) {
							timerFilterThread = new TimerFilterThread(filterFactory.getAllFilter());
							timerFilterThread.start();
						}
					} else if (timerFilterThread != null) {
						timerFilterThread.setStopped();
						timerFilterThread = null;
					}
				}
			});

		}
		return menuToolsFilter;
	}
1109750
void filterTree(String filter) {

        HierarchicalContainer container = (HierarchicalContainer)m_tree.getContainerDataSource();
        container.removeAllContainerFilters();
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(filter)) {
            final String lowerCaseFilter = filter.toLowerCase();
            container.addContainerFilter(new Filter() {

                private static final long serialVersionUID = 1L;

                public boolean appliesToProperty(Object propertyId) {

                    return true;
                }

                public boolean passesFilter(Object itemId, Item item) throws UnsupportedOperationException {

                    CmsCategory cat = (CmsCategory)itemId;

                    return cat.getPath().toLowerCase().contains(lowerCaseFilter)
                        || ((cat.getTitle() != null) && cat.getTitle().toLowerCase().contains(lowerCaseFilter));
                }
            });
        }
    }
1203443
function filterFiles (filters) {
  return (files, metalsmith, done) => {
    filter(files, filters, metalsmith.metadata(), done)
  }
}
950759
function filter(fp, opts) {
  if (opts && opts.filter) {
    return opts.filter(fp, opts);
  }
  return /[^x]\.js$/.test(fp);
}
739804
public static license_file[] get_filtered(nitro_service service, String filter) throws Exception
	{
		license_file obj = new license_file();
		options option = new options();
		option.set_filter(filter);
		license_file[] response = (license_file[]) obj.getfiltered(service, option);
		return response;
	}
901578
public FilterType<WebFragmentType<T>> getOrCreateFilter()
   {
      List<Node> nodeList = childNode.get("filter");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new FilterTypeImpl<WebFragmentType<T>>(this, "filter", childNode, nodeList.get(0));
      }
      return createFilter();
   }
1222071
public void addFilter(final WebAppFilter filter) {
		NullArgumentException.validateNotNull(filter, "Filter");
		NullArgumentException.validateNotNull(filter.getFilterName(),
				"Filter name");
		NullArgumentException.validateNotNull(filter.getFilterClass(),
				"Filter class");
		filters.put(filter.getFilterName(), filter);
		// add url patterns and servlet names for filter mappings added before
		// filter
		for (WebAppFilterMapping mapping : getFilterMappings(filter
				.getFilterName())) {
			if (mapping.getUrlPattern() != null
					&& mapping.getUrlPattern().trim().length() > 0) {
				filter.addUrlPattern(mapping.getUrlPattern());
			}
			if (mapping.getServletName() != null
					&& mapping.getServletName().trim().length() > 0) {
				filter.addServletName(mapping.getServletName());
			}
		}
	}
97716
def process_with_filter(input, filter_class)
      filter = filter_class.new

      output = MemoryFileWrapper.new("/output", input.path, "UTF-8")
      output.create { filter.generate_output([input], output) }

      output
    end
683054
def create_filter(self):
        """"""
        return Filter(
            self.networkapi_url,
            self.user,
            self.password,
            self.user_ldap)
269617
public static NodeSet fromFilter(String filter) {
        Map<String, Map<String, String>> stringMapMap = parseFilter(filter);
        NodeSet nodeSet = new NodeSet();
        nodeSet.createInclude(stringMapMap.get("include"));
        nodeSet.createExclude(stringMapMap.get("exclude"));
        return nodeSet;
    }
976256
private FilterMappingDescriptor createFilterMapping(FilterMappingType filterMappingType, Map<String, FilterDescriptor> filters,
            Map<String, ServletDescriptor> servlets, Store store) {
        FilterMappingDescriptor filterMappingDescriptor = store.create(FilterMappingDescriptor.class);
        FilterNameType filterName = filterMappingType.getFilterName();
        FilterDescriptor filterDescriptor = getOrCreateNamedDescriptor(FilterDescriptor.class, filterName.getValue(), filters, store);
        filterDescriptor.getMappings().add(filterMappingDescriptor);
        for (Object urlPatternOrServletName : filterMappingType.getUrlPatternOrServletName()) {
            if (urlPatternOrServletName instanceof UrlPatternType) {
                UrlPatternType urlPatternType = (UrlPatternType) urlPatternOrServletName;
                UrlPatternDescriptor urlPatternDescriptor = createUrlPattern(urlPatternType, store);
                filterMappingDescriptor.getUrlPatterns().add(urlPatternDescriptor);
            } else if (urlPatternOrServletName instanceof ServletNameType) {
                ServletNameType servletNameType = (ServletNameType) urlPatternOrServletName;
                ServletDescriptor servletDescriptor = getOrCreateNamedDescriptor(ServletDescriptor.class, servletNameType.getValue(), servlets, store);
                filterMappingDescriptor.setServlet(servletDescriptor);
            }
        }
        for (DispatcherType dispatcherType : filterMappingType.getDispatcher()) {
            DispatcherDescriptor dispatcherDescriptor = store.create(DispatcherDescriptor.class);
            dispatcherDescriptor.setValue(dispatcherType.getValue());
            filterMappingDescriptor.getDispatchers().add(dispatcherDescriptor);
        }

        return filterMappingDescriptor;
    }
2969
def rtree_filter(self):
        
        return RtreeFilter(self.src_filter.sitecol,
                           self.oqparam.maximum_distance,
                           self.src_filter.filename)
47413
private static List<String> gridBrowsers(Map<String, String> filter) {

        ArrayList<String> response = new ArrayList<String>();
        LOGGER.debug("Trying to get a list of Selenium-available browsers");

        String grid = System.getProperty("SELENIUM_GRID");

        if (grid != null) {
            grid = "http://" + grid + "/grid/console";
            Document doc;
            try {
                doc = Jsoup.connect(grid).timeout(DEFAULT_TIMEOUT).get();
            } catch (IOException e) {
                LOGGER.debug("Exception on connecting to Selenium grid: {}", e.getMessage());
                return response;
            }

            Elements slaves = (Elements) doc.select("div.proxy");

            for (Element slave : slaves) {
                String slaveStatus = slave.select("p.proxyname").first().text();
                if (!slaveStatus.contains("Connection") && !slaveStatus.contains("Conexión")) {
                    Integer iBusy = 0;
                    Elements browserList = slave.select("div.content_detail").select("*[title]");
                    Elements busyBrowserList = slave.select("div.content_detail").select("p > .busy");
                    for (Element browserDetails : browserList) {
                        if (browserDetails.attr("title").startsWith("{")) {
                            boolean filterCheck = true;
                            for (Map.Entry<String, String> f : filter.entrySet()) {
                                String stringFilter = f.getKey() + "=" + f.getValue() + "[,|}]";
                                Pattern patFilter = Pattern.compile(stringFilter);
                                Matcher mFilter = patFilter.matcher(browserDetails.attr("title"));
                                filterCheck = filterCheck & mFilter.find();
                            }
                            if (filterCheck) {
                                Pattern pat = Pattern.compile("browserName=(.*?),.*?(version=(.*?)[,|}])");
                                Matcher m = pat.matcher(browserDetails.attr("title"));
                                while (m.find()) {
                                    String browser = m.group(1) + "_" + m.group(3);
                                    if (browser.equals(System.getProperty("FORCE_BROWSER"))) {
                                        response.add(browser);
                                    }
                                }
                            }
                        } else {
                            String version = busyBrowserList.get(iBusy).parent().text();
                            String browser = busyBrowserList.get(iBusy).text();
                            version = version.substring(2);
                            version = version.replace(browser, "");
                            String browserSrc = busyBrowserList.get(iBusy).select("img").attr("src");
                            if (!browserSrc.equals("")) {
                                browser = browserSrc.substring(browserSrc.lastIndexOf('/') + 1, browserSrc.length()
                                        - DEFAULT_LESS_LENGTH);
                            }
                            response.add(browser + "_" + version);
                            iBusy++;
                        }
                    }
                }
            }
        }
        // Sort response
        Collections.sort(response);
        return response;
    }