Check if the given path is an alternative for a name.

    .. versionadded:: 2015.8.4

    CLI Example:

    .. code-block:: bash

        salt '*' alternatives.check_exists name path
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()))
213533
def exists?(path)
      path = @uri.merge(path).path
      headers = {'Depth' => '1'}
      body = '<?xml version="1.0" encoding="utf-8"?><DAV:propfind xmlns:DAV="DAV:"><DAV:allprop/></DAV:propfind>'
      begin
        res = @handler.request(:propfind, path, body, headers.merge(@headers))
      rescue
        return false
      end
      return (res.is_a? Net::HTTPSuccess)
    end
264139
def is_file(dirname):
    ''''''
    if not os.path.isfile(dirname):
        msg = "{0} is not an existing file".format(dirname)
        raise argparse.ArgumentTypeError(msg)
    else:
        return dirname
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 );
	}
}
54658
function exists (path, callback) {
    Fs.stat(path, function (err) {
        callback(checkErr(err));
    });
}
1079722
def check_path(file_path):
    '''
        
    '''
    directory = os.path.dirname(file_path)
    if directory != '':
        if not os.path.exists(directory):
            os.makedirs(directory, 0o775)
1004902
def check_exists(path, type='file'):
    

    if type == 'file':
        if not os.path.isfile(path):
            raise RuntimeError('The file `%s` does not exist.' % path)
    else:
        if not os.path.isdir(path):
            raise RuntimeError('The folder `%s` does not exist.' % path)

    return True
350992
def file_exists?(file_path)
      if @site.respond_to?(:in_source_dir)
        File.exist? @site.in_source_dir(file_path)
      else
        File.exist? Bunto.sanitized_path(@site.source, file_path)
      end
    end
635973
def available(name):
    '''
    
    '''
    path = '/etc/rc.d/{0}'.format(name)
    return os.path.isfile(path) and os.access(path, os.X_OK)
865444
def _inform_if_path_does_not_exist(path):
    
    expanded_path = get_expanded_path(path)
    if not os.path.exists(expanded_path):
        print('Could not find custom path at: {}'.format(expanded_path))
1286899
def exists(path):
    """"""
    try:
        return path.expanduser().absolute().exists()
    except AttributeError:
        return os.path.exists(os.path.abspath(os.path.expanduser(str(path))))
704928
def exists(name, path=None):
    '''
    
    '''

    _exists = name in ls_(path=path)
    # container may be just created but we did cached earlier the
    # lxc-ls results
    if not _exists:
        _exists = name in ls_(cache=False, path=path)
    return _exists
210824
def exists(path, **kwargs):
    """"""
    import os.path
    return os.path.exists(path, **kwargs)
832525
def command_exists?(command)
      ENV['PATH'].split(File::PATH_SEPARATOR).any? {|d| File.exist? File.join(d, command) }
    end
388119
def exists(self, path, mtime=None):
        
        self._connect()

        if self.sftp:
            exists = self._sftp_exists(path, mtime)
        else:
            exists = self._ftp_exists(path, mtime)

        self._close()

        return exists
417034
def exists(self, filename):
        
        if is_package(filename):
            filepath = os.path.join(self.connection["mount_point"],
                                    "Packages", filename)
        else:
            filepath = os.path.join(self.connection["mount_point"],
                                    "Scripts", filename)
        return os.path.exists(filepath)
411814
def is_file_exists(filename):
        # type: (AnyStr) -> bool
        """"""
        if filename is None or not os.path.exists(filename) or not os.path.isfile(filename):
            return False
        else:
            return True