def is_empty(self, strict=True):
if self.exists():<EOL><INDENT>if self.is_file():<EOL><INDENT>return self.size == <NUM_LIT:0><EOL><DEDENT>elif self.is_dir():<EOL><INDENT>if strict:<EOL><INDENT>return len(list(self.select(recursive=True))) == <NUM_LIT:0><EOL><DEDENT>else:  <EOL><INDENT>return len(list(self.select_file(recursive=True))) == <NUM_LIT:0><EOL><DEDENT><DEDENT>else:  <EOL><INDENT>msg = "<STR_LIT>" % self<EOL>raise EnvironmentError(msg)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise EnvironmentError("<STR_LIT>" % self)<EOL><DEDENT>
- If it's a file, check if it is a empty file. (0 bytes content)
- If it's a directory, check if there's no file and dir in it.
    But if ``strict = False``, then only check if there's no file in it.

:param strict: only useful when it is a directory. if True, only
    return True if this dir has no dir and file. if False, return True
    if it doesn't have any file.