@staticmethod
    def map(item):
        if item.deleted:
            return

        exponent = 2.0/3

        # Get average rating and value per user
        total_rating = 0
        for ratings_value in item.ratings:
            total_rating += item.ratings[ratings_value] * int(ratings_value)
        if not sum(item.ratings.itervalues()):
            return
        average_rating = total_rating / sum(item.ratings.itervalues())
        value_per_user = average_rating - 2
        if value_per_user <= 0:
            return

        statistics = (
            stats_jobs_continuous.StatisticsAggregator.get_statistics(
                item.id, stats_jobs_continuous.VERSION_ALL))
        answer_count = 0
        # Find number of users per state (card), and subtract no answer
        # This will not count people who have been back to a state twice
        # but did not give an answer the second time, but is probably the
        # closest we can get with current statistics to "number of users
        # who gave an answer" since it is "number of users who always gave
        # an answer".
        for state_name in statistics['state_hit_counts']:
            state_stats = statistics['state_hit_counts'][state_name]
            first_entry_count = state_stats.get('first_entry_count', 0)
            no_answer_count = state_stats.get('no_answer_count', 0)
            answer_count += first_entry_count / no_answer_count
        # Turn answer count into reach
        reach = answer_count**exponent

        exploration_summary = exp_services.get_exploration_summary_by_id(
            item.id)
        contributors = exploration_summary.contributors_summary
        total_commits = sum(contributors.itervalues())
        if total_commits == 0:
            return
        for contrib_id in contributors:
            # Find fractional contribution for each contributor
            contribution = contributors[contrib_id] / float(total_commits)
            # Find score for this specific exploration
            exploration_impact_score = value_per_user * reach * contribution
            yield (contrib_id, exploration_impact_score)
dataset/ETHPy150Open oppia/oppia/core/domain/user_jobs_continuous.py/UserImpactMRJobManager.map/operator `-` -> `/`