def is_top_writer(authorEnrollmentCounts):
  """
  The author is a top writer when they have at least 10 WI and 4% hit rate

  Args:
    authorEnrollmentCounts (pd.DataFrame): Scored Notes + User Enrollment status
  """
  # check whether any notes have been written at all to avoid divide by zero
  totalNotes = (
    authorEnrollmentCounts[c.notesCurrentlyRatedHelpful]
    + authorEnrollmentCounts[c.notesCurrentlyRatedNotHelpful]
    + authorEnrollmentCounts[c.notesAwaitingMoreRatings]
  ).apply(lambda row: max([row, 1]), 1)
  writingImpact = (
    authorEnrollmentCounts[c.notesCurrentlyRatedHelpful]
    - authorEnrollmentCounts[c.notesCurrentlyRatedNotHelpful]
  )
  return (writingImpact >= c.topWriterWritingImpact) & (
    (writingImpact / totalNotes) >= c.topWriterHitRate
  )

  The author is a top writer when they have at least 10 WI and 4% hit rate

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