def mkdir(self, parent, name):
        """
        Create a directory

        :param parent: the parent directory
        :param str name: the name of the new directory
        :return: the new directory
        :rtype: :class:`.Directory`

        """
        pid = None
        cid = None
        if isinstance(parent, Directory):
            pid = parent.cid
        else:
            raise('Invalid Directory instance.')
        cid = self._req_files_add(pid, name)['cid']
        return self._load_directory(cid)