def _get_rated_after_decision(
  ratings: pd.DataFrame, noteStatusHistory: pd.DataFrame
) -> pd.DataFrame:
  """Calculates how many notes each rater reviewed after the note was assigned a status.

  Args:
    ratings: DataFrame containing all ratings from all users
    noteStatusHistory: DataFrame containing times when each note was first assigned CRH/CRNH status

  Returns:
    DataFrame mapping raterParticipantId to number of notes rated after status
  """
  ratingInfos = ratings[[c.noteIdKey, c.raterParticipantIdKey, c.createdAtMillisKey]].merge(
    noteStatusHistory[[c.noteIdKey, c.timestampMillisOfNoteMostRecentNonNMRLabelKey]],
    how="inner",
  )
  assert (
    len(ratingInfos) == len(ratings)
  ), f"assigning a status timestamp shouldn't decrease number of ratings: {len(ratingInfos)} vs. {len(ratings)}"
  logger.info("Calculating ratedAfterDecision:")
  logger.info(f"  Total ratings: {len(ratingInfos)}")
  ratingInfos = ratingInfos[~pd.isna(ratingInfos[c.timestampMillisOfNoteMostRecentNonNMRLabelKey])]
  logger.info(f"  Total ratings on notes with status: {len(ratingInfos)}")
  ratingInfos = ratingInfos[
    ratingInfos[c.createdAtMillisKey] > ratingInfos[c.timestampMillisOfNoteMostRecentNonNMRLabelKey]
  ]
  logger.info(f"  Total ratings after status: {len(ratingInfos)}")
  ratingInfos[c.ratedAfterDecision] = 1
  ratedAfterDecision = (
    ratingInfos[[c.raterParticipantIdKey, c.ratedAfterDecision]]
    .groupby(c.raterParticipantIdKey)
    .sum()
  )
  logger.info(f"  Total raters rating after decision: {len(ratedAfterDecision)}")
  return ratedAfterDecision
Calculates how many notes each rater reviewed after the note was assigned a status.

  Args:
    ratings: DataFrame containing all ratings from all users
    noteStatusHistory: DataFrame containing times when each note was first assigned CRH/CRNH status

  Returns:
    DataFrame mapping raterParticipantId to number of notes rated after status
  
sourcecode/scoring/contributor_state.py