filter the posts using a subfolder if supplied
979196
function filterFolder(posts) {
      var reFolder = new RegExp(folder);
      return posts.filter(function filterPosts(post) {
        return reFolder.test(post.source.substr(0, post.source.lastIndexOf(path.sep)));
      });
    }
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
1236593
def filter_by_folder(self, include=None, exclude=None):
        ""
        include,exclude = listify(include),listify(exclude)
        def _inner(o):
            if isinstance(o, Path): n = o.relative_to(self.path).parts[0]
            else: n = o.split(os.path.sep)[len(str(self.path).split(os.path.sep))]
            if include and not n in include: return False
            if exclude and     n in exclude: return False
            return True
        return self.filter_by_func(_inner)
1160394
function (cb) {

                req.linz.model.list.activeFilters = {};

                // check if there are any filters in the form post
                if (!session.list.formData.selectedFilters) {
                    return cb(null);
                }

                formtoolsAPI.list.getActiveFilters(req, session.list.formData.selectedFilters.split(','), session.list.formData, req.params.model, function (err, result) {

                    if (err) {
                        return cb(err);
                    }

                    req.linz.model.list.activeFilters = result;

                    return cb(null);
                });

            }
703664
function filteredFiles(folder, pattern) {
  var files = [];
    
  if (fs.existsSync(folder)){
    fs.readdirSync(folder).forEach(function(file) {
      if (file.match(pattern) != null)
        files.push(file);
    });
  }
  return files;
}
211035
function filterRepresented(modules, files, options) {
    return _.filter(modules, function(module) {
      return !_.some(files, function(file) {
        // Look for the module name somewhere in the source path
        return (
          path
            .join(sep, options.srcPrefix, file.src.replace(rmain, '$1'), sep)
            .indexOf(sep + module + sep) > -1
        )
      })
    })
  }
1031317
def filter_directories(modified_files)
      modified_files.reject do |file|
        File.directory?(file) && !Overcommit::Utils::FileUtils.symlink?(file)
      end
    end
1020734
function removePostsContent( posts, options ) {

	var _sortPosts = options && typeof options.sortPosts === 'function' ?
				options.sortPosts : sortPosts,
			i = 0,
			len = 0;

	// Posts should be objects separated by commas but not wrapped in []
	posts = JSON.parse( '[' + posts.contents.toString() + ']' );

	len = posts.length;

	for ( i; i < len; i++ ) {

		delete posts[i].content;
	}

	// Sort posts by newest
	posts.sort( _sortPosts );

	return JSON.stringify( posts );
}
972146
def _get_query(self, order=None, filters=None):
        
        order = self._get_order(order)
        return self.posts.all().order_by(order)
121279
def retrieve_posts(dir)
      return if outside_configured_directory?(dir)

      site.posts.docs.concat(post_reader.read_posts(dir))
      site.posts.docs.concat(post_reader.read_drafts(dir)) if site.show_drafts
    end
506294
public function filterNestedModuleShortocde($post)
    {
        if (is_admin()) {
            return $post;
        }

        if (substr($post->post_type, 0, 4) != 'mod-') {
            return $post;
        }

        $post->post_content = preg_replace('/\[modularity(.*)\]/', '', $post->post_content);
        return $post;
    }
182489
def filtered(self):
        """"""
        if not is_tagged(self.tags, self.opt.tags):
            LOG.info("Skipping %s as it does not have requested tags",
                     self.path)
            return False

        if not specific_path_check(self.path, self.opt):
            LOG.info("Skipping %s as it does not match specified paths",
                     self.path)
            return False

        return True
1251645
public function adminColumnFilter()
    {
        global $typenow, $wp_query;

        if (in_array($typenow, $this->postType)) {
            wp_dropdown_categories([
                'show_option_all' => sprintf(__('Show all %s', 'cuztom'), $this->plural),
                'taxonomy'        => $this->name,
                'name'            => $this->name,
                'orderby'         => 'name',
                'selected'        => isset($wp_query->query[$this->name]) ? $wp_query->query[$this->name] : '',
                'hierarchical'    => true,
                'show_count'      => true,
                'hide_empty'      => true,
            ]);
        }
    }
905605
def _post_filter(search, urlkwargs, definitions):
    """"""
    filters, urlkwargs = _create_filter_dsl(urlkwargs, definitions)

    for filter_ in filters:
        search = search.post_filter(filter_)

    return (search, urlkwargs)
669739
def sub_article_folders(self):
        
        l = list()
        for p in Path.sort_by_fname(
                Path(self.dir_path).select_dir(recursive=False)
        ):
            af = ArticleFolder(dir_path=p.abspath)
            try:
                if af.title is not None:
                    l.append(af)
            except:
                pass
        return l
278331
public function filterNumberOfPostsInArchive($query) : bool
    {
        if (!is_admin() && $query->is_main_query()) {

            //Check that posttype is valid
            if (!isset($query->query["post_type"])) {
                return false;
            }

            //Get current post count
            $postCount = get_field('archive_' . $query->query["post_type"] . '_number_of_posts', 'option');

            //If not set, use default value
            if (isset($postCount) && !empty($postCount) && is_numeric($postCount)) {
                $query->set('posts_per_page', $postCount);
                return true;
            }
        }

        return false;
    }
1132735
def filter(self, table, users, filter_string):
        """"""
        q = filter_string.lower()
        return [user for user in users
                if (q in user.name.lower() or
                    q in (getattr(user, 'email', None) or '').lower())]