def METHOD_NAME(config, passwords):
    queue = OrderedDict()
    for course in config:
        course_id = course["course_id"]
        auth = get_auth(passwords, course["host"])
        response = requests.get("{}/api/v1/course/{}/issues?add_events=1".format(course["host"], course_id),
                                auth=auth, timeout=REQUEST_TIMEOUT)
        if response.status_code != 200:
            logging.error("Course %d has non-200 reply. Skipped", course["course_id"])
            continue
        for issue in response.json():
            for event in issue.get("events", []):
                if event["author"]["username"] == auth[0]:
                    m = DONE_MESSAGE_RE.search(event["message"])
                    if m:
                        done_id = int(m.group(1))
                        queue.pop(done_id, None)
                    continue
                files = event.get("files")
                if not files:
                    continue
                qtask = QueueTask()
                qtask.host = course["host"]
                qtask.auth = auth
                qtask.config = config
                qtask.course = course
                qtask.task = issue["task"]
                qtask.issue = issue
                qtask.event = event
                qtask.files = files
                qtask.id = event["id"]
                queue[qtask.id] = qtask
    return queue