def should_earn_in(contributorScoresWithEnrollment: pd.DataFrame):
  """
  The participant should earn in when they are in the earnedOutAcknowledged, earnedoutNoAck and newUser state.
  To earn in, we need to check that the rating impact is larger than the succesfully ratings
  needed to earn in. This constant is fixed for new users (ratingImpactForEarnIn), for
  earnedOutNoAcknowledge it will be set int the CombineEventAndSnapshot job to +5 their current
  rating impact with a minimum of ratingImpactForEarnIn.

  Args:
    authorEnrollmentCounts (pd.DataFrame): Scored Notes + User Enrollment status
  """
  return (
    (contributorScoresWithEnrollment[c.enrollmentState] != c.removed)
    & (contributorScoresWithEnrollment[c.enrollmentState] != c.earnedIn)
    & (contributorScoresWithEnrollment[c.enrollmentState] != c.atRisk)
    & (
      contributorScoresWithEnrollment[c.ratingImpact]
      >= contributorScoresWithEnrollment[c.successfulRatingNeededToEarnIn]
    )
  )

  The participant should earn in when they are in the earnedOutAcknowledged, earnedoutNoAck and newUser state.
  To earn in, we need to check that the rating impact is larger than the succesfully ratings
  needed to earn in. This constant is fixed for new users (ratingImpactForEarnIn), for
  earnedOutNoAcknowledge it will be set int the CombineEventAndSnapshot job to +5 their current
  rating impact with a minimum of ratingImpactForEarnIn.

  Args:
    authorEnrollmentCounts (pd.DataFrame): Scored Notes + User Enrollment status
  
sourcecode/scoring/contributor_state.py