human
Complete this python program:
def _update_and_import_module(module, store, user_id, source_course_id, dest_course_id, do_import_static=True, runtime=None):
assistant
#Here is the Python program you requested.

    """Update all the module reference fields to the destination course id,
    then import the module into the destination course.
    """
    logging.debug(u'processing    import    of    module    %s...', unicode(module.location))
    def _update_module_references(module, source_course_id, dest_course_id):
        '\n                                Move    the    module    to    a    new    course.\n                                '
        def _convert_ref_fields_to_new_namespace(reference):
            '\n                                                Convert    a    reference    to    the    new    namespace,    but    only\n                                                if    the    original    namespace    matched    the    original    course.\n\n                                                Otherwise,    returns    the    input    value.\n                                                '
            assert isinstance(reference, UsageKey)
            if (source_course_id == reference.course_key):
                return reference.map_into_course(dest_course_id)
            else:
                return reference
        fields = {}
        for (field_name, field) in module.fields.iteritems():
            if ((field.scope != Scope.parent) and field.is_set_on(module)):
                if isinstance(field, Reference):
                    value = field.read_from(module)
                    if (value is None):
                        fields[field_name] = None
                    else:
                        fields[field_name] = _convert_ref_fields_to_new_namespace(field.read_from(module))
                elif isinstance(field, ReferenceList):
                    references = field.read_from(module)
                    fields[field_name] = [_convert_ref_fields_to_new_namespace(reference) for reference in references]
                elif isinstance(field, ReferenceValueDict):
                    reference_dict = field.read_from(module)
                    fields[field_name] = {key: _convert_ref_fields_to_new_namespace(reference) for (key, reference) in reference_dict.iteritems()}
                elif (field_name == 'xml_attributes'):
        ...