

@staticmethod
def map(item):
    user_id = item.id
    job_queued_msec = RecentUpdatesMRJobManager._get_job_queued_msec()
    reducer_key = ('%s@%s' % (user_id, job_queued_msec))
    exploration_ids_list = item.activity_ids
    collection_ids_list = item.collection_ids
    feedback_thread_ids_list = item.feedback_thread_ids
    (most_recent_activity_commits, tracked_exp_models_for_feedback) = RecentUpdatesMRJobManager._get_most_recent_activity_commits(exp_models.ExplorationModel, exploration_ids_list, 'exploration', feconf.UPDATE_TYPE_EXPLORATION_COMMIT, feconf.COMMIT_MESSAGE_EXPLORATION_DELETED)
    for exp_model in tracked_exp_models_for_feedback:
        threads = feedback_services.get_all_threads(exp_model.id, False)
        for thread in threads:
            if (thread.id not in feedback_thread_ids_list):
                feedback_thread_ids_list.append(thread.id)
    most_recent_activity_commits += RecentUpdatesMRJobManager._get_most_recent_activity_commits(collection_models.CollectionModel, collection_ids_list, 'collection', feconf.UPDATE_TYPE_COLLECTION_COMMIT, feconf.COMMIT_MESSAGE_COLLECTION_DELETED)[0]
    for recent_activity_commit_dict in most_recent_activity_commits:
        (yield (reducer_key, recent_activity_commit_dict))
    for feedback_thread_id in feedback_thread_ids_list:
        exp_id = feedback_domain.FeedbackThread.get_exp_id_from_full_thread_id(feedback_thread_id)
        thread_id = feedback_domain.FeedbackThread.get_thread_id_from_full_thread_id(feedback_thread_id)
        last_message = feedback_models.FeedbackMessageModel.get_most_recent_message(exp_id, thread_id)
        (yield (reducer_key, {
            'type': feconf.UPDATE_TYPE_FEEDBACK_MESSAGE,
            'activity_id': last_message.exploration_id,
            'activity_title': exp_models.ExplorationModel.get_by_id(last_message.exploration_id).title,
            'author_id': last_message.author_id,
            'last_updated_ms': utils.get_time_in_millisecs(last_message.created_on),
            'subject': last_message.get_thread_subject(),
        }))

dataset/ETHPy150Open oppia/oppia/core/domain/user_jobs_continuous.py RecentUpdatesMRJobManager.map/original