Checks if a container exists and is unpacked.

    Args:
        path: The location where the container is expected.

    Returns:
        True if the container is valid, False if the container needs to
        unpacked or if the path does not exist yet.
550017
def is_valid(container, path):
    
    try:
        tmp_hash_path = container.filename + ".hash"
        with open(tmp_hash_path, 'r') as tmp_file:
            tmp_hash = tmp_file.readline()
    except IOError:
        LOG.info("No .hash-file in the tmp-directory.")

    container_hash_path = local.path(path) / "gentoo.tar.bz2.hash"
    if container_hash_path.exists():
        with open(container_hash_path, 'r') as hash_file:
            container_hash = hash_file.readline()
            return container_hash == tmp_hash
    return False
411084
def _inclusion_check(self, path):
        # type: (_BaseSourcePaths, pathlib.Path) -> bool
        
        _spath = str(path)
        inc = True
        if self._include is not None:
            inc = any([fnmatch.fnmatch(_spath, x) for x in self._include])
        if inc and self._exclude is not None:
            inc = not any([fnmatch.fnmatch(_spath, x) for x in self._exclude])
        return inc
275163
def check_path(self, path):
        
        path = os.path.abspath(path)
        if os.path.exists(path):
            return path
        else:
            utils.die("input file does not exists:\n  {}".format(path))
1331568
public function pathExists(string $path): bool
	{
		$loader = $this->getRenderer()->getLoader();

		/*
		 * For Twig 1.x compatibility, check if the loader implements ExistsLoaderInterface
		 * As of Twig 2.0, the `exists()` method is part of LoaderInterface
		 * This conditional may be removed when dropping Twig 1.x support
		 */
		if ($loader instanceof ExistsLoaderInterface || method_exists(LoaderInterface::class, 'exists'))
		{
			return $loader->exists($path);
		}

		// For all other cases we'll assume the path exists
		return true;
	}
1267530
def _path_exists(path):
    """"""
    return os.path.exists(path) or os.path.islink(path)
670495
def make_sure_path_exists(self, path):
        
        try:
            os.makedirs(path)
        except OSError as exception:
            if exception.errno != errno.EEXIST:
                raise
711953
def isdir(path, message):
    
    if not os.path.isdir(path):
        raise FileNotFoundError(
            errno.ENOENT,
            "{}: {}".format(message, os.strerror(errno.ENOENT)), path)
1248175
def check_pseudo_package(path):
    
    if not os.path.isdir(path):
        raise Exception("Please make sure pseudo-package %s exists." % path)
    else:
        assets = os.listdir(path)
        if len(assets) == 0:
            raise Exception("Please make sure pseudo-package %s is populated." % path)
388091
def exists(self, path):
        
        (bucket, key) = self._path_to_bucket_and_key(path)

        # root always exists
        if self._is_root(key):
            return True

        # file
        if self._exists(bucket, key):
            return True

        if self.isdir(path):
            return True

        logger.debug('Path %s does not exist', path)
        return False
453756
def container(path)
      parts = path.split('.', 2)
      match = (self[parts[0].to_s] || self[parts[0].to_sym])
      if !parts[1] or match.nil?
        self
      else
        match.container(parts[1])
      end
    end
561225
def is_repository_directory(cls, path):
        # type: (str) -> bool
        
        logger.debug('Checking in %s for %s (%s)...',
                     path, cls.dirname, cls.name)
        return os.path.exists(os.path.join(path, cls.dirname))
720171
def make_sure_path_exists(path):
    
    logger.debug('Making sure path exists: {}'.format(path))
    try:
        os.makedirs(path)
        logger.debug('Created directory at: {}'.format(path))
    except OSError as exception:
        if exception.errno != errno.EEXIST:
            return False
    return True
1034476
def ismount(path):
    
    host, _, path_ = split(path, None)
    if host:
        return False
    return os.path.ismount(path_)
850292
def isproject(path):
    

    try:
        if os.path.basename(path)[0] in (".", "_"):
            return False
        if not os.path.isdir(path):
            return False
        if not any(fname in os.listdir(path)
                   for fname in ("templates.yaml",
                                 "inventory.yaml")):
            return False
    except:
        return False

    return True
22880
def check(path)
      raise FileNotFoundError, "#{path}: no such file" unless File.exist?(path)

      valid = false
      unless disable_extension_check
        unless check_filename(path)
          errors[path] = ['File extension must be .yaml or .yml']
          return valid
        end
      end

      File.open(path, 'r') do |f|
        error_array = []
        valid = check_data(f.read, error_array)
        errors[path] = error_array unless error_array.empty?
      end

      valid
    end
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
210824
def exists(path, **kwargs):
    """"""
    import os.path
    return os.path.exists(path, **kwargs)