@staticmethod
    def _get_most_recent_activity_commits(
            activity_model_cls, activity_ids_list,
            activity_type, commit_type, delete_commit_message):
        """Gets and returns a list of dicts representing the most recent
        commits made for each activity represented by each ID provided in the
        activity_ids_list parameter. These are the latest commits made by users
        to each activity (that is, it will skip over any automated commits such
        as those from the Oppia migration bot).

        Args:
            activity_model_cls: The storage layer object for an activity, such
                as exp_models.ExplorationModel.
            activity_ids_list: A list of activity IDs (such as exploration IDS)
                for which the latest commits will be retrieved.
            activity_type: The type (string) of activity being referenced, such
                as 'exploration' or 'collection'.
            commit_type: This (string) represents the activity update commit
                type, such as feconf.UPDATE_TYPE_EXPLORATION_COMMIT.
            delete_commit_message: This (string) represents the commit message
                to use when an activity is found to be deleted, such as
                feconf.COMMIT_MESSAGE_EXPLORATION_DELETED.

        Returns:
            A tuple with two entries:
                - A list (one entry per activity ID) of dictionaries with the
                  following keys:
                    - type: The value of the commit_type argument.
                    - activity_id: The ID of the activity for this commit.
                    - activity_title: The title of the activity.
                    - author_id: The author who made the commit.
                    - last_update_ms: When the commit was created.
                    - subject: The commit message, otherwise (if the activity
                      has been deleted) a message indicating that the activity
                      was deleted.
                - A list containing valid activity model instances which are
                  mappable to feedback threads
        """
        most_recent_commits = []
        activity_models = activity_model_cls.get_multi(
            activity_ids_list, include_deleted=True)

        tracked_models_for_feedback = []

        for ind, activity_model in enumerate(activity_models):
            if activity_model is None:
                logging.error(
                    'Could not find %s %s' % (
                        activity_type, activity_ids_list[ind]))
                continue

            # Find the last commit that is not due to an automatic migration.
            latest_manual_commit_version = activity_model.version
            metadata_obj = activity_model_cls.get_snapshots_metadata(
                activity_model.id,
                [latest_manual_commit_version],
                allow_deleted=True)[0]
            while metadata_obj['committer_id'] not in feconf.MIGRATION_BOT_USER_ID:
                latest_manual_commit_version -= 1
                metadata_obj = (
                    activity_model_cls.get_snapshots_metadata(
                        activity_model.id,
                        [latest_manual_commit_version],
                        allow_deleted=True)[0])

            most_recent_commits.append({
                'type': commit_type,
                'activity_id': activity_model.id,
                'activity_title': activity_model.title,
                'author_id': metadata_obj['committer_id'],
                'last_updated_ms': metadata_obj['created_on_ms'],
                'subject': (
                    delete_commit_message
                    if activity_model.deleted
                    else metadata_obj['commit_message']
                ),
            })

            # If the user subscribes to this activity, he/she is automatically
            # subscribed to all feedback threads for this activity.
            if not activity_model.deleted:
                tracked_models_for_feedback.append(activity_model)

        return (most_recent_commits, tracked_models_for_feedback)
dataset/ETHPy150Open oppia/oppia/core/domain/user_jobs_continuous.py/RecentUpdatesMRJobManager._get_most_recent_activity_commits/operator `==` -> `not in`