Resolves @import paths to absolute file paths.
@param {string} filePath - The path of the LESS file.
@param {Array.<string>} importPaths - The array of @import paths.
@returns {Array.<string>}
359294
function resolveImportPaths(filePath, importPaths){
  var dir = path.dirname(filePath);
  return importPaths.map(function(relativePath){
    if(!path.extname(relativePath)){
      relativePath += '.less';
    }
    return path.resolve(dir, relativePath);
  });
}
578959
function importerAsync(options, handler) {
    var modulePath, recursive = false, parent = '';

    if (typeof options === 'string') {
        modulePath = options;

    } else {
        modulePath = options.path;
        recursive = options.recursive || recursive;
        parent = options.parent || parent;
        if (!modulePath) throw new Error("module directory path must be given.");
    }

    // absolute path? or relevant path?
    if (modulePath.indexOf('/') != 0) {
        // relevant. join with parent module's path
        modulePath = path.join(path.dirname(module.parent.parent.filename), modulePath);
    }

    fs.readdir(modulePath, function(err, files) {
        files.forEach(function(name) {
            if (name.lastIndexOf('.js') != name.length - 3) return;

            if (recursive && fs.lstatSync(path.join(modulePath, name)).isDirectory()) {
                importerAsync({
                    path: path.join(modulePath, name),
                    recursive: true,
                    parent: path.join(parent, name)
                }, handler);
            }

            name = name.substring(0, name.lastIndexOf('.')); // remove ext
            var moduleObj = require(path.join(modulePath, name));
            if (handler) handler(moduleObj, path.join(parent, name));
        });
    });
}
569026
function resolveSassPath(sassPath, loadPaths, extensions) {
  // trim sass file extensions
  var re = new RegExp('(\.('+extensions.join('|')+'))$', 'i');
  var sassPathName = sassPath.replace(re, '');
  // check all load paths
  var i, j, length = loadPaths.length, scssPath, partialPath;
  for (i = 0; i < length; i++) {
    for (j = 0; j < extensions.length; j++) {
      scssPath = path.normalize(loadPaths[i] + '/' + sassPathName + '.' + extensions[j]);
      try {
        if (fs.lstatSync(scssPath).isFile()) {
          return scssPath;
        }
      } catch (e) {}
    }

    // special case for _partials
    for (j = 0; j < extensions.length; j++) {
      scssPath = path.normalize(loadPaths[i] + '/' + sassPathName + '.' + extensions[j]);
      partialPath = path.join(path.dirname(scssPath), '_' + path.basename(scssPath));
      try {
        if (fs.lstatSync(partialPath).isFile()) {
          return partialPath;
        }
      } catch (e) {}
    }
  }

  // File to import not found or unreadable so we assume this is a custom import
  return false;
}
832005
function(resolvers) {
        return function(path, name, importerPath) {
            var num_resolvers = resolvers.length;
            return new Promise(function(resolve, reject) {
                if (resolvers.length === 0 ) {
                    reject('At least 1 resolver must be provided');
                }

                function try_resolver(index) {
                    resolvers[index](path, name, importerPath)
                        .then(function(m) {
                            resolve(m);
                        })
                        .catch(function() {
                            if (index + 1 === num_resolvers) {
                                reject(new Error('Could not find module: ' + path));
                            } else {
                                try_resolver(index + 1);
                            }
                        });
                }

                try_resolver(0);
            });
        };
    }
414777
function resolveExternalPath(importPath, options) {
  let baseIndex = importPath[0] === '@' ? importPath.indexOf('/') + 1 : 0;
  let addonName = importPath.substring(0, importPath.indexOf('/', baseIndex));
  let addon = options.parent.addons.find(addon => addon.name === addonName);

  if (!addon) {
    throw new Error(`Unable to resolve styles from addon ${addonName}; is it installed?`);
  }

  let pathWithinAddon = importPath.substring(addonName.length + 1);
  let addonTreePath = path.join(addon.root, addon.treePaths.addon);

  let absolutePath = ensurePosixPath(path.resolve(addonTreePath, pathWithinAddon));
  let keyPath = options.addonModulesRoot + addonName + '/' + pathWithinAddon;
  return new DependencyPath('external', absolutePath, keyPath);
}
923458
function mkPath(absPath) {
    let localPrefix = absPath.substring(absPath.indexOf(dir_of_interest) + dir_of_interest.length)
    if (localPrefix.startsWith("/")) localPrefix = localPrefix.substring(1)
    return path.resolve(dir_of_interest,
        'node_modules',
        '@areslabs',
        'babel-plugin-import-css',
        'rncsscache',
        localPrefix + '.js'
    )
}
771697
def resolve_import(import_path, from_module):
    '''
    '''
    if not import_path or not import_path.startswith('.'):
        return import_path

    from_module = from_module.split('.')
    dots = 0
    for c in import_path:
        if c == '.':
            dots += 1
        else:
            break

    if dots:
        from_module = from_module[:-dots]
        import_path = import_path[dots:]

    if import_path:
        from_module.append(import_path)

    return '.'.join(from_module)
138459
function (filePath)
		{
			if (typeof arguments[1]=='function')
				var cb = arguments[1];

			if (typeof arguments[2]=='function')
				var cb = arguments[2];

			var binary = typeof arguments[1]=='boolean' ? arguments[1] : false,
				realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath,
				cmd = !cb ? 'readFileSync' : 'readFile';

			try {
				var _cb = cb ? function (err,file) {
					cb&&cb(!err ? ((binary===true) ? file : file.toString()) : false);
				} : null,
				file = fs[cmd](realPath,_cb);
			} catch (e)
			{
				if (_cb)
					cb&&cb(false);
				else
					return false;
			}
			return (file ? (binary===true) ? file : file.toString() : false);
		}
629451
function resolve() {
            resolvePath(path, function (err, _resolvedPath) {
                if (err) {
                    if (err.code !== "ENOENT") {
                        return error(err);
                    }
                    // If checkSymlinks is on we'll get an ENOENT when creating a new file.
                    // In that case, just resolve the parent path and go from there.
                    resolvePath(dirname(path), function (err, dir) {
                        if (err) return error(err);
                        resolvedPath = join(dir, basename(path));
                        createTempFile();
                    });
                    return;
                }
                
                resolvedPath = _resolvedPath;
                createTempFile();
            });
        }
1015960
function(filePaths, importRegexp, System) {
      var moduleNames = [];
      for (var filePath in filePaths) {
        if (filePaths.hasOwnProperty(filePath) && importRegexp.test(filePath)) {
          moduleNames.push(adapter.getModuleNameFromPath(filePath, System.baseURL, System));
        }
      }
      return moduleNames;
    }
1075803
function pathParser(root, extname, subPath, paths) {
  var dirPath = path.resolve(subPath || root);
  var files;
  paths = paths || {};

  try {
    files = fs.readdirSync(dirPath);
  } catch(e) {
    files = [];
  }
  files.forEach(function(file) {
    file = path.join(dirPath, '/', file);
    if (fs.statSync(file).isFile()) {
      if (~extname.split('|').indexOf(path.extname(file).substr(1))) {
        var rootPath = '^' + path.join(path.resolve(root), '/');
        rootPath = rootPath.replace(/\\/g, '\\\\') + '(.*)\.(' + extname + ')$';
        paths[file.match(new RegExp(rootPath))[1].toLowerCase()] = file;
      }
    } else if (fs.statSync(file).isDirectory()) {
      pathParser(root, extname, file, paths);
    }
  });
  return paths;
}
445035
protected String normalizeExportPath(String exportPath) {

        String result = insertContextStrings(exportPath);
        result = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebApplication(result);
        if (result.endsWith(File.separator)) {
            // ensure export path does NOT end with a File.separator
            result = result.substring(0, result.length() - 1);
        }
        return result;
    }
347910
public void setFilePaths(String... filePaths) {
		Path[] paths = new Path[filePaths.length];
		for (int i = 0; i < paths.length; i++) {
			paths[i] = new Path(filePaths[i]);
		}
		setFilePaths(paths);
	}
589075
function resolve(files, opts) {
  var fn = opts.filter || function(fp) {
    return true;
  };

  if (opts.realpath === true) {
    return files.filter(fn);
  }

  var len = files.length;
  var idx = -1;
  var res = [];

  while (++idx < len) {
    var fp = path.resolve(opts.cwd, files[idx]);
    if (!fn(fp) || ~res.indexOf(fp)) continue;
    res.push(fp);
  }
  return res;
}
641436
function (path, currentFileInfo, callback) {
            var parserImporter = this;
            this.queue.push(path);

            //
            // Import a file asynchronously
            //
            less.Parser.importer(path, currentFileInfo, function (e, root, fullPath) {
                parserImporter.queue.splice(parserImporter.queue.indexOf(path), 1); // Remove the path from the queue

                var imported = fullPath in parserImporter.files;

                parserImporter.files[fullPath] = root;                        // Store the root

                if (e && !parserImporter.error) { parserImporter.error = e; }
                
                callback(e, root, imported);
            }, env);
        }
1332907
function(filepath, req, res) {
    var path = require("path"),
        config = module.exports.config,
        result = false,
        parentdir;
    do {
        var defaultdir = path.resolve(path.join(config.responsesdefault, filepath));
        parentdir = path.resolve(path.join(config.responses, filepath));
        if (isValidDir(parentdir) && isValidFile(path.join(parentdir, "index.js"))) {
            //Parent module response handler exists.
            require(parentdir)(req, res);
            result = true;
        } else if (isValidDir(defaultdir) && isValidFile(path.join(defaultdir, "index.js"))) {
            //Default response handler
            require(defaultdir)(req, res);
            result = true;
        }
        if (filepath === path.sep) break;
        filepath = path.dirname(filepath);
    } while (result === false && parentdir !== filepath);
    return result;
}
678805
protected File findFile(List<String> loadPaths, String moduleName) {
        String fileName = normalizeName(moduleName);
        File file = new File( moduleName );
        if ( file.isAbsolute() ) {
            if ( file.exists() ) {
                return file;
            }
        }
        for (String loadPath : loadPaths) {
            // require('foo');
            file = new File(loadPath, fileName);
            // foo.js is in the require path
            if (file.exists()) break;
        }
        return file;
    }