EXISTS // 
FUNCTION: exists( path, clbk )
Tests whether a path exists on the filesystem.

@param {String} path - path to test
@param {Function} clbk - callback to invoke after testing path existence
@returns {Void}
325840
function exists( path, clbk ) {
	fcn( path, done );

	/**
	* FUNCTION: done( error )
	*	Callback invoked performing a filesystem call.
	*
	* @private
	* @param {Error|Null} error - error object
	*/
	function done( error ) {
		if ( clbk.length === 2 ) {
			if ( error ) {
				return clbk( error, false );
			}
			return clbk( null, true );
		}
		if ( error ) {
			return clbk( false );
		}
		return clbk( true );
	}
}
943495
async function exists(dir) {
  try {
    debug(`checking if ${dir} exists`);
    const s = await stat(dir);

    debug(`${dir} exists`);

    return s.isDirectory();
  }
  catch (err) {
    debug(`${dir} does not exist`);

    return false;
  }
}
884950
def PathExists(self, key, val, env):
        """"""
        if not os.path.exists(val):
            m = 'Path for option %s does not exist: %s'
            raise SCons.Errors.UserError(m % (key, val))
581125
public void exists(String path, boolean watch, StatCallback cb, Object ctx) {
        exists(path, watch ? watchManager.defaultWatcher : null, cb, ctx);
    }
382894
function exists(file, src, opts) {
	var files = opts.path.map(function (dir) {
		return path.join(dir, file);
	});

	files = globby.sync(files);

	if (!files.length) {
		throw new Error(createError(file, src, opts.path));
	}

	return files[0];
}
1268827
@Override
    public Promise<Boolean> exists(String path) {
        return adapter.toPromise(handler -> vertx.fileSystem().exists(path, handler));
    }
238278
function exists (filepath, callback) {
  fs.stat(filepath, err => {
    if (err) callback(false)
    else callback(true)
  })
}
1015001
def exists(self, fileDirSpec, **kwargs):
            

            str_path        = self.cwd()
            for k,v in kwargs.items():
                if k == 'path': str_path    = v
            if fileDirSpec in self.lstr_lsnode(str_path):
                return True
            if fileDirSpec in self.lsf(str_path):
                return True
            return False
1366200
def check_path_exists_foreach(path_params, func):
    
    @wraps(func)
    def wrapper(*args):
        self = args[0]
        params = args[1]

        if not self.in_transaction:
            for name in path_params:
                value = getattr(params, name)
                paths = value if type(value) == list else [value]
                resolved = []
                for path in paths:
                    path = self.resolve_path(path)
                    if not self.client.exists(path):
                        self.show_output("Path %s doesn't exist", path)
                        return False
                    resolved.append(path)

                if type(value) == list:
                    setattr(params, name, resolved)
                else:
                    setattr(params, name, resolved[0])

        return func(self, params)

    return wrapper
1269986
function (path) {
    if (fs.existsSync(path) && fs.statSync(path).isDirectory()) {
      return true;
    }
    return false;
  }
210824
def exists(path, **kwargs):
    """"""
    import os.path
    return os.path.exists(path, **kwargs)
1215973
function fileExists(fileName) {
        if (!fileName) {
            return false;
        }

        var filePath = PathUtils.resolveInRoot(outputFolder, fileName);
        return fs.existsSync(filePath);
    }
517947
def check_exists(name, path):
    '''
    
    '''
    cmd = [_get_cmd(), '--display', name]
    out = __salt__['cmd.run_all'](cmd, python_shell=False)

    if out['retcode'] > 0 and out['stderr'] != '':
        return False

    return any((line.startswith(path) for line in out['stdout'].splitlines()))
971863
function mkdirSync (path) {
  const dir = Path.resolve(path)
  if (existsSync(dir)) {
    return true
  }

  Fs.mkdirSync(dir)
  return existsSync(dir)
}
629318
def path_exists?(path = @path)
      path = path.split(' ') if path.is_a?(String) && path.include?(' ')
      if path.is_a?(Array)
        path.each do |p|
          unless File.exist?(p)
            puts "#{p} does not exist"
            return false
          end
        end
      else
        path = path.gsub('/**', '').gsub('/*', '').gsub(/\/\.*/, '') if path.include?('*')
        if File.exist?(path)
          return true
        else
          puts "#{path} does not exist"
          return false
        end
      end
    end
1353049
function _ensureExists(dir, callback) {
    dir = path.resolve(dir); // make full path
    
    path.exists(dir, function(exists) {
        if (!exists) {
            // ensure that the parent dir exists
            _ensureExists(path.dirname(dir), function(err) {
                if (err) {
                    callback(err);
                    return;
                }
                
                // make the dir
                log.log('Creating ' + dir);
                fs.mkdir(dir, function(err) {
                    if (err) {
                        callback(err);
                        return;
                    }
                    
                    callback(null);
                });
            });
        }
        else {
            callback(null);
        }
    });
}
1233282
def exists(self, path):
        
        _complain_ifclosed(self.closed)
        return self.fs.exists(path)