Public: Find the source of assets by paths.

 Returns Enumerator of assets file content.
495246
def find_sources(*args)
      return to_enum(__method__, *args) unless block_given?

      if environment
        find(*args).each do |asset|
          yield asset.source
        end
      else
        args.each do |path|
          asset = assets[path]
          yield File.binread(File.join(dir, asset)) if asset
        end
      end
    end
97419
function getProductionPath(assetPath, flags) {
  var ext = path.extname(assetPath);
  var filename = assetPath.slice(0, assetPath.lastIndexOf(ext));
  var out = filename;
  if (_.contains(flags, 'min')) {
    out += '.min';
  }
  out += ext;
  if (_.contains(flags, 'gz')) {
    out += '.gz';
  }
  return out;
}
451002
def paths(self):
        """"""
        if self.format is None:
            raise ArcanaFileFormatError(
                "Cannot get paths of fileset ({}) that hasn't had its format "
                "set".format(self))
        if self.format.directory:
            return chain(*((op.join(root, f) for f in files)
                           for root, _, files in os.walk(self.path)))
        else:
            return chain([self.path], self.aux_files.values())
804329
def _get_cached_style_urls(self, asset_url_path):
        
        try:
            cached_styles = os.listdir(self.cache_path)
        except IOError as ex:
            if ex.errno != errno.ENOENT and ex.errno != errno.ESRCH:
                raise
            return []
        except OSError:
            return []
        return [posixpath.join(asset_url_path, style)
                for style in cached_styles
                if style.endswith('.css')]
836184
def getResourceInst(self, path, environ):
        
        self._count_getResourceInst += 1
        fp = self._locToFilePath(path)
        if not os.path.exists(fp):
            return None

        if os.path.isdir(fp):
            return FolderResource(path, environ, fp)
        return FileResource(path, environ, fp)
777579
def locate_files(pattern, root_dir=os.curdir):
    
    for dirpath, dirnames, filenames in os.walk(os.path.abspath(root_dir)):
        for filename in fnmatch.filter(filenames, pattern):
            yield os.path.join(dirpath, filename)
250341
def assets_by_site(self):
        
        assets_by_site = [[] for sid in range(self.tot_sites)]
        for i, ass in enumerate(self.array):
            assets_by_site[ass['site_id']].append(self[i])
        return numpy.array(assets_by_site)
1065814
@Override
    public Asset<?> assetAt(String path) {
        List<WebJarLib> candidates = findLibsContaining(path);

        if (candidates.size() == 1) {
            // Perfect ! only one match
            return new DefaultAsset<>(
                    "/libs/" + candidates.get(0).name + "/" + candidates.get(0).version + "/" + path,
                    candidates.get(0).get(path),
                    candidates.get(0).toString(),
                    candidates.get(0).lastModified(),
                    CacheUtils.computeEtag(candidates.get(0).lastModified(), configuration, crypto)
            );
        } else if (candidates.size() > 1) {
            // Several candidates
            logger().warn("{} WebJars provide '{}' - returning the one from {}-{}", candidates.size(), path,
                    candidates.get(0).name, candidates.get(0).version);
            return new DefaultAsset<>(
                    "/libs/" + candidates.get(0).name + "/" + candidates.get(0).version + "/" + path,
                    candidates.get(0).get(path),
                    candidates.get(0).toString(),
                    candidates.get(0).lastModified(),
                    CacheUtils.computeEtag(candidates.get(0).lastModified(), configuration, crypto)
            );
        } else {
            Matcher matcher = PATTERN.matcher(path);
            if (!matcher.matches()) {
                // It should have been handled by the path match.
                return null;
            }

            final String name = matcher.group(1);
            final String version = matcher.group(3);
            if (version != null) {
                String rel = matcher.group(4);
                // We have a name and a version
                // Try to find the matching library
                WebJarLib lib = find(name, version);
                if (lib != null) {
                    return new DefaultAsset<>(
                            rel,
                            lib.get(rel),
                            lib.toString(),
                            lib.lastModified(),
                            CacheUtils.computeEtag(lib.lastModified(), configuration, crypto)
                    );
                }
                // If not found, it may be because the version is not really the version but a segment of the path.
            }
            // If we reach this point it means that the name/version lookup has failed, try without the version
            String rel = matcher.group(4);
            if (version != null) {
                // We have a group 3
                rel = version + "/" + rel;
            }

            List<WebJarLib> libs = find(name);
            if (libs.size() == 1) {
                // Only on library has the given name
                if (libs.get(0).contains(rel)) {
                    WebJarLib lib = libs.get(0);
                    return new DefaultAsset<>(
                            "/libs/" + lib.name + "/" + lib.version + "/" + rel,
                            lib.get(rel),
                            lib.toString(),
                            lib.lastModified(),
                            CacheUtils.computeEtag(lib.lastModified(), configuration, crypto)
                    );
                }
            } else if (libs.size() > 1) {
                // Several candidates
                WebJarLib higher = null;
                ComparableVersion higherVersion = null;
                for (WebJarLib lib: libs) {
                    if (lib.contains(rel)) {
                        if(higher == null) {
                            higher = lib;
                            higherVersion = new ComparableVersion(higher.version);
                        } else {
                            ComparableVersion newVersion = new ComparableVersion(lib.version);
                            if(newVersion.compareTo(higherVersion) > 0) {
                                higher = lib;
                                higherVersion = new ComparableVersion(higher.version);
                            }
                        }
                    }
                }
                if(higher != null) {
                    logger().warn("{} WebJars match the request '{}' - returning the resource from {}-{}",
                            libs.size(), path, higher.name, higher.version);
                    return new DefaultAsset<>(
                            "/libs/" + higher.name + "/" + higher.version + "/" + rel,
                            higher.get(rel),
                            higher.toString(),
                            higher.lastModified(),
                            CacheUtils.computeEtag(higher.lastModified(), configuration, crypto)
                    );
                }

            }

            return null;
        }
    }
548654
def source_files(self):
        """"""
        if 'srcs' in self.params and self.params['srcs'] is not None:
            return util.flatten(self.params['srcs'])
72780
private Node getNestedNode(ArchivePath path) {
        // Iterate through nested archives
        for (Entry<ArchivePath, ArchiveAsset> nestedArchiveEntry : nestedArchives.entrySet()) {
            ArchivePath archivePath = nestedArchiveEntry.getKey();
            ArchiveAsset archiveAsset = nestedArchiveEntry.getValue();

            // Check to see if the requested path starts with the nested archive path
            if (startsWith(path, archivePath)) {
                Archive<?> nestedArchive = archiveAsset.getArchive();

                // Get the asset path from within the nested archive
                ArchivePath nestedAssetPath = getNestedPath(path, archivePath);

                // Recurse the call to the nested archive
                return nestedArchive.get(nestedAssetPath);
            }
        }
        return null;
    }
576013
function (asset) {
    var bundle = this.bundle;
    var requires = bundle.getRequiredFiles(asset.assetFilePath);
    if (requires.length > 0) {
      return requires.map(function (file) {
        return bundle.getAsset(file).logicalPath;
      });
    } else {
      return [asset.logicalPath];
    }
  }
1015883
def find_in_paths(name, paths):
    
    for path in paths:
        file_ = osp.join(path, name)
        if osp.exists(file_) and not osp.isdir(file_):
            abs_file = osp.abspath(file_)
            if os.access(file_, os.X_OK):
                return abs_file
1135134
def path(self):
        """"""
        if (self.source_file.startswith('a/') and
                self.target_file.startswith('b/')):
            filepath = self.source_file[2:]
        elif (self.source_file.startswith('a/') and
              self.target_file == '/dev/null'):
            filepath = self.source_file[2:]
        elif (self.target_file.startswith('b/') and
              self.source_file == '/dev/null'):
            filepath = self.target_file[2:]
        else:
            filepath = self.source_file
        return filepath
613046
function getPaths(src, output) {
    if(src === undefined)
        src = Elixir.config.assetsPath+'/images';

    return new Elixir.GulpPaths()
        .src(src, Elixir.config.assetsPath+'/images')
        .output(output || Elixir.config.publicPath+'/images');
}
1019583
function (type, group) {
    if (!config.assets) throw('No assets found in config');
    var t = config.assets[type];
    if (!t) throw('Asset type not found: ' + type);
    var g = t[group];
    if (!g) throw('Asset group not found: ' + group);

    if (!_.isArray(g)) g = [g];
    return _.chain(g).map(function (f) {
        return fss.source(f);
    }).map(function (f) {
        if (fs.lstatSync(f).isDirectory()) return fss.allSourceFilePaths(f);
        return f;
    }).flatten().uniq().filter(function (f) {
        var process = fss.isProcessableFile(f);
        var include = !fss.isHelperFile(_.last(f.split('/')));
        return process && include && !assetFileTypeMismatch(type, f);
    }).value();
}
535459
function resolveDependencies(self, paths) {
  var assets = [], cache = {};

  _.forEach(paths, function (p) {
    var asset;

    if (p === self.pathname) {
      if (!cache[p]) {
        cache[p] = true;
        assets.push(self);
      }
      return;
    }

    asset = self.environment.findAsset(p, { bundle: false });

    if (asset) {
      asset.__requiredAssets__.forEach(function (asset_dependency) {
        if (!cache[asset_dependency.pathname]) {
          cache[asset_dependency.pathname] = true;
          assets.push(asset_dependency);
        }
      });
    }
  });

  return assets;
}
1257651
def find_file(pattern = params[:splat].first, source_path: build_path)
      finder = Compiler::FileFinders::Normal.new(source_path)
      finder.find_files(pattern).first
    end