find path using webkit file system
161588
function resolveNative(success, fail, path, fsType, options, size) {
    window.webkitRequestFileSystem(
        fsType,
        size,
        function (fs) {
            if (path === '') {
                //no path provided, call success with root file system
                success(createEntryFromNative(fs.root));
            } else {
                //otherwise attempt to resolve as file
                fs.root.getFile(
                    path,
                    options,
                    function (entry) {
                        success(createEntryFromNative(entry));
                    },
                    function (fileError) {
                        //file not found, attempt to resolve as directory
                        fs.root.getDirectory(
                            path,
                            options,
                            function (entry) {
                                success(createEntryFromNative(entry));
                            },
                            function (dirError) {
                                //path cannot be resolved
                                if (fileError.code === FileError.INVALID_MODIFICATION_ERR && 
                                    options.exclusive) {
                                    //mobile-spec expects this error code
                                    fail(FileError.PATH_EXISTS_ERR);
                                } else {
                                    fail(FileError.NOT_FOUND_ERR);
                                }
                            }
                        );
                    }
                );
            }
        }
    );
}
1184618
function getPath(path, callback) {
  fs.lstat(path, function(err, stats) {
    if(err) return callback(err);

    // Check if it's a link
    if(stats.isSymbolicLink()) fs.readlink(path, callback);

    callback(err, path);
  });
}
178627
function (path) {
                //There has to be an easier way to do this.
                var i, part, ary,
                    firstChar = path.charAt(0);

                if (firstChar !== '/' &&
                        firstChar !== '\\' &&
                        path.indexOf(':') === -1) {
                    //A relative path. Use the current working directory.
                    path = xpcUtil.cwd() + '/' + path;
                }

                ary = path.replace(/\\/g, '/').split('/');

                for (i = 0; i < ary.length; i += 1) {
                    part = ary[i];
                    if (part === '.') {
                        ary.splice(i, 1);
                        i -= 1;
                    } else if (part === '..') {
                        ary.splice(i - 1, 2);
                        i -= 2;
                    }
                }
                return ary.join('/');
            }
1245612
def _get_directory_path(context):
    """"""
    path = os.path.join(settings.BASE_PATH, 'store')
    path = context.params.get('path', path)
    path = os.path.join(path, context.crawler.name)
    path = os.path.abspath(os.path.expandvars(path))
    try:
        os.makedirs(path)
    except Exception:
        pass
    return path
372404
def path(ctx, paths):
    """"""
    click.secho('Use "renku storage pull" instead.', fg='red', err=True)
    ctx.exit(2)
175236
def _find_path(self, search_dirs, file_name):
        
        for dir_path in search_dirs:
            file_path = os.path.join(dir_path, file_name)
            if os.path.exists(file_path):
                return file_path

        return None
1085813
function handlePathSlashes (path) {
                var cutIndex = 0;
                for (var i = 0; i < path.length - 1; i++) {
                    if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {
                        cutIndex = i + 1;
                    } else break;
                }

                return path.substr(cutIndex);
            }
1146040
def link(self):
    """"""
    if not self.IsLink():
      return ''

    location = getattr(self.path_spec, 'location', None)
    if location is None:
      return ''

    return self._file_system.GetDataByPath(location)
89638
function parseDirectory( path ) {

            return fs.readdirSync( path )

                .map( function( file ) {

                    var filePath = path + "/" + file;

                    if ( isIncludeFile( filePath ) ) return parseFile( filePath );
                    else if ( isDirectory( filePath ) ) return parseDirectory( filePath );

                    return null;
                } )

                .filter( function( value ) {

                    return value !== null;

                } );
        }
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'
    )
}
428904
function _paths(cwd, dataPath) {
  const paths = Utils.assignWith({}, {
    root: '.',
    data: dataPath,
    cache: join(dataPath, 'cache'),
    uploads: join(dataPath, 'uploads'),
    www: './www',
    modules: './node_modules',
  }, (_, srcPath) => resolve(cwd, srcPath));

  // Ensure paths exist
  Utils.mkdirp(paths.cache);
  Utils.mkdirp(paths.uploads);
  Utils.mkdirp(paths.www);

  return paths;
}
890021
def find_in_path(name, path):
    ""
    # adapted fom http://code.activestate.com/recipes/52224-find-a-file-given-a-search-path/
    for dir in path.split(os.pathsep):
        binpath = os.path.join(dir, name)
        if os.path.exists(binpath):
            return os.path.abspath(binpath)
    return None
796105
function findAppPath() {
    if (oars._appPath) return oars._appPath;

    var cwd = process.cwd();
    var argv = process.argv;

    var index = _.findIndex(argv, function(value) {
      return _.startsWith(value, cwd);
    });

    if (index === -1) {
      return cwd;
    } else {
      return path.dirname(argv[index]);
    }
  }
1155662
function getFilePath (cfg, req) {
	const urlParsed = req[cfg.parsedURLName] || url.parse(req.url);
	return path.join(cfg.documentRoot, (urlParsed.pathname || '/'));
}
164149
def _anchor_path(self, anchor_id):
        ""
        file_name = '{}.yml'.format(anchor_id)
        file_path = self._spor_dir / file_name
        return file_path
696196
def find(C, node, path, namespaces=None, extensions=None, smart_strings=True, **args):
        """"""
        xp = node.xpath(
            path,
            namespaces=namespaces or C.NS,
            extensions=extensions,
            smart_strings=smart_strings,
            **args
        )
        if len(xp) > 0:
            return xp[0]
1014530
function findResource(name, filepath, extList) {
  var candidates = [name, path.join(name, 'index')];
  var baseName = path.basename(name);
  if (baseName && baseName !== '.' && baseName !== '..') {
    candidates.push(path.join(name, baseName));
  }
  var info = null;

  candidates.every(function(candidate) {
    info = fis.uri(candidate, filepath);

    for (var i = 0, len = extList.length; i < len && !info.file; i++) {
      info = fis.uri(candidate + extList[i], filepath);
    }

    if (info && info.file) {
      return false;
    }

    return true;
  });

  return info;
}