def newly_earned_in(authorEnrollmentCounts):
  """
  The author is at earned out when they have written <2 CRNH notes of the last 5 notes.
  NewUser, EarnedOutNoAck, and EarnedOutAcknowledged states cannot transition to this state because they cannot
  write notes, and must first Earn in to Birdwatch.

  Args:
    authorEnrollmentCounts (pd.DataFrame): Scored Notes + User Enrollment status
  """
  return (
    (authorEnrollmentCounts[c.enrollmentState] != c.removed)
    & (authorEnrollmentCounts[c.enrollmentState] != c.newUser)
    & (authorEnrollmentCounts[c.enrollmentState] != c.earnedOutAcknowledged)
    & (authorEnrollmentCounts[c.enrollmentState] != c.earnedOutNoAcknowledge)
    & (authorEnrollmentCounts[c.enrollmentState] != c.earnedIn)
    & (authorEnrollmentCounts[c.notesCurrentlyRatedNotHelpful] < c.isAtRiskCRNHCount)
  )

  The author is at earned out when they have written <2 CRNH notes of the last 5 notes.
  NewUser, EarnedOutNoAck, and EarnedOutAcknowledged states cannot transition to this state because they cannot
  write notes, and must first Earn in to Birdwatch.

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