Returns logicalPath for `filename` if it matches given filters
490270
function logical_path_for_filename(self, filename, filters) {
  var logical_path = self.attributesFor(filename).logicalPath;

  if (matches_filter(filters, logical_path, filename)) {
    return logical_path;
  }

  // If filename is an index file, retest with alias
  if (path.basename(filename).split('.').shift() === 'index') {
    logical_path = logical_path.replace(/\/index\./, '.');
    if (matches_filter(filters, logical_path, filename)) {
      return logical_path;
    }
  }
}
628774
function logicalPath($absolutePath)
    {
        foreach ($this->loadPaths->paths() as $lp) {
            $absoluteLoadPath = realpath($lp);

            if (strpos($absolutePath, $absoluteLoadPath) === 0) {
                return ltrim(substr($absolutePath, strlen($absoluteLoadPath)), '/');
            }
        }
    }
48234
function filter(options, includes, root, filepath, stat) {
  var paths = path.relative(root, filepath).split(path.sep);
  // always include test/tests directory when running jpm test
  if (options.command === "test") {
    if (/^tests?$/.test(paths[0])) {
      if (paths.length === 1 && stat.isDirectory()) {
        return true;
      }
      if (paths.length > 1) {
        return true;
      }
    }
  }
  return includes.indexOf(filepath) !== -1;
}
1105556
public static logical_disk[] get_filtered(nitro_service service, String filter) throws Exception
	{
		logical_disk obj = new logical_disk();
		options option = new options();
		option.set_filter(filter);
		logical_disk[] response = (logical_disk[]) obj.getfiltered(service, option);
		return response;
	}
212401
def filename_match(fsearch, filename, width, height):
    '''
    
    '''
    fsearch = clean_path(fsearch)
    filename = clean_path(filename)
    if fsearch == filename:
        return True

    if fsearch.find('@') == -1:
        return False
    basename, fileext = os.path.splitext(fsearch)
    nickname, extinfo = basename.split('@', 1)
    if extinfo == 'auto':
        valid_names = {}.fromkeys([
            nickname+'@{}x{}'.format(width, height)+fileext,
            nickname+'@{}x{}'.format(height, width)+fileext,
            nickname+'.{}x{}'.format(width, height)+fileext,
            nickname+'.{}x{}'.format(height, width)+fileext,
        ])
        if filename in valid_names:
            return True
    # if extinfo.find('x') != -1:
    #     cw, ch = extinfo.split('x', 1)
    #     if cw*width == ch*height or cw*height == ch*width:
    #         return True
    return False
602881
function getFilePath(sourcePath, filename, subDir) {
    if (subDir === void 0) { subDir = ''; }
    var filePath = filename
        .replace(path.resolve(sourcePath), '')
        .replace(path.basename(filename), '');
    if (subDir) {
        filePath = filePath.replace(subDir + path.sep, '');
    }
    if (/^[\/\\]/.test(filePath)) {
        filePath = filePath.substr(1);
    }
    return filePath.replace(/\\/g, '/');
}
165559
def match(self, filepath):
        
        for pattern in self.__pattern:
            if len(fnmatch.filter([filepath], pattern)) > 0:
                return True
        return False
1201205
private Subquery<ImageFile> getImagesWithFileNameSubquery(final String filename, final FilterStringLogic searchLogic) {
        final CriteriaBuilder criteriaBuilder = getCriteriaBuilder();
        final Subquery<ImageFile> subQuery = getCriteriaQuery().subquery(ImageFile.class);
        final Root<LanguageImage> root = subQuery.from(LanguageImage.class);
        subQuery.select(root.get("imageFile").as(ImageFile.class));

        // Create the Condition for the subquery
        final Predicate imageIdMatch = criteriaBuilder.equal(getRootPath().get("imageFileId"), root.get("imageFile").get("imageFileId"));
        final Predicate filenameMatch;
        if (searchLogic == FilterStringLogic.MATCHES) {
            filenameMatch = criteriaBuilder.equal(root.get("originalFileName"), filename);
        } else {
            filenameMatch = criteriaBuilder.like(criteriaBuilder.lower(root.get("originalFileName").as(String.class)),
                    '%' + cleanLikeCondition(filename).toLowerCase() + '%');
        }
        subQuery.where(criteriaBuilder.and(imageIdMatch, filenameMatch));

        return subQuery;
    }
327170
def match(self, filename, isdir=False):
    

    for lst in self:
      result = lst.match(filename, isdir)
      if result != MATCH_DEFAULT:
        return result
    return MATCH_DEFAULT
19707
def _find_observable_paths(extra_files=None):
    """"""
    rv = set(
        os.path.dirname(os.path.abspath(x)) if os.path.isfile(x) else os.path.abspath(x)
        for x in sys.path
    )

    for filename in extra_files or ():
        rv.add(os.path.dirname(os.path.abspath(filename)))

    for module in list(sys.modules.values()):
        fn = getattr(module, "__file__", None)
        if fn is None:
            continue
        fn = os.path.abspath(fn)
        rv.add(os.path.dirname(fn))

    return _find_common_roots(rv)
634494
public boolean matchesFilter(String filter) {

        filter = filter.toLowerCase();
        return getTitle().toLowerCase().contains(filter) || m_path.toLowerCase().contains(filter);
    }
490956
function filterFiles(files, validExtensions) {
    const accepted = [];

    for (const fileName of files) {
        if (accepted.indexOf(fileName) === -1 && fileMatchesExtension(fileName, validExtensions)) {
            accepted.push(fileName);
        }
    }

    return accepted;
}
722373
def match_filenames(filenames, pattern):
    """"""
    matching = []

    for filename in filenames:
        if fnmatch(get_filebase(filename, pattern), globify(pattern)):
            matching.append(filename)

    return matching
858750
function findPaths(schema, options) {
  const paths = [];

  schema.eachPath(function(path, type) {
    if (type.enumValues && type.enumValues.length) {
      paths.push(
        {
          path: path,
          enumValues: type.enumValues,
          options: options
        }
      );
    }
  });

  return filterPaths(paths, options);
}
283859
function filterPaths(paths, allowed) {
  if (!allowed) { return []; }
  if (!allowed.only.length) { return paths; }

  return paths.filter(
    path => {
      let match = false;

      for (const filter of allowed.only) {
        try {
          switch (typeof filter) {
            case 'function':
              match = filter(path.path);
              break;
            case 'string':
              match = path.path === filter;
              break;
            default:
              match = filter.test(path.path);
         }
        } catch (e) {
          throw new Error(`${ typeof filter } is not an allowed filter type. Must be String, RegExp or Function`);
        }
        if (match) { return match; }
      }
      return match;
    }
  );
}
433582
def filter_paths(pathnames, patterns=None, ignore_patterns=None):
    """"""
    result = []
    if patterns is None:
        patterns = ['*']
    if ignore_patterns is None:
        ignore_patterns = []
    for pathname in pathnames:
        if match_patterns(pathname, patterns) and not match_patterns(pathname, ignore_patterns):
            result.append(pathname)
    return result
1024632
function getFullFilename(filename) {
  if (p.isAbsolute(filename)) {
    return filename
  }
  return p.join(process.cwd(), filename)
}