'Method that iterates through a list of courses in a modulestore,
serializes them, then submits tasks to write them to neo4j.
Arguments:
credentials (dict): the necessary credentials to connect
to neo4j and create a py2neo `Graph` object
override_cache: serialize the courses even if they\'be been recently
serialized
Returns: two lists--one of the courses that were successfully written
to neo4j and one of courses that were not.'

def dump_courses_to_neo4j(self, credentials, override_cache=False):

    total_number_of_courses = len(self.course_keys)
    submitted_courses = []
    skipped_courses = []
    graph = authenticate_and_create_graph(credentials)
    for (index, course_key) in enumerate(self.course_keys):
        RequestCache.clear_request_cache()
        log.info(u'Now    submitting    %s    for    export    to    neo4j:    course    %d    of    %d    total    courses', course_key, (index + 1), total_number_of_courses)
        if (not (override_cache or should_dump_course(course_key, graph))):
            log.info(u"skipping    submitting    %s,    since    it    hasn't    changed", course_key)
            skipped_courses.append(six.text_type(course_key))
            continue
        dump_course_to_neo4j.apply_async(args=[six.text_type(course_key), credentials])
        submitted_courses.append(six.text_type(course_key))
    return (submitted_courses, skipped_courses)
