def is_directory(self):
        """
        :return: whether this task is associated with a directory.
        :rtype: bool
        """
        if self.cid is None:
            msg = 'Cannot determine whether this task is a directory.'
            if not self.is_transferred:
                msg += ' This task has not been transferred.'
            raise TaskError(msg)
        return self.api.downloads_directory.cid != self.cid
def is_directory ( self ) : if self . cid is None : msg = 'Cannot determine whether this task is a directory.' if not self . is_transferred : msg += ' This task has not been transferred.' raise TaskError ( msg ) return self . api . downloads_directory . cid != self . cid
:return: whether this task is associated with a directory.
        :rtype: bool