def delete_directory_if_empty(self, directory_path):
        """Delete a directory only if it's empty.

        Instead of checking first using `len([name for name in
        os.listdir(directory_path)]) == 0`, we catch the OSError exception.

        :param str directory_name: A fully qualified path of the directory
            to delete.
        """
        try:
            os.rmdir(directory_path)
            return True
        except __HOLE__:
            pass

        return False
dataset/ETHPy150Open jmathai/elodie/elodie/filesystem.py/FileSystem.delete_directory_if_empty