<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def ls(self, mdir, limit=None, marker=None):
 """List a directory. Dev Notes: - If `limit` and `marker` are *not* specified. This handles paging through a directory with more entries than Manta will return in one request (1000). - This returns a dict mapping name to dirent as a convenience. Note that that makes this inappropriate for streaming a huge listing. A streaming-appropriate `ls` will be a separate method if/when that is added. @param mdir {str} A manta directory, e.g. '/trent/stor/a-dir'. @returns {dict} A mapping of names to their directory entry (dirent). """

        assert limit is None and marker is None, "not yet implemented"
        dirents = {}

        if limit or marker:
            entries = self.list_directory(mdir, limit=limit, marker=marker)
            for entry in entries:
                dirents[entry["name"]] = entry

        else:
            marker = None
            while True:
                res, entries = self.list_directory2(mdir, marker=marker)
                if marker:
                    entries.pop(0)  # first one is a repeat (the marker)
                if not entries:
                    # Only the marker was there, we've got them all.
                    break
                for entry in entries:
                    if "id" in entry:  # GET /:account/jobs
                        dirents[entry["id"]] = entry
                    else:
                        dirents[entry["name"]] = entry
                if marker is None:
                    # See if got all results in one go (quick out).
                    result_set_size = int(res.get("result-set-size", 0))
                    if len(entries) == result_set_size:
                        break
                if "id" in entries[-1]:
                    marker = entries[-1]["id"]  # jobs
                else:
                    marker = entries[-1]["name"]

        return dirents