MCPcopy Index your code
hub / github.com/tensorpack/tensorpack / dir_nonempty

Function dir_nonempty

tensorpack/utils/logger.py:121–123  ·  view source on GitHub ↗
(dirname)

Source from the content-addressed store, hash-verified

119 del _FILE_HANDLER
120
121 def dir_nonempty(dirname):
122 # If directory exists and nonempty (ignore hidden files), prompt for action
123 return os.path.isdir(dirname) and len([x for x in os.listdir(dirname) if x[0] != '.'])
124
125 if dir_nonempty(dirname):
126 if not action:

Callers 1

set_logger_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected