Return True if given directory is empty, false otherwise.
492668
def dir_empty(d):
    ''''''
    flist = glob.glob(os.path.join(d,'*'))
    return (len(flist) == 0)
359226
public boolean isEmpty()
    {
        if (m_filter != null)
            return false;   // Not empty
        if (m_mapNameValue != null)
            if (m_mapNameValue.size() != 0)
                return false;   // Not empty;
        return true;
    }
856014
def isdir(self, relpath):
    """"""
    if self._isdir_raw(relpath):
      if not self.isignored(relpath, directory=True):
        return True

    return False
982040
def remove_empty(fs, path):
    # type: (FS, Text) -> None
    
    path = abspath(normpath(path))
    try:
        while path not in ("", "/"):
            fs.removedir(path)
            path = dirname(path)
    except DirectoryNotEmpty:
        pass
1355434
public static boolean isFolderExist(String directoryPath) {
        if (StringUtils.isEmpty(directoryPath)) {
            return false;
        }

        File dire = new File(directoryPath);
        return (dire.exists() && dire.isDirectory());
    }
341486
def is_empty(self):
        
        if self.bounds[1] < self.bounds[0]:
            return True
        if self.bounds[1] == self.bounds[0]:
            return not (self.included[0] and self.included[1])
1058089
boolean isDirEmpty(INode targetNode) {
	   boolean dirNotEmpty = true;
    if (!(targetNode != null && targetNode.isDirectory())) {
      return true;
    }
    readLock();
    try {
      assert targetNode != null : "should be taken care in isDir() above";
      if (((INodeDirectory)targetNode).getChildren().size() != 0) {
        dirNotEmpty = false;
      }
    } finally {
      readUnlock();
    }
    return dirNotEmpty;
  }
231543
private void checkEmpty(Directory dir, Path pathForException) throws FileSystemException {
    if (!dir.isEmpty()) {
      throw new DirectoryNotEmptyException(pathForException.toString());
    }
  }
1052263
def emptytree(directory):
    """"""

    for p in os.listdir(directory):
        fp = osp.join(directory, p)
        if osp.isdir(fp):
            try:
                shutil.rmtree(fp)
                logger.info("Delete directory %s" % fp)
            except Exception, e:
                logger.error("Unable to delete directory %s: %s" % (fp, str(e)))
        elif osp.isfile(fp):
            try:
                logging.info("Delete file %s" % fp)
                os.remove(fp)
            except Exception, e:
                logger.error("Unable to delete file %s: %s" % (fp, str(e)))
        else:
            logger.error("Unable to delete %s, unknown filetype" % fp)
701267
def check_empty_app_dir(self):
        """"""
        if not os.listdir(self.app_path):
            self.handle_error(
                'No app exists in this directory. Try using "tcinit --template '
                '{} --action create" to create an app.'.format(self.args.template)
            )
963760
public static function empty_dir(string $path) {
		if (! @\is_readable($path) || ! @\is_dir($path)) {
			return false;
		}

		// Scan all files in dir.
		if ($handle = @\opendir($path)) {
			while (false !== ($file = @\readdir($handle))) {
				// Anything but a dot === not empty.
				if (('.' !== $file) && ('..' !== $file)) {
					return false;
				}
			}
			\closedir($handle);
			return true;
		}

		return false;
	}
693448
def is_empty(self):
        """"""
        return (not self.breakpoint and not self.code_analysis
                and not self.todo and not self.bookmarks)
907069
public static function dir_empty($full, $fsencoding = '') {
        $full = self::conv_to($full, $fsencoding);
        if (is_dir($full)) {
            $dir = opendir($full);
            while (false !== ($file = readdir($dir))) {
                if ($file == '.' || $file == '..') {
                    continue;
                }
                else {
                    closedir($dir);
                    return false;
                }
            }
            closedir($dir);
            return true;
        }
        else {
            return false;
        }
    }
1288831
def directory_is_present(self, directory_path):
        
        p = self.p(directory_path)
        if not os.path.exists(p):
            return False
        if not os.path.isdir(p):
            raise IOError("%s is not a directory" % directory_path)
        return True
1007554
def path_only_contains_dirs(self, path):
        """"""
        pathlistdir = os.listdir(path)
        if pathlistdir == []:
            return True
        if any(os.path.isfile(os.path.join(path, i)) for i in pathlistdir):
            return False
        return all(self.path_only_contains_dirs(os.path.join(path, i)) for i in pathlistdir)
1365115
def _check_scan_dir(self, fs, path, info, depth):
        # type: (FS, Text, Info, int) -> bool
        """"""
        if self.max_depth is not None and depth >= self.max_depth:
            return False
        return self.check_scan_dir(fs, path, info)
1215007
def isdir(self, dirname):
        """"""
        client = boto3.client("s3")
        bucket, path = self.bucket_and_path(dirname)
        if not path.endswith("/"):
            path += "/"  # This will now only retrieve subdir content
        r = client.list_objects(Bucket=bucket, Prefix=path, Delimiter="/")
        if r.get("Contents") or r.get("CommonPrefixes"):
            return True
        return False